Update to ply 2.3
[gem5.git] / ext / ply / example / ansic / cparse.py
index ddfd5c72b9786a3a81e7a29a7af2bbf4fe89af7d..d474378c8c0f6e46b63ed60435ceac85b4cfbc23 100644 (file)
@@ -4,8 +4,9 @@
 # Simple parser for ANSI C.  Based on the grammar in K&R, 2nd Ed.
 # -----------------------------------------------------------------------------
 
-import yacc
+import sys
 import clex
+import ply.yacc as yacc
 
 # Get the token map
 tokens = clex.tokens
@@ -852,7 +853,10 @@ def p_error(t):
 
 import profile
 # Build the grammar
-profile.run("yacc.yacc()")
+
+yacc.yacc(method='LALR')
+
+#profile.run("yacc.yacc(method='LALR')")