Examples of JReturnStatement


Examples of com.google.gwt.dev.jjs.ast.JReturnStatement

    public void endVisit(JReturnStatement x, Context ctx) {
      JExpression expr = x.getExpr();
      if (expr != null) {
        JExpression newExpr = checkAndReplace(expr, currentMethod.getType());
        if (expr != newExpr) {
          JReturnStatement newStmt = new JReturnStatement(x.getSourceInfo(),
              newExpr);
          ctx.replaceMe(newStmt);
        }
      }
    }
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JReturnStatement

      // Lock the method.
      synthetic.freezeParamTypes();

      // return (new Foo()).Foo() : The only statement in the function
      JReturnStatement ret = new JReturnStatement(
          synthetic.getSourceInfo().makeChild(BuildDeclMapVisitor.class,
              "Return statement"), call);

      // Add the return statement to the method body
      JMethodBody body = (JMethodBody) synthetic.getBody();
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JReturnStatement

      }

      JConditional conditional = new JConditional(sourceInfo,
          currentMethod.getType(), condExpr, thenExpression, elseExpression);

      JReturnStatement returnStatement = new JReturnStatement(sourceInfo,
          conditional);
      return returnStatement;
    }

    if (elseStmt != null) {
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JReturnStatement

        currentMethodScope = null;
        currentMethod = null;

        // synthesize a return statement to emulate returning the new object
        block.addStmt(new JReturnStatement(info, thisRef));
      } catch (Throwable e) {
        throw translateException(ctor, e);
      }
    }
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JReturnStatement

         * their this object, so any embedded return statements have to be fixed
         * up.
         */
        JClassType enclosingType = (JClassType) currentMethod.getEnclosingType();
        assert (x.expression == null);
        return new JReturnStatement(info, createThisRef(info, enclosingType));
      } else {
        return new JReturnStatement(info, dispProcessExpression(x.expression));
      }
    }
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JReturnStatement

      // wrap it in a return if necessary
      JStatement callOrReturn;
      if (bridgeMethod.getType() == program.getTypeVoid()) {
        callOrReturn = call.makeStatement();
      } else {
        callOrReturn = new JReturnStatement(program.createSourceInfoSynthetic(
            GenerateJavaAST.class, "part of a bridge method"), call);
      }

      // create a body that is just that call
      JMethodBody body = (JMethodBody) bridgeMethod.getBody();
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JReturnStatement

      } else {
        info = method.getSourceInfo();
      }

      block.clear();
      block.addStmt(new JReturnStatement(info, returnValue));
    }
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JReturnStatement

          JExpressionStatement exprStmt = (JExpressionStatement) stmt;
          JExpression expr = exprStmt.getExpr();
          JExpression clone = cloner.cloneExpression(expr);
          multi.exprs.add(clone);
        } else if (stmt instanceof JReturnStatement) {
          JReturnStatement returnStatement = (JReturnStatement) stmt;
          JExpression expr = returnStatement.getExpr();
          if (expr != null) {
            if (!ignoringReturnValue || expr.hasSideEffects()) {
              JExpression clone = cloner.cloneExpression(expr);
              clone = maybeCast(clone, body.getMethod().getType());
              multi.exprs.add(clone);
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JReturnStatement

    public void endVisit(JReturnStatement x, Context ctx) {
      JExpression expr = x.getExpr();
      if (expr != null) {
        JExpression newExpr = checkAndReplace(expr, currentMethod.getType());
        if (expr != newExpr) {
          JReturnStatement newStmt = new JReturnStatement(x.getSourceInfo(),
              newExpr);
          ctx.replaceMe(newStmt);
        }
      }
    }
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JReturnStatement

      }
      JStatement statement;
      if (returnType == program.getTypeVoid()) {
        statement = newCall.makeStatement();
      } else {
        statement = new JReturnStatement(delegateCallSourceInfo, newCall);
      }
      newBody.getBlock().addStmt(statement);

      /*
       * Rewrite the method body. Update all thisRefs to paramRefs. Update
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.