Update to ply 2.3
[gem5.git] / ext / ply / test / calclex.py
index f8eb91a09cb4bda7e2786bc5ef16b8fb0f9223cc..d3e873266fe0abd0f8534a9dd6cddce1369dd5da 100644 (file)
@@ -1,6 +1,10 @@
 # -----------------------------------------------------------------------------
 # calclex.py
 # -----------------------------------------------------------------------------
+import sys
+
+sys.path.append("..")
+import ply.lex as lex
 
 tokens = (
     'NAME','NUMBER',
@@ -36,10 +40,9 @@ def t_newline(t):
 
 def t_error(t):
     print "Illegal character '%s'" % t.value[0]
-    t.skip(1)
+    t.lexer.skip(1)
 
 # Build the lexer
-import lex
 lex.lex()