示例#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);
 }