diff options
author | Santo Cariotti <santo@dcariotti.me> | 2024-06-30 13:45:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-30 13:45:57 +0200 |
commit | 8aa8b5834953cab15c0687608f4fafea2e6c61be (patch) | |
tree | 1835ae7c789136b4a6c44c12efd4247a0b96d893 /src/semanticanalysis/STentry.java | |
parent | 7125bb27fedaafd5a56b5122e4251b182448ddac (diff) | |
parent | 06d7c8dee25c065b1a569337f34d3cd5e892a31d (diff) |
Merge pull request #10 from boozec/check-semantics
Co-Authored-By: geno <gabriele.genovese2@studio.unibo.it>
Co-Authored-By: L0P0P <grassoemanuele@live.com>
Diffstat (limited to 'src/semanticanalysis/STentry.java')
-rw-r--r-- | src/semanticanalysis/STentry.java | 13 |
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; + } + } |