예제 #1
0
 @Override
 public void visit(ReturnStatement statement) {
   if (statement.getResult() != null) {
     statement.getResult().acceptVisitor(this);
     statement.setResult(resultExpr);
   }
   resultStmt = statement;
 }
예제 #2
0
 @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);
 }