Examples of JSArrayLiteral


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

      push(nameRef);
    }

    @Override
    public void endVisit(JsonArray x, Context ctx) {
      JsArrayLiteral jsArrayLiteral = new JsArrayLiteral(x.getSourceInfo());
      popList(jsArrayLiteral.getExpressions(), x.getExprs().size());
      push(jsArrayLiteral);
    }
View Full Code Here

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

              JMethod meth = ((JMethodCall) init).getTarget();
              // immortal types can only have non-primitive literal initializers of createArray,createObject
              if (meth == createObjMethod) {
                fieldVar.setInitExpr(new JsObjectLiteral(init.getSourceInfo()));
              } else if (meth == createArrMethod) {
                fieldVar.setInitExpr(new JsArrayLiteral(init.getSourceInfo()));
              } else {
                assert false : "Illegal initializer expression for immortal field " + field;
              }
            }
          }
View Full Code Here

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

            + tokenType);
    }
  }

  private JsArrayLiteral mapArrayLit(Node node) throws JsParserException {
    JsArrayLiteral toLit = new JsArrayLiteral();
    Node from = node.getFirstChild();
    while (from != null) {
      toLit.getExpressions().add(mapExpression(from));
      from = from.getNext();
    }
    return toLit;
  }
View Full Code Here

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

      push(nameRef);
    }

    @Override
    public void endVisit(JsonArray x, Context ctx) {
      JsArrayLiteral jsArrayLiteral = new JsArrayLiteral();
      popList(jsArrayLiteral.getExpressions(), x.exprs.size());
      push(jsArrayLiteral);
    }
View Full Code Here

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

      JsExpression asg = createAssignment(fieldRef, nullMethodName.makeRef());
      globalStmts.add(new JsExprStmt(asg));
    }

    private JsExpression generateTypeTable() {
      JsArrayLiteral arrayLit = new JsArrayLiteral();
      for (int i = 0; i < program.getJsonTypeTable().size(); ++i) {
        JsonObject jsonObject = program.getJsonTypeTable().get(i);
        accept(jsonObject);
        arrayLit.getExpressions().add((JsExpression) pop());
      }
      return arrayLit;
    }
View Full Code Here

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

    push(program.getNumberLiteral(x.getValue()));
  }

  @Override
  public void endVisit(JLongLiteral x, Context ctx) {
    JsArrayLiteral arrayLit = new JsArrayLiteral();
    double[] doubleArray = LongLib.typeChange(x.getValue());
    arrayLit.getExpressions().add(program.getNumberLiteral(doubleArray[0]));
    arrayLit.getExpressions().add(program.getNumberLiteral(doubleArray[1]));
    push(arrayLit);
  }
View Full Code Here

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

      stack.push(newExpression);
    }

    @Override
    public void endVisit(JsArrayLiteral x, JsContext<JsExpression> ctx) {
      JsArrayLiteral toReturn = new JsArrayLiteral();
      List<JsExpression> expressions = toReturn.getExpressions();
      for (JsExpression e : x.getExpressions()) {
        expressions.add(0, stack.pop());
      }
      stack.push(toReturn);
    }
View Full Code Here

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

            + tokenType);
    }
  }

  private JsArrayLiteral mapArrayLit(Node node) throws JsParserException {
    JsArrayLiteral toLit = new JsArrayLiteral(makeSourceInfo(node));
    Node from = node.getFirstChild();
    while (from != null) {
      toLit.getExpressions().add(mapExpression(from));
      from = from.getNext();
    }
    return toLit;
  }
View Full Code Here

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

  // TODO(rluble): flesh out the test.
  public void testEquality() {
    final SourceOrigin sourceInfo = SourceOrigin.UNKNOWN;
    JsNumberLiteral one = new JsNumberLiteral(sourceInfo, 1);
    JsNumberLiteral two = new JsNumberLiteral(sourceInfo, 2);
    JsArrayLiteral arrayOneTwoLiteral = new JsArrayLiteral(sourceInfo, one, two);
    JsArrayLiteral arrayOneTwoLiteral2 = new JsArrayLiteral(sourceInfo, one,two);
    JsArrayLiteral arrayTwoOneLiteral = new JsArrayLiteral(sourceInfo, two, one);

    JsObjectLiteral emptyObject = new JsObjectLiteral(sourceInfo);

    assertEquals(arrayOneTwoLiteral, arrayOneTwoLiteral2);
    assertEquals(arrayOneTwoLiteral2, arrayOneTwoLiteral);
    assertFalse(arrayOneTwoLiteral.equals(arrayTwoOneLiteral));
    assertFalse(arrayTwoOneLiteral.equals(arrayOneTwoLiteral2));
    assertFalse(arrayTwoOneLiteral.equals(emptyObject));
    assertFalse(emptyObject.equals(arrayOneTwoLiteral2));
  }
View Full Code Here

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

      push(nameRef);
    }

    @Override
    public void endVisit(JsonArray x, Context ctx) {
      JsArrayLiteral jsArrayLiteral = new JsArrayLiteral();
      popList(jsArrayLiteral.getExpressions(), x.exprs.size());
      push(jsArrayLiteral);
    }
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.