Exemplo n.º 1
0
class Parser(object):
    """A controller of lexer and yaccer for convenience."""
    def __init__(self, grammar):
        lexer = Lexer()
        self.yaccer = Yaccer(lexer)
        self.yaccer.build(grammar)

    def parse(self, data):
        self.yaccer.parse(data)
Exemplo n.º 2
0
 def __init__(self, grammar):
     lexer = Lexer()
     self.yaccer = Yaccer(lexer)
     self.yaccer.build(grammar)