[11:45:19] warning(200): mygrammar.g:14:57: Decision can match input such as "','" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
[11:45:19] warning(200): C:\Users\Jarrod Roberson\mygrammar.g:14:57: Decision can match input such as "','" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
我希望能够将函数嵌套在其他函数中。
myfunction(x) ->
sqr(a) -> a * a,
y -> sqr(x).
这是它抱怨的那条线
function : ID '(' args ')' '->' statement (',' statement)* ;
这就是它正在考虑的替代方案
statement : ATOM
| expression
| assignment
| function
;
我正在使用.
我的语句结束规则
program : (statement'.')*;
这是 ANTLRWorks 中的 synatx 图
(来源:vertigrated.com)
我真的很喜欢在没有任何警告的情况下编译/工作。如何解决此警告情况?