simpleparse - what is wrong with my grammar?

Discussion in 'Python' started by Laszlo Nagy, Feb 24, 2008.

  1. Laszlo Nagy

    Laszlo Nagy Guest

    The program below gives me "segmentation fault (core dumped)".

    Environment:
    Linux gandalf-desktop 2.6.20-16-generic #2 SMP Tue Feb 12 05:41:34
    UTC 2008 i686 GNU/Linux
    Python 2.5.1

    What is wrong with my grammar? Can it be an internal error in simpleparse?

    Thanks,

    Laszlo


    from simpleparse.common import numbers, strings, comments
    from simpleparse.parser import Parser

    declaration = r'''
    expr := paren_expr/unop_expr/binop_expr/word
    paren_expr := "(",expr,")"
    unop_expr := unop,expr
    binop_expr := expr,binop,expr
    unop := ("+"/"-")
    binop := ("|"/"&"/"@")
    word := [a-zA-Z], [a-zA-Z0-9_]*
    '''

    parser = Parser( declaration)
    success, resultTrees, nextCharacter =
    parser.parse("testword",production="expr",processor=None)
    print success
    Laszlo Nagy, Feb 24, 2008
    #1
    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. Bhupesh Naik
    Replies:
    2
    Views:
    3,849
    Bhupesh Naik
    Aug 7, 2003
  2. exits funnel

    Java Grammar Parser?

    exits funnel, Jul 15, 2003, in forum: Java
    Replies:
    3
    Views:
    8,586
    Roedy Green
    Jul 19, 2003
  3. Fortepianissimo

    semantic operation in simpleparse?

    Fortepianissimo, Sep 18, 2003, in forum: Python
    Replies:
    0
    Views:
    310
    Fortepianissimo
    Sep 18, 2003
  4. David Hirschfield

    simpleparse parsing problem

    David Hirschfield, Sep 2, 2006, in forum: Python
    Replies:
    1
    Views:
    384
    Paul McGuire
    Sep 2, 2006
  5. David Isaac

    SimpleParse installer available for 2.5

    David Isaac, Oct 2, 2006, in forum: Python
    Replies:
    0
    Views:
    255
    David Isaac
    Oct 2, 2006
Loading...

Share This Page