[antlr-interest] AST migration question

Thomas N. thn-d at gmx.de
Mon Dec 22 07:11:21 PST 2008


Hi,

I'm migrating AST building/parsing from an Antlr 2 grammar to Antlr 3.1.1, but the documentation on this is not too verbose (I've read them many times). I must admit that I'm not an AST expert and avoided them wherever I could, so maybe my question is not that keen...

Here is an Antlr2 example:

version_number!
{ short minor=0,major=0; String verStr=null; }
    : minor=u2 major=u2 { verStr = ""+major+"."+minor; #version_number = #[VERSION,verStr]; }
    ;

So, how is this done in Antlr 3.1.1?

Thomas Neustupny
-- 
Sensationsangebot verlängert: GMX FreeDSL - Telefonanschluss + DSL 
für nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K1308T4569a


More information about the antlr-interest mailing list