summaryrefslogtreecommitdiffstats
path: root/Lib/compiler/misc.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/compiler/misc.py')
-rw-r--r--Lib/compiler/misc.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/compiler/misc.py b/Lib/compiler/misc.py
new file mode 100644
index 0000000..5a3e261
--- /dev/null
+++ b/Lib/compiler/misc.py
@@ -0,0 +1,18 @@
+class Set:
+ def __init__(self):
+ self.elts = {}
+ def add(self, elt):
+ self.elts[elt] = elt
+ def items(self):
+ return self.elts.keys()
+ def has_elt(self, elt):
+ return self.elts.has_key(elt)
+
+class Stack:
+ def __init__(self):
+ self.stack = []
+ self.pop = self.stack.pop
+ def push(self, elt):
+ self.stack.append(elt)
+ def top(self):
+ return self.stack[-1]