[antlr-interest] manual tree construction

Michael Laszlo mjl at nova.edu
Fri Sep 16 06:19:18 PDT 2005


Thanks Monty. This works:

var_decl!
 : ID DEC_ASSIGN e:expr { #var_decl = #(ID, DEC_ASSIGN, e); }
 ;

It seems necessary to reference expr by label or the resulting parser
doesn't compile.

The example I modeled it on (from ANTLR Tree Construction) doesn't include
commas:

begin!
    :   INT PLUS i:INT
        { #begin = #(PLUS INT i); }
    ;

(I'm too accustomed to comma-less Scheme lists.)

When I send to this archive, the note is not placed at the proper level in
response to your message.  I think some setting in Outlook Express truncates
the email's subject line.





More information about the antlr-interest mailing list