[stringtemplate-interest] Listing of used Attributes (@Caleb)
Dreyer Ulf (CR/APA3)
Ulf.Dreyer at de.bosch.com
Wed Jul 11 22:13:24 PDT 2007
Hi,
sorry but I forgot to mention that my parser doesn't do dynamically
computed attributes either.
(It would be surprising that what I jotted down in half a day is
superior
to Ter's own stuff ;)
I can think of one way to implement this:
If we are interestet in the superset of the used symbols we can
look up the static part and apply the dynamic attribute to all
symbols that are valid "members" of the static part.
But this would result in rather large trees which are mostly wrong.
I for my part don't need dynamically computed attributes (or
templates)
for now and therefore am happy with my solution but it IS an
interesting
problem ;)
>> Me:
> Terence:
>> 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.
>Cool. I think I have some recursive method that walks ST expression
>trees and answers this, but it can't do dynamically computed
>attribute names.
Ulf
More information about the stringtemplate-interest
mailing list