Struct perplex::grammar::Rule [−][src]
pub struct Rule { /* fields omitted */ }
A single rule within a grammar.
Methods
impl Rule
[src]
impl Rule
pub fn new(name: NonterminalId, symbols: Vec<Symbol>) -> Rule
[src]
pub fn new(name: NonterminalId, symbols: Vec<Symbol>) -> Rule
Create a new empty rule.
pub fn name(&self) -> NonterminalId
[src]
pub fn name(&self) -> NonterminalId
The name of this rule.
pub fn symbols(&self) -> &[Symbol]
[src]
pub fn symbols(&self) -> &[Symbol]
The symbols in this production.
pub fn pretty<'a>(
&'a self,
grammar: &'a Grammar
) -> Pretty<&'a Grammar, &'a Self>
[src]
pub fn pretty<'a>(
&'a self,
grammar: &'a Grammar
) -> Pretty<&'a Grammar, &'a Self>
Get a pretty printer for this rule.
Trait Implementations
impl Debug for Rule
[src]
impl Debug for Rule
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Rule
[src]
impl Clone for Rule