[stringtemplate-interest] no "..." pass through argument for v4?

Terence Parr parrt at cs.usfca.edu
Wed Dec 22 12:25:34 PST 2010


In v3 we have a ... arg that lets us see dynamically inherited values through arguments like this:

/** i+=INT in lexer */
lexerRuleRefAndListLabel(rule,label,args,elementIndex,scope) ::= <<
<lexerRuleRef(...)>
<listLabel(elem=label,...)>
>>

it's just bein lazy, not passing arguments along.  It has a big peformance hit so i think i'll drop for v4.  

Consider

f(a) ::= "<name>_<a>"

arg 'a' is clearly immediately available w/o looking up the chain of enclosing templates so it should be a fast array lookup.  name is clearly not defined as arg and so slower lookup is needed.  If we allow "<f(...)>" the assumption that 'a' is an arg is no longer true.

Ter


More information about the stringtemplate-interest mailing list