Examples of JsExprStmt


Examples of com.google.gwt.dev.js.ast.JsExprStmt

          GenerateJavaScriptAST.class, "Type marker");
      JsNameRef fieldRef = typeMarkerName.makeRef(sourceInfo);
      fieldRef.setQualifier(globalTemp.makeRef(sourceInfo));
      JsExpression asg = createAssignment(fieldRef,
          nullMethodName.makeRef(sourceInfo));
      JsExprStmt stmt = asg.makeStmt();
      globalStmts.add(stmt);
      typeForStatMap.put(stmt, program.getTypeJavaLangObject());
    }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsExprStmt

        if (!method.isStatic() && !method.isAbstract()) {
          JsNameRef lhs = polymorphicNames.get(method).makeRef(sourceInfo);
          lhs.setQualifier(globalTemp.makeRef(sourceInfo));
          JsNameRef rhs = names.get(method).makeRef(sourceInfo);
          JsExpression asg = createAssignment(lhs, rhs);
          JsExprStmt asgStat = new JsExprStmt(x.getSourceInfo(), asg);
          globalStmts.add(asgStat);
          vtableInitForMethodMap.put(asgStat, method);
        }
      }
    }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsExprStmt

        // for non-statics, only setup an assignment if needed
        if (rhs != null) {
          JsNameRef fieldRef = name.makeRef();
          fieldRef.setQualifier(globalTemp.makeRef());
          JsExpression asg = createAssignment(fieldRef, rhs);
          push(new JsExprStmt(asg));
        } else {
          push(null);
        }
      }
    }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsExprStmt

      // increments
      {
        JsExpression incrExpr = null;
        List/* <JsExprStmt> */exprStmts = popList(x.getIncrements().size());
        for (int i = 0; i < exprStmts.size(); ++i) {
          JsExprStmt exprStmt = (JsExprStmt) exprStmts.get(i);
          incrExpr = createCommaExpression(incrExpr, exprStmt.getExpression());
        }
        jsFor.setIncrExpr(incrExpr);
      }

      // condition
      if (x.getTestExpr() != null) {
        jsFor.setCondition((JsExpression) pop());
      }

      // initializers
      JsExpression initExpr = null;
      List/* <JsExprStmt> */initStmts = popList(x.getInitializers().size());
      for (int i = 0; i < initStmts.size(); ++i) {
        JsExprStmt initStmt = (JsExprStmt) initStmts.get(i);
        if (initStmt != null) {
          initExpr = createCommaExpression(initExpr, initStmt.getExpression());
        }
      }
      jsFor.setInitExpr(initExpr);

      push(jsFor);
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsExprStmt

        body.getStatements().add(jsReturn);
        rhs.setBody(body);

        // asg
        JsExpression asg = createAssignment(lhs, rhs);
        globalStmts.add(new JsExprStmt(asg));
      }
    }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsExprStmt

        JField typeIdField = program.getSpecialField("Object.typeId");
        JsNameRef fieldRef = getName(typeIdField).makeRef();
        fieldRef.setQualifier(globalTemp.makeRef());
        JsIntegralLiteral typeIdLit = jsProgram.getIntegralLiteral(BigInteger.valueOf(typeId));
        JsExpression asg = createAssignment(fieldRef, typeIdLit);
        globalStmts.add(new JsExprStmt(asg));
      }
    }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsExprStmt

      } else {
        // no package name could be split, just use the full name
        rhs = jsProgram.getStringLiteral(x.getName());
      }
      JsExpression asg = createAssignment(lhs, rhs);
      globalStmts.add(new JsExprStmt(asg));
    }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsExprStmt

        if (!method.isStatic() && !method.isAbstract()) {
          JsNameRef lhs = getPolyName(method).makeRef();
          lhs.setQualifier(globalTemp.makeRef());
          JsNameRef rhs = getName(method).makeRef();
          JsExpression asg = createAssignment(lhs, rhs);
          globalStmts.add(new JsExprStmt(asg));
        }
      }
    }
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsExprStmt

              + jsniCode);
          try {
            // start at -1 to avoid counting our synthetic header
            // TODO: get the character position start correct
            JsStatements result = jsParser.parse(jsProgram.getScope(), sr, -1);
            JsExprStmt jsExprStmt = (JsExprStmt) result.get(0);
            JsFunction jsFunction = (JsFunction) jsExprStmt.getExpression();
            ((JsniMethod) newMethod).setFunc(jsFunction);
          } catch (IOException e) {
            throw new InternalCompilerException(
                "Internal error parsing JSNI in method '" + newMethod
                    + "' in type '" + enclosingType.getName() + "'", e);
View Full Code Here

Examples of com.google.gwt.dev.js.ast.JsExprStmt

    private JsFunction createGlobalFunction(String code) {
      try {
        List<JsStatement> stmts =
            JsParser.parse(SourceOrigin.UNKNOWN, topScope, new StringReader(code));
        assert stmts.size() == 1;
        JsExprStmt stmt = (JsExprStmt) stmts.get(0);
        List<JsStatement> globalStmts = jsProgram.getGlobalBlock().getStatements();
        globalStmts.add(0, stmt);
        return (JsFunction) stmt.getExpression();
      } catch (Exception e) {
        throw new InternalCompilerException("Unexpected exception parsing '" + code + "'", e);
      }
    }
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.