Package com.google.caja.lexer.TokenQueue

Examples of com.google.caja.lexer.TokenQueue.Mark


    }
    return new CssTree.Pseudo(pos(m), atom);
  }

  private CssTree.Declaration parseDeclaration() throws ParseException {
    Mark m = tq.mark();
    if (tq.lookaheadToken("}") || tq.lookaheadToken(";")) {
      return new CssTree.EmptyDeclaration(pos(m));
    }
    boolean hasStarHack = tq.checkToken("*");
    Mark declStart = tq.mark();
    CssTree.Property property = parseProperty();
    if (property == null) {
      SKIP_TO_CHUNK_END_FROM_WITHIN_BLOCK.recover(this, m);
      return null;
    }
View Full Code Here


        MessagePart.Factory.valueOf(";"),
        MessagePart.Factory.valueOf(t.text));
  }

  private CssTree.Expr parseExpr() throws ParseException {
    Mark m = tq.mark();
    List<CssTree> children = Lists.newArrayList();
    {
      CssTree.Term term = parseTerm();
      if (term == null) { return null; }
      children.add(term);
View Full Code Here

    }
    return new CssTree.Expr(pos(m), children);
  }

  private CssTree.Term parseTerm() throws ParseException {
    Mark m = tq.mark();
    CssTree.UnaryOperator op = parseUnaryOperator();

    if (isTolerant && tq.isEmpty()) { return null; }

    Mark m2 = tq.mark();
    CssTree.CssExprAtom expr;
    Token<CssTokenType> t = tq.peek();
    switch (t.type) {
      case IDENT:
        String ident = unescape(t);
View Full Code Here

    }
    return op;
  }

  private CssTree.CssLiteral parseLiteral() throws ParseException {
    Mark m = tq.mark();
    Token<CssTokenType> t = tq.pop();
    switch (t.type) {
      case QUANTITY:
        try {
          return new CssTree.QuantityLiteral(pos(m), unescape(t));
View Full Code Here

    }
  }

  private CssTree.UriLiteral parseUri() throws ParseException {
    Token<CssTokenType> t = tq.peek();
    Mark m = tq.mark();
    try {
      String uriStr;
      switch (t.type) {
        case URI:
        {
View Full Code Here

    }
    return new CssTree.ProgId(pos(start), Name.css(sb.toString()), attrs);
  }

  private CssTree.ProgIdAttribute parseProgIdAttribute() throws ParseException {
    Mark attrStart = tq.mark();
    String name = expectIdent();
    if (name == null) { return null; }
    if (!tq.checkToken("=")) { return null; }
    Mark valueStart = tq.mark();
    CssTree.UnaryOperator op = parseUnaryOperator();
    if (tq.isEmpty()) { return null; }
    Token<CssTokenType> t = tq.peek();
    CssTree.CssLiteral lit = null;
    if (t.type == CssTokenType.HASH) {
View Full Code Here

  private Function<DOMImplementation, DocumentType> findDoctype()
      throws ParseException {
    if (tokens.isEmpty()) { return null; }
    Function<DOMImplementation, DocumentType> doctypeMaker = null;
    Mark start = tokens.mark();

    doctypeloop:
    while (!tokens.isEmpty()) {
      Token<HtmlTokenType> t = tokens.peek();
      switch (t.type) {
View Full Code Here

TOP

Related Classes of com.google.caja.lexer.TokenQueue.Mark

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.