python parser

Discussion in 'Python' started by tuxlover, Jul 12, 2005.

  1. tuxlover

    tuxlover Guest

    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
    tuxlover, Jul 12, 2005
    #1
    1. Advertising

  2. 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/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.
    Christopher Subich, Jul 12, 2005
    #2
    1. Advertising

  3. tuxlover

    matt Guest

    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
    matt, Jul 12, 2005
    #3
  4. tuxlover

    Robert Kern Guest

    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


    "In the fields of hell where the grass grows high
    Are the graves of dreams allowed to die."
    -- Richard Harter
    Robert Kern, Jul 12, 2005
    #4
  5. On Tue, 12 Jul 2005 13:30:14 -0700, Robert Kern <> 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
    Bengt Richter, Jul 12, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bernd Oninger
    Replies:
    0
    Views:
    756
    Bernd Oninger
    Jun 9, 2004
  2. ZOCOR

    XML Parser VS HTML Parser

    ZOCOR, Oct 3, 2004, in forum: Java
    Replies:
    11
    Views:
    810
    Paul King
    Oct 5, 2004
  3. Bernd Oninger
    Replies:
    0
    Views:
    810
    Bernd Oninger
    Jun 9, 2004
  4. Joel Hedlund
    Replies:
    2
    Views:
    508
    Joel Hedlund
    Nov 11, 2006
  5. Joel Hedlund
    Replies:
    0
    Views:
    305
    Joel Hedlund
    Nov 11, 2006
Loading...

Share This Page