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]
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)