Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Parsers with Python

Reply
Thread Tools

Parsers with Python

 
 
Daniel Carrera
Guest
Posts: n/a
 
      02-17-2004
Greetings all,

I am a new subscriber to this list, and a novice Python user. Is this the
correct place to ask for advice on Python-programming?

I want to write a parser for BibTeX. A BibTeX file is a collection of
entries that look like this:

@book {Daniel04,
title = "My Title",
publisher = {Some publisher Inc.},
volume = 2,
year = 2004
}


Can anyone recommend a parser generator for Python? I have been
programming for a few years, but I have never made a parser. I only have
a vague notion of what a lexer and a grammar are. Is there a resource
that you might recommend?

Thanks you for your time.

Cheers,
--
Daniel Carrera | No trees were harmed in the generation of this e-mail.
PhD student. | A significant number of electrons were, however, severely
Math Dept. UMD | inconvenienced.


 
Reply With Quote
 
 
 
 
JCM
Guest
Posts: n/a
 
      02-17-2004
Daniel Carrera <(E-Mail Removed)> wrote:
....
> Can anyone recommend a parser generator for Python? I have been
> programming for a few years, but I have never made a parser. I only have
> a vague notion of what a lexer and a grammar are. Is there a resource
> that you might recommend?


I've had good luck with PLY (http://systems.cs.uchicago.edu/ply/).
 
Reply With Quote
 
 
 
 
A.M. Kuchling
Guest
Posts: n/a
 
      02-17-2004
On Tue, 17 Feb 2004 10:18:07 -0500,
Daniel Carrera <(E-Mail Removed)> wrote:
> I want to write a parser for BibTeX. A BibTeX file is a collection of
> entries that look like this:


You should probably look at Greg Ward's btOOL
(http://www.gerg.ca/software/btOOL/), which includes C and Perl parsers for
BibTeX. Unfortunately the software predates Greg's use of Python, so
there's no Python support.

--amk
 
Reply With Quote
 
Robert E. Brown
Guest
Posts: n/a
 
      02-18-2004

On Tue, 17 Feb 2004 10:18:07 -0500,
Daniel Carrera <(E-Mail Removed)> wrote:
> I want to write a parser for BibTeX. A BibTeX file is a collection of
> entries that look like this:



The cl-bibtex project implements readers and writers for BibTeX formatted
files in Common Lisp, which is a closer to Python than C or Perl:

http://savannah.nongnu.org/projects/cl-bibtex/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparison of parsers in python? Peng Yu Python 24 09-26-2009 11:43 AM
data structure for ASTs in Python-written parsers eliben Python 0 02-14-2009 06:47 AM
Newbie programmer question: How do parsers work?(Python examples?) bio_enthusiast Python 5 08-26-2006 12:12 AM
ANN: parsing 1.0.0 - Python class library for defining and executing text parsers Paul McGuire Python 0 12-16-2003 08:04 AM
parsers / lexers usable from Python and Java (and C++/C)? John J. Lee Python 3 06-26-2003 01:16 AM



Advertisments