call
This commit is contained in:
@@ -124,10 +124,16 @@ instruction returns [Instruction out]:
|
||||
}
|
||||
) BacF
|
||||
| //ASSIGN
|
||||
i=ident ASSIGN e=expression
|
||||
{
|
||||
i=ident
|
||||
(ASSIGN e=expression
|
||||
{
|
||||
$out = new AssignImp($i.out, $e.out);
|
||||
}
|
||||
}
|
||||
|ParO (para=list_expression)? ParF
|
||||
{
|
||||
$out = new VoidFunctionImp($i.out,($para.out != null) ? $para.out : new ArrayList<>());
|
||||
}
|
||||
)
|
||||
| // PRINT
|
||||
PRINT
|
||||
{ArrayList<Object> printer= new ArrayList<Object>();}
|
||||
|
||||
@@ -157,7 +157,7 @@ public class PrettyprinterVisitor implements ProgramVisitor<String,String>,
|
||||
|
||||
@Override
|
||||
public String visitVoidFunction(VoidFunctionImp instr, String h) {
|
||||
String str = instr.nom()+ "( ";
|
||||
String str = h+instr.nom()+ "(";
|
||||
for(int i=0;i<instr.expr().size();i++){
|
||||
str+= instr.expr().get(i).accept(this,h);
|
||||
if(i<instr.expr().size()-1){
|
||||
|
||||
@@ -203,6 +203,7 @@ public class toLLVM_Visitor implements ProgramVisitor<SymTable,ProgramLLVMImp>,
|
||||
|
||||
if (!(fun.define.type() instanceof VoidLLVMImp)){
|
||||
System.err.println("Fonction n'est pas un void");
|
||||
return l;
|
||||
}
|
||||
|
||||
l.add(new CallLLVMImp(fun.define,paramsLLVM,""));
|
||||
|
||||
Reference in New Issue
Block a user