[stringtemplate-interest] elseif bug

Aigner, Thomas (LfF-R) Thomas.Aigner at lff.bayern.de
Thu Apr 17 01:44:56 PDT 2008


Hi, 
This is a known bug, see http://www.antlr.org:8888/browse/ST-36

Thomas

> -----Original Message-----
> From: stringtemplate-interest-bounces at antlr.org 
> [mailto:stringtemplate-interest-bounces at antlr.org] On Behalf 
> Of Zenaan Harkness
> Sent: Thursday, April 17, 2008 10:00 AM
> To: stringtemplate-interest
> Subject: Re: [stringtemplate-interest] elseif bug
> 
> 
> On Thu, Apr 17, 2008 at 05:47:58PM +1000, Zenaan Harkness wrote:
> > Can someone confirm whether in fact elseif in the latest 
> version of ST
> > is not being recognized, or am I doing something wrong?
> > 
> > java.lang.IllegalArgumentException: Can't find template elseif.st
> > at
> > 
> org.antlr.stringtemplate.StringTemplateGroup.lookupTemplate(St
> ringTemplateGroup.java:485)
> > ...
> 
> Here's my ST code snippet:
> 
> <if(!isInterface)>
> <if(!model.poly)> final
> <elseif(model.isAbstract)> abstract
> <endif>
> <endif>
> 
> Is there something obviously wrong that I'm doing here?
> 
> Perhaps ST is mixing up the elseif and assuming that goes 
> with the first
> if, rather than the second? Ie, perhaps ST is not nesting 
> properly here?
> 
> If I change the code to this:
> 
> <if(!isInterface)>
> <if(!model.poly)> final
> <if(model.isAbstract)> abstract
> <endif>
> <endif>
> 
> It works ... ?? (leaving aside the logic bug in my generated 
> code logic :)
> 
> -- 
> Homepage: www.SoulSound.net -- Free Australia: www.UPMART.org
> Please respect the confidentiality of this email as sensibly 
> warranted.
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org:8080/mailman/listinfo/stringtemplate-interest
> 


More information about the stringtemplate-interest mailing list