summaryrefslogtreecommitdiff
path: root/st/TypeInstance.java
diff options
context:
space:
mode:
Diffstat (limited to 'st/TypeInstance.java')
-rw-r--r--st/TypeInstance.java21
1 files changed, 14 insertions, 7 deletions
diff --git a/st/TypeInstance.java b/st/TypeInstance.java
index 13947ae..e00c1f9 100644
--- a/st/TypeInstance.java
+++ b/st/TypeInstance.java
@@ -2,15 +2,14 @@ package st;
public class TypeInstance extends AbstractInstance {
+ private AbstractInstance scope;
+
public TypeInstance(String name, TypeEnum type) {
super(name, type);
+ this.scope = null;
}
- public String toString() {
- return this.name + ":" + this.type;
- }
-
- public boolean same_type(TypeInstance other) {
+ public boolean sameType(TypeInstance other) {
/**
* Given a TypeInstance object other,
* returns true if other object
@@ -22,11 +21,19 @@ public class TypeInstance extends AbstractInstance {
*/
return this.type != TypeEnum.ERROR &&
- this.type == other.get_type();
+ this.type == other.getType();
}
- public boolean has_checked() {
+ public boolean hasChecked() {
return type != TypeEnum.ERROR;
}
+ public AbstractInstance getScope() {
+ /**
+ * Returns the scope of the variable, or
+ * `null' if unset.
+ */
+ return this.scope;
+ }
+
}