Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1.     @Override
  2.     public void visit(FunctionCallExpression e) {
  3.         // TODO Auto-generated method stub
  4. //      throw new RuntimeException(
  5. //              "FunctionCallExpression case not implemented");
  6.         int count = 0;
  7.         for(Expression expr : e.getArguments()){
  8.             count +=4;
  9.             //expr.accept(this);
  10.         }
  11.         //buf.append(generateInstruction("subl", "$" + count, "%esp"));
  12.         for(Expression expr : e.getArguments()){
  13.             count -= 4;
  14.             buf.append(generateInstruction("movl","%eax", (count==0?"":count) + "(%esp)"));
  15.            
  16.             //System.out.println("Just printed moving eax into " + (count==0?"":count) + "(%esp).");
  17.            
  18.         }
  19.         buf.append(INDENT + "call      _"  + e.getName());
  20.         buf.append(NEWLINE);
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement