Package com.google.dart.engine.html.scanner

Examples of com.google.dart.engine.html.scanner.Token


  public Void visitXmlTagNode(XmlTagNode node) {
    Element element = node.getElement();
    if (element != null) {
      // tag
      {
        Token tagToken = node.getTagToken();
        Location location = createLocationForToken(tagToken);
        store.recordRelationship(element, IndexConstants.ANGULAR_REFERENCE, location);
      }
      // maybe add closing tag range
      Token closingTag = node.getClosingTag();
      if (closingTag != null) {
        Location location = createLocationForToken(closingTag);
        store.recordRelationship(element, IndexConstants.ANGULAR_CLOSING_TAG_REFERENCE, location);
      }
    }
View Full Code Here


  @Override
  protected void internalPerform() throws AnalysisException {
    try {
      AbstractScanner scanner = new StringScanner(source, content);
      scanner.setPassThroughElements(new String[] {TAG_SCRIPT});
      Token token = scanner.tokenize();
      lineInfo = new LineInfo(scanner.getLineStarts());
      final RecordingErrorListener errorListener = new RecordingErrorListener();
      unit = new HtmlParser(source, errorListener).parse(token, lineInfo);
      unit.accept(new RecursiveXmlVisitor<Void>() {
        @Override
View Full Code Here

   * '&lt;/', and '>', '/>' is discarded, but all other whitespace is preserved.
   *
   * @return the content (not {@code null})
   */
  public String getContent() {
    Token token = attributeEnd.getNext();
    if (token == contentEnd) {
      return "";
    }
    //TODO (danrubel): handle CDATA and replace HTML character encodings with the actual characters
    String content = token.getLexeme();
    token = token.getNext();
    if (token == contentEnd) {
      return content;
    }
    StringBuilder buffer = new StringBuilder(content);
    while (token != contentEnd) {
      buffer.append(token.getLexeme());
      token = token.getNext();
    }
    return buffer.toString();
  }
View Full Code Here

  /**
   * Reports an error on the attribute's value, or (if absent) on the attribute's name.
   */
  private void reportErrorForAttributeValue(XmlAttributeNode node, ErrorCode errorCode,
      Object... arguments) {
    Token valueToken = node.getValueToken();
    if (valueToken == null || valueToken.isSynthetic()) {
      reportErrorForAttribute(node, errorCode, arguments);
    } else {
      reportErrorForToken(valueToken, errorCode, arguments);
    }
  }
View Full Code Here

TOP

Related Classes of com.google.dart.engine.html.scanner.Token

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.