Revert "pytholite/compiler: SymbolStack"

This reverts commit f57da497b2.
This commit is contained in:
Sebastien Bourdeauducq 2012-11-10 12:09:45 +01:00
parent f57da497b2
commit a901ef46ab
1 changed files with 1 additions and 23 deletions

View File

@ -55,35 +55,13 @@ class _Register:
sync = [Case(self.sel, *cases)]
return Fragment(sync=sync)
class _SymbolStack:
def __init__(self):
self.stack = []
def push(self, init={}):
self.stack.append(init)
def pop(self):
return self.stack.pop()
def __setitem__(self, key, value):
self.stack[-1][key] = value
def __getitem__(self, key):
for frame in reversed(self.stack):
try:
return frame[key]
except KeyError:
pass
raise KeyError
class _AbstractNextState:
def __init__(self, target_state):
self.target_state = target_state
class _Compiler:
def __init__(self, symdict, registers):
self.symdict = _SymbolStack()
self.symdict.push(symdict)
self.symdict = symdict
self.registers = registers
self.targetname = ""