[antlr-interest] Re: StringTemplate enhancement question
Terence Parr
parrt at cs.usfca.edu
Tue Jun 22 14:59:38 PDT 2004
On Jun 22, 2004, at 2:48 PM, birmanstefan wrote:
> C inside
>> An interesting alternative. I think that the "tokens.name,type" is
>> faster to type though ;)
> I was thinking of a more general case when "tokens", "name", "type",
> "Ter", "342" don't come as explicit strings, but as variables eg
> varTokens, varName, varType... Then I would :
> st.setAttributes(varTokens + "." + varName + "," + varType+...,
> new Object[]{varValName, varValType});
> and then you would have to split it. This is the reason behind the
> proposal. Most of the time probably the user would use "tokens.name,
> type".
Oh, I get it now. Yeah, that would be a hassle, but as you say the
normal case would be just the static strings as you know what variable
is reference within the template.
>> I'm guessing that it won't cost much in code/time to interpret the
>> attribute name. Perhaps I should make it more obvious though like
>> "tokens.{name,type}".
> This is ok, although I do not complain of "tokens.name,type".
Yes, this one is terse, but the {...} makes it very clear what you are
trying to do. I'm also worried that people may have used a.b as
attribute names! Should be illegal, but I don't check for it. Not
sure if it's decidable.
Ter
--
CS Professor & Grad Director, University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Cofounder, http://www.jguru.com
Cofounder, http://www.knowspam.net enjoy email again!
Cofounder, http://www.peerscope.com pure link sharing
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/antlr-interest/
<*> To unsubscribe from this group, send an email to:
antlr-interest-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list