[Wisp-cvs] wisp/users/dig linkie.py,1.11,1.12
Status: Alpha
Brought to you by:
digg
From: <di...@us...> - 2003-03-09 06:19:36
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv4513 Modified Files: linkie.py Log Message: wrote Linkie.get_symbol_dict Index: linkie.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/linkie.py,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- linkie.py 16 Feb 2003 10:48:17 -0000 1.11 +++ linkie.py 9 Mar 2003 06:19:33 -0000 1.12 @@ -183,6 +183,16 @@ place_symbol.""" if this._unresolved_locals: raise 'Incomplete linkie', this return this._symbols[:] + def get_symbol_dict (this): + """get_symbols() -> dictionary of string -> int + Returns a dictionary of symbols placed in the linkie by + place_symbol. Checks uniqueness of such symbols.""" + if this._unresolved_locals: raise 'Incomplete linkie', this + d = {} + for name, value in this._symbols: + if d.has_key(name): raise 'Symbol not unique', name + else: d[name] = value + return d def get_notes (this): """get_notes() -> list of (offset, type, argument) tuples Returns a list of the linker notes from the linkie.""" |