[stringtemplate-interest] pushed another ST4 build
Monty Zukowski
monty at codetransform.com
Wed Dec 29 11:23:06 PST 2010
Just read your notes on the interpreter. Looks very clean, should
make for great portability and speed.
Nice!
Monty
On Wed, Dec 29, 2010 at 9:03 AM, Terence Parr <parrt at cs.usfca.edu> wrote:
> Nope, just an array;
>
> t(x,y) ::= "<x><y>"
>
> generates
>
> load_local 0
> write
> load_local 1
> write
>
> The compiler translates id to int. For dynamic scoping look up, it keeps a
> hashtable but in the template def object not the ST itself. then you can do
>
> locals[impl.formalArgs.get(id).index]
>
> to get value if you only have a name.
>
> This saves a hashtable per ST :) memory and gc overhead savings
>
> T
> On Dec 28, 2010, at 2:32 PM, Monty Zukowski wrote:
>
>> What's the rationale there? Is the array key,value,key,value? Since
>> the number of items is usually short, a few equals() calls beats the
>> hash function?
>>
>> Monty
>>
>> On Mon, Dec 27, 2010 at 12:54 PM, Terence Parr <parrt at cs.usfca.edu> wrote:
>>>
>>> fast array not hashmap look up for attributes.
>>> http://bit.ly/hVN7PG
>>> Ter
>>> _______________________________________________
>>> stringtemplate-interest mailing list
>>> stringtemplate-interest at antlr.org
>>> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
>>>
>>>
>> _______________________________________________
>> 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