5.1.6. Cannot generate the grammar because, duplicate token type xxx when collapsing subrule into set

如果ANTLR语法写的有问题的话,则是无法生成对应的代码的。

错误有多种可能:

比如是由于符号类型冲突而无法生成代码,详见:

【已解决】Antlr语法编译出错:Cannot generate the grammar because, duplicate token type COMPOSITE_OPERATOR when collapsing subrule into set