[
Lists Home |
Date Index |
Thread Index
]
> > I have a bunch of program config files with sentences based on a
> > grammar. The files and the grammar were written to be used with the yacc
> > parser. Now I have to port the code from c to python, so I'd like to
> > rewrite these config files as xml to parse them with xml python standard
> > tools.
This may not be directly appropos, but the combination of parset tools, XML,
Python and C leads me immdiately to think of BisonGen:
http://4suite.org/?xslt=downloads.xslt
"BisonGen is a parser generator for Python. It takes an XML file, similar to
bison/flex files in format, and generates from it two parsers: one in C, one
in pure Python."
It should be clarified that both parsers are available from Python. The nice
thing about the approach is that the C parser is available for speed, and the
Python one for portability.
The 4Suite XPath, XPattern and Versa (RDF query language) parsers are written
in BisonGen as examples.
--
Uche Ogbuji Fourthought, Inc.
http://uche.ogbuji.net http://4Suite.org http://fourthought.com
Gems From the [Python/XML] Archives - http://www.xml.com/pub/a/2003/04/09/py-xm
l.html
Introducing N-Triples - http://www-106.ibm.com/developerworks/xml/library/x-thi
nk17/index.html
Use internal references in XML vocabularies - http://www-106.ibm.com/developerw
orks/xml/library/x-tipvocab.html
EXSLT by example - http://www-106.ibm.com/developerworks/library/x-exslt.html
The worry about program wizards - http://www.adtmag.com/article.asp?id=7238
Use rdf:about and rdf:ID effectively in RDF/XML - http://www-106.ibm.com/develo
perworks/xml/library/x-tiprdfai.html
|