[antlr-interest] Re: tree parser generating templates

Terence Parr parrt at cs.usfca.edu
Thu Dec 15 10:32:41 PST 2005


On Dec 15, 2005, at 10:24 AM, duboimat at iro.umontreal.ca wrote:
> class LangWalker extends TreeParser;
> {
> StringTemplateGroup group; TextReader str;
> StringTemplate program_st,header_st,block_st,thread_st,
> assign_st,plus_st,moins_st,div_st,star_st;
> StringTemplate code;
>
> public void init()
> 	{
> 	str = new StreamReader("program.st");
> 	group= new StringTemplateGroup(str);

Ok, first thing:use a group file format and StringTemplateGroup.  See  
the article I have up on using ANTLR+ST.

>        ...
>
> To build the program I have to put a template into another one.
> if i build lines I have to regroup it to build a block .
>
> It work only when i use st for a subset of the program . I can't  
> regroup all
> subset to built a program without having repetition from another  
> subset with a
> new value. May be a need to reset the template with its value.

I have that functionality but I've never once used it...

> Is there another to do a manually request in v2?

see the article :)

Ter


More information about the antlr-interest mailing list