[antlr-interest] [StringTemplate] Double-Types in StringTemplate: Maybe I'm blind

Terence Parr parrt at cs.usfca.edu
Fri May 7 14:14:17 PDT 2010


why not:

> <CHOICE>$choice$</CHOICE>

alone?
Ter
On May 7, 2010, at 2:12 PM, Daniel Kasmeroglu wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi there,
> 
> Maybe someone of you can point me to the corresponding doc to solve my problem. I've got
> the following template:
> 
> $if(choice)$
> <CHOICE>$choice$</CHOICE>
> $endif$
> 
> This obviously shall evaluate to either '<CHOICE>true</CHOICE>' or
> '<CHOICE>false</CHOICE>' . My problem is that 'choice' is of type 'Boolean'. If it's null
> the fragment shall not be generated. Unfortunately the value 'Boolean.FALSE' prohibits the
> evaluation. At the moment I'm solving this while providing special test methods for the
> wrapping objects but I was wondering if there's some kind of 'ifset' test or something
> like that to solve this.
> 
> Thanks in advance.
> 
> 
> - -- 
> Best regards
> 
> Daniel Kasmeroglu
> 
> http://www.kasisoft.com
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iQEVAwUBS+SCPRY813X6YpljAQIIZQf/RS2YIueFwmCBUKhrTHDDnRP2Nxtn+QbH
> i0PmYSBap47oSzCpRPPmiqlQTkQvDXYngGSEFBZ9eAdBdvho73mgWyTzfQl0ZREH
> fDIhSfeU7rLgPirGgiABLJIglPVyHJ4TFBzYX74MwSfiQo5zYR75ShM/+MDk6A4Q
> CDIlnD4+OzkgvnmokYVzLOqJqh1veLV3En3A5beKRHH7Q86Sfb+gfaqyYCfqfvg1
> 1dZTa9vDRwKsKBU5LFhfOzbl+/fJZJgyfsu+PUF0MfuFuHQUcayyfSt4sKpuW4km
> hXAOqNC3VAkTRHr3BbKUwGzvxut+nF7ZOYV/EUvDleu5E/T0hbGRvw==
> =rgIE
> -----END PGP SIGNATURE-----
> 
> 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