print et Read en cours
This commit is contained in:
@@ -29,6 +29,8 @@ public interface Interface {
|
||||
public S visitReturnLLVM(ReturnLLVMImp instr, H h);
|
||||
public S visitAssignLLVM(AssignLVMImp instr, H h);
|
||||
public S visitStoreLLVM(StoreLLVMImp instr, H h);
|
||||
public S visitPrintLLVM(PrintLLVMImp instr, H h);
|
||||
public S visitReadLLVM(ReadLLVMImp instr, H h);
|
||||
}
|
||||
|
||||
//////////ExpressionLLVM (expression)
|
||||
|
||||
@@ -100,6 +100,17 @@ TypeLLVMVisitor<String,String>
|
||||
return "load" + " i" + e.nbBits() + ", i"+ e.nbBits2() + "* %" + e.val().accept(this, h);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visitPrintLLVM(PrintLLVMImp instr, String h) {
|
||||
return INDENT+"print";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visitReadLLVM(ReadLLVMImp instr, String h) {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException("Unimplemented method 'visitReadLLVM'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String visitValLLVM(ValLLVMImpl e, String h) {
|
||||
return e.val() + "";
|
||||
@@ -121,4 +132,5 @@ TypeLLVMVisitor<String,String>
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -61,6 +61,21 @@ public class ProgramLLVM {
|
||||
}
|
||||
}
|
||||
|
||||
public static record PrintLLVMImp(ArrayList<String> l) implements InstructionLLVM{
|
||||
@Override
|
||||
public <H, S> S accept(InstructionLLVMVisitor<H, S> v, H h) {
|
||||
return v.visitPrintLLVM(this, h);
|
||||
}
|
||||
}
|
||||
|
||||
public static record ReadLLVMImp(ArrayList<String> l) implements InstructionLLVM{
|
||||
|
||||
@Override
|
||||
public <H, S> S accept(InstructionLLVMVisitor<H, S> v, H h) {
|
||||
return v.visitReadLLVM(this, h);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Expression :
|
||||
public static record BinOpLLVMImp(TypeLLVM type,Op op, ValLLVM val1,ValLLVM val2) implements ExpressionLLVM{
|
||||
|
||||
Reference in New Issue
Block a user