Antlr4性能调优

2019年4月29日

setting setBuildParseTree to false means that your walker will have nothing to walk. [1]简单来说BuildParseTree=false与Listener模式不兼容。

Look for grammar actions

https://stackoverflow.com/questions/41355044/antlr4-parse-rule-to-match-open-close-brackets

如果用Mike Lischke的方法,parser还是要去分析那些不感兴趣的文本。正如其它人提到的“discarding these code blocks during lexing might be easier. Discarding them in the parser would mean that everything inside the { … } will still need to be tokenized.”

参考资料

  1. GRosenberg. Are there any good examples to references where setBuildParseTree = false?. . 2016-04-13 [2019-04-28].