A context-free grammar. A Grammar consists of a start state and a set
of productions. The set of terminals and nonterminals is implicitly
specified by the productions.
If you need efficient key-based access to productions, you can use a
subclass to implement it.
|
__init__(self,
start,
productions,
lexicon=None)
Create a new context-free grammar, from the given start state and set
of Production s. |
source code
|
|
|
|
|
|
|
|
|
|
|
covers(self,
tokens)
Check whether the grammar rules cover the given list of tokens. |
source code
|
|
|
|
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__
|