[stringtemplate-interest] List of used Attributes from ST without formal parameters

Terence Parr parrt at cs.usfca.edu
Thu Feb 22 11:49:35 PST 2007


Hi.  In Java, you can use toStructureString(). Or modify to get  
list.  Perhaps even getChunks() to look at ASTExpr's.

Ter
On Feb 22, 2007, at 5:01 AM, Dreyer Ulf (CR/APA3) wrote:

> Hi,
>
>
> Is there any way to ask a template for a list of all the Attributes  
> it uses?
> I'd like to check template-chunks for required variables:
>
> Example:
>
> From "$log.length$"
> I would like to get   'log.length', or possibly [log,log.length]
>
> more complicated:
> "$logs:{u| $u.name - u.length$}$  --> [logs, logs.name, logs.length]
>
> Is there any way to do this besides writing another parser.
> This seems such a waste because ST already contains a lot of
> the needed mechanisms.
>
> Thans a lot,
>
> Ulf
>
> P.S.: (Using StringTemplate for C#  3.0.1)
>
>
> -- 
> Dipl. Inf. Ulf Dreyer
> Robert Bosch GmbH
> Zentralbereich Forschung und Vorausentwicklung
> Software und Systemengineering in der Fertigungsautomatisierung CR/ 
> APA3
> Postfach 30 02 40  D-70442 Stuttgart
> Tel.: 0711/811- 34365
> Fax:  0711/811-518 34365
> eMail: ulf . dreyer at de . bosch . com
>
> Robert Bosch GmbH, Sitz: Stuttgart, Registergericht: Amtsgericht  
> Stuttgart HRB 14000 Aufsichtsratsvorsitzender: Hermann Scholl;  
> Geschäftsführung: Franz Fehrenbach, Siegfried Dais; Bernd Bohr,  
> Wolfgang Chur, Rudolf Colm, Gerhard Kümmel, Wolfgang Malchow, Peter  
> Marks; Volkmar Denner, Peter Tyroller.
>
> _______________________________________________
> 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