Hello, all -- I've recently been developing a matlab grammar using ANTLR. It's polished enough now for my use, so I thought I'd post it to the list (I've seen other people interested in such a thing).
You can download it at: http://www.mit.edu/~wingated/code/mparser_0.1.tar.gz The grammar supports C and Java language back-ends. In addition to the grammar itself, the package includes a MEX interface so that you can parse matlab code from within matlab itself. The result is a deeply nested set of matlab structures representing the AST (which I use to do source code transformations). It's not perfect - matlab turns out to be surprisingly hard to parse (due to lexing ambiguities and matlab's use of syntactically significant whitespace) but I think I've got most of it right. I'll follow-up with a few technical questions to this list to see if I can finish it off The Right Way, but for now, well... release early, release often. Any comments / feedback welcome. I have to say: using ANTLR for this project was definitely the right choice. Great work! -- David -- David Wingate | Computational Cognitive Science Group [email protected] | Brain and Cognitive Sciences (617) 324-2894 | Stochastic Systems Group 46-4053H BCS | Laboratory for Information and Decision Systems 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.
