How to force ANTLR to parse all input CharStream

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 02:44:50

Your main rule needs to end with the EOF token - an ANTLR-provided special token that matches end of input.

If the token's not there, ANTLR will just parse whatever it can match and then stop. By putting the EOF at the end of your entry rule, you tell ANTLR that whatever it parses must end at the end of input.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!