473,241 Members | 1,676 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,241 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 1459
[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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
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...

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.