Enum Token

Source
pub enum Token {
Show 81 variants Colon, OpenBracket, CloseBracket, OpenParen, CloseParen, Define, Problem, Objects, Domain, ProblemDomain, Requirements, Types, Constants, Predicates, Functions, Action, DurativeAction, Parameters, Duration, Precondition, Condition, Effect, Init, Goal, And, Not, Either, Assign, ScaleUp, ScaleDown, Increase, Decrease, Forall, At, Over, All, Start, End, Integer(i64), Float(f64), Plus, Times, Divide, Equal, Strips, Typing, DisjunctivePreconditions, Equality, ExistentialPreconditions, UniversalPreconditions, QuantifiedPreconditions, ConditionalEffects, ActionExpansions, ForeachExpansions, DagExpansions, DomainAxioms, SubgoalsThroughAxioms, SafetyConstraints, ExpressionEvaluation, Fluents, OpenWorld, TrueNegation, Adl, Ucpop, NumericFluents, DurativeActions, DurativeInequalities, ContinuousEffects, NegativePreconditions, DerivedPredicates, TimedInitialLiterals, Preferences, Constraints, ActionCosts, GoalUtilities, Time, Id(String), Var(String), Dash, Comment, Package,
}
Expand description

All of the possible tokens in a PDDL file

Variants§

§

Colon

A colon :

§

OpenBracket

An open bracket [

§

CloseBracket

A close bracket ]

§

OpenParen

An open parenthesis (

§

CloseParen

A close parenthesis )

§

Define

The define keyword

§

Problem

The problem keyword

§

Objects

The :objects keyword

§

Domain

The domain keyword (without the colon, used in the domain file to define the domain)

§

ProblemDomain

The :domain keyword (with the colon, used in the problem file to specify the domain)

§

Requirements

The :requirements keyword

§

Types

The :types keyword

§

Constants

The :constants keyword

§

Predicates

The :predicates keyword

§

Functions

The :functions keyword

§

Action

The :action keyword

§

DurativeAction

The :durative-action keyword

§

Parameters

The :parameters keyword

§

Duration

The :duration keyword

§

Precondition

The :precondition keyword

§

Condition

The :condition keyword

§

Effect

The :effect keyword

§

Init

The :init keyword

§

Goal

The :goal keyword

§

And

The and keyword

§

Not

The not keyword

§

Either

The either keyword

§

Assign

The assign keyword

§

ScaleUp

The scale-up keyword

§

ScaleDown

The scale-down keyword

§

Increase

The increase keyword

§

Decrease

The decrease keyword

§

Forall

The forall keyword

§

At

The at keyword

§

Over

The over keyword

§

All

The all keyword

§

Start

The start keyword

§

End

The end keyword

§

Integer(i64)

A number (positive or negative, e.g. 1 or -1)

§

Float(f64)

A floating point number (e.g. 1.0)

§

Plus

The + operator

§

Times

The * operator

§

Divide

The - operator

§

Equal

The = operator

§

Strips

The :strips requirement (PDDL 1)

§

Typing

The :typing requirement (PDDL 1)

§

DisjunctivePreconditions

The :negative-preconditions requirement (PDDL 1)

§

Equality

The :disjunctive-preconditions requirement (PDDL 1)

§

ExistentialPreconditions

The :existential-preconditions requirement (PDDL 1)

§

UniversalPreconditions

The :universal-preconditions requirement (PDDL 1)

§

QuantifiedPreconditions

The :quantified-preconditions requirement (PDDL 1)

§

ConditionalEffects

The :conditional-effects requirement (PDDL 1)

§

ActionExpansions

The :action-expansions requirement (PDDL 1)

§

ForeachExpansions

The :foreach-expansions requirement (PDDL 1)

§

DagExpansions

The :dag-expansions requirement (PDDL 1)

§

DomainAxioms

The :domain-axioms requirement (PDDL 1)

§

SubgoalsThroughAxioms

The :subgoals-through-axioms requirement (PDDL 1)

§

SafetyConstraints

The :safety-constraints requirement (PDDL 1)

§

ExpressionEvaluation

The :expression-evaluation requirement (PDDL 1)

§

Fluents

The :fluents requirement (PDDL 1)

§

OpenWorld

The :open-world requirement (PDDL 1)

§

TrueNegation

The :true-negation requirement (PDDL 1)

§

Adl

The :adl requirement (PDDL 1)

§

Ucpop

The :ucpop requirement (PDDL 1)

§

NumericFluents

The :numeric-fluents requirement (PDDL 2.1)

§

DurativeActions

The :durative-actions requirement (PDDL 2.1)

§

DurativeInequalities

The :durative-inequalities (or, as a typo, :duration-inequalities) requirement (PDDL 2.1)

§

ContinuousEffects

The :continuous-effects requirement (PDDL 2.1)

§

NegativePreconditions

The :negative-preconditions requirement (PDDL 2.1)

§

DerivedPredicates

The :derived-predicates requirement (PDDL 2.2)

§

TimedInitialLiterals

The :timed-initial-literals requirement (PDDL 2.2)

§

Preferences

The :preferences requirement (PDDL 3)

§

Constraints

The :constraints requirement (PDDL 3)

§

ActionCosts

The :action-costs requirement (PDDL 3.1)

§

GoalUtilities

The :goal-utilities requirement (PDDL 3.1)

§

Time

The :time requirement (PDDL+)

§

Id(String)

A PDDL identifier (a sequence of letters, digits, underscores, and hyphens, starting with a letter)

§

Var(String)

A PDDL variable (a sequence of letters, digits, underscores, and hyphens, starting with a question mark)

§

Dash

A dash (-) character that can represent a minus sign or a hyphen

§

Comment

A comment (a semicolon followed by any characters). The comment is ignored.

§

Package

A package declaration (a sequence of characters enclosed in parentheses, starting with in-package). The package name is ignored.

Trait Implementations§

Source§

impl Clone for Token

Source§

fn clone(&self) -> Token

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Token

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Token

Source§

fn fmt(&self, _derive_more_display_formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'s> Logos<'s> for Token

Source§

type Error = ParserError

Error type returned by the lexer. This can be set using #[logos(error = MyError)]. Defaults to () if not set.
Source§

type Extras = ()

Associated type Extras for the particular lexer. This can be set using #[logos(extras = MyExtras)] and accessed inside callbacks.
Source§

type Source = str

Source type this token can be lexed from. This will default to str, unless one of the defined patterns explicitly uses non-unicode byte values or byte slices, in which case that implementation will use [u8].
Source§

fn lex(lex: &mut Lexer<'s, Self>)

The heart of Logos. Called by the Lexer. The implementation for this function is generated by the logos-derive crate.
Source§

fn lexer(source: &'source Self::Source) -> Lexer<'source, Self>
where Self::Extras: Default,

Create a new instance of a Lexer that will produce tokens implementing this Logos.
Source§

fn lexer_with_extras( source: &'source Self::Source, extras: Self::Extras, ) -> Lexer<'source, Self>

Create a new instance of a Lexer with the provided Extras that will produce tokens implementing this Logos.
Source§

impl<'a> Parser<TokenStream<'a>, &'a str, ParserError> for Token

Source§

fn parse( &mut self, input: TokenStream<'a>, ) -> IResult<TokenStream<'a>, &'a str, ParserError>

A parser takes in input type, and returns a Result containing either the remaining input and the output value, or an error
Source§

fn map<G, O2>(self, g: G) -> Map<Self, G, O>
where G: Fn(O) -> O2, Self: Sized,

Maps a function over the result of a parser
Source§

fn flat_map<G, H, O2>(self, g: G) -> FlatMap<Self, G, O>
where G: FnMut(O) -> H, H: Parser<I, O2, E>, Self: Sized,

Creates a second parser from the output of the first one, then apply over the rest of the input
Source§

fn and_then<G, O2>(self, g: G) -> AndThen<Self, G, O>
where G: Parser<O, O2, E>, Self: Sized,

Applies a second parser over the output of the first one
Source§

fn and<G, O2>(self, g: G) -> And<Self, G>
where G: Parser<I, O2, E>, Self: Sized,

Applies a second parser after the first one, return their results as a tuple
Source§

fn or<G>(self, g: G) -> Or<Self, G>
where G: Parser<I, O, E>, Self: Sized,

Applies a second parser over the input if the first one failed
Source§

fn into<O2, E2>(self) -> Into<Self, O, O2, E, E2>
where O2: From<O>, E2: From<E>, Self: Sized,

automatically converts the parser’s output and error values to another type, as long as they implement the From trait
Source§

impl PartialEq for Token

Source§

fn eq(&self, other: &Token) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Token

Auto Trait Implementations§

§

impl Freeze for Token

§

impl RefUnwindSafe for Token

§

impl Send for Token

§

impl Sync for Token

§

impl Unpin for Token

§

impl UnwindSafe for Token

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.