simpleparse - what is wrong with my grammar?

L

Laszlo Nagy

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
 

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,754
Messages
2,569,522
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top