Lexical analyzers and parsers

Henk Jansen rdr_nl at my-dejanews.com
Tue Apr 13 12:10:44 EDT 1999


In article <14092.48400.954787.617539 at amarok.cnri.reston.va.us>,
  "Andrew M. Kuchling" <akuchlin at cnri.reston.va.us> wrote:
> Julien Oster writes:
> >What about lexical analyzers and parsers?
> >
> >Under C I use bison/yacc and (f)lex. Under python, I can either implement
this
> >stuff using C or try to write my parsers on my own, which is real pain.
>
> 	There are actually a bunch of different systems available; see
> http://starship.python.net/crew/amk/python/string.html#parsing
> for a list.  (If I've missed any, let me know.)

I've tried out a few of the Python based parser-generator tools for a
non-trivial language (Modelica). I found kwParsing and PyLR too slow, PyLR
wasn't complete (and AFAIK still isn't). I was most successful with YAPPS and
liked it because it's a recursive-decendent parser, ala ANTLR, but only
LL(1). Finally, I've decided to use the Java-based ANTLR tool because it's
mature, actively being used and supported by a wide users group. Moreover, it
has great support for AST building and translation (I wouldn't like thinking
of figuring out all this myself...). I'll probably use JPython to mix the
best of both, simply because Python is great.

Henk

--
 =====================================================================
 Henk Jansen -- Delft University of Technology -- Dept. of Mathematics
 hjansen at math.tudelft.nl
 http://dutita0.twi.tudelft.nl/WAGM/people/H.Jansen.html

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




More information about the Python-list mailing list