summaryrefslogtreecommitdiff
path: root/st/AbstractInstance.java
diff options
context:
space:
mode:
Diffstat (limited to 'st/AbstractInstance.java')
-rw-r--r--st/AbstractInstance.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/st/AbstractInstance.java b/st/AbstractInstance.java
new file mode 100644
index 0000000..a7dc8eb
--- /dev/null
+++ b/st/AbstractInstance.java
@@ -0,0 +1,35 @@
+package st;
+
+public abstract class AbstractInstance {
+ protected String name; // the literal name of the declaration
+ protected TypeEnum type; // the type of the declaration
+ protected int size; // the size in memory
+
+ public AbstractInstance(String name, TypeEnum type) {
+ this.type = type;
+ this.name = name;
+ }
+
+ public abstract String toString();
+
+ public boolean equals(AbstractInstance other) {
+ return this.name == other.get_name();
+ }
+
+ public int hashCode() {
+ return this.name.hashCode();
+ }
+
+ public String get_name() {
+ return this.name;
+ }
+
+ public TypeEnum get_type() {
+ return this.type;
+ }
+
+ public int get_size() {
+ return this.size;
+ }
+
+}