Bob Smiley wrote: > Thanks for the reply, but I'm actually not trying to create an > interpreter...my goal is to create a simple scripting language that I can > just translate into C and compile with GCC. My question may have been > confusing because I was asking about a language similar to C, but really any > grammar with the features I listed below would probably work. > For what you want to do, if you were familiar with grammars I would say it is easiest to type it in from scratch. However, as you are not, then why not take the example GNU C parser (download the examples from the download page), and take out the stuff you do not need (quite a lot of it). Advice: take out the keywords you don't want first, then remove the rules that use them, then remove other stuff you don't need.
The best thing to do then would be to use a string template to output your C file, then compile that to a .o file. The option output=AST; is what you need for that. However, you coudl also provide a few helper classes that build the .C file and just call into these with actions. Jim List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---
