Examples of JReturnStatement


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

        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

          currentMethod.getParams().get(0));
      JMethod delegateTo = program.getIndexedMethod("Enum.valueOf");
      JMethodCall call = new JMethodCall(sourceInfo, null, delegateTo);
      call.addArgs(mapRef, nameRef);
      currentMethodBody.getBlock().addStmt(
          new JReturnStatement(sourceInfo, call));
    }
View Full Code Here

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

        initializers.add(fieldRef);
      }
      JNewArray newExpr = JNewArray.createInitializers(program, sourceInfo,
          program.getTypeArray(type, 1), initializers);
      currentMethodBody.getBlock().addStmt(
          new JReturnStatement(sourceInfo, newExpr));
    }
View Full Code Here

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

    }

    JConditional conditional = new JConditional(sourceInfo, objectMethod.getType(),
        condition, thenValue, elseValue);

    JReturnStatement returnStatement = new JReturnStatement(sourceInfo,
        conditional);
    ((JMethodBody) newMethod.getBody()).getBlock().addStmt(returnStatement);
    return newMethod;
  }
View Full Code Here

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

          currentMethod.getParams().get(0));
      JMethod delegateTo = program.getIndexedMethod("Enum.valueOf");
      JMethodCall call = new JMethodCall(sourceInfo, null, delegateTo);
      call.addArgs(mapRef, nameRef);
      currentMethodBody.getBlock().addStmt(
          new JReturnStatement(sourceInfo, call));
    }
View Full Code Here

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

        initializers.add(fieldRef);
      }
      JNewArray newExpr = JNewArray.createInitializers(program, sourceInfo,
          program.getTypeArray(type, 1), initializers);
      currentMethodBody.getBlock().addStmt(
          new JReturnStatement(sourceInfo, newExpr));
    }
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.