diff --git a/src/main/java/TP2/llvm/Interface.java b/src/main/java/TP2/llvm/Interface.java index 235c30d..e00a7b5 100644 --- a/src/main/java/TP2/llvm/Interface.java +++ b/src/main/java/TP2/llvm/Interface.java @@ -27,7 +27,7 @@ public interface Interface { public interface InstructionLLVMVisitor { 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); diff --git a/src/main/java/TP2/llvm/PrettyprinterLLVM_Visitor.java b/src/main/java/TP2/llvm/PrettyprinterLLVM_Visitor.java index 0d9f4ed..a68cee0 100644 --- a/src/main/java/TP2/llvm/PrettyprinterLLVM_Visitor.java +++ b/src/main/java/TP2/llvm/PrettyprinterLLVM_Visitor.java @@ -65,7 +65,7 @@ TypeLLVMVisitor } @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); } diff --git a/src/main/java/TP2/llvm/ProgramLLVM.java b/src/main/java/TP2/llvm/ProgramLLVM.java index d008dd3..da8e26d 100644 --- a/src/main/java/TP2/llvm/ProgramLLVM.java +++ b/src/main/java/TP2/llvm/ProgramLLVM.java @@ -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 S accept(InstructionLLVMVisitor v, H h) { return v.visitAssignLLVM(this, h); @@ -74,7 +74,7 @@ public class ProgramLLVM { } } - public static record CallLLVMImp(DefineLLVMImp f, ArrayList params, String str) implements InstructionLLVM{ + public static record CallLLVMImp(DefineLLVMImp f, ArrayList params, String str) implements InstructionLLVM{ //une expression ? @Override public S accept(InstructionLLVMVisitor 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 S accept(ExpressionLLVMVisitor v, H h) { - return v.visitConstLLVM(this, h); - } - - @Override - public String prettyprinter() { - return val+""; - } - - }*/ - - public static record allocaLLVMImp(TypeLLVM type) implements ExpressionLLVM{ @Override public S accept(ExpressionLLVMVisitor 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; } }