Struct perplex::grammar::Grammar[][src]

pub struct Grammar { /* fields omitted */ }

A grammar.

Methods

impl Grammar
[src]

Create a new empty grammar.

Add a nonterminal.

Add a terminal.

Lookup a nonterminal by name.

Panics if the nonterminal does not exist.

Lookup a terminal by name.

Panics if the terminal does not exist.

Find a nonterminal.

Find a terminal.

Get the name of a nonterminal.

Get the name of a terminal.

The upper bound on nonterminal IDs.

Basically returns the largest nonterminal ID + 1. Can be used as capacity for containers that will hold terminals.

The upper bound on terminal IDs.

Basically returns the largest terminal ID + 1. Can be used as capacity for containers that will hold terminals.

Add a rule to the grammar.

The rules in this grammar.

The rules for a specific nonterminal in the grammar.

Access a single rule of this grammar.

Panics if the id is the builtin ACCEPT nonterminal, which represents the virtual root rule.

Trait Implementations

impl Debug for Grammar
[src]

Formats the value using the given formatter. Read more

impl Clone for Grammar
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Index<RuleId> for Grammar
[src]

The returned type after indexing.

Performs the indexing (container[index]) operation.

impl IndexMut<RuleId> for Grammar
[src]

Performs the mutable indexing (container[index]) operation.

Auto Trait Implementations

impl Send for Grammar

impl Sync for Grammar