[antlr-interest] antlr-interest Digest, Vol 39, Issue 111

Mark Edgeworth mark.edgeworth at scarletcode.co.uk
Thu Feb 28 01:40:38 PST 2008


Hi Olivier,

You could always wrap the List[] in a new class of your own, and use that as
the return type.  Something like:
public class ArrayOfLists {
    public List [] array;
}

You can then pass that around instead (you can accessors and mutators if you
need them).  OR, why not use an ArrayList instead, they are easier to use
than straight arrays in most places (of course this might raise an issue
with ArrayList<List> - is this allowable as a return by ANTLR?!)

Hope this helps,

Mark Edgeworth 
 
Incoras Solutions Ltd.

At 14:15 27/02/2008, Olivier Lefevre wrote:
 >Consider this tree grammar rule with Java output:
 >
 >    foo returns [List[] lists] <blah blah>
[...]
 >which is just wrong: the array-ness of lists (i.e., the [])
 >was thrown away. Is this is a deliberate limitation, where
 >is it documented?



More information about the antlr-interest mailing list