[stringtemplate-interest] v4 ST

Terence Parr parrt at cs.usfca.edu
Wed Oct 7 17:19:38 PDT 2009


I've changed it between add and inject 5x today! ugh. Inject is what I  
say in papers, but it's not what people would expect. I'm thinking  
just simple add() for now.

BTW, as a testament to ST's simplicity, I have 12 instructions in the  
bytecode interpreter and it does all canonical operations :)  It's  
cool stuff.  I took the stack-based bytecode interp pattern from book  
which comes with disassembler and such.

Example compilation:

compile: <if(name)>works<else>fail<endif>

0000:	load_attr  #0:"name"
0003:	brf        13
0006:	load_str   #1:"works"
0009:	write
0010:	br         17
0013:	load_str   #2:"fail"
0016:	write

compile: hi <name:a>!

0000:	load_str   #0:"hi "
0003:	write
0004:	load_attr  #1:"name"
0007:	load_str   #2:"a"
0010:	map
0011:	write
0012:	load_str   #3:"!"
0015:	write

Cool, right?

I thank Sam Harwell who discussed the instructions with me when he  
visited.

Ter
On Oct 7, 2009, at 5:11 PM, Gerald Rosenberg wrote:

> At 04:35 PM 10/7/2009, Zenaan Harkness wrote:
>
>> Minimising Cognitive Load for the user I feel is important, and to  
>> me,
>> .inject increases cognitive load, whereas .add reduces cognitive  
>> load.
>
> Minimizing congatv, congaviv, cognatitiv, coganative . . . .  Sigh,
> maybe Feeble Design Patterns are best ;).
>
> In the end, I think it is dealer's (Ter's) choice.
>
> _______________________________________________
> 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