-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathType.java
More file actions
27 lines (25 loc) · 702 Bytes
/
Type.java
File metadata and controls
27 lines (25 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
public abstract class Type {
public abstract Object accept(Visitor v);
public abstract String toString();
public abstract String toSignString();
public abstract String toStringInArrayCreation();
public int pos;
public int line;
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return true;
}
public boolean isSubType(Type t) {
//Subtyping relationship
if (this instanceof IntegerType && t instanceof FloatType) {
return true;
}
return this.equals(t);
}
}