Skip to main content

Terminal

Type Alias Terminal 

Source
pub type Terminal<'a> = &'a [u8];
Expand description

A Terminal, represented as a byte array.

Trait Implementations§

Source§

impl<'a> Label<'a> for Terminal<'a>

Source§

fn to_string(&self) -> &str

The string represented by the byte array

§Panics

This will panic if the byte array is not a string. This should never happen and also is an issue specifically only for Terminal (any other Label can not crash here.) As such, it was decided that this function will not return a proper GLLResult.

Source§

fn is_eps(&self) -> bool

Is this Label epsilon? Read more
Source§

fn first_set( &self, _: &GLLState<'a>, ) -> ImplementationResult<'a, Vec<(Vec<GLLBlockLabel<'a>>, Option<Terminal<'a>>)>>

Returns the first-follow set of the label. Read more
Source§

fn _first( &self, state: &mut GLLState<'a>, _: &mut HashSet<Rc<str>>, ) -> GLLResult<'a, bool>

Internal method for Label::first to do the recursive step. Read more
Source§

fn code(&self, _: &mut GLLState<'a>) -> GLLResult<'a, ()>

Any code to run when encountering this label. Read more
Source§

fn is_terminal(&self) -> bool

Is this label a terminal? Read more
Source§

fn _is_nullable( &self, _: &GLLState<'a>, _: &mut HashSet<Rc<str>>, ) -> ImplementationResult<'a, bool>

Internal method for Label::is_nullable to do the recursive step. Read more
Source§

fn uuid(&self) -> &str

A unique identifier for this label.
Source§

fn str_parts(&self) -> Vec<&str>

The chunk represented by Label::to_string, but split by symbol into a vector.
Source§

fn attr_rep_map(&self) -> (Vec<&str>, Vec<&str>)

A tuple of string representations for any associated attributes. Read more
Source§

fn _weight( &self, _state: &GLLState<'a>, ) -> Option<ImplementationResult<'a, Value<'a>>>

Optionally return the weight of this label. Read more
Source§

fn first(&self, state: &mut GLLState<'a>) -> GLLResult<'a, bool>

Check if the next token in the current state is accepted by this label’s first-follow set. Read more
Source§

fn is_nullable(&self, state: &GLLState<'a>) -> ImplementationResult<'a, bool>

Could this label resolve to epsilon? Read more
Source§

fn weight(&self, state: &GLLState<'a>) -> ImplementationResult<'a, Value<'a>>

Returns either the weight of this label as calculated by _weight, or 1. Read more