While I was studying compilers in the faculty we used Aflex and Ayacc to create a lexic and sintactic parser, which we used in our own little compiler.

These two are version of the Lex and Yacc tools rewritten for Ada, but I discovered you can use them to parse any language you want as long as you provide them with a LALR grammatic.

URL is http://www.ics.uci.edu/~arcadia/Afle...lex-ayacc.html

If you want any more information on this I can try to dig it out from my notes.