summaryrefslogtreecommitdiff
path: root/minijava/TypeInstance.java
diff options
context:
space:
mode:
authorbd-912 <bdunahu@colostate.edu>2024-03-17 21:37:38 -0600
committerbd-912 <bdunahu@colostate.edu>2024-03-17 21:37:38 -0600
commitacb209e4bef36186744ee09c67fcad77550e78d2 (patch)
tree85e27346b897200f2c06ee74b27ad6d2c798065b /minijava/TypeInstance.java
parent6a24c69232901de51f50beab9c3d3b3760dee334 (diff)
Pretty printing for TypeCheckSimp, start for symbol table
Diffstat (limited to 'minijava/TypeInstance.java')
-rw-r--r--minijava/TypeInstance.java40
1 files changed, 20 insertions, 20 deletions
diff --git a/minijava/TypeInstance.java b/minijava/TypeInstance.java
index 13920e4..483a093 100644
--- a/minijava/TypeInstance.java
+++ b/minijava/TypeInstance.java
@@ -1,29 +1,29 @@
package minijava;
public class TypeInstance {
- TypeEnum type;
+ TypeEnum type;
- public TypeInstance(TypeEnum type) {
- this.type = type;
- }
+ public TypeInstance(TypeEnum type) {
+ this.type = type;
+ }
- public boolean equal_type(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!
- */
+ public boolean equal_type(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.type;
- }
+ return this.type != TypeEnum.ERROR &&
+ this.type == other.type;
+ }
- public TypeEnum get_type() {
- return this.type;
- }
+ public TypeEnum get_type() {
+ return this.type;
+ }
}