Skip to main content

Call

Enum Call 

Source
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§

Source§

impl Debug for Call

Source§

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

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

impl PartialEq for Call

Source§

fn eq(&self, other: &Call) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Call

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> 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<S> BuildFrom<S> for S

Source§

fn build_from(source: S) -> S

Converts to this type from the input type.
Source§

impl<S, T> BuildInto<T> for S
where T: BuildFrom<S>,

Source§

fn build_into(self) -> T

Calls T::from(self) to convert a S into a T.

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<S, T> TryBuildInto<T> for S
where T: TryBuildFrom<S>,

Source§

type Error = <T as TryBuildFrom<S>>::Error

The type returned in the event of a conversion error.
Source§

fn try_build_into(self) -> Result<T, <T as TryBuildFrom<S>>::Error>

Performs the conversion.
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.