From 7c6c79a437a4c1e7cf85964d005a3cdeb59809f1 Mon Sep 17 00:00:00 2001 From: bd-912 Date: Fri, 26 Apr 2024 17:01:49 -0600 Subject: Added skeleton files in "heat" libary, successor to TypeCheckSimp --- st/ClassInstance.java | 6 +++++- st/TypeInstance.java | 19 ------------------- 2 files changed, 5 insertions(+), 20 deletions(-) (limited to 'st') diff --git a/st/ClassInstance.java b/st/ClassInstance.java index 8394a2c..789571b 100644 --- a/st/ClassInstance.java +++ b/st/ClassInstance.java @@ -13,7 +13,11 @@ public class ClassInstance extends AbstractInstance { this.mtds = new ArrayList<>(); } - public boolean equals(Object other) { + @Override public String toString() { + return String.format("%s", this.name); + } + + @Override public boolean equals(Object other) { ClassInstance o; return (other instanceof ClassInstance && ((o = (ClassInstance) other).getName() == this.getName())); diff --git a/st/TypeInstance.java b/st/TypeInstance.java index e43c5b3..330662c 100644 --- a/st/TypeInstance.java +++ b/st/TypeInstance.java @@ -26,25 +26,6 @@ public class TypeInstance extends AbstractInstance { cls.getSize() : 4; } - public boolean sameType(TypeInstance other) { - /** - * Given a TypeInstance object other, - * returns true if other object - * is the same type as this one. - * - * We can say two types are equal, as - * long as they are not equal on a - * type error! - */ - - return this.type != TypeEnum.ERROR && - this.type == other.getType(); - } - - public boolean hasChecked() { - return type != TypeEnum.ERROR; - } - public void addClassInstance(ClassInstance cls) { this.cls = cls; } -- cgit v1.2.3