AW: [antlr-interest] Problem: part of AST gets lost in limbo
Ulrich Hobelmann
u.hobelmann at web.de
Thu Jun 8 11:43:36 PDT 2006
On Jun 8, 2006, at 8:09 PM, Koehne Kai wrote:
> Hi Ulrich,
>
>> sts:(statement)*
>
> this will not work. According to the manual, only atomic or rule
> reference production elements can be labeled:
> http://www.antlr.org/doc/metalang.html#_bb16
>
> Instead of referencing (statement)* directly, you can use
> #lc.getNextSibling().
Hm, my Java complains that that method (lc.getNextSibling()) can't be
found in class antlr.Token.
But simply factoring the statements out into another production helps
on first glance.
Too bad Antlr didn't complain about my wrong syntax. I kept thinking
it was legal code (maybe because the statements even was wrapped in
() which makes it look like a single element)...
Thanks!
Ulrich
More information about the antlr-interest
mailing list