Merge remote-tracking branch 'origin/main'
# Conflicts: # src/main/java/TP2/asd/toLLVM_Visitor.java # tests/aLaMain.vsl
This commit is contained in:
@@ -27,7 +27,7 @@ public interface Interface {
|
||||
|
||||
public interface InstructionLLVMVisitor<H,S> {
|
||||
public S visitReturnLLVM(ReturnLLVMImp instr, H h);
|
||||
public S visitAssignLLVM(AssignLVMImp instr, H h);
|
||||
public S visitAssignLLVM(AssignLLVMImp instr, H h);
|
||||
public S visitStoreLLVM(StoreLLVMImp instr, H h);
|
||||
public S visitPrintLLVM(PrintLLVMImp instr, H h);
|
||||
public S visitReadLLVM(ReadLLVMImp instr, H h);
|
||||
|
||||
@@ -65,7 +65,7 @@ TypeLLVMVisitor<String,String>
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visitAssignLLVM(AssignLVMImp instr, String h) {
|
||||
public String visitAssignLLVM(AssignLLVMImp instr, String h) {
|
||||
return INDENT+instr.var().accept(this, h) + " = " + instr.e().accept(this, h);
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public class ProgramLLVM {
|
||||
}
|
||||
|
||||
|
||||
public static record AssignLVMImp(VarLLVMImp var, ExpressionLLVM e) implements InstructionLLVM{
|
||||
public static record AssignLLVMImp(VarLLVMImp var, ExpressionLLVM e) implements InstructionLLVM{
|
||||
@Override
|
||||
public <H, S> S accept(InstructionLLVMVisitor<H, S> v, H h) {
|
||||
return v.visitAssignLLVM(this, h);
|
||||
@@ -74,7 +74,7 @@ public class ProgramLLVM {
|
||||
}
|
||||
}
|
||||
|
||||
public static record CallLLVMImp(DefineLLVMImp f, ArrayList<ValLLVM> params, String str) implements InstructionLLVM{
|
||||
public static record CallLLVMImp(DefineLLVMImp f, ArrayList<ValLLVM> params, String str) implements InstructionLLVM{ //une expression ?
|
||||
@Override
|
||||
public <H, S> S accept(InstructionLLVMVisitor<H, S> v, H h) {
|
||||
return v.visitCallLLVM(this, h);
|
||||
@@ -110,19 +110,6 @@ public class ProgramLLVM {
|
||||
}
|
||||
|
||||
|
||||
/*public static record ConstLLVMImp(TypeLLVM type, int val) implements ExpressionLLVM{
|
||||
public <H, S> S accept(ExpressionLLVMVisitor<H, S> v, H h) {
|
||||
return v.visitConstLLVM(this, h);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String prettyprinter() {
|
||||
return val+"";
|
||||
}
|
||||
|
||||
}*/
|
||||
|
||||
|
||||
public static record allocaLLVMImp(TypeLLVM type) implements ExpressionLLVM{
|
||||
@Override
|
||||
public <H, S> S accept(ExpressionLLVMVisitor<H, S> v, H h) {
|
||||
@@ -171,6 +158,7 @@ public class ProgramLLVM {
|
||||
|
||||
@Override
|
||||
public TypeLLVM getType() {
|
||||
System.out.println("getType");
|
||||
return type;
|
||||
}
|
||||
}
|
||||
@@ -184,6 +172,7 @@ public class ProgramLLVM {
|
||||
|
||||
@Override
|
||||
public TypeLLVM getType() {
|
||||
System.out.println("getType");
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user