[antlr-interest] StringTemplate and newlines

Joan Pujol joanpujol at gmail.com
Sat Nov 20 12:41:13 PST 2004


On Sat, 20 Nov 2004 09:52:10 -0800, Terence Parr <parrt at cs.usfca.edu> wrote:

> I suspect that my 2.1 beta will make you happy ;)
WoooW. Very Happy yes ;)

> It would take me a while to figure precisely your problem here.  It
> seems like a similar problem as above: an expression on a line by
> itself that generates no output gets a newline.  Is that correct?

If I use the template2 (the one that works) yes. But for my template1
that doesn't works it's not the problem. I will try to be more
general:

The template 1 is :

template1(param1,param2) ::= //Where param2 is <param2:{parama,paramb}>

In my code I set param1 one time and param2 several times.
For some param2 parama is true and for some others parama is false

then if the template is:
<<
    <if(param2.parama)> <param2:{ <it.parama> <it.paramb>}> <endif>
    <param1>
     ....
>>

The problem is that if I set some param2 that have parama true and
then I set one param2 that  has parama to false all the info putted
inside the if is lost.
Thus I have to put the if inside the <param2{, that is what I do in my
template2, and the problem then are the newlines.

Cheers,

-- 
Joan Jesús Pujol Espinar


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 





More information about the antlr-interest mailing list