[antlr-interest] rule return value not declared
Kendall Shaw
kshaw at kendallshaw.com
Wed Jul 29 10:25:19 PDT 2009
Gavin Lambert <antlr at mirality.co.nz> writes:
> At 09:37 29/07/2009, Kendall Shaw wrote:
>>The result is that the return attribute "list" is not
>>declared in the resulting parser:
> [...]
>> @init { list = new ArrayList<String>(); }
>> : (t=thingy { list.add($t.name); })+
>
> You should be using $list here.
Thanks. It's odd that it works in all of my other rules without the '$'.
More information about the antlr-interest
mailing list