[antlr-interest] Embedded actions for while-loop

Ahmad Al-Naimi dr_a2002 at hotmail.com
Sun Nov 23 00:27:44 PST 2008





Hello,

All the documentation provided with Antlr concentrate on the grammar and tree construction (understandably).
I'm working on developing a small interpreter, and will use one of the grammars in the examples with modifications.
However, I couldn't find any grammar example ready with actions (except for simple calculator examples... very primitive nothing new).

I'm struggling to build the embedded actions for the "if" and "while" grammars. I'm relying on standard C-style grammar, so I should be able to compile something like:

if (a>1)
{
   // some code here
}

while(a>1)
{
   // some code here
}

The output is Java. However, examples of any other language is appreciated.
Any links or resources with embedded actions (something more advanced than a calculator)?
Or any hints in this regard?

Thanks a lot!
Naimi

_________________________________________________________________
Connect to the next generation of MSN Messenger 
http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20081123/a0500290/attachment.html 


More information about the antlr-interest mailing list