![](/img/trans.png)
[英]How do I remove the “unsupported option 'greedy'” warning in this ANTLR grammar?
[英]How to remove 'k' option when converting ANTLR 3 grammar to ANTLR 4
ANTLR 4中没有令牌先行选项,因此...这是ANTLR 3代码:
declarations: // Order is important here.
( options { k = 3; }: DECLARE_SYMBOL identifier (variable_declaration | condition_declaration))*
cursor_declaration* handler_declaration*
;
删除k
选项。 它用于告知解析器生成器必要的前瞻。 ANTLR4中新的ALL(*)算法不再需要此设置,因为它可以动态使用任何所需的先行(理论上甚至是无限的)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.