Examples of JsArrayLiteral


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

  }

  private void makeVars() {
    SourceInfo info = jsProgram.createSourceInfoSynthetic(getClass());
    JsVar stackVar = new JsVar(info, stack);
    stackVar.setInitExpr(new JsArrayLiteral(info));
    JsVar stackDepthVar = new JsVar(info, stackDepth);
    stackDepthVar.setInitExpr(new JsNumberLiteral(info, (-1)));
    JsVar lineNumbersVar = new JsVar(info, lineNumbers);
    lineNumbersVar.setInitExpr(new JsArrayLiteral(info));

    JsVars vars;
    JsStatement first = jsProgram.getGlobalBlock().getStatements().get(0);
    if (first instanceof JsVars) {
      vars = (JsVars) first;
View Full Code Here

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

      // Generates a list of lists of pairs: [[["key", "value"], ...], ...]
      // The outermost list is indexed by soft permutation id. Each item represents
      // a map from binding properties to their values, but is stored as a list of pairs
      // for easy iteration.
      JsArrayLiteral permProps = new JsArrayLiteral(sourceInfo);
      for (ImmutableMap<String, String> propMap : props.findEmbeddedProperties(TreeLogger.NULL)) {
        JsArrayLiteral entryList = new JsArrayLiteral(sourceInfo);
        for (Entry<String, String> entry : propMap.entrySet()) {
          JsArrayLiteral pair = new JsArrayLiteral(sourceInfo,
              new JsStringLiteral(sourceInfo, entry.getKey()),
              new JsStringLiteral(sourceInfo, entry.getValue()));
          entryList.getExpressions().add(pair);
        }
        permProps.getExpressions().add(entryList);
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(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

        JsInvocation invokeBridge = new JsInvocation(methodRef.getSourceInfo());
        invokeBridge.setQualifier(makeBridgeMethodRef);
        invokeBridge.getArguments().add(methodRef);
        invokeBridge.getArguments().add(m.getType() == JPrimitiveType.LONG ?
            JsBooleanLiteral.TRUE : JsBooleanLiteral.FALSE);
        JsArrayLiteral arrayLiteral = new JsArrayLiteral(m.getSourceInfo());
        for (JParameter p : m.getParams()) {
          if (p.getType() == JPrimitiveType.LONG) {
            arrayLiteral.getExpressions().add(JsBooleanLiteral.TRUE);
          } else {
            arrayLiteral.getExpressions().add(JsBooleanLiteral.FALSE);
          }
        }
        invokeBridge.getArguments().add(arrayLiteral);
        return invokeBridge;
      }
View Full Code Here

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

            + tokenType, node);
    }
  }

  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

      stack.push(newExpression);
    }

    @Override
    public void endVisit(JsArrayLiteral x, JsContext ctx) {
      JsArrayLiteral toReturn = new JsArrayLiteral(x.getSourceInfo());
      List<JsExpression> expressions = toReturn.getExpressions();
      int size = x.getExpressions().size();
      while (size-- > 0) {
        expressions.add(0, stack.pop());
      }
      stack.push(toReturn);
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(x.getSourceInfo());
      popList(jsArrayLiteral.getExpressions(), x.exprs.size());
      push(jsArrayLiteral);
    }
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(x.getSourceInfo());
      popList(jsArrayLiteral.getExpressions(), x.getExprs().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.