Examples of makeStatement()


Examples of com.google.gwt.dev.jjs.ast.JExpression.makeStatement()

      lValues.pop();
      // The variable may have been pruned.
      if (isVariablePruned(x.getVariableRef().getTarget())) {
        JExpression replacement = makeReplacementForAssignment(
            x.getSourceInfo(), x.getVariableRef(), x.getInitializer());
        ctx.replaceMe(replacement.makeStatement());
      }
    }

    @Override
    public void endVisit(JFieldRef x, Context ctx) {
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JExpression.makeStatement()

    @Override
    public void endVisit(SynchronizedStatement x, BlockScope scope) {
      try {
        JBlock block = pop(x.block);
        JExpression expression = pop(x.expression);
        block.addStmt(0, expression.makeStatement());
        push(block);
      } catch (Throwable e) {
        throw translateException(x, e);
      }
    }
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JMethodCall.makeStatement()

      }

      JMethod mainMethod = findMainMethod(mainType);
      if (mainMethod != null && mainMethod.isStatic()) {
        JMethodCall onModuleLoadCall = new JMethodCall(null, null, mainMethod);
        block.addStmt(onModuleLoadCall.makeStatement());
        continue;
      }

      // Couldn't find a static main method; must rebind the class
      String[] resultTypeNames = rpo.getAllPossibleRebindAnswers(logger,
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JMethodCall.makeStatement()

          JMethod myClinit = currentClass.getMethods().get(0);
          JMethod superClinit = currentClass.getSuperClass().getMethods().get(0);
          JMethodCall superClinitCall = new JMethodCall(
              myClinit.getSourceInfo(), null, superClinit);
          JMethodBody body = (JMethodBody) myClinit.getBody();
          body.getBlock().addStmt(0, superClinitCall.makeStatement());
        }

        if (x.fields != null) {
          // Process fields
          for (int i = 0, n = x.fields.length; i < n; ++i) {
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JMethodCall.makeStatement()

        // Call clinit; $clinit is always in position 0.
        JMethod clinitMethod = enclosingType.getMethods().get(0);
        JMethodCall clinitCall = new JMethodCall(info, null, clinitMethod);
        JMethodBody body = (JMethodBody) ctor.getBody();
        JBlock block = body.getBlock();
        block.addStmt(clinitCall.makeStatement());

        /*
         * All synthetic fields must be assigned, unless we have an explicit
         * this constructor call, in which case the callee will assign them for
         * us.
 
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JMethodCall.makeStatement()

         */
        if (!hasExplicitThis) {
          // $init is always in position 1 (clinit is in 0)
          JMethod initMethod = enclosingType.getMethods().get(1);
          JMethodCall initCall = new JMethodCall(info, thisRef, initMethod);
          block.addStmt(initCall.makeStatement());
        }

        // user code (finally!)
        block.addStmts(processStatements(x.statements));

View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JMethodCall.makeStatement()

      }

      // 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);
      }
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JMethodCall.makeStatement()

      }

      JMethod mainMethod = findMainMethod(mainType);
      if (mainMethod != null && mainMethod.isStatic()) {
        JMethodCall onModuleLoadCall = new JMethodCall(null, null, mainMethod);
        block.addStmt(onModuleLoadCall.makeStatement());
        continue;
      }

      // Couldn't find a static main method; must rebind the class
      String[] resultTypeNames = rpo.getAllPossibleRebindAnswers(logger,
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JMethodCall.makeStatement()

          JMethod myClinit = currentClass.getMethods().get(0);
          JMethod superClinit = currentClass.getSuperClass().getMethods().get(0);
          JMethodCall superClinitCall = new JMethodCall(
              myClinit.getSourceInfo(), null, superClinit);
          JMethodBody body = (JMethodBody) myClinit.getBody();
          body.getBlock().addStmt(0, superClinitCall.makeStatement());
        }

        if (x.fields != null) {
          // Process fields
          for (int i = 0, n = x.fields.length; i < n; ++i) {
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JMethodCall.makeStatement()

        // Call clinit; $clinit is always in position 0.
        JMethod clinitMethod = enclosingType.getMethods().get(0);
        JMethodCall clinitCall = new JMethodCall(info, null, clinitMethod);
        JMethodBody body = (JMethodBody) ctor.getBody();
        JBlock block = body.getBlock();
        block.addStmt(clinitCall.makeStatement());

        /*
         * All synthetic fields must be assigned, unless we have an explicit
         * this constructor call, in which case the callee will assign them for
         * us.
 
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.