[antlr-interest] Customizing Abstract Syntax Tree

Abhijit Nandkumar Ghonge Abhijit_Ghonge at infosys.com
Tue Dec 12 08:05:22 PST 2006


Hi,

            Can anybody help me with this? Can I customize the Abstract
syntax tree? For example:

I have a parser like this:

class CalcParser extends Parser;

options {

            buildAST = true; // uses CommonAST by default

}



expr

            :           mexpr (PLUS mexpr)* SEMI!

            ;



mexpr

            :           atom (STAR atom)*

            ;



atom:    INT

            ;



I want an Abstract Syntax Tree such as:



2 + ( 3 + 4)



Then I may be able to develop something like this:







Please help.



Regards,

Abhijit.



**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20061212/d6fae09f/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 5179 bytes
Desc: image001.jpg
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20061212/d6fae09f/attachment-0001.jpe 


More information about the antlr-interest mailing list