summaryrefslogtreecommitdiff
path: root/st/SymbolTable.java
diff options
context:
space:
mode:
authorbd-912 <bdunahu@colostate.edu>2024-04-07 12:26:47 -0600
committerbd-912 <bdunahu@colostate.edu>2024-04-07 12:26:47 -0600
commit1ec847c7222b8adb9a70264c98a44dc9911d65d3 (patch)
treeed8d2601bc14079bb39c7af0f0c6533875b48b2c /st/SymbolTable.java
parent9cd3df6ff58e3999a049f97a0acaaf997a01fec8 (diff)
More bugfixes in ST, changes to scoping
Diffstat (limited to 'st/SymbolTable.java')
-rw-r--r--st/SymbolTable.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/st/SymbolTable.java b/st/SymbolTable.java
index 9d7ffb4..7475e5e 100644
--- a/st/SymbolTable.java
+++ b/st/SymbolTable.java
@@ -96,22 +96,21 @@ public class SymbolTable {
public TypeInstance getType(String id) {
AbstractInstance symbol;
return ((symbol = this.symt.get(id)) !=
- null && symbol.getType() != TypeEnum.classname &&
- symbol.getType() != TypeEnum.method) ?
+ null && symbol instanceof TypeInstance) ?
(TypeInstance) symbol : null;
}
public MethodInstance getMethod(String id) {
AbstractInstance symbol;
return ((symbol = this.symt.get(id)) !=
- null && symbol.getType() == TypeEnum.method) ?
+ null && symbol instanceof MethodInstance) ?
(MethodInstance) symbol : null;
}
public ClassInstance getClass(String id) {
AbstractInstance symbol;
return ((symbol = this.symt.get(id)) !=
- null && symbol.getType() == TypeEnum.classname) ?
+ null && symbol instanceof ClassInstance) ?
(ClassInstance) symbol : null;
}