Esempio n. 1
0
 def grammar(self, ast, *args):
     directives = OrderedDict((d.name, d.value) for d in ast.directives)
     keywords = set(ast.keywords or [])
     return grammars.Grammar(self.grammar_name,
                             list(self.rules.values()),
                             directives=directives,
                             keywords=keywords)
Esempio n. 2
0
 def grammar(self, ast):
     return model.Grammar(self.name, ast.rules)
Esempio n. 3
0
 def grammar(self, ast):
     return model.Grammar(self.name,
                          [r for r in ast.rules if r is not None])