Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void visit(FunctionCallExpression e) {
- // TODO Auto-generated method stub
- // throw new RuntimeException(
- // "FunctionCallExpression case not implemented");
- int count = 0;
- for(Expression expr : e.getArguments()){
- count +=4;
- //expr.accept(this);
- }
- //buf.append(generateInstruction("subl", "$" + count, "%esp"));
- for(Expression expr : e.getArguments()){
- count -= 4;
- buf.append(generateInstruction("movl","%eax", (count==0?"":count) + "(%esp)"));
- //System.out.println("Just printed moving eax into " + (count==0?"":count) + "(%esp).");
- }
- buf.append(INDENT + "call _" + e.getName());
- buf.append(NEWLINE);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement