Package com.google.caja.parser.quasiliteral

Examples of com.google.caja.parser.quasiliteral.Rewriter


   */
  final List<ScopeInfo> inners = Lists.newArrayList();

  ScopeInfo(Block program, MessageQueue mq) {
    this(new ScopeInfo(),
        Scope.fromProgram(program, new Rewriter(mq, false, false)));
    // The global scope is infected since top level declarations
    // are aliased by members of the local scope.
    this.dynamicUsePossible = true;
  }
View Full Code Here


          .withInput(ContentType.JS)
          .withInput(cp)
          .build();

      UncajoledModule ucm = new UncajoledModule(input);
      Rewriter esrw = new ES53Rewriter(buildInfo, mq, false /* logging */);
      cajoledModule = (CajoledModule) esrw.expand(ucm);
    } catch (ParseException e) {
      e.toMessageQueue(mq);
    } catch (IllegalStateException e) {
      mq.addMessage(MessageType.INTERNAL_ERROR,
          MessagePart.Factory.valueOf(e.getMessage()));
View Full Code Here

        new PluginMeta(), TestBuildInfo.getInstance(),
        UriFetcher.NULL_NETWORK, mq);
    return new ExpressionSanitizerCaja(mgr, null) {
      @Override
      protected Rewriter newES53Rewriter(ModuleManager mgr) {
        return new Rewriter(mq, true, true) {{
          addRule(new Rule() {
            @Override
            @RuleDescription(
                name="passthru",
                synopsis="Pass through input vacuously 'expanded'",
View Full Code Here

   */
  public Block optimize(Block js, MessageQueue mq) {
    finishInference();
    while (true) {
      Result out = new Result();
      Scope s = Scope.fromProgram(js, new Rewriter(mq, false, false));
      optimize(s, js, false, false, false, false, out);
      Block optimized = ConstLocalOptimization.optimize((Block) out.node);
      if (optimized == js) { return optimized; }
      js = optimized;
    }
View Full Code Here

    String output = "";

    try {
      Block start = p.parse();
      tq.expectEmpty();
      Rewriter icr = new InnocentCodeRewriter(errs, false /* logging */);
      output = Rewriter.render(icr.expand(start));
      out.append(output);
    } catch (ParseException ex) {
      ex.toMessageQueue(errs);
    }

View Full Code Here

TOP

Related Classes of com.google.caja.parser.quasiliteral.Rewriter

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.