diff options
author | Benedikt Böhm <bb@xnull.de> | 2009-06-09 08:44:42 +0200 |
---|---|---|
committer | Benedikt Böhm <bb@xnull.de> | 2009-06-09 08:44:42 +0200 |
commit | d3b74248d53f19bc8f10510d3d44b68aa4883ab6 (patch) | |
tree | 4d7eb3a0acbffe59c8d774af38ae95c5b6b9de9f /src/front/symbol.py | |
parent | 91ae46d9f2087272d4bd27a2b12f52fd1d782caa (diff) | |
download | swppy-d3b74248d53f19bc8f10510d3d44b68aa4883ab6.tar.gz swppy-d3b74248d53f19bc8f10510d3d44b68aa4883ab6.tar.xz swppy-d3b74248d53f19bc8f10510d3d44b68aa4883ab6.zip |
simplify scope, symbol and types
Diffstat (limited to '')
-rw-r--r-- | src/front/symbol.py | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/src/front/symbol.py b/src/front/symbol.py index 879403f..b93b778 100644 --- a/src/front/symbol.py +++ b/src/front/symbol.py @@ -1,34 +1,8 @@ -class SymbolClass(object): - def __init__(self, name): - self.name = name - - def __str__(self): - return self.name - - def __repr__(self): - return "<SymbolClass: %s>" % self - -SymbolClass.CONST = SymbolClass("CONST") -SymbolClass.VAR = SymbolClass("VAR") -SymbolClass.FUNC = SymbolClass("FUNC") - -class SymbolType(object): - def __init__(self, name): - self.name = name - - def __str__(self): - return self.name - - def __repr__(self): - return "<SymbolType: %s>" % self - -SymbolType.INT = SymbolType("INT") -SymbolType.BOOL = SymbolType("BOOL") +from type import DataType class Symbol(object): - __slots__ = ['cls', 'type', 'value'] + __slots__ = ['type', 'value'] - def __init__(self, value, type = SymbolType.INT, cls = SymbolClass.VAR): + def __init__(self, value, type = DataType.INT): self.value = value self.type = type - self.cls = cls |