summaryrefslogtreecommitdiff
path: root/src/semanticanalysis/STentry.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/semanticanalysis/STentry.java')
-rw-r--r--src/semanticanalysis/STentry.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/semanticanalysis/STentry.java b/src/semanticanalysis/STentry.java
index 0e4b00e..51fb109 100644
--- a/src/semanticanalysis/STentry.java
+++ b/src/semanticanalysis/STentry.java
@@ -6,9 +6,10 @@ import ast.types.Type;
* Entry class for the symbol table.
*/
public class STentry {
- private Type type;
- private int offset;
- private int nesting;
+
+ private final Type type;
+ private final int offset;
+ private final int nesting;
private String label;
public STentry(Type type, int offset, int nesting) {
@@ -52,4 +53,10 @@ public class STentry {
return label;
}
+ @Override
+ public String toString() {
+ // Print all the fields of the STentry
+ return "Type: " + type + ", Offset: " + offset + ", Nesting: " + nesting + ", Label: " + label;
+ }
+
}