Examples of JsStringLiteral


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

      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);
      }

      jsProgram.getGlobalBlock().getStatements().add(
          constructInvocation(sourceInfo, "ModuleUtils.setGwtProperty",
              new JsStringLiteral(sourceInfo, "permProps"), permProps).makeStmt());
    }
View Full Code Here

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

    private JsExprStmt outputDisplayName(JsNameRef function, JMethod method) {
      JsNameRef displayName = new JsNameRef(function.getSourceInfo(), "displayName");
      displayName.setQualifier(function);
      String displayStringName = getDisplayName(method);
      JsStringLiteral displayMethodName = new JsStringLiteral(function.getSourceInfo(), displayStringName);
      return createAssignment(displayName, displayMethodName).makeStmt();
    }
View Full Code Here

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

          JsName provideFunc = indexedFunctions.get("JavaClassHierarchySetupUtil.provide").getName();
          JsNameRef provideFuncRef = provideFunc.makeRef(x.getSourceInfo());
          JsInvocation provideCall = new JsInvocation(x.getSourceInfo());

          provideCall.setQualifier(provideFuncRef);
          provideCall.getArguments().add(new JsStringLiteral(x.getSourceInfo(),
              exportNamespacePair.getLeft()));

          // _ = JCHSU.provide('foo.bar')
          JsExprStmt provideStat = createAssignment(globalTemp.makeRef(x.getSourceInfo()),
              provideCall).makeStmt();
View Full Code Here

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

        return mapConditional(node);

      case TokenStream.STRING: {
        SourceInfo info = makeSourceInfoDistinct(node);
        info.addCorrelation(info.getCorrelator().by(Literal.STRING));
        return new JsStringLiteral(info, node.getString());
      }

      case TokenStream.NUMBER:
        return mapNumber(node);
View Full Code Here

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

    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) {
      JsStringLiteral lit = (JsStringLiteral) unknown;
      String litName = lit.getValue();
      return new JsNameRef(makeSourceInfo(nameRefNode), litName);
    } else {
      throw createParserException("Expecting a name reference", nameRefNode);
    }
  }
View Full Code Here

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

        (arg1 instanceof JsStringLiteral || arg2 instanceof JsStringLiteral)) {
      // cases: number + string or string + number
      StringBuilder result = new StringBuilder();
      if (appendLiteral(result, (JsValueLiteral) arg1)
          && appendLiteral(result, (JsValueLiteral) arg2)) {
        return new JsStringLiteral(info, result.toString());
      }
      return expr;
    }

    if (arg1 instanceof JsNumberLiteral && arg2 instanceof JsNumberLiteral) {
View Full Code Here

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

    push(JsNullLiteral.INSTANCE);
  }

  @Override
  public final void endVisit(JStringLiteral x, Context ctx) {
    push(new JsStringLiteral(x.getSourceInfo(), x.getValue()));
  }
View Full Code Here

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

      gwtOnLoadName.setObfuscatable(false);
      JsVar gwtOnLoadNameVar = new JsVar(sourceInfo, gwtOnLoadName);
      gwtOnLoadNameVar.setInitExpr(new JsConditional(sourceInfo, new JsBinaryOperation(sourceInfo,
          JsBinaryOperator.REF_EQ, new JsPrefixOperation(
              sourceInfo, JsUnaryOperator.TYPEOF, gwtOnLoadName.makeRef(sourceInfo)),
          new JsStringLiteral(sourceInfo, "undefined")), JsNullLiteral.INSTANCE,
          gwtOnLoadName.makeRef(sourceInfo)));
      JsVars gwtOnLoadNameVars = new JsVars(sourceInfo);
      gwtOnLoadNameVars.add(gwtOnLoadNameVar);
      globalStmts.add(gwtOnLoadNameVars);
View Full Code Here

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

                                           String lastProvidedNamespace, Pair<String, String> exportNamespacePair) {
      if (!lastProvidedNamespace.equals(exportNamespacePair.getLeft())) {
        JsName provideFunc = indexedFunctions.get("JavaClassHierarchySetupUtil.provide").getName();
        JsInvocation provideCall = new JsInvocation(x.getSourceInfo());
        provideCall.setQualifier(provideFunc.makeRef(x.getSourceInfo()));
        provideCall.getArguments().add(new JsStringLiteral(x.getSourceInfo(),
            exportNamespacePair.getLeft()));
        JsExprStmt provideStat = createAssignment(globalTemp.makeRef(x.getSourceInfo()),
            provideCall).makeStmt();
        globalStmts.add(provideStat);
        lastProvidedNamespace = exportNamespacePair.getLeft();
View Full Code Here

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

    push(JsNullLiteral.INSTANCE);
  }

  @Override
  public final void endVisit(JStringLiteral x, Context ctx) {
    push(new JsStringLiteral(x.getSourceInfo(), x.getValue()));
  }
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.