Home | Trees | Indices | Help |
---|
|
|
|||
|
__init__(self,
grammar,
string='') A parser instance must have a grammar at instance creation time. |
||
| recognize_string(self, string='') | ||
|
recurse_recognize(self,
goals,
agenda,
wordlist) Parse wordlist using goals (derivation).
|
||
|
expand(self,
next_goal,
rest_goals,
agenda,
wordlist) Expand next_goal using grammar
(self.productions ) Generate new GoalList
using one production and add unused productions to
agenda .
|
||
|
match_word(self,
next_goal,
wordlist,
rest_goals,
agenda)next_goal is a terminal.
|
||
|
backtrack(self,
agenda) Suppose agenda is non-empty:
|
||
|
parse_string(self,
string='') Not yet implemented |
||
| trace(self, boolean=True) | ||
| trace_match(self, boolean, next_goal, word, rest_goals, rest_wordlist) | ||
| trace_expand(self, next_goal, next_production, goals, agenda, wordlist) | ||
| trace_backtrack(self, goals, wordlist) | ||
| string_to_wordlist(self, string) | ||
| legal_input(self, string='') | ||
| recursion_check(self) |
|
A parser instance must have a grammar at instance creation time. The terminals, productions, and start_cat for the grammar are stored upon creation. If a string is supplied it is converted to a list words and stored in self.input. A string may also be supplied when the recognizer- or parser- method is called. |
|
Parse wordlist using Return True whenever Suppose If Suppose wordlist is empty, return True. Else backtrack
(If {agenda} is non-empty continue parsing with the next state on the
agenda; else return False) backtrack also contains a recursive call to
recurse_recognize .
|
next_goal using grammar
(self.productions ) Generate new GoalList using
one production and add unused productions to agenda . Keep
parsing with new GoalList , new agenda , old
WordList .
|
Suppose If next_goal matches Else this parse path fails; call backtrack (if Suppose backtrack .
|
Suppose agenda[0].GoalList = new goals agenda[0].WordList = new wordlist Keep parsing with new goals and new worldlist and popped agenda. Suppose |
|
|
|
|
|
|
|
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0alpha3 on Sat May 5 22:37:39 2007 | http://epydoc.sourceforge.net |