[stringtemplate-interest] Finding Attribute Names
Terence Parr
parrt at cs.usfca.edu
Mon Dec 13 19:06:14 PST 2010
well, I believe the grammar must pull out the names but they might get away with something sneaky with maps or toString or something. I don't think i have anything available. see the todebugstring stuff i think. it tries to walk to find them all.
Ter
On Dec 13, 2010, at 3:51 AM, Omer Anson wrote:
> Hello,
>
> I am writing a tool in Java, in which the user submits a template to
> be filled in later. Since I do not trust said user, I cannot trust him
> to provide me with all the attributes that appear in the template.
>
> My question is this:
> Is it possible, using StringTemplate and Java, to retrieve all the
> attribute names in the template?
>
> For instance, if I have the template:
> $if (greeting)$ $greeting$ $target$
> $else$ No greeting :(
> $endif$
>
> Is there a method that will return {greeting, target}? Is there a
> workaround to do this without reviewing the ASTExpr objects?
>
> Thank you
> Omer Anson.
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
More information about the stringtemplate-interest
mailing list