Package com.google.caja.lexer

Examples of com.google.caja.lexer.TokenConsumer.mark()


    renderPropertyName(rc, false);
    out.consume(":");
    if (!Operation.is(value, Operator.COMMA)) {
      value.render(rc);
    } else {
      out.mark(value.getFilePosition());
      out.consume("(");
      value.render(rc);
      out.consume(")");
    }
  }
View Full Code Here


    return childrenAs(Declaration.class);
  }

  public void render(RenderContext rc) {
    TokenConsumer out = rc.getOut();
    out.mark(getFilePosition());
    if (children().isEmpty()) {
      throw new SomethingWidgyHappenedError("Empty MultiDeclaration");
    }
    out.consume("var");
    boolean seen = false;
View Full Code Here

  public String getLabel() { return label; }

  public void render(RenderContext rc) {
    TokenConsumer out = rc.getOut();
    out.mark(getFilePosition());
    out.consume("continue");
    if (null != label && !"".equals(label)) {
      out.consume(label);
    }
  }
View Full Code Here

    this.body = (Statement) children.get(2);
  }

  public void render(RenderContext rc) {
    TokenConsumer out = rc.getOut();
    out.mark(getFilePosition());
    String label = getRenderedLabel();
    if (null != label) {
      out.consume(label);
      out.consume(":");
    }
View Full Code Here

  @Override
  public boolean isTargetForContinue() { return false; }

  public void render(RenderContext rc) {
    TokenConsumer out = rc.getOut();
    out.mark(getFilePosition());
    String label = getRenderedLabel();
    if (null != label) {
      out.consume(label);
      out.consume(":");
    }
View Full Code Here

    out.consume("{");
    while (it.hasNext()) {
      SwitchCase caseStmt = (SwitchCase) it.next();
      caseStmt.render(rc);
    }
    out.mark(FilePosition.endOfOrNull(getFilePosition()));
    out.consume("}");
  }

  @Override
  public boolean isTerminal() {
View Full Code Here

  @Override
  public Statement getBody() { return body; }

  public void render(RenderContext rc) {
    TokenConsumer out = rc.getOut();
    out.mark(getFilePosition());
    String label = getRenderedLabel();
    if (null != label) {
      out.consume(label);
      out.consume(":");
    }
View Full Code Here

    }
  }

  public void render(RenderContext rc) {
    TokenConsumer out = rc.getOut();
    out.mark(getFilePosition());
    switch (op.getType()) {
      case PREFIX:
        out.consume(op.getSymbol());
        renderParam(0, rc);
        if (op == Operator.CONSTRUCTOR) {
View Full Code Here

          }
        }
        break;
      case POSTFIX:
        renderParam(0, rc);
        out.mark(FilePosition.endOfOrNull(getFilePosition()));
        out.consume(op.getSymbol());
        break;
      case INFIX:
        renderParam(0, rc);
        switch (getOperator()) {
View Full Code Here

          if (!parenthesize(Operator.COMMA, false, (Expression) e)) {
            e.render(rc);
          } else {
            out.consume("(");
            e.render(rc);
            out.mark(FilePosition.endOfOrNull(e.getFilePosition()));
            out.consume(")");
          }
        }
        out.mark(FilePosition.endOfOrNull(getFilePosition()));
        out.consume(op.getClosingSymbol());
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.