summaryrefslogtreecommitdiff
path: root/st
diff options
context:
space:
mode:
Diffstat (limited to 'st')
-rw-r--r--st/SymbolTable.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/st/SymbolTable.java b/st/SymbolTable.java
index ed1506b..7f3c788 100644
--- a/st/SymbolTable.java
+++ b/st/SymbolTable.java
@@ -148,6 +148,21 @@ public class SymbolTable {
return ret;
}
+ public TypeInstance getTypeAttr(String name) {
+ TokenKey id = new TokenKey(name,
+ (ClassInstance) this.getActive(TypeEnum.classname),
+ null);
+ AbstractInstance symbol;
+ TypeInstance ret = ((symbol = this.symt.get(id)) !=
+ null && symbol instanceof TypeInstance) ?
+ (TypeInstance) symbol : null;
+ if (ret == null)
+ MinimalLogger.severe(String.format("getType returning null for missing alias %s!",
+ id));
+ return ret;
+ }
+
+
public MethodInstance getMethod(String name) {
TokenKey id = new TokenKey(name,
(ClassInstance) this.getActive(TypeEnum.classname),
@@ -189,11 +204,11 @@ public class SymbolTable {
id));
MinimalLogger.severe(String.format("It was: %s",
this.symt.get(id)));
- return ret;
+ return ret;
}
public AbstractInstance getActive(TypeEnum type) {
- return this.active.get(type);
+ return this.active.get(type);
}
}