faster: Significant performance boost on large grammar

15s to 5s
This commit is contained in:
John Doty 2024-04-17 23:25:15 -07:00
parent 6fa89a9757
commit f656dbd8f3
2 changed files with 31 additions and 17 deletions

View file

@ -419,7 +419,7 @@ grammar = {
# dump_yacc(grammar)
grammar, precedence = desugar(grammar, precedence)
gen = parser_faster.GenerateLR1("File", grammar, precedence=precedence)
table = gen.gen_table()
print(parser_faster.format_table(gen, table))
print()
gen.gen_table()
# print(parser_faster.format_table(gen, table))
# print()
# tree = parse(table, ["id", "+", "(", "id", "[", "id", "]", ")"])