Update to ply 2.3
[gem5.git] / ext / ply / test / lex_hedit.py
index 68f9fcbd179bf74d47cfd8cd22fb9e2259c17262..9949549c409a12c4a5debc27c0931d5a4fe1312c 100644 (file)
 # This example shows how to modify the state of the lexer to parse
 # such tokens
 # -----------------------------------------------------------------------------
+import sys
+sys.path.insert(0,"..")
+
+import ply.lex as lex
 
 tokens = (
     'H_EDIT_DESCRIPTOR',
@@ -33,10 +37,9 @@ def t_H_EDIT_DESCRIPTOR(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()
 lex.runmain(data="3Habc 10Habcdefghij 2Hxy")