NonTerminal

Trait NonTerminal 

Source
pub trait NonTerminal: Copy {
    // Required methods
    fn is_trace(&self) -> bool;
    fn nonterm_type(&self) -> Option<NonTerminalType>;
    fn as_str(&self) -> &'static str;
    fn to_usize(&self) -> usize;

    // Provided methods
    fn is_auto_generated(&self) -> bool { ... }
    fn is_augmented(&self) -> bool { ... }
}
Expand description

A struct to hold information about non-terminal symbols

Required Methods§

Source

fn is_trace(&self) -> bool

whether this non-terminal is set as %trace

Source

fn nonterm_type(&self) -> Option<NonTerminalType>

for internal use only; If this non-terminal is auto-generated, gets the pattern where this non-terminal was generated from.

Source

fn as_str(&self) -> &'static str

Gets the pretty name of this non-terminal.

Source

fn to_usize(&self) -> usize

converts this non-terminal to a usize

Provided Methods§

Source

fn is_auto_generated(&self) -> bool

Whether this non-terminal is auto-generated by rustylr. Some non-terminals could be auto-generated to handle regex patterns, character sets, etc.

Source

fn is_augmented(&self) -> bool

Augmented rule will be generated for entry point of the grammar.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§