Derivation rules#

Constructor#

DerivationRule(symbol, value)

Derivation rule that expands to a expression (grammar).

Attributes#

DerivationRule.symbol

Symbol (non-terminal) for the derivation rule.

DerivationRule.value

Grammar the symbol derives into.

Rendering#

DerivationRule.render([full, wrap])

Render the grammar as a regular expression.

DerivationRule.as_string([indent])

Return a string representation of the grammar.

Simplification#

DerivationRule.simplify()

Simplify the grammar.

Utility#

DerivationRule.copy()

Create a copy of the grammar.

DerivationRule.equals(other[, check_quantifier])

Check equality with another value.

Metadata#

Warning

DerivationRule.attrs_dict is considered experimental and may change without warning.

DerivationRule.attrs_dict()

Return instance attributes of the grammar.