Exemplo n.º 1
0
def tree(input: str) -> LN:
    print("Input is {}".format(repr(input)))
    driver = Driver(pygram.python_grammar_no_print_statement,
                    convert=pytree.convert)
    return driver.parse_string(input)
Exemplo n.º 2
0
 def parse_line(self, source: str) -> LN:
     grammar = pygram.python_grammar_no_print_statement
     driver = Driver(grammar, convert=pytree.convert)
     # Skip file_input, simple_stmt
     return driver.parse_string(source + "\n").children[0].children[0]
Exemplo n.º 3
0
def driver():
    return Driver(pygram.python_grammar, convert=pytree.convert, logger=log)