Struct rustlr::zc_parser::StackedItem
source · 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