grammatica.grammar.DerivationRule#
- class grammatica.grammar.DerivationRule(symbol, value)[source]#
Derivation rule that expands to a expression (grammar).
Non-terminal symbol and an expression separated by a metasymbol (e.g. ‘symbol ::= expression’).
- Parameters:
symbol (
str) – Symbol (non-terminal) for the derivation rule.value (
Grammar) – Grammar the symbol derives into.
Attributes
Symbol (non-terminal) for the derivation rule. |
|
Grammar the symbol derives into. |
|
|
Separator metasymbol to use for the derivation rule. |
Methods
|
Return a string representation of the grammar. |
Return instance attributes of the grammar. |
|
|
Create a copy of the grammar. |
|
Check equality with another value. |
|
Render the grammar as a regular expression. |
|
Simplify the grammar. |