Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   python parser (http://www.velocityreviews.com/forums/t347035-python-parser.html)

tuxlover 07-12-2005 06:01 PM

python parser
 
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


Christopher Subich 07-12-2005 08:00 PM

Re: python parser
 
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.

matt 07-12-2005 08:17 PM

Re: python parser
 
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


Robert Kern 07-12-2005 08:30 PM

Re: python parser
 
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
rkern@ucsd.edu

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


Bengt Richter 07-12-2005 09:13 PM

Re: python parser
 
On Tue, 12 Jul 2005 13:30:14 -0700, Robert Kern <rkern@ucsd.edu> 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 site:pyparsing.sourceforge.net
will only get one hit (maybe less if I typoed again ;-)

Regards,
Bengt Richter


All times are GMT. The time now is 07:51 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.