Skip to main content

ParolParserError

Enum 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

👎Deprecated since 4.0.0:

Scanner switching directives have been removed from the grammar syntax.

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.

This error can no more occur as of Parol 4, because scanner switching directives have been removed from the grammar syntax.

Fields

§context: String
👎Deprecated since 4.0.0:

Scanner switching directives have been removed from the grammar syntax.

Context where the error was issued

§input: PathBuf
👎Deprecated since 4.0.0:

Scanner switching directives have been removed from the grammar syntax.

Source file

§location: Location
👎Deprecated since 4.0.0:

Scanner switching directives have been removed from the grammar syntax.

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

Returns 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> 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.