Rule
- class neologism.Rule(lhs: str, rhs: Iterable[str])[source]
A class that is used to create and modify the
DCFG.The API uses
strfor symbols.Ruleis immutable, hashable and has its equivalence implemented.
A Rule is the atomic production: one left-hand-side
non-terminal expanding to a tuple of zero or more symbols on the
right-hand side. Rules are immutable, hashable, and value-equal –
two Rule objects with the same LHS and RHS compare equal regardless
of construction order.