1 2 3 4 5 6 7 8 9 10 11 12 13 14
import earlpy if False: p = earlpy.Parser("grammars/expression") node = p.parse_string("1 + 1 + 2 + 3") print(node.pprint()) elif True: p = earlpy.Parser("grammars/c") node = p.parse_file("examples/simple.c") print(node.pprint()) else: p = earlpy.Parser("grammars/c") node = p.parse_file("examples/expr.c") print(node.pprint())