Enum pddl_parser::lexer::Token

source ·
pub enum Token {
Show 68 variants OpenParen, CloseParen, Define, Problem, Objects, Domain, ProblemDomain, Requirements, Types, Constants, Predicates, Functions, Action, Parameters, Precondition, Effect, Init, Goal, And, Not, Either, Assign, ScaleUp, ScaleDown, Increase, Decrease, Integer(i64), Float(f64), Plus, Times, Divide, 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§

§

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

§

Parameters

The :parameters keyword

§

Precondition

The :precondition 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

§

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

§

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 copy 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

§

type Error = ParserError

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

type Extras = ()

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

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_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<Token> for Token

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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 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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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 Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

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

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

§

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 Twhere U: TryFrom<T>,

§

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.