[antlr-interest] StringTemplate questions

Terence Parr parrt at cs.usfca.edu
Fri Nov 9 17:51:55 PST 2007


On Nov 9, 2007, at 3:07 AM, G R wrote:

> First of all, thanks Jeff.
> I've try using your template by doing this one (I'm using a group  
> template file) :
> difference(left, right, keyNames) ::= <<
> SELECT *
> FROM <left><if(keyNames)>
> WHERE <keyNames: {keyName | <keyName> NOT IN ( SELECT <keyName>  
> FROM <right> )
> }; separator="\nAND"><endif>
> >>

Wow!  You got it on your own.

> My Tree grammar that is calling this template is here :
> ->difference(left={$left.st}, right={$right.st}, keyNames= 
> {RATranslator.getPrimaryKeys($left.text)});
>
> Where RATranslator.getPrimaryKeys(String tableName) returns a String 
> [].
> I've check the array returned by this methode, ans it's ok.
> But when I try to use it as a list, I just get the physical adress  
> of my array. Instead of writing the content, I get something like  
> this : [Ljava.lang.String;@1931579.

Oh!  Yeah, I think there was an issue where property return values  
weren't converted to lists. hang on...oh, looks like code is ok.  Can  
you try latest build?

http://www.stringtemplate.org/download/build/ 
stringtemplate-11-09-2007.17.tar.gz

Ter


More information about the antlr-interest mailing list