diff options
author | David Beazley <dave@dabeaz.com> | 2006-11-21 15:09:46 +0000 |
---|---|---|
committer | David Beazley <dave@dabeaz.com> | 2006-11-21 15:09:46 +0000 |
commit | 80c8c2d0a6e63745ff099b33ad2848b6fb17285a (patch) | |
tree | 36d223fc55a5649dc85a4f8a3fa9d17cb130c6c3 /test/lex_rule1.py | |
download | ply-80c8c2d0a6e63745ff099b33ad2848b6fb17285a.tar.gz |
initial checkin
Diffstat (limited to 'test/lex_rule1.py')
-rw-r--r-- | test/lex_rule1.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/lex_rule1.py b/test/lex_rule1.py new file mode 100644 index 0000000..e49a15b --- /dev/null +++ b/test/lex_rule1.py @@ -0,0 +1,27 @@ +# lex_token.py +# +# Rule defined as some other type + +import sys +sys.path.insert(0,"..") + +import ply.lex as lex + +tokens = [ + "PLUS", + "MINUS", + "NUMBER", + ] + +t_PLUS = r'\+' +t_MINUS = r'-' +t_NUMBER = 1 + +def t_error(t): + pass + +sys.tracebacklimit = 0 + +lex.lex() + + |