473,320 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Python parser generators

Hello, everybody!

Can someone give an overview of existing Python parser generators?

I played with TPG and like it a lot. However, I'd like to know more
about alternatives. Google shows several options: PyLR, DParser, etc.

I'm not intrested in ultra-speed: TPG although claims to be not
lighting-quick seems quick enough for my needs, I'm rather looking for
convinience and expressivness.

TIA,
anton.

Jul 18 '05 #1
2 1463
[anton muhin]
Can someone give an overview of existing Python parser generators?
[...] I'm rather looking for convenience and expressiveness.


Hello, Anton.

I looked at a few, but did not look at them all, and finally settled for
SPARK for production. (I do not fully understand why a few generators
which were written after SPARK did not at least recycle its elegance.)

SPARK is not blazing fast, but is not inordinately slow either, _given_
you write reasonable grammars. By "reasonable", I do not mean small,
we indeed use some rather big ones here. But I mean grammars which are
rather left-to-right-ly, and for which big inputs could be chumped into
smaller syntactical units at lexical time. In that way, each of the
repeated call to a SPARK parser in an application is not given the whole
input -- we found out that this is worth, and usually easy to do. Our
parsers are easy to maintain and very dependable. We are happy with it.

--
François Pinard http://www.iro.umontreal.ca/~pinard

Jul 18 '05 #2
François Pinard wrote:
[anton muhin]
Can someone give an overview of existing Python parser
generators?
[...] I'm rather looking for convenience and expressiveness.


Hello, Anton.

I looked at a few, but did not look at them all, and finally
settled for
SPARK for production. (I do not fully understand why a few
generators which were written after SPARK did not at least recycle
its elegance.)

SPARK is not blazing fast, but is not inordinately slow either,
_given_
you write reasonable grammars. By "reasonable", I do not mean
small,
we indeed use some rather big ones here. But I mean grammars
which are rather left-to-right-ly, and for which big inputs could
be chumped into
smaller syntactical units at lexical time. In that way, each of
the repeated call to a SPARK parser in an application is not given
the whole
input -- we found out that this is worth, and usually easy to do.
Our
parsers are easy to maintain and very dependable. We are happy
with it.


And, here is a link to a comparison document:

http://www.python.org/sigs/parser-si...-standard.html

The above article does not mention PLY. I used PLY to write (most
of) a parser for the RELAX NG compact syntax. PLY worked well for
me. PLY is available at:

http://systems.cs.uchicago.edu/ply/.

The parser for the RELAX NG compact syntax might serve as a
reasonable example of how to use PLY. It is available at:

http://www.rexx.com/~dkuhlman/relaxngcompact.html

And, I've written a bit of documentation on how to use Python parser
generators, which is at:

http://www.rexx.com/~dkuhlman/python...ython_201.html.

Dave

--
http://www.rexx.com/~dkuhlman
dk******@rexx.com
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John J. Lee | last post by:
Are there any parser / lexer generators useable from both CPython and Java? I don't mind much if the Python-useable output is in Python or C (as long as the C can be wrapped automatically, of...
699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
3
by: Simon Foster | last post by:
Anyone have any experience or pointers to how to go about creating a parser lexer for assemble in Python. I was thinking of using PLY but wonder whether it's too heavyweight for what I want. ...
7
by: svilen | last post by:
hello again. i'm now into using python instead of another language(s) for describing structures of data, including names, structure, type-checks, conversions, value-validations, metadata etc....
19
by: Leif K-Brooks | last post by:
Has anyone ever tried implementing a simple unstructured BASIC dialect in Python? I'm getting interested in language implementation, and looking at a reasonably simple example like that could be...
4
by: Michael | last post by:
But i'm a good c++ programmer. What i want to do is parse a text file and store the information in relevant fields: //Text File: *Version 200 *SCENE { AMBIENT_COLOUR 0.0 0.0 0.0
13
by: Wiseman | last post by:
I'm kind of disappointed with the re regular expressions module. In particular, the lack of support for recursion ( (?R) or (?n) ) is a major drawback to me. There are so many great things that can...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.