summaryrefslogtreecommitdiff
path: root/arch/isa_parser.py
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2005-11-02 14:56:18 -0500
committerAli Saidi <saidi@eecs.umich.edu>2005-11-02 14:56:18 -0500
commit3b66cb49ecf29e762f4659ed174ca76b8f553a1e (patch)
treeb8f29795c7abf7c93882881252aff716fb33ee02 /arch/isa_parser.py
parent0523736b96b2779f8a33c2315c94be55d0a4d9c7 (diff)
parenta0829a7780b110a912ffc250d424b6dfe3586e62 (diff)
downloadgem5-3b66cb49ecf29e762f4659ed174ca76b8f553a1e.tar.xz
Merge zizzer:/bk/m5
into zeep.eecs.umich.edu:/z/saidi/work/m5 --HG-- extra : convert_revision : 3cc23080d19cc464a8ba7c1c93b6e5d45af7d463
Diffstat (limited to 'arch/isa_parser.py')
-rwxr-xr-xarch/isa_parser.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/arch/isa_parser.py b/arch/isa_parser.py
index eaef4b798..8f4c6bce7 100755
--- a/arch/isa_parser.py
+++ b/arch/isa_parser.py
@@ -794,20 +794,19 @@ def defFormat(id, params, code, lineno):
##############
# Stack: a simple stack object. Used for both formats (formatStack)
-# and default cases (defaultStack).
+# and default cases (defaultStack). Simply wraps a list to give more
+# stack-like syntax and enable initialization with an argument list
+# (as opposed to an argument that's a list).
-class Stack:
- def __init__(self, initItem):
- self.stack = [ initItem ]
+class Stack(list):
+ def __init__(self, *items):
+ list.__init__(self, items)
def push(self, item):
- self.stack.append(item);
-
- def pop(self):
- return self.stack.pop()
+ self.append(item);
def top(self):
- return self.stack[-1]
+ return self[-1]
# The global format stack.
formatStack = Stack(NoFormat())