modification de l'implémentation de prototype, il implement Function
This commit is contained in:
@@ -7,7 +7,7 @@ import TP2.llvm.ProgramLLVM.*;
|
||||
public class Program{
|
||||
|
||||
//Prog
|
||||
public static record ProgramImp(ArrayList<Function> fonctions,ArrayList<Prototype> protos) implements ProgramI{
|
||||
public static record ProgramImp(ArrayList<Function> fonctions) implements ProgramI{
|
||||
public <H, S> S accept(ProgramVisitor<H, S> v, H h) {
|
||||
return v.visitProgram(this, h);
|
||||
}
|
||||
@@ -24,17 +24,9 @@ public class Program{
|
||||
}
|
||||
}
|
||||
|
||||
//Prototype
|
||||
public static record PrototypeImp(Type type, String nom, ArrayList<VarImp> params) 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, ArrayList<VarImp> params,Instruction instruction)implements Function {
|
||||
public static record FunctionImp(Type type, String nom, ArrayList<VarImp> params,Instruction instruction) implements Function {
|
||||
//public FunctionImp(Type type, String name, Instruction instruction) {
|
||||
// this(type, name, new ArrayList<>() {{ add(instruction); }}); C KOI ?
|
||||
//}
|
||||
@@ -43,6 +35,13 @@ public class Program{
|
||||
return v.visitFunction(this, h);
|
||||
}
|
||||
}
|
||||
|
||||
public static record PrototypeImp(Type type, String nom, ArrayList<VarImp> params) implements Function{
|
||||
@Override
|
||||
public <H, S> S accept(FunctionVisitor<H, S> v, H h) {
|
||||
return v.visitPrototype(this,h);
|
||||
}
|
||||
}
|
||||
|
||||
//Expression
|
||||
public static record ConstImp(int c) implements Expression{
|
||||
@@ -63,6 +62,13 @@ public class Program{
|
||||
}
|
||||
}
|
||||
|
||||
public static record Appeal(String fName, ArrayList<Expression> params) implements Expression{
|
||||
@Override
|
||||
public <H, S> S accept(ExprVisitor<H, S> v, H h) {
|
||||
return v.visitAppeal(this, h);
|
||||
}
|
||||
}
|
||||
|
||||
//Declaration
|
||||
|
||||
public static record DeclarationImp(Type t, ArrayList<String> s) implements Declaration{
|
||||
|
||||
Reference in New Issue
Block a user