Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > python parser

Reply
Thread Tools

python parser

 
 
tuxlover
Guest
Posts: n/a
 
      07-12-2005
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

 
Reply With Quote
 
 
 
 
Christopher Subich
Guest
Posts: n/a
 
      07-12-2005
tuxlover wrote:
> 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/d...r/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.
 
Reply With Quote
 
 
 
 
matt
Guest
Posts: n/a
 
      07-12-2005
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_con...thon_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

 
Reply With Quote
 
Robert Kern
Guest
Posts: n/a
 
      07-12-2005
tuxlover wrote:
> 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
http://www.velocityreviews.com/forums/(E-Mail Removed)

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

 
Reply With Quote
 
Bengt Richter
Guest
Posts: n/a
 
      07-12-2005
On Tue, 12 Jul 2005 13:30:14 -0700, Robert Kern <(E-Mail Removed)> wrote:

>tuxlover wrote:
>> 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".
>

or google for
verilog site:sourceforge.net

BTW googling for
verilog siteyparsing.sourceforge.net
will only get one hit (maybe less if I typoed again

Regards,
Bengt Richter
 
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
import parser does not import parser.py in same dir on win Joel Hedlund Python 2 11-11-2006 03:46 PM
import parser does not import parser.py in same dir on win Joel Hedlund Python 0 11-11-2006 11:34 AM
XML Parser VS HTML Parser ZOCOR Java 11 10-05-2004 01:58 PM
XMLparser: Difference between parser.setErrorHandler() vs. parser.setContentHandler() Bernd Oninger Java 0 06-09-2004 01:26 AM
XMLparser: Difference between parser.setErrorHandler() vs. parser.setContentHandler() Bernd Oninger XML 0 06-09-2004 01:26 AM



Advertisments