[antlr-interest] AST with optional parameters

David Smith david.smith at cc.gatech.edu
Tue Jun 7 07:33:29 PDT 2011


Yes, the language is Matlab and a semicolon on the end of an 
assignment expression suppresses display of the result of the assignment.
Bart, I appreciate the suggestion; I haven't tried that (much 
simpler) solution - I'll let you know.

                                 DMS
At 08:26 AM 6/7/2011, Bart Kiers wrote:
>Hi John,
>
>Have you tried:
>
>    |   (ID GETS) => ID GETS e=expr (s=SEMI)? -> ^(GETS ID $e $s?)
>
>is the semicolon really necessary in the tree? (e.g. does the presence
>of the semicolon actually change the meaning of of the statement?)
>
>
>Exactly my thought after I sent my previous e-mail!
>
>perhaps:
>
>    | (ID GETS) => ID GETS^ expr SEMI!?
>
>
>Or the equivalent rewrite rule:
>
>(ID GETS) => ID GETS expr SEMI? -> ^(GETS ID expr)
>
>
>Regards,
>
>Bart.
>
>
>
>Hope this helps...
>   -jbb
>
>
>
>List: 
><http://www.antlr.org/mailman/listinfo/antlr-interest>http://www.antlr.org/mailman/listinfo/antlr-interest
>Unsubscribe: 
><http://www.antlr.org/mailman/options/antlr-interest/your-email-address>http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>

David M. Smith http://www.cc.gatech.edu/fac/David.Smith
Georgia Institute of Technology, College of Computing
Sent from my ASR-33 Teletype 



More information about the antlr-interest mailing list