pub struct StackedItem<AT: Default> {
    pub value: AT,
    pub line: usize,
    pub column: usize,
    /* private fields */
}
Expand description

these structures are what’s on the parse stack. When writing a grammar rule such as E --> E:a + E:b, the variables a and b will be bound to values of this type, and thus inside the semantic actions one would need to use a.value to extract the value, which is of the declared ‘absyntype’ of the grammar. Alternatively, one can use a pattern: E:@a@ + E:@b@ to bind a and b directly to the values.

Fields§

§value: AT§line: usize§column: usize

Implementations§

source§

impl<AT: Default> StackedItem<AT>

source

pub fn new(si: usize, value: AT, line: usize, column: usize) -> StackedItem<AT>

source

pub fn lbox(self) -> LBox<AT>

converts the information in a stacked item to an LBox enclosing the abstract syntax value along with starting line and column numbers

Auto Trait Implementations§

§

impl<AT> RefUnwindSafe for StackedItem<AT>where AT: RefUnwindSafe,

§

impl<AT> Send for StackedItem<AT>where AT: Send,

§

impl<AT> Sync for StackedItem<AT>where AT: Sync,

§

impl<AT> Unpin for StackedItem<AT>where AT: Unpin,

§

impl<AT> UnwindSafe for StackedItem<AT>where AT: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · 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, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.