diff options
Diffstat (limited to 'src/semanticanalysis/SymbolTable.java')
-rw-r--r-- | src/semanticanalysis/SymbolTable.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/semanticanalysis/SymbolTable.java b/src/semanticanalysis/SymbolTable.java index 617b48a..6756ec4 100644 --- a/src/semanticanalysis/SymbolTable.java +++ b/src/semanticanalysis/SymbolTable.java @@ -153,4 +153,19 @@ public class SymbolTable { this.offset.add(offs); } + @Override + public String toString() { + // Print the symbol table + String str = ""; + for (int i = 0; i < this.symbolTable.size(); i++) { + str += "Level " + i + "\n"; + HashMap<String, STentry> H = this.symbolTable.get(i); + for (String key : H.keySet()) { + STentry T = H.get(key); + str += key + " -> " + T.toString() + "\n"; + } + } + return str; + } + } |