问题
I have tried a few days to fix my grammar file(uniformSQL.g4) in order to improve the parser performance but still failed. The parser cost 4000+ ms to parser through the SQL case. And I also tried to use SLL(*) strategy, it is fast but come out a lot of mismatch cases.
So I wonder how to get the best performance when designing the grammar.
I also tried to lower the parse tree'height when designing grammar, but the speed turned out to be slower.
Looking forward to your suggestion,thanks.
This is my uniformSQL.g4 grammar file: https://github.com/ihainan/GBase-8a-MPP-Cluster-SQL-Parser/blob/master/src/main/java/cn/edu/bit/linc/sqlparser/antlr/uniformSQL.g4
And this is my SQL test case(280+ lines): https://github.com/ihainan/GBase-8a-MPP-Cluster-SQL-Parser/blob/master/test.sql
来源:https://stackoverflow.com/questions/32645754/is-there-any-good-ways-to-improve-the-parsers-performance-generated-using-antlr