A non-terminal symbol for a context free grammar.
Nonterminal
is a wrapper class for node values; it is used
by Production
s to distinguish node values from leaf values.
The node value that is wrapped by a Nonterminal
is known as
its symbol. Symbols
are typically strings representing phrasal categories (such as
"NP"
or "VP"
). However,
more complex symbol types are sometimes used (e.g., for lexicalized
grammars). Since symbols are node values, they must be immutable and
hashable. Two Nonterminal
s are considered equal if their
symbols are equal.
|
|
(any)
|
|
boolean
|
__eq__(self,
other)
Returns:
True if this non-terminal is equal to other . |
source code
|
|
boolean
|
__ne__(self,
other)
Returns:
True if this non-terminal is not equal to other . |
source code
|
|
|
|
|
|
string
|
|
string
|
|
Nonterminal
|
__div__(self,
rhs)
Returns:
A new nonterminal whose symbol is A/B , where A
is the symbol for this nonterminal, and B is the symbol for rhs. |
source code
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__
|