[antlr-interest] Error 206 Recursion woes
Tangeleno
tangeleno at gmail.com
Tue Apr 10 19:19:59 PDT 2012
The error is "Ln17:7 Alternative 1: after matching input such as '$'
'{''$' '{''$' '{''$' '{''$' '{' the decision cannot predict what comes
next due to recursion overflow to id from accessor and to object data
from id and to accessor from objectData"
From what I can gather from the book pg 281 is the closest I can find
to this problem it should be a warning and not an error. The problem is
coming about when I add the rule objectData as an alternative to the
param rule, which I really don't understand as because it's complaining
about id accessor and objectData...
So my question is what am I doing wrong and what can I do to fix it
while still allowing nested objectDatas?
http://privatepaste.com/6611be2380 is an example of what can happen in
this silly language and 6 levels is by no means the cap...
objectData
: '$' '{'accessor objectMember*'}'
;
objectMember
: ('.'|':') accessor;
accessor: id indexer* typeCast*;
id : (ID|objectData);
indexer : '[' commaParams ']'
;
commaParams
: param (',' param)*
;
param : objectData|number|string
;
spaceParams
: param (WS param)* NewLine
;
typeCast: '(' id ')';
number : INT|FLOAT;
string : STRING|.*;
More information about the antlr-interest
mailing list