From: rdr_nl at my-dejanews.com (Henk Jansen)
Date: Tue, 13 Apr 1999 16:10:44 GMT
Subject: Lexical analyzers and parsers
References: <7jn20jmxsw.fsf@gandalf.midearth.fuzzys.org> <14092.48400.954787.617539@amarok.cnri.reston.va.us>
Message-ID: <7evq9s$68n$1@nnrp1.dejanews.com>
Content-Length: 1577
X-UID: 656                                                  

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    




