pub enum ParserAction<S, P, A>{
Error,
Accept,
Shift(S),
Reduce(P),
Ambig(A),
Goto(S),
}Expand description
Parser action used by the parsing automaton.
Represents the next operation the parser should perform, such as shifting, reducing, accepting, etc. Parameterized by identifiers for parser states, productions, and ambiguities.
§Type Parameters
S: Parser state identifier type implementingParserStateID.P: Production identifier type implementingParserProdID.A: Ambiguity identifier type implementingParserAmbigID.
Variants§
Error
Indicates a parsing error.
Accept
Signals successful parsing (accepting the input).
Shift(S)
Shifts the next token and transitions to the given parser state.
Reduce(P)
Reduces by the given production rule.
Ambig(A)
Handles an ambiguity represented by the given ambiguity ID.
Goto(S)
Performs a goto transition to the given parser state.
Trait Implementations§
Source§impl<S, P, A> Clone for ParserAction<S, P, A>
impl<S, P, A> Clone for ParserAction<S, P, A>
Source§fn clone(&self) -> ParserAction<S, P, A>
fn clone(&self) -> ParserAction<S, P, A>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<S, P, A> Debug for ParserAction<S, P, A>
impl<S, P, A> Debug for ParserAction<S, P, A>
Source§impl<S, P, A> PartialEq for ParserAction<S, P, A>
impl<S, P, A> PartialEq for ParserAction<S, P, A>
impl<S, P, A> Copy for ParserAction<S, P, A>
impl<S, P, A> Eq for ParserAction<S, P, A>
impl<S, P, A> StructuralPartialEq for ParserAction<S, P, A>
Auto Trait Implementations§
impl<S, P, A> Freeze for ParserAction<S, P, A>
impl<S, P, A> RefUnwindSafe for ParserAction<S, P, A>
impl<S, P, A> Send for ParserAction<S, P, A>
impl<S, P, A> Sync for ParserAction<S, P, A>
impl<S, P, A> Unpin for ParserAction<S, P, A>
impl<S, P, A> UnwindSafe for ParserAction<S, P, A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more