Enum moparse::SyntaxEvent
source · pub enum SyntaxEvent {
Enter(Payload),
Exit(Payload),
Advance(Terminal),
}Expand description
Represents a single Modelica syntax event.
Syntax event may mark starts and ends of productions or terminals. The list of such syntax events should be consumed to build a parse tree or an AST.
Variants§
Enter(Payload)
Event indicating beginning of the Modelica production.
Exit(Payload)
Event indicating an end of some Modelica production.
Advance(Terminal)
Event indicating a terminal (token or error).
Implementations§
source§impl<'a> SyntaxEvent
impl<'a> SyntaxEvent
sourcepub fn get_token(&'a self, tokens: &'a TokenCollection) -> &'a Token
pub fn get_token(&'a self, tokens: &'a TokenCollection) -> &'a Token
Return a reference to the token from the TokenCollection
corresponds to this event.
Trait Implementations§
source§impl Debug for SyntaxEvent
impl Debug for SyntaxEvent
source§impl PartialEq for SyntaxEvent
impl PartialEq for SyntaxEvent
source§fn eq(&self, other: &SyntaxEvent) -> bool
fn eq(&self, other: &SyntaxEvent) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl StructuralPartialEq for SyntaxEvent
Auto Trait Implementations§
impl RefUnwindSafe for SyntaxEvent
impl Send for SyntaxEvent
impl Sync for SyntaxEvent
impl Unpin for SyntaxEvent
impl UnwindSafe for SyntaxEvent
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