A context-free grammar production. Each production expands a single
Nonterminal
(the left-hand side) to a sequence of terminals and
Nonterminals
(the right-hand side). terminals can be any immutable hashable object that
is not a Nonterminal
. Typically, terminals are strings
representing word types, such as "dog"
or
"under"
.
Abstractly, a Grammar production indicates that the right-hand side is
a possible instantiation of the left-hand side. Grammar
productions are context-free, in the sense that this instantiation
should not depend on the context of the left-hand side or of the
right-hand side.
|
|
Nonterminal
|
|
sequence of (Nonterminal and (terminal))
|
rhs(self)
Returns:
the right-hand side of this Production . |
source code
|
|
string
|
|
string
|
|
boolean
|
|
|
|
|
|
int
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__
|