[antlr-interest] Stringtemplate : parallel multi-valued attribute iteration

Bill Andersen andersen at highfleet.com
Fri May 7 12:40:27 PDT 2010


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







More information about the antlr-interest mailing list