[antlr-interest] added action shortcuts for templates

Terence Parr parrt at cs.usfca.edu
Sat Jan 14 15:15:11 PST 2006


Howdy,

For ANTLR v3 added these shortcuts:

	 *    %foo(a={},b={},...) ctor (even shorter than $templates::foo(...))
	 *    %({name-expr})(a={},...) indirect template ctor reference
	 *
	 *    The above are parsed by antlr.g and translated by codegen.g
	 *    The following are parsed manually here:
	 *
	 *    %{string-expr} anonymous template from string expr
	 *    %{expr}.y = z; template attribute y of StringTemplate-typed  
expr to z
	 *    %x.y = z; set template attribute y of x (always set never get  
attr)
	 *              to z [languages like python without ';' must still  
use the
	 *              ';' which the code generator is free to remove  
during code gen]

Note that I added

-> ({name-expr})(a={},...)

also as a rewrite.

i expect another early access release shortly.

Ter


More information about the antlr-interest mailing list