Hendrik Maryns schrieb:
> HI,
> 
> Ok, so the ‘token file not found’ issue seems to be bogus, but here is
> the next problem with my grammar:
> 
> error(211): fsqTreeParser.g:68:3: [fatal] rule body has non-LL(*)
> decision due to recursive rule invocations reachable from alts 3,5.
> Resolve by left-factoring or using syntactic predicates or using
> backtrack=true option.
> 
> Strangely, the parser grammar contains the exact same rule, but does not
> give this error message.
> 
> Here is the relevant rule:
> 
> body returns [Formula result]
>   : label { $result = $label.result; }
>   | atomic { $result = $atomic.result; }
>   | unary { $result = $unary.result; }
>   | binary { $result = $binary.result; }
>   | n_ary { $result = $n_ary.result; }
>   | quantor { $result = $quantor.result; }
>   ;
> 
> Indeed, the unary, binary, n_ary and quantor rules (indirectly) refer to
> formula:
> 
> formula returns [Formula result]
>   : ^(FORMULA body) { $result = $body.result; }
>   ;
> 
> What would be the proper thing to do here?  Adding backtrack=true does
> fix it, but I am not sure whether that is a good idea?
> 
> You might notice that I am trying to implement a parser for some logic
> here.
> 
> H.

Try the description of
<http://www.antlr.org/wiki/display/ANTLR3/How+to+remove+global+backtracking+from+your+grammar>.

Johannes
> 
> 
> ------------------------------------------------------------------------
> 
> 
> List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
> Unsubscribe: 
> http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address
> 


List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to