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

Mark Volkmann r.mark.volkmann at gmail.com
Mon Nov 26 12:57:50 PST 2007


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