[antlr-interest] How to make the rule return two or more values?

Kamil Burzynski nopik at data.pl
Mon Apr 14 13:49:23 PDT 2008


Yixun Liu wrote:
> Hi,
> How to make the rule return two or more values?
> For example, the rule: atom returns [float weight] only return one value. How to return two variables and how to get them?

Just [ int a, int b ]. Antlr will create structure containing them, so 
they will be accessible like $rule.a from calling rule.

-- 
Best regards from
Kamil Burzynski


More information about the antlr-interest mailing list