[antlr-interest] Stringtemplate : parallel multi-valued attribute iteration
Terence Parr
parrt at cs.usfca.edu
Fri May 7 12:56:40 PDT 2010
Hi Bill. that should work. Can you show us how you set attributes types, vars?
Ter
On May 7, 2010, at 12:40 PM, Bill Andersen wrote:
> Folks
>
> I have a template defined in a group file
>
> classDef(vars,types,body) ::= <<
> public class Foo {
>
> <vars,types:{ var,type | <type> <var> = null; }>
> <body>
>
> }
>>>
>
> and I pass in a (Java) array of strings as values for the 'vars' and 'types' attributes. So given
>
> vars = ["v1","v2"]
> types = ["T1","T2"]
>
> I'd like the output for the iterator on 'vars' and 'types' to be
>
> T1 v1 = null;
> T2 v2 = null;
>
> except that I'm seeing instead the output
>
> [Ljava.lang.String;@63b9240e [Ljava.lang.String;@fee4648 = null;
>
> Iterating on one of the multi-valued attributes alone yields correct results. I'm using the ANTLR 3.2 jars. Any help appreciated.
>
> .bill
>
>
> Bill Andersen
> Highfleet, Inc. (www.highfleet.com)
> 3600 O'Donnell Street, Suite 600
> Baltimore, MD 21224
> Office: +1.410.675.1201
> Cell: +1.443.858.6444
> Fax: +1.410.675.1204
>
>
>
>
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
More information about the antlr-interest
mailing list