Enum rusty_lr::ParseError

source ·
pub enum ParseError<'a, Term, NonTerm, CallbackError, ReduceActionError> {
    InvalidNonTerminal(&'a NonTerm, &'a [ProductionRule<Term, NonTerm>], &'a [State<Term, NonTerm>], Vec<usize>),
    InvalidTerminal(Term, &'a [ProductionRule<Term, NonTerm>], &'a [State<Term, NonTerm>], Vec<usize>),
    Callback(CallbackError),
    ReduceAction(ReduceActionError),
}
Expand description

Error type for feed()

Variants§

§

InvalidNonTerminal(&'a NonTerm, &'a [ProductionRule<Term, NonTerm>], &'a [State<Term, NonTerm>], Vec<usize>)

Invalid non-terminal feeded. This variant should be removed in the future. it will not occur if the grammar is builded correctly

§

InvalidTerminal(Term, &'a [ProductionRule<Term, NonTerm>], &'a [State<Term, NonTerm>], Vec<usize>)

Invalid terminal feeded

§

Callback(CallbackError)

Error from callback trait

§

ReduceAction(ReduceActionError)

Error from macro reduce action

Implementations§

source§

impl<'a, Term, NonTerm, CallbackError, ReduceActionError> ParseError<'a, Term, NonTerm, CallbackError, ReduceActionError>

source

pub fn backtrace( rules: &[ProductionRule<Term, NonTerm>], states: &[State<Term, NonTerm>], state_stack: &[usize], ) -> Vec<BTreeSet<ShiftedRuleRef>>
where NonTerm: PartialEq,

generate backtrace information. returned Vec holds a list of ruleset, each ruleset is what current state was trying to parse. 0’th index is the latest, that is, the last element of Vec will hold the initial state’s ruleset

Trait Implementations§

source§

impl<'a, Term, NonTerm, CallbackError, ReduceActionError> Debug for ParseError<'a, Term, NonTerm, CallbackError, ReduceActionError>
where Term: Debug + Hash + Eq, NonTerm: Debug + PartialEq, CallbackError: Debug, ReduceActionError: Debug,

source§

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

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

impl<'a, Term, NonTerm, CallbackError, ReduceActionError> Display for ParseError<'a, Term, NonTerm, CallbackError, ReduceActionError>
where Term: Display + Hash + Eq, NonTerm: Display + PartialEq, CallbackError: Display, ReduceActionError: Display,

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, Term, NonTerm, CallbackError, ReduceActionError> Freeze for ParseError<'a, Term, NonTerm, CallbackError, ReduceActionError>
where Term: Freeze, CallbackError: Freeze, ReduceActionError: Freeze,

§

impl<'a, Term, NonTerm, CallbackError, ReduceActionError> RefUnwindSafe for ParseError<'a, Term, NonTerm, CallbackError, ReduceActionError>
where Term: RefUnwindSafe, CallbackError: RefUnwindSafe, ReduceActionError: RefUnwindSafe, NonTerm: RefUnwindSafe,

§

impl<'a, Term, NonTerm, CallbackError, ReduceActionError> Send for ParseError<'a, Term, NonTerm, CallbackError, ReduceActionError>
where Term: Send + Sync, CallbackError: Send, ReduceActionError: Send, NonTerm: Sync,

§

impl<'a, Term, NonTerm, CallbackError, ReduceActionError> Sync for ParseError<'a, Term, NonTerm, CallbackError, ReduceActionError>
where Term: Sync, CallbackError: Sync, ReduceActionError: Sync, NonTerm: Sync,

§

impl<'a, Term, NonTerm, CallbackError, ReduceActionError> Unpin for ParseError<'a, Term, NonTerm, CallbackError, ReduceActionError>
where Term: Unpin, CallbackError: Unpin, ReduceActionError: Unpin,

§

impl<'a, Term, NonTerm, CallbackError, ReduceActionError> UnwindSafe for ParseError<'a, Term, NonTerm, CallbackError, ReduceActionError>
where Term: UnwindSafe + RefUnwindSafe, CallbackError: UnwindSafe, ReduceActionError: UnwindSafe, NonTerm: RefUnwindSafe,

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§

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.