python parser

T

tuxlover

Hello everyone

I have to write a verilog parser in python for a class project. I was
wondering if all you folks could advise me on choosing the right python
parser module. I am not comfortable with lex/yacc and as a result find
myself strugging with any module which use lex/yacc syntax/philosophy.
pyparser looks good to me, but before I dive into it, I would really
appreciate feedback from members of this group

Thanks
Tuxlover
 
C

Christopher Subich

tuxlover said:
I have to write a verilog parser in python for a class project. I was
wondering if all you folks could advise me on choosing the right python
parser module. I am not comfortable with lex/yacc and as a result find
myself strugging with any module which use lex/yacc syntax/philosophy.
pyparser looks good to me, but before I dive into it, I would really
appreciate feedback from members of this group

I've had good luck with DParser for Python
(http://staff.washington.edu/sabbey/dy_parser/index.html); in fact, it
might even be a very easy translation from a premade Verilog grammar to
a DParser grammar (Google search if you don't have BNF for Verilog already).

Two caevats come to mind, though; documentation isn't as newbie-friendly
as it could be, and DParser requires a binary library -- it's not
Python-only, which might matter for your project.
 
M

matt

I recently was successful using pyparsing after messing around with ply
for a few hours. See my blog for more details (
http://panela.blog-city.com/icfp_contest_implementation_in_python_notes.htm
).

I personally corresponded with the author and he was very helpful as
well, giving my useful critiques and feedback. The next time I'm
parsing something more complex than a tab-delimited file (excluding xml
:)) I'll probably use pyparsing. I found it very pythonic and easy to
use.

good luck parsing...
matt
 
R

Robert Kern

tuxlover said:
Hello everyone

I have to write a verilog parser in python for a class project. I was
wondering if all you folks could advise me on choosing the right python
parser module. I am not comfortable with lex/yacc and as a result find
myself strugging with any module which use lex/yacc syntax/philosophy.
pyparser looks good to me, but before I dive into it, I would really
appreciate feedback from members of this group

A Verilog parser has been written using pyparsing at least once before,
so I imagine that it shouldn't be too difficult to do so again. Of
course, if you just need *a* Verilog parser, not necessarily one written
by you, you could just email the guy who wrote it and ask him for a
copy. Grep

http://pyparsing.sourceforge.net/

for "Verilog".

--
Robert Kern
(e-mail address removed)

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
 
B

Bengt Richter

A Verilog parser has been written using pyparsing at least once before,
so I imagine that it shouldn't be too difficult to do so again. Of
course, if you just need *a* Verilog parser, not necessarily one written
by you, you could just email the guy who wrote it and ask him for a
copy. Grep

http://pyparsing.sourceforge.net/

for "Verilog".
or google for
verilog site:sourceforge.net

BTW googling for
verilog site:pyparsing.sourceforge.net
will only get one hit (maybe less if I typoed again ;-)

Regards,
Bengt Richter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top