Lines Matching refs:grammar
4 """Parser engine for the grammar tables generated by pgen.
6 The grammar table must be loaded first.
35 p = Parser(grammar, [converter]) # create instance
60 def __init__(self, grammar, convert=None):
63 The grammar argument is a grammar.Grammar instance; see the
64 grammar module for more information.
73 two arguments, the first being the grammar (a grammar.Grammar
89 self.grammar = grammar
90 self.convert = convert or (lambda grammar, node: node)
98 defaults to the grammar's start symbol.
106 start = self.grammar.start
111 stackentry = (self.grammar.dfas[start], 0, newnode)
127 t, v = self.grammar.labels[i]
146 itsdfa = self.grammar.dfas[t]
150 self.push(t, self.grammar.dfas[t], newstate, context)
170 ilabel = self.grammar.keywords.get(value)
173 ilabel = self.grammar.tokens.get(type)
182 newnode = self.convert(self.grammar, newnode)
197 newnode = self.convert(self.grammar, popnode)