Wednesday, April 13, 2011

Antlr

So I have started playing a little bit with Antlr, specifically using antlrworks. I was originally going to learn MPS, however Antlr seems like a possibly better choice. It seems that it can generate python as well as java parsers. Obviously I am most interested in the python ones.

http://www.dalkescientific.com/writings/diary/archive/2007/10/30/antlr_mw.html

This seems to be a good article that I am starting to work through.

http://www.antlr.org/wiki/display/ANTLR3/ANTLR+Cheat+Sheet


Some notes:
need the python library from http://antlr.org/download/Python/
- requires 3.1.3 version of antlr, will not work with the newest version of antlrworks
name of file must match the grammar name
the language can be specified like(defaults to java):
options{
language=python;
}