Package com.google.gwt.dev.js.ast

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


   * Produces a {@link JsNameRef}.
   */
  private JsNameRef mapAsPropertyNameRef(Node nameRefNode)
      throws JsParserException {
    // Javac 1.6.0_01 doesn't like the cast below if this is parameterized
    @SuppressWarnings("unchecked")
    JsNode unknown = map(nameRefNode);
    // This is weird, but for "a.b", the rhino AST calls "b" a string literal.
    // However, since we know it's for a PROPGET, we can unstringliteralize it.
    //
    if (unknown instanceof JsStringLiteral) {
View Full Code Here


    }
  }

  private JsExpression mapExpression(Node exprNode) throws JsParserException {
    // Javac 1.6.0_01 doesn't like the cast below if this is parameterized
    @SuppressWarnings("unchecked")
    JsNode unknown = map(exprNode);
    if (unknown instanceof JsExpression) {
      return (JsExpression) unknown;
    } else {
      throw createParserException("Expecting an expression", exprNode);
View Full Code Here

      //
      JsFor toFor = new JsFor(makeSourceInfo(forNode));

      // The first item is either an expression or a JsVars.
      // Javac 1.6.0_01 doesn't like the cast below if this is parameterized
      @SuppressWarnings("unchecked")
      JsNode initThingy = map(fromInit);
      if (initThingy != null) {
        if (initThingy instanceof JsVars) {
          toFor.setInitVars((JsVars) initThingy);
        } else {
View Full Code Here

  }

  private JsExpression mapOptionalExpression(Node exprNode)
      throws JsParserException {
    // Javac 1.6.0_01 doesn't like the cast below if this is parameterized
    @SuppressWarnings("unchecked")
    JsNode unknown = map(exprNode);
    if (unknown != null) {
      if (unknown instanceof JsExpression) {
        return (JsExpression) unknown;
      } else {
View Full Code Here

    }
  }

  private JsStatement mapStatement(Node nodeStmt) throws JsParserException {
    // Javac 1.6.0_01 doesn't like the cast below if this is parameterized
    @SuppressWarnings("unchecked")
    JsNode unknown = map(nodeStmt);
    if (unknown != null) {
      if (unknown instanceof JsStatement) {
        return (JsStatement) unknown;
      } else if (unknown instanceof JsExpression) {
View Full Code Here

      }

      // setup fields
      JsVars vars = new JsVars();
      for (int i = 0; i < jsFields.size(); ++i) {
        JsNode node = jsFields.get(i);
        if (node instanceof JsVar) {
          vars.add((JsVar) node);
        } else {
          assert (node instanceof JsStatement);
          JsStatement stmt = (JsStatement) jsFields.get(i);
View Full Code Here

  @SuppressWarnings("unchecked")
  private static JsFunction isFunction(JsExpression e) {
    if (e instanceof JsNameRef) {
      JsNameRef ref = (JsNameRef) e;

      JsNode staticRef = ref.getName().getStaticRef();
      if (staticRef instanceof JsFunction) {
        return (JsFunction) staticRef;
      }
    }
View Full Code Here

    } else if (node instanceof JsStatement) {
      willReportRange = true;
    } else if ((node instanceof JsNameRef) && needSourcemapNames) {
      willReportRange = true;
    } else {
      JsNode parent = parentStack.get(parentStack.size() - 1);
      if ((node instanceof JsExpression) &&
          (parent instanceof JsDoWhile)) {
        // Always instrument the expression because it comes at the end.
        // (So we can stop there in a loop.)
        willReportRange = true;
      } else {
        // Instrument the expression if it was inlined in Java.
        SourceInfo info = ((JsNode) node).getSourceInfo();
        if (!surroundsInJavaSource(parent.getSourceInfo(), info)) {
          willReportRange = true;
        }
      }
    }
View Full Code Here

        // Only resolve unqualified names
        if (x.getQualifier() == null) {
          JsName name = getScope().findExistingName(x.getIdent());

          // Ensure that we're resolving a name from the function's parameters
          JsNode node = name == null ? null : name.getStaticRef();
          if (node instanceof JsParameter) {
            JsParameter param = (JsParameter) node;
            if (jsFunction.getParameters().contains(param)) {
              x.resolve(name);
            }
View Full Code Here

      }

      // setup fields
      JsVars vars = new JsVars(x.getSourceInfo());
      for (int i = 0; i < jsFields.size(); ++i) {
        JsNode node = jsFields.get(i);
        if (node instanceof JsVar) {
          vars.add((JsVar) node);
        } else {
          assert (node instanceof JsStatement);
          JsStatement stmt = (JsStatement) node;
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.js.ast.JsNode

Copyright © 2018 www.massapicom. 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.