summaryrefslogtreecommitdiff
path: root/ext/ply/example/yply/yparse.py
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2009-08-16 13:39:58 -0700
committerNathan Binkert <nate@binkert.org>2009-08-16 13:39:58 -0700
commite1270f81bdc81f5a575b34c2d2c294bdde3e6f4f (patch)
treeb54af3469a338609faf04e67603c5264e79d59a5 /ext/ply/example/yply/yparse.py
parentbcaf93d182f43bf72d52104bb909324945904120 (diff)
downloadgem5-e1270f81bdc81f5a575b34c2d2c294bdde3e6f4f.tar.xz
ply: update PLY to version 3.2
Diffstat (limited to 'ext/ply/example/yply/yparse.py')
-rw-r--r--ext/ply/example/yply/yparse.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/ply/example/yply/yparse.py b/ext/ply/example/yply/yparse.py
index a4e46bef7..ab5b88451 100644
--- a/ext/ply/example/yply/yparse.py
+++ b/ext/ply/example/yply/yparse.py
@@ -25,7 +25,7 @@ def p_defsection(p):
print "precedence = ", repr(preclist)
print
print "# -------------- RULES ----------------"
- print
+ print
def p_rulesection(p):
'''rulesection : rules SECTION'''
@@ -78,12 +78,12 @@ def p_idlist(p):
p[1].append(p[3])
def p_tokenid(p):
- '''tokenid : ID
+ '''tokenid : ID
| ID NUMBER
| QLITERAL
| QLITERAL NUMBER'''
p[0] = p[1]
-
+
def p_optsemi(p):
'''optsemi : ';'
| empty'''
@@ -165,7 +165,7 @@ def p_rule_empty(p):
def p_rule_empty2(p):
'''rule : ID ':' morerules ';' '''
-
+
p[3].insert(0,[])
p[0] = (p[1],p[3])
@@ -173,10 +173,10 @@ def p_morerules(p):
'''morerules : morerules '|' rulelist
| '|' rulelist
| '|' '''
-
- if len(p) == 2:
+
+ if len(p) == 2:
p[0] = [[]]
- elif len(p) == 3:
+ elif len(p) == 3:
p[0] = [p[2]]
else:
p[0] = p[1]