
--
You received this message because you are subscribed to the Google Groups "antlr-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to antlr-discussi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/antlr-discussion/38830e35-9656-4f89-b635-f8d6ba690a96n%40googlegroups.com.
Background:Recently, I try to translate my old grammar rules, which are written in flex and bison, to antlr. However I met performance issue when I finish translation. the *.g4 file is about 1700s tokens and 1600s statements, 9400s branches of statements.When I compiled the g4 file, the antlr generated ATN graph that was nedges:68285, states:60948. The edges number is such enormous that antlr can not serialize the edges data (it only supports 0-65535), so I had to modify the serialization code to fit my project.

Thanks for replying. For some security reason, I can not share the grammar rule of my company's product with you (sorry for that). Our RDBMS rule is more complicated than MYSQL, it is kind of like a superset for MYSQL's grammar.How many rules and sub-rules does MYSQL have? If my rule does need such a large number of rules. Is it normal for antlr to take seconds to parse?
Le 30 juin 2021 à 01:48, John Brown <zbyty...@gmail.com> a écrit :
Hi Jan,Thanks for your advice. My environment is a UNIX-like system, so I did not try C# runtime. But I did some other runtime tests for my rules.First, as I said above, I translate my grammar rules from a statement output file generated by Bison. That file does have some duplicated rules and adds a lot of "."(wildcard) in the original rules as Mike said. So I removed them, cut duplicated branches then generated a normal g4 file for Antlr. The edge and node of ATN is reduced to about 24k.Now it's faster than before. However, it's still not as fast as I want. My test maybe not such strict. I used the same sentence, run in different runtimes on the same computer.Cpp: about 2s, Java: about 3s, Python3: about 29s, and JS: about 15mins on Chrome(not OOM anymore (¬‿¬) ).John
--
You received this message because you are subscribed to a topic in the Google Groups "antlr-discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/antlr-discussion/U2uSnV6zqyo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to antlr-discussi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/antlr-discussion/c5712c3c-f1bb-42d2-8e13-b269cd0c63f8n%40googlegroups.com.