[antlr-interest] Problem with return values in ANTLR 3

Jim Idle jimi at temporal-wave.com
Wed Dec 21 15:09:45 PST 2005


I have found that you need to do this (though it is probably a bug and
you should use the $ - please notify wildly if you change this Ter as my
grammars will suddenly break for no apparent reason ;-)):

: 'Checked' '=' ('true' {result = true; } |'false') ';'

-----Original Message-----
From: antlr-interest-bounces at antlr.org [mailto:antlr-interest- 

On Dec 21, 2005, at 3:01 AM, Dr. Kocher, Hartmut wrote:

> I try to return a boolean value from a rule (instead of the usual  
> template).
>
>             : 'Checked' '=' ('true' {$result = true; } |'false') ';'
>
>             ;

Seems like a bug...adding to list.


More information about the antlr-interest mailing list