add check type

This commit is contained in:
Vu Tuan Minh
2025-04-24 06:07:25 +02:00
parent 2948c372dd
commit 3b2314c236
7 changed files with 234 additions and 19 deletions

View File

@@ -7,7 +7,7 @@ import TP2.llvm.ProgramLLVM.*;
public class Program{
//Prog
public static record ProgramImp(ArrayList<Function> fonctions) implements ProgramI{
public static record ProgramImp(ArrayList<Function> fonctions,ArrayList<Prototype> protos) implements ProgramI{
public <H, S> S accept(ProgramVisitor<H, S> v, H h) {
return v.visitProgram(this, h);
}
@@ -23,6 +23,15 @@ public class Program{
return this.accept(llvmVisitor,new SymTable());
}
}
//Prototype
public static record PrototypeImp(Type type, String nom, ArrayList<String> s) implements Prototype{
@Override
public <H, S> S accept(PrototypeVisitor<H, S> v, H h) {
return v.visitPrototype(this,h);
}
}
//Fonction
public static record FunctionImp(Type type, String nom, Instruction instruction)implements Function {