From 0de1debf8b72c460d6974de8a8ab9cbbdeecb160 Mon Sep 17 00:00:00 2001 From: bd-912 Date: Mon, 8 Apr 2024 00:07:44 -0600 Subject: J2V works for simple examples --- st/SymbolTable.java | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'st') diff --git a/st/SymbolTable.java b/st/SymbolTable.java index 7475e5e..d0ea221 100644 --- a/st/SymbolTable.java +++ b/st/SymbolTable.java @@ -37,14 +37,6 @@ public class SymbolTable { /** * Methods intended to be used during the second pass */ - public void setActive(TypeEnum type, String id) { - this.active.put(type, id); - } - - public void removeActive(TypeEnum type) { - this.active.remove(type); - } - public void setExtend(String arg) { String str = this.active.get(TypeEnum.classname); ClassInstance cls = this.getClass(str); @@ -93,6 +85,14 @@ public class SymbolTable { * Methods to safely retrieve differentiable types * in `typecheck', `vaporize' libraries */ + public void setActive(TypeEnum type, String id) { + this.active.put(type, id); + } + + public void removeActive(TypeEnum type) { + this.active.remove(type); + } + public TypeInstance getType(String id) { AbstractInstance symbol; return ((symbol = this.symt.get(id)) != @@ -114,4 +114,8 @@ public class SymbolTable { (ClassInstance) symbol : null; } + public String getActive(TypeEnum type) { + return this.active.get(type); + } + } -- cgit v1.2.3