Or objects#

Constructor#

Or(subexprs[, quantifier])

Grouped grammar that represents a logical OR operation between grammars.

Attributes#

Or.separator

Separator to use for the grammar.

Or.subexprs

Group of grammars.

Or.quantifier

Minimum and maximum repetitions the expression must match.

Rendering#

Or.render([full, wrap])

Render the grammar as a regular expression.

Or.render_quantifier()

Render the quantifier.

Or.needs_wrapped()

Check if the expression needs to be wrapped in parentheses.

Or.as_string([indent])

Return a string representation of the grammar.

Simplification#

Or.simplify()

Simplify the grammar.

Or.simplify_subexprs(original_subexprs, ...)

Simplify the provided subexpressions for the grouped grammar.

Utility#

Or.copy()

Create a copy of the grammar.

Or.equals(other[, check_quantifier])

Check equality with another value.

Metadata#

Warning

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

Or.attrs_dict()

Return instance attributes of the grammar.