Enum parol::parser::errors::ParolParserError

source ·
pub enum ParolParserError {
    UnknownScanner {
        context: String,
        name: String,
        input: PathBuf,
        token: Location,
    },
    EmptyGroup {
        context: String,
        input: PathBuf,
        start: Location,
        end: Location,
    },
    EmptyOptional {
        context: String,
        input: PathBuf,
        start: Location,
        end: Location,
    },
    EmptyRepetition {
        context: String,
        input: PathBuf,
        start: Location,
        end: Location,
    },
    ConflictingTokenAliases {
        first_alias: String,
        second_alias: String,
        expanded: String,
        input: PathBuf,
        first: Location,
        second: Location,
    },
    EmptyScanners {
        empty_scanners: Vec<String>,
    },
    UnsupportedGrammarType {
        grammar_type: String,
        input: PathBuf,
        token: Location,
    },
    UnsupportedFeature {
        feature: String,
        hint: String,
        input: PathBuf,
        token: Location,
    },
    InvalidTokenInTransition {
        context: String,
        token: String,
        input: PathBuf,
        location: Location,
    },
    TokenIsNotInScanner {
        context: String,
        scanner: String,
        token: String,
        input: PathBuf,
        location: Location,
    },
    MixedScannerSwitching {
        context: String,
        input: PathBuf,
        location: Location,
    },
}
Expand description

Error types used by the crate::parser::ParolGrammar’s semantic actions

Variants§

§

UnknownScanner

Undeclared scanner found. Please declare a scanner via %scanner name {{…}}

Fields

§context: String

Context (semantic action) where the error was issued

§name: String

Name of the unknown scanner state

§input: PathBuf

Source

§token: Location

Location

§

EmptyGroup

Empty Groups () are not allowed.

Fields

§context: String

Context (semantic action) where the error was issued

§input: PathBuf

Source

§start: Location

Start location

§end: Location

End location

§

EmptyOptional

Empty Optionals [] are not allowed.

Fields

§context: String

Context (semantic action) where the error was issued

§input: PathBuf

Source

§start: Location

Start location

§end: Location

End location

§

EmptyRepetition

Empty Repetitions {{}} are not allowed.

Fields

§context: String

Context (semantic action) where the error was issued

§input: PathBuf

Source

§start: Location

Start location

§end: Location

End location

§

ConflictingTokenAliases

Multiple token aliases that expand to the same text will produce a terminal conflict.

Fields

§first_alias: String

First

§second_alias: String

Second

§expanded: String

Expanded

§input: PathBuf

Source

§first: Location

First alias

§second: Location

Second alias

§

EmptyScanners

Empty Scanner states are not allowed.

Fields

§empty_scanners: Vec<String>

Names of the empty scanner states

§

UnsupportedGrammarType

Unsupported grammar type

Fields

§grammar_type: String

The grammar type found

§input: PathBuf

Source

§token: Location

Location

§

UnsupportedFeature

Unsupported feature

Fields

§feature: String

The feature found

§hint: String

Hint

§input: PathBuf

Source

§token: Location

Location

§

InvalidTokenInTransition

Invalid token in transition, e.g. a token that is not defined in the grammar is used in a transition. Use a primary non-terminal for the token.

Fields

§context: String

Context where the error was issued

§token: String

Token that is not defined matched against a valid primary non-terminal

§input: PathBuf

Source file

§location: Location

Location of the token

§

TokenIsNotInScanner

The token that is used to initiate a transition is not defined in this scanner.

Fields

§context: String

Context where the error was issued

§scanner: String

The scanner where the token is not defined

§token: String

Token that is not defined in the scanner

§input: PathBuf

Source file

§location: Location

Location of the token

§

MixedScannerSwitching

Mixed scanner switching is not allowed - use either parser-based or scanner-based switching. Parser-based switching is done via the %sc, %push and %pop directives productions. Scanner-based switching is done via the %on directive in the header of the grammar file.

Fields

§context: String

Context where the error was issued

§input: PathBuf

Source file

§location: Location

Location of the token

Trait Implementations§

source§

impl Debug for ParolParserError

source§

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

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

impl Display for ParolParserError

source§

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

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

impl Error for ParolParserError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<ParolParserError> for ParolError

source§

fn from(err: ParolParserError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

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> 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> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToString for T
where 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 T
where 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 T
where 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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V