From 8e7089a5d6ba1f4f50a90133bb50bc5c6c554aff Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Thu, 13 Jun 2024 11:00:06 +0200 Subject: Set up visitor (#3) Co-authored-by: geno --- src/ast/types/Type.java | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/ast/types/Type.java (limited to 'src/ast/types/Type.java') 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 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 ""; + } + +} -- cgit v1.2.3-71-g8e6c