Enum perplex_runtime::Symbol [−][src]
pub enum Symbol<T, NT> { Terminal(T), Nonterminal(NT), }
A symbol on the parse stack.
Generic over the type of terminal T
and nonterminal NT
.
Variants
Terminal(T)
Nonterminal(NT)
Methods
impl<T, NT> Symbol<T, NT>
[src]
impl<T, NT> Symbol<T, NT>
pub fn unwrap_terminal(self) -> T
[src]
pub fn unwrap_terminal(self) -> T
Return the terminal wrapped in this symbol.
Panics if the symbol is not a terminal.
pub fn unwrap_nonterminal(self) -> NT
[src]
pub fn unwrap_nonterminal(self) -> NT
Return the nonterminal wrapped in this symbol.
Panics if the symbol is not a nonterminal.