avancement sur Read et Print, todo : @.ftm

This commit is contained in:
Rochas
2025-04-13 16:00:06 +02:00
parent 2f16120dae
commit 9ef84876f7
4 changed files with 55 additions and 15 deletions

View File

@@ -22,7 +22,7 @@ public class ProgramLLVM {
//Define
public static record DefineLLVMImpl(String nom, TypeLLVM type, ArrayList<InstructionLLVM> instrs) implements DefineLLVM{
public static record DefineLLVMImpl(String name, TypeLLVM type, ArrayList<VarLLVMImpl> params, ArrayList<InstructionLLVM> instrs) implements DefineLLVM{
public <H, S> S accept(DefineLLVMVisitor<H, S> v, H h) {
return v.visitDefineLLVM(this, h);
}
@@ -31,7 +31,7 @@ public class ProgramLLVM {
//Instructon :
//Label
public static record LabelLLVMImp(String nom) implements InstructionLLVM{
public static record LabelLLVMImp(String name) implements InstructionLLVM{
@Override
public <H, S> S accept(InstructionLLVMVisitor<H, S> v, H h) {
return v.visitLabelLLVM(this, h);
@@ -74,14 +74,21 @@ public class ProgramLLVM {
}
}
public static record PrintLLVMImpl(ArrayList<Object> l) implements InstructionLLVM{
public static record CallLLVMImpl(DefineLLVMImpl f, ArrayList<ValLLVM> params, String str) implements InstructionLLVM{
@Override
public <H, S> S accept(InstructionLLVMVisitor<H, S> v, H h) {
return v.visitCallLLVM(this, h);
}
}
public static record PrintLLVMImpl(ArrayList<ValLLVM> l) implements InstructionLLVM{ //TODO c'est un Call qui appel la fonction print
@Override
public <H, S> S accept(InstructionLLVMVisitor<H, S> v, H h) {
return v.visitPrintLLVM(this, h);
}
}
public static record ReadLLVMImpl(VarLLVMImpl var) implements InstructionLLVM{
public static record ReadLLVMImpl(ArrayList<ValLLVM> l) implements InstructionLLVM{ //TODO c'est un Call qui appel la fonction read
@Override
public <H, S> S accept(InstructionLLVMVisitor<H, S> v, H h) {
@@ -203,4 +210,11 @@ public class ProgramLLVM {
return v.visitBooleanLLVM(this, h);
}
}
public static record StringLLVMImp() implements TypeLLVM{
@Override
public <H, S> S accept(TypeLLVMVisitor<H, S> v, H h) {
return v.visitStringLLVM(this, h);
}
}
}