pub enum Call {
Enter,
Loop,
Exit,
End(Terminate),
}Expand description
Action calls to the wrapper with the method ListenerWrapper::switch. The wrapper translates the action accordingly to the current nonterminal and alternative; for example, by calling the appropriate listener callback.
Variants§
Enter
Enters a new nonterminal rule. The alternative is already known, but the values of the symbols in that alternative haven’t been scanned yet.
This can be used to initialize the listener’s variables when a particular rule is about to be parsed (the listener methods associated with this action are normally optional since no information is returned to the wrapper).
The wrapper also uses this call to initialize stack items like accumulators used in rule loops
like a -> b*.
Loop
Re-enters a loop nonterminal. This is currently not used in the wrapper.
Exit
Exits an alternative, once all the symbols in it have been parsed: nonterminals and terminals.
This is typically used to call an exit method of the listener and evaluate its value when it has one.
End(Terminate)
This action is used in two situations:
- when the parsing of the top rule has completed normally. In that case, the wrapper calls the [exit(…)] method of the listener (done in the generated code).
- when the parsing is aborted or concluded in reaction to an check_abort_request(…) call. In that case, the wrapper calls the [abort(…)] method of the listener (done in the generated code).
The Terminate value it contains tells the wrapper which of those eventualities has occurred.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Call
impl RefUnwindSafe for Call
impl Send for Call
impl Sync for Call
impl Unpin for Call
impl UnsafeUnpin for Call
impl UnwindSafe for Call
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
Source§impl<S> BuildFrom<S> for S
impl<S> BuildFrom<S> for S
Source§fn build_from(source: S) -> S
fn build_from(source: S) -> S
Source§impl<S, T> BuildInto<T> for Swhere
T: BuildFrom<S>,
impl<S, T> BuildInto<T> for Swhere
T: BuildFrom<S>,
Source§fn build_into(self) -> T
fn build_into(self) -> T
Calls T::from(self) to convert a S into a T.