[antlr-interest] question about ".st" in Mantra grammar

Terence Parr parrt at cs.usfca.edu
Mon Nov 26 13:22:41 PST 2007


hi. Those refer to the template returned from expression, statement,  
etc...

Ter
On Nov 26, 2007, at 12:57 PM, Mark Volkmann wrote:

> I'm trying to learn more about using ANTLR by studying the grammar
> files for Mantra. I'm looking at the statement rule in CodeGen.g and
> see this alternative.
>
> ^('if' expression s=statement (el=statement)?)
> -> ifstat(cond={$expression.st}, stat={$s.st}, elsestat={$el.st})
>
> I understand that ifstat is a template in Java.stg, but what do the
> ".st" parts in that last line do? I couldn't find an example like this
> in the ANTLR book, but maybe I missed it.
>
> -- 
> R. Mark Volkmann
> Object Computing, Inc.



More information about the antlr-interest mailing list