Exemplo n.º 1
0
    def __init__(self, spec):
        from yapps import grammar, yappsrt
        from StringIO import StringIO

        scanner = grammar.ParserDescriptionScanner(spec)
        parser = grammar.ParserDescription(scanner)
        parser = yappsrt.wrap_error_reporter(parser, 'Parser')
        parser.preparser = _Definitions
        parser.output = StringIO()
        parser.generate_output()
        exec parser.output.getvalue() in self.__dict__
Exemplo n.º 2
0
    def __init__(self, spec):
        from yapps import grammar, yappsrt
        from StringIO import StringIO

        scanner = grammar.ParserDescriptionScanner(spec)
        parser = grammar.ParserDescription(scanner)
        parser = yappsrt.wrap_error_reporter(parser, 'Parser')
        parser.preparser = _Definitions
        parser.output = StringIO()
        parser.generate_output()
        exec parser.output.getvalue() in self.__dict__
Exemplo n.º 3
0
def parse(rule, text):
    P = DiceCalculator(DiceCalculatorScanner(text))
    return yappsrt.wrap_error_reporter(P, rule)
Exemplo n.º 4
0
def parse(rule, text):
    P = ParserDescription(ParserDescriptionScanner(text))
    return yappsrt.wrap_error_reporter(P, rule)
Exemplo n.º 5
0
def parse(rule, text):
    P = linda(lindaScanner(text))
    return yappsrt.wrap_error_reporter(P, rule)
Exemplo n.º 6
0
def parse(rule, text):
    P = linda(lindaScanner(text))
    return yappsrt.wrap_error_reporter(P, rule)
Exemplo n.º 7
0
def parse(rule, text):
    P = MipsParser(MipsParserScanner(text))
    return yappsrt.wrap_error_reporter(P, rule)
Exemplo n.º 8
0
def parse(rule, text):
    P = wiki2beamer(wiki2beamerScanner(text))
    return yappsrt.wrap_error_reporter(P, rule)
Exemplo n.º 9
0
def parse(rule, text):
    P = ParserDescription(ParserDescriptionScanner(text))
    return yappsrt.wrap_error_reporter(P, rule)