The program below gives me "segmentati on 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.com mon import numbers, strings, comments
from simpleparse.par ser 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("t estword",produc tion="expr",pro cessor=None)
print success
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.com mon import numbers, strings, comments
from simpleparse.par ser 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("t estword",produc tion="expr",pro cessor=None)
print success