[antlr-interest] Java arrays in "returns" ?

Marcin Rzeźnicki marcin.rzeznicki at gmail.com
Sat Mar 13 03:59:36 PST 2010


On Sat, Mar 13, 2010 at 10:28 AM, Bart Kiers <bkiers at gmail.com> wrote:

> 2010/3/12 Marcin Rzeźnicki <marcin.rzeznicki at gmail.com>
>
> > Hi
> > I've got an awkward question. How can I return an array from rule?
> > "rule_name returns [Object[] sth] " obviously does not work because
> syntax
> > checker thinks that closing bracket of Object[] closes returns. I could
> not
> > find anywhere how to escape it. Thx for any help.<
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address>
> >
>
> This message from 2007 indicates it is not possible to have nested brackets
> inside "rule return statements":
> http://www.antlr.org/pipermail/antlr-interest/2007-March/019712.html
> and AFAIK, this still is not possible.
>
>
>
Thanks, but this message seems to be outdated. I tried: returns[Object[\]
blah] and it seemed to be working (I am not 100% sure 'cause I got error
from somewhere else in my grammar and didn't have time to check it out)



-- 
Greetings
Marcin Rzeźnicki


More information about the antlr-interest mailing list