[stringtemplate-interest] $r.st vs $r.template

Terence Parr parrt at cs.usfca.edu
Tue Nov 22 11:31:01 PST 2005


On Nov 21, 2005, at 6:31 PM, Kamal Verma wrote:

> I will personally like ".template", though longer to type, it is  
> clear and avoid chances of error while reading the big code.

Hi. I'm leaning that way also.

> I am new to string template and antlr, but I was wondering if there  
> is any round-trip example which preserves whitespaces will be  
> great. Like,
>
> source1-->LEXER-->token_stream-->PARSER-->some_tree-- 
> >STRING_TEMPLATE->source2

Going to trees is harder given that some tokens don't make it into  
the tree!  Have you seen:

http://www.antlr.org/article/preserving.token.order/ 
preserving.token.order.tml

> given is,
>
> source1=source2 (syntactically) (like, reformatted)
> source1=source2 (semantically) (translated)
> source1=source2 (both) - complete round trip preserving whitespace.
>
> Since, I am new to this I was wondering if there are examples already.

You might look at that above article...

Ter


More information about the stringtemplate-interest mailing list