@Override public void visit(ReturnStatement statement) { if (statement.getResult() != null) { statement.getResult().acceptVisitor(this); statement.setResult(resultExpr); } resultStmt = statement; }
@Override public void visit(ExitInstruction insn) { ReturnStatement stmt = Statement.exitFunction( insn.getValueToReturn() != null ? Expr.var(insn.getValueToReturn().getIndex()) : null); stmt.setLocation(currentLocation); statements.add(stmt); }
@Override public void visitReturnStatement(ReturnStatement returnStatement) { returnStatement.getExpressionStatement().accept(this); }