[antlr-interest] ANTLR generating invalid Java

Terence Parr parrt at cs.usfca.edu
Thu Aug 7 13:11:10 PDT 2008


TheProblem is that predicates can be hoisted out of their original  
rule...  If you put a {} blank action in front of the predicate, it  
will not be hoistd.
T
On Aug 7, 2008, at 12:54 PM, Oren Ben-Kiki wrote:

> On Thu, Aug 7, 2008 at 12:37 PM, Oren Ben-Kiki <oren at ben-kiki.org>  
> wrote:
>> I didn't see this warning in the book... Now that I am aware of it, I
>> can avoid the problem by turning of auto-backtracking and manually
>> adding syntactic predicates. Thanks!
>
> I spoke in haste... it seems it is not possible to use rule parameters
> in syntactic predicates :-(
> It seems as though parameters were envisioned as carrying context only
> to actions;
> the rules themselves (that is, the valid input syntax) is not expected
> to be affected by them.
> This means I am SOL - my syntax _does_ depend on the value of the  
> parameters.
> Is this really the case?
>
> Oren.



More information about the antlr-interest mailing list