[antlr-interest] missing attribute access on rule scope when testing token in action section
dacarey at gmail.com
Sun Oct 21 06:31:06 PDT 2007
I think I answered my own question here and it seems it is a typo in the
If the if clause you don't prefix el with a '$' so it is
On 21/10/2007, Dave Carey <dacarey at gmail.com> wrote:
> I have a question regarding "action section" and testing for the presence
> of optional tokens inside them
> According to the v3 Definitive Antlr Guide ( section 6.3) you can do
> something like this:-
> stat: 'if' expr 'then' stat(el='else' stat)?
> System.out.println ("found an else");}
> In fact when I try this same example ( Anrlr 3.0.1) I always get
> error(117): Test.g3:116:4: missing attribute access on rule scope: el
> You can workaround by access the token contents supplying an attribute e.g.
> $el.text: but this doesn't feel right and the guide suggests that it
> should work as prescribed.
> Can anybody clarify?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the antlr-interest