By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,747 Members | 1,683 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,747 IT Pros & Developers. It's quick & easy.

flex/bison like module in Python?

P: n/a
Dear Pythonists;

Curious if there exists in Python package(s) for use as lexer/parser
for implementation of language grammars?

Already using cmd.py from the standard distro for it's basic features
but wishing for much more advanced capability. As such, I refer to
flex/bison because though complex they are general purpose and very
useful.

I am trying to avoid having to do the lexer/parser part in C if
possible.

Thanks.

--
-------------------------------------------------------------------------------
Jerry Sievers 305 854-3001 (home) WWW ECommerce Consultant
305 321-1144 (mobile http://www.JerrySievers.com/
Jul 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Jerry Sievers" <je***@jerrysievers.com> wrote in message
news:m3************@prod01.jerrysievers.com...
Dear Pythonists;

Curious if there exists in Python package(s) for use as lexer/parser
for implementation of language grammars?

Already using cmd.py from the standard distro for it's basic features
but wishing for much more advanced capability. As such, I refer to
flex/bison because though complex they are general purpose and very
useful.

I am trying to avoid having to do the lexer/parser part in C if
possible.

Thanks.

--
-------------------------------------------------------------------------- ----- Jerry Sievers 305 854-3001 (home) WWW ECommerce Consultant
305 321-1144 (mobile http://www.JerrySievers.com/


Check out this page from the Python Wiki:
http://www.python.org/moin/LanguageParsing

(although I'm partial to pyparsing, myself...)

-- Paul
Jul 18 '05 #2

P: n/a
Jerry Sievers wrote:
Curious if there exists in Python package(s) for use as lexer/parser
for implementation of language grammars?


(s) indeed:

http://www.nedbatchelder.com/text/python-parsers.html

</F>

Jul 18 '05 #3

P: n/a
You may checkout

www.antlr.org

around Xmas - a extension for Python will be released.

Regards,
Wolfgang.

"Jerry Sievers" <je***@jerrysievers.com> wrote in message
news:m3************@prod01.jerrysievers.com...
Dear Pythonists;

Curious if there exists in Python package(s) for use as lexer/parser
for implementation of language grammars?

Already using cmd.py from the standard distro for it's basic features
but wishing for much more advanced capability. As such, I refer to
flex/bison because though complex they are general purpose and very
useful.

I am trying to avoid having to do the lexer/parser part in C if
possible.

Thanks.

--
-------------------------------------------------------------------------------
Jerry Sievers 305 854-3001 (home) WWW ECommerce Consultant
305 321-1144 (mobile http://www.JerrySievers.com/

Jul 18 '05 #4

P: n/a

For command line parsing, take a look at the shlex module, also in the
standard distro. It may fit your requirements for additional
functionality beyond cmd.

/Jean Brouwers

PS) We use SimpleParse/mxTextTools for parsing large log files, both
are listed on the web page mentioned below. In addition, check out
David Mertz' web pages 'Text Processing in Python' at

<http://gnosis.cx/TPiP/>

In article <ma**************************************@python.o rg>,
Fredrik Lundh <fr*****@pythonware.com> wrote:
Jerry Sievers wrote:
Curious if there exists in Python package(s) for use as lexer/parser
for implementation of language grammars?


(s) indeed:

http://www.nedbatchelder.com/text/python-parsers.html

</F>

Jul 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.