Package com.google.gwt.dev.jjs.ast

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


        JParameter param = x.getParams().get(i);
        newCall.addArg(new JParameterRef(delegateCallSourceInfo, param));
      }
      JStatement statement;
      if (returnType == program.getTypeVoid()) {
        statement = newCall.makeStatement();
      } else {
        statement = new JReturnStatement(delegateCallSourceInfo, newCall);
      }
      newBody.getBlock().addStmt(statement);
View Full Code Here


        JParameter param = (JParameter) x.params.get(i);
        newCall.getArgs().add(new JParameterRef(program, bodyInfo, param));
      }
      JStatement statement;
      if (oldReturnType == program.getTypeVoid()) {
        statement = newCall.makeStatement();
      } else {
        statement = new JReturnStatement(program, bodyInfo, newCall);
      }
      x.body.statements.add(statement);
View Full Code Here

        // Call clinit; $clinit is always in position 0.
        JMethod clinitMethod = (JMethod) enclosingType.methods.get(0);
        JMethodCall clinitCall = new JMethodCall(program, info, null,
            clinitMethod);
        ctor.body.statements.add(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

        if (!hasExplicitThis) {
          // $init is always in position 1 (clinit is in 0)
          JMethod initMethod = (JMethod) enclosingType.methods.get(1);
          JMethodCall initCall = new JMethodCall(program, info, thisRef,
              initMethod);
          ctor.body.statements.add(initCall.makeStatement());
        }

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

      }

      // qualifier will be null if onModuleLoad is static
      JMethodCall onModuleLoadCall = new JMethodCall(program, null, qualifier,
          mainMethod);
      bootStrapMethod.body.statements.add(onModuleLoadCall.makeStatement());
    }
    program.addEntryMethod(bootStrapMethod);
  }

  private static JMethod findMainMethod(JReferenceType referenceType) {
View Full Code Here

      }

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

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

      // qualifier will be null if onModuleLoad is static
      JMethodCall onModuleLoadCall = new JMethodCall(program, null, qualifier,
          mainMethod);

      body.getStatements().add(makeStatsCalls(program, mainClassName));
      body.getStatements().add(onModuleLoadCall.makeStatement());
    }
    program.addEntryMethod(bootStrapMethod);
  }

  private static JMethod findMainMethod(JReferenceType referenceType) {
View Full Code Here

          JMethod myClinit = currentClass.methods.get(0);
          JMethod superClinit = currentClass.extnds.methods.get(0);
          JMethodCall superClinitCall = new JMethodCall(program,
              myClinit.getSourceInfo(), null, superClinit);
          JMethodBody body = (JMethodBody) myClinit.getBody();
          body.getStatements().add(0, superClinitCall.makeStatement());
        }

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

        JMethod clinitMethod = enclosingType.methods.get(0);
        JMethodCall clinitCall = new JMethodCall(program, info, null,
            clinitMethod);
        JMethodBody body = (JMethodBody) ctor.getBody();
        List<JStatement> statements = body.getStatements();
        statements.add(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

        if (!hasExplicitThis) {
          // $init is always in position 1 (clinit is in 0)
          JMethod initMethod = enclosingType.methods.get(1);
          JMethodCall initCall = new JMethodCall(program, info, thisRef,
              initMethod);
          statements.add(initCall.makeStatement());
        }

        // user code (finally!)
        if (x.statements != null) {
          for (int i = 0, n = x.statements.length; i < n; ++i) {
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.