[Wisp-cvs] wisp/users/dig tran.py,1.37,1.38
Status: Alpha
Brought to you by:
digg
From: <di...@us...> - 2003-04-22 12:36:59
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv4324 Modified Files: tran.py Log Message: let Register inherit from Stackable Index: tran.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/tran.py,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- tran.py 22 Apr 2003 12:32:12 -0000 1.37 +++ tran.py 22 Apr 2003 12:36:54 -0000 1.38 @@ -24,7 +24,7 @@ def get_scalar (this): return 0 def get_dollars (this): return 0 def get_symbols (this): return () - def get_regs (this): return () + def get_registers (this): return () class Token (object): pass class Stackable (object): def contained_registers (this): @@ -67,8 +67,6 @@ class Dollar_Type (Unique, Stackable, Summable): def __init__ (this): Unique.__init__(this, '$') - Stackable.__init__(this) - Summable.__init__(this) def get_dollars (this): return 1 Semicolon = Unique_Token(';') @@ -176,7 +174,7 @@ if tok <> None: return tok else: return Lexer.get_token(this) -class Register (tuple): +class Register (tuple, Stackable): def __new__ (cls, *args): return tuple.__new__(cls, args) def parent (this): @@ -189,6 +187,8 @@ i += 1 def __repr__ (this): return 'Register' + tuple.__repr__(this) + def contained_registers (this): + return this, class Class_Marker (object): def __init__ (this, id): |