[stringtemplate-interest] Listing of used Attributes (@Caleb)

Dreyer Ulf (CR/APA3) Ulf.Dreyer at de.bosch.com
Tue Jul 10 22:12:32 PDT 2007


 Hi Terence,

  
 template applications would probably be difficult with added listeners:
 
 Examble:
 SomeTemplate() ::= << <it.foo> and <it.bar> >>

[...]
 <someList:someTemplate()>

 In this case if we someList is empty (because we just want to find out about
 used attributes) someTemplate will not be executed and someList[].foo/.bar will
 not be "found", am I right?

 I slappted together a parser (handwritten but one could probably use a treeparser)
 which analyses the AST of all actions.
 There are some problems with recursion and anonymous templates are not implemented
 but it produces a tree wich looks like this for the above example:
 [...]
 |
 +someList
    |someList.foo
    +someList.bar

 Now I can analyse any stringTemplate and get a suggestion of what a datastructure 
 fed to the top-template should look like.

Ulf

-----Ursprüngliche Nachricht-----

Betreff: Re: [stringtemplate-interest] Listing of used Attributes (@Caleb)

Hi Ulf,

Yeah, it would be nice to have an event trace for debugging.  We  
could add to the listener maybe so that events like "ref attribute x"  
could be heard.

Ter
On Jul 3, 2007, at 7:21 AM, Dreyer Ulf (CR/APA3) wrote:
> Hello Caleb,
>
> you wrote on the ANTLR/ST-Wiki about the possibility of
> listing the attributes a StringTemplate uses/has looked for.
> Since I have exactly this problem (albeit in a simpler case)
> I would love to read more about this on the list or in the wiki.
>
> Could you extend your Wiki entry with the mentioned methods?
>
> I'd like to find out about all used Variables (preferably beforehand)
> in a scenario where there are no indirect calls (as in <(expr) 
> (argument)>).
>
> The second you method is finding out the attributes AFTERwards.
> Is this also possible with an empty Attribute-Set?
> (Again in my scenario where I don't use attributes to reference  
> templates/properties)
>
> Thanks
>
> Ulf
>
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org:8080/mailman/listinfo/stringtemplate-interest

_______________________________________________
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