summaryrefslogtreecommitdiffstats
path: root/src/ast/types/Type.java
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2024-06-13 09:00:06 +0000
committerGitHub <noreply@github.com>2024-06-13 09:00:06 +0000
commit8e7089a5d6ba1f4f50a90133bb50bc5c6c554aff (patch)
treed4a627e56a199720f7d811af5756402e76628864 /src/ast/types/Type.java
parent1c8761901b26c0be4d61f3aed5ec0495a558a0e7 (diff)
Set up visitor (#3)
Co-authored-by: geno <gabriele.genovese2@studio.unibo.it>
Diffstat (limited to 'src/ast/types/Type.java')
-rw-r--r--src/ast/types/Type.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/ast/types/Type.java b/src/ast/types/Type.java
new file mode 100644
index 0000000..4756255
--- /dev/null
+++ b/src/ast/types/Type.java
@@ -0,0 +1,41 @@
+package com.clp.project.ast.types;
+
+import java.util.ArrayList;
+
+import com.clp.project.semanticanalysis.SemanticError;
+import com.clp.project.semanticanalysis.SymbolTable;
+import com.clp.project.ast.nodes.*;
+
+/**
+ * A node which represents a type class.
+ */
+public class Type implements Node {
+ public boolean isEqual(Type A, Type B) {
+ if (A.getClass().equals(B.getClass()))
+ return true;
+ else
+ return false;
+ }
+
+ public String toPrint(String s) {
+ return s;
+ }
+
+ public ArrayList<SemanticError> checkSemantics(SymbolTable ST, int _nesting) {
+ // It is never invoked
+ return null;
+ }
+
+ @Override
+ public Type typeCheck() {
+ // It is never invoked
+ return null;
+ }
+
+ @Override
+ public String codeGeneration() {
+ // It is never invoked
+ return "";
+ }
+
+}