| Index: pkg/analyzer_experimental/lib/src/generated/html.dart
|
| diff --git a/pkg/analyzer_experimental/lib/src/generated/html.dart b/pkg/analyzer_experimental/lib/src/generated/html.dart
|
| index 0de0d5bb6fcfb6da24fe9ad9db545a1aff3e64ed..206f55239e358d4b55aa05700f63fa7f80f8bd4c 100644
|
| --- a/pkg/analyzer_experimental/lib/src/generated/html.dart
|
| +++ b/pkg/analyzer_experimental/lib/src/generated/html.dart
|
| @@ -1,8 +1,6 @@
|
| // This code was auto-generated, is not intended to be edited, and is subject to
|
| // significant change. Please see the README file for more information.
|
| -
|
| library engine.html;
|
| -
|
| import 'dart:collection';
|
| import 'java_core.dart';
|
| import 'java_engine.dart';
|
| @@ -10,52 +8,50 @@ import 'source.dart';
|
| import 'error.dart';
|
| import 'instrumentation.dart';
|
| import 'element.dart' show HtmlElementImpl;
|
| -
|
| -
|
| /**
|
| * Instances of the class {@code Token} represent a token that was scanned from the input. Each
|
| * token knows which token follows it, acting as the head of a linked list of tokens.
|
| * @coverage dart.engine.html
|
| */
|
| class Token {
|
| -
|
| +
|
| /**
|
| * The offset from the beginning of the file to the first character in the token.
|
| */
|
| int _offset = 0;
|
| -
|
| +
|
| /**
|
| * The previous token in the token stream.
|
| */
|
| Token _previous;
|
| -
|
| +
|
| /**
|
| * The next token in the token stream.
|
| */
|
| Token _next;
|
| -
|
| +
|
| /**
|
| * The type of the token.
|
| */
|
| TokenType _type;
|
| -
|
| +
|
| /**
|
| * The lexeme represented by this token.
|
| */
|
| String _value;
|
| -
|
| +
|
| /**
|
| * Initialize a newly created token.
|
| * @param type the token type (not {@code null})
|
| * @param offset the offset from the beginning of the file to the first character in the token
|
| */
|
| Token.con1(TokenType type, int offset) {
|
| - _jtd_constructor_154_impl(type, offset);
|
| + _jtd_constructor_155_impl(type, offset);
|
| }
|
| - _jtd_constructor_154_impl(TokenType type, int offset) {
|
| - _jtd_constructor_155_impl(type, offset, type.lexeme);
|
| + _jtd_constructor_155_impl(TokenType type, int offset) {
|
| + _jtd_constructor_156_impl(type, offset, type.lexeme);
|
| }
|
| -
|
| +
|
| /**
|
| * Initialize a newly created token.
|
| * @param type the token type (not {@code null})
|
| @@ -63,14 +59,14 @@ class Token {
|
| * @param value the lexeme represented by this token (not {@code null})
|
| */
|
| Token.con2(TokenType type2, int offset2, String value2) {
|
| - _jtd_constructor_155_impl(type2, offset2, value2);
|
| + _jtd_constructor_156_impl(type2, offset2, value2);
|
| }
|
| - _jtd_constructor_155_impl(TokenType type2, int offset2, String value2) {
|
| + _jtd_constructor_156_impl(TokenType type2, int offset2, String value2) {
|
| this._type = type2;
|
| this._value = StringUtilities.intern(value2);
|
| this._offset = offset2;
|
| }
|
| -
|
| +
|
| /**
|
| * Return the offset from the beginning of the file to the character after last character of the
|
| * token.
|
| @@ -78,43 +74,43 @@ class Token {
|
| * of the token
|
| */
|
| int get end => _offset + length;
|
| -
|
| +
|
| /**
|
| * Return the number of characters in the node's source range.
|
| * @return the number of characters in the node's source range
|
| */
|
| int get length => lexeme.length;
|
| -
|
| +
|
| /**
|
| * Return the lexeme that represents this token.
|
| * @return the lexeme (not {@code null})
|
| */
|
| String get lexeme => _value;
|
| -
|
| +
|
| /**
|
| * Return the next token in the token stream.
|
| * @return the next token in the token stream
|
| */
|
| Token get next => _next;
|
| -
|
| +
|
| /**
|
| * Return the offset from the beginning of the file to the first character in the token.
|
| * @return the offset from the beginning of the file to the first character in the token
|
| */
|
| int get offset => _offset;
|
| -
|
| +
|
| /**
|
| * Return the previous token in the token stream.
|
| * @return the previous token in the token stream
|
| */
|
| Token get previous => _previous;
|
| -
|
| +
|
| /**
|
| * Answer the token type for the receiver.
|
| * @return the token type (not {@code null})
|
| */
|
| TokenType get type => _type;
|
| -
|
| +
|
| /**
|
| * Return {@code true} if this token is a synthetic token. A synthetic token is a token that was
|
| * introduced by the parser in order to recover from an error in the code. Synthetic tokens always
|
| @@ -122,7 +118,7 @@ class Token {
|
| * @return {@code true} if this token is a synthetic token
|
| */
|
| bool isSynthetic() => length == 0;
|
| -
|
| +
|
| /**
|
| * Set the next token in the token stream to the given token. This has the side-effect of setting
|
| * this token to be the previous token for the given token.
|
| @@ -135,7 +131,7 @@ class Token {
|
| return token;
|
| }
|
| String toString() => lexeme;
|
| -
|
| +
|
| /**
|
| * Set the previous token in the token stream to the given token.
|
| * @param previous the previous token in the token stream
|
| @@ -144,13 +140,12 @@ class Token {
|
| this._previous = previous2;
|
| }
|
| }
|
| -
|
| /**
|
| * Instances of {@code HtmlParseResult} hold the result of parsing an HTML file.
|
| * @coverage dart.engine.html
|
| */
|
| class HtmlParseResult extends HtmlScanResult {
|
| -
|
| +
|
| /**
|
| * The unit containing the parsed information (not {@code null}).
|
| */
|
| @@ -158,14 +153,13 @@ class HtmlParseResult extends HtmlScanResult {
|
| HtmlParseResult(int modificationTime, Token token, List<int> lineStarts, HtmlUnit unit) : super(modificationTime, token, lineStarts) {
|
| this._unit = unit;
|
| }
|
| -
|
| +
|
| /**
|
| * Answer the unit generated by parsing the source
|
| * @return the unit (not {@code null})
|
| */
|
| HtmlUnit get htmlUnit => _unit;
|
| }
|
| -
|
| /**
|
| * Instances of the class {@code RecursiveXmlVisitor} implement an XML visitor that will recursively
|
| * visit all of the nodes in an XML structure. For example, using an instance of this class to visit
|
| @@ -190,31 +184,30 @@ class RecursiveXmlVisitor<R> implements XmlVisitor<R> {
|
| return null;
|
| }
|
| }
|
| -
|
| /**
|
| * The abstract class {@code XmlNode} defines behavior common to all XML/HTML nodes.
|
| * @coverage dart.engine.html
|
| */
|
| abstract class XmlNode {
|
| -
|
| +
|
| /**
|
| * The parent of the node, or {@code null} if the node is the root of an AST structure.
|
| */
|
| XmlNode _parent;
|
| -
|
| +
|
| /**
|
| * Use the given visitor to visit this node.
|
| * @param visitor the visitor that will visit this node
|
| * @return the value returned by the visitor as a result of visiting this node
|
| */
|
| accept(XmlVisitor visitor);
|
| -
|
| +
|
| /**
|
| * Return the first token included in this node's source range.
|
| * @return the first token or {@code null} if none
|
| */
|
| Token get beginToken;
|
| -
|
| +
|
| /**
|
| * Return the offset of the character immediately following the last character of this node's
|
| * source range. This is equivalent to {@code node.getOffset() + node.getLength()}. For an html
|
| @@ -222,13 +215,13 @@ abstract class XmlNode {
|
| * @return the offset of the character just past the node's source range
|
| */
|
| int get end => offset + length;
|
| -
|
| +
|
| /**
|
| * Return the last token included in this node's source range.
|
| * @return the last token or {@code null} if none
|
| */
|
| Token get endToken;
|
| -
|
| +
|
| /**
|
| * Return the number of characters in the node's source range.
|
| * @return the number of characters in the node's source range
|
| @@ -241,7 +234,7 @@ abstract class XmlNode {
|
| }
|
| return endToken2.offset + endToken2.length - beginToken2.offset;
|
| }
|
| -
|
| +
|
| /**
|
| * Return the offset from the beginning of the file to the first character in the node's source
|
| * range.
|
| @@ -255,7 +248,7 @@ abstract class XmlNode {
|
| }
|
| return beginToken.offset;
|
| }
|
| -
|
| +
|
| /**
|
| * Return this node's parent node, or {@code null} if this node is the root of an AST structure.
|
| * <p>
|
| @@ -269,14 +262,14 @@ abstract class XmlNode {
|
| accept(new ToSourceVisitor(writer));
|
| return writer.toString();
|
| }
|
| -
|
| +
|
| /**
|
| * Use the given visitor to visit all of the children of this node. The children will be visited
|
| * in source order.
|
| * @param visitor the visitor that will be used to visit the children of this node
|
| */
|
| void visitChildren(XmlVisitor<Object> visitor);
|
| -
|
| +
|
| /**
|
| * Make this node the parent of the given child nodes.
|
| * @param children the nodes that will become the children of this node
|
| @@ -292,7 +285,7 @@ abstract class XmlNode {
|
| }
|
| return children;
|
| }
|
| -
|
| +
|
| /**
|
| * Make this node the parent of the given child node.
|
| * @param child the node that will become a child of this node
|
| @@ -305,7 +298,7 @@ abstract class XmlNode {
|
| }
|
| return child;
|
| }
|
| -
|
| +
|
| /**
|
| * Set the parent of this node to the given node.
|
| * @param newParent the node that is to be made the parent of this node
|
| @@ -314,7 +307,6 @@ abstract class XmlNode {
|
| _parent = newParent;
|
| }
|
| }
|
| -
|
| /**
|
| * Instances of the class {@code SimpleXmlVisitor} implement an AST visitor that will do nothing
|
| * when visiting an AST node. It is intended to be a superclass for classes that use the visitor
|
| @@ -326,7 +318,6 @@ class SimpleXmlVisitor<R> implements XmlVisitor<R> {
|
| R visitXmlAttributeNode(XmlAttributeNode xmlAttributeNode) => null;
|
| R visitXmlTagNode(XmlTagNode xmlTagNode) => null;
|
| }
|
| -
|
| /**
|
| * The abstract class {@code AbstractScanner} implements a scanner for HTML code. Subclasses are
|
| * required to implement the interface used to access the characters being scanned.
|
| @@ -334,32 +325,32 @@ class SimpleXmlVisitor<R> implements XmlVisitor<R> {
|
| */
|
| abstract class AbstractScanner {
|
| static List<String> _NO_PASS_THROUGH_ELEMENTS = <String> [];
|
| -
|
| +
|
| /**
|
| * The source being scanned.
|
| */
|
| Source _source;
|
| -
|
| +
|
| /**
|
| * The token pointing to the head of the linked list of tokens.
|
| */
|
| Token _tokens;
|
| -
|
| +
|
| /**
|
| * The last token that was scanned.
|
| */
|
| Token _tail;
|
| -
|
| +
|
| /**
|
| * A list containing the offsets of the first character of each line in the source code.
|
| */
|
| List<int> _lineStarts = new List<int>();
|
| -
|
| +
|
| /**
|
| * An array of element tags for which the content between tags should be consider a single token.
|
| */
|
| List<String> _passThroughElements = _NO_PASS_THROUGH_ELEMENTS;
|
| -
|
| +
|
| /**
|
| * Initialize a newly created scanner.
|
| * @param source the source being scanned
|
| @@ -371,13 +362,13 @@ abstract class AbstractScanner {
|
| _tail = _tokens;
|
| recordStartOfLine();
|
| }
|
| -
|
| +
|
| /**
|
| * Return an array containing the offsets of the first character of each line in the source code.
|
| * @return an array containing the offsets of the first character of each line in the source code
|
| */
|
| List<int> get lineStarts => _lineStarts;
|
| -
|
| +
|
| /**
|
| * Return the current offset relative to the beginning of the file. Return the initial offset if
|
| * the scanner has not yet scanned the source code, and one (1) past the end of the source code if
|
| @@ -385,20 +376,20 @@ abstract class AbstractScanner {
|
| * @return the current offset of the scanner in the source
|
| */
|
| int get offset;
|
| -
|
| +
|
| /**
|
| * Answer the source being scanned.
|
| * @return the source or {@code null} if undefined
|
| */
|
| Source get source => _source;
|
| -
|
| +
|
| /**
|
| * Set array of element tags for which the content between tags should be consider a single token.
|
| */
|
| void set passThroughElements(List<String> passThroughElements2) {
|
| this._passThroughElements = passThroughElements2 != null ? passThroughElements2 : _NO_PASS_THROUGH_ELEMENTS;
|
| }
|
| -
|
| +
|
| /**
|
| * Scan the source code to produce a list of tokens representing the source.
|
| * @return the first token in the list of tokens that were produced
|
| @@ -408,13 +399,13 @@ abstract class AbstractScanner {
|
| appendEofToken();
|
| return firstToken();
|
| }
|
| -
|
| +
|
| /**
|
| * Advance the current position and return the character at the new current position.
|
| * @return the character at the new current position
|
| */
|
| int advance();
|
| -
|
| +
|
| /**
|
| * Return the substring of the source code between the start offset and the modified current
|
| * position. The current position is modified by adding the end delta.
|
| @@ -425,13 +416,13 @@ abstract class AbstractScanner {
|
| * @return the specified substring of the source code
|
| */
|
| String getString(int start, int endDelta);
|
| -
|
| +
|
| /**
|
| * Return the character at the current position without changing the current position.
|
| * @return the character at the current position
|
| */
|
| int peek();
|
| -
|
| +
|
| /**
|
| * Record the fact that we are at the beginning of a new line in the source.
|
| */
|
| @@ -601,23 +592,22 @@ abstract class AbstractScanner {
|
| }
|
| }
|
| }
|
| -
|
| /**
|
| * Instances of {@code HtmlScanResult} hold the result of scanning an HTML file.
|
| * @coverage dart.engine.html
|
| */
|
| class HtmlScanResult {
|
| -
|
| +
|
| /**
|
| * The time at which the contents of the source were last set.
|
| */
|
| int _modificationTime = 0;
|
| -
|
| +
|
| /**
|
| * The first token in the token stream (not {@code null}).
|
| */
|
| Token _token;
|
| -
|
| +
|
| /**
|
| * The line start information that was produced.
|
| */
|
| @@ -627,48 +617,47 @@ class HtmlScanResult {
|
| this._token = token;
|
| this._lineStarts = lineStarts;
|
| }
|
| -
|
| +
|
| /**
|
| * Answer the line start information that was produced.
|
| * @return an array of line starts (not {@code null})
|
| */
|
| List<int> get lineStarts => _lineStarts;
|
| -
|
| +
|
| /**
|
| * Return the time at which the contents of the source were last set.
|
| * @return the time at which the contents of the source were last set
|
| */
|
| int get modificationTime => _modificationTime;
|
| -
|
| +
|
| /**
|
| * Answer the first token in the token stream.
|
| * @return the token (not {@code null})
|
| */
|
| Token get token => _token;
|
| }
|
| -
|
| /**
|
| * Instances of the class {@code StringScanner} implement a scanner that reads from a string. The
|
| * scanning logic is in the superclass.
|
| * @coverage dart.engine.html
|
| */
|
| class StringScanner extends AbstractScanner {
|
| -
|
| +
|
| /**
|
| * The string from which characters will be read.
|
| */
|
| String _string;
|
| -
|
| +
|
| /**
|
| * The number of characters in the string.
|
| */
|
| int _stringLength = 0;
|
| -
|
| +
|
| /**
|
| * The index, relative to the string, of the last character that was read.
|
| */
|
| int _charOffset = 0;
|
| -
|
| +
|
| /**
|
| * Initialize a newly created scanner to scan the characters in the given string.
|
| * @param source the source being scanned
|
| @@ -698,29 +687,28 @@ class StringScanner extends AbstractScanner {
|
| return -1;
|
| }
|
| }
|
| -
|
| /**
|
| * Instances of the class {@code CharBufferScanner} implement a scanner that reads from a character
|
| * buffer. The scanning logic is in the superclass.
|
| * @coverage dart.engine.html
|
| */
|
| class CharBufferScanner extends AbstractScanner {
|
| -
|
| +
|
| /**
|
| * The buffer from which characters will be read.
|
| */
|
| CharSequence _buffer;
|
| -
|
| +
|
| /**
|
| * The number of characters in the buffer.
|
| */
|
| int _bufferLength = 0;
|
| -
|
| +
|
| /**
|
| * The index of the last character that was read.
|
| */
|
| int _charOffset = 0;
|
| -
|
| +
|
| /**
|
| * Initialize a newly created scanner to scan the characters in the given character buffer.
|
| * @param source the source being scanned
|
| @@ -747,19 +735,18 @@ class CharBufferScanner extends AbstractScanner {
|
| return -1;
|
| }
|
| }
|
| -
|
| /**
|
| * Instances of the class {@code ToSourceVisitor} write a source representation of a visited XML
|
| * node (and all of it's children) to a writer.
|
| * @coverage dart.engine.html
|
| */
|
| class ToSourceVisitor implements XmlVisitor<Object> {
|
| -
|
| +
|
| /**
|
| * The writer to which the source is to be written.
|
| */
|
| PrintWriter _writer;
|
| -
|
| +
|
| /**
|
| * Initialize a newly created visitor to write source code representing the visited nodes to the
|
| * given writer.
|
| @@ -809,7 +796,7 @@ class ToSourceVisitor implements XmlVisitor<Object> {
|
| }
|
| return null;
|
| }
|
| -
|
| +
|
| /**
|
| * Safely visit the given node.
|
| * @param node the node to be visited
|
| @@ -820,14 +807,13 @@ class ToSourceVisitor implements XmlVisitor<Object> {
|
| }
|
| }
|
| }
|
| -
|
| /**
|
| * The enumeration {@code TokenType} defines the types of tokens that can be returned by the
|
| * scanner.
|
| * @coverage dart.engine.html
|
| */
|
| class TokenType implements Comparable<TokenType> {
|
| -
|
| +
|
| /**
|
| * The type of the token that marks the end of the input.
|
| */
|
| @@ -844,13 +830,13 @@ class TokenType implements Comparable<TokenType> {
|
| static final TokenType TAG = new TokenType('TAG', 10, null);
|
| static final TokenType TEXT = new TokenType('TEXT', 11, null);
|
| static final List<TokenType> values = [EOF, EQ, GT, LT_SLASH, LT, SLASH_GT, COMMENT, DECLARATION, DIRECTIVE, STRING, TAG, TEXT];
|
| -
|
| +
|
| /// The name of this enum constant, as declared in the enum declaration.
|
| final String name;
|
| -
|
| +
|
| /// The position in the enum declaration.
|
| final int ordinal;
|
| -
|
| +
|
| /**
|
| * The lexeme that defines this type of token, or {@code null} if there is more than one possible
|
| * lexeme for this type of token.
|
| @@ -859,7 +845,7 @@ class TokenType implements Comparable<TokenType> {
|
| TokenType(this.name, this.ordinal, String lexeme) {
|
| this._lexeme = lexeme;
|
| }
|
| -
|
| +
|
| /**
|
| * Return the lexeme that defines this type of token, or {@code null} if there is more than one
|
| * possible lexeme for this type of token.
|
| @@ -873,7 +859,6 @@ class TokenType_EOF extends TokenType {
|
| TokenType_EOF(String name, int ordinal, String arg0) : super(name, ordinal, arg0);
|
| String toString() => "-eof-";
|
| }
|
| -
|
| /**
|
| * Instances of {@code XmlAttributeNode} represent name/value pairs owned by an {@link XmlTagNode}.
|
| * @coverage dart.engine.html
|
| @@ -882,7 +867,7 @@ class XmlAttributeNode extends XmlNode {
|
| Token _name;
|
| Token _equals;
|
| Token _value;
|
| -
|
| +
|
| /**
|
| * Construct a new instance representing an XML attribute.
|
| * @param name the name token (not {@code null}). This may be a zero length token if the attribute
|
| @@ -898,19 +883,19 @@ class XmlAttributeNode extends XmlNode {
|
| accept(XmlVisitor visitor) => visitor.visitXmlAttributeNode(this);
|
| Token get beginToken => _name;
|
| Token get endToken => _value;
|
| -
|
| +
|
| /**
|
| * Answer the equals sign token that appears between the name and value tokens. This may be{@code null} if the attribute is badly formed.
|
| * @return the token or {@code null} if there is no equals sign between the name and value
|
| */
|
| Token get equals => _equals;
|
| -
|
| +
|
| /**
|
| * Answer the attribute name. This may be a zero length token if the attribute is badly formed.
|
| * @return the name (not {@code null})
|
| */
|
| Token get name => _name;
|
| -
|
| +
|
| /**
|
| * Answer the lexeme for the value token without the leading and trailing quotes.
|
| * @return the text or {@code null} if the value is not specified
|
| @@ -938,7 +923,7 @@ class XmlAttributeNode extends XmlNode {
|
| }
|
| return text;
|
| }
|
| -
|
| +
|
| /**
|
| * Answer the attribute value. A properly formed value will start and end with matching quote
|
| * characters, but the value returned may not be properly formed.
|
| @@ -948,7 +933,6 @@ class XmlAttributeNode extends XmlNode {
|
| void visitChildren(XmlVisitor<Object> visitor) {
|
| }
|
| }
|
| -
|
| /**
|
| * The interface {@code XmlVisitor} defines the behavior of objects that can be used to visit an{@link XmlNode} structure.
|
| * @coverage dart.engine.html
|
| @@ -958,7 +942,6 @@ abstract class XmlVisitor<R> {
|
| R visitXmlAttributeNode(XmlAttributeNode xmlAttributeNode);
|
| R visitXmlTagNode(XmlTagNode xmlTagNode);
|
| }
|
| -
|
| /**
|
| * Instances of {@code HtmlScanner} receive and scan HTML content from a {@link Source}.<br/>
|
| * For example, the following code scans HTML source and returns the result:
|
| @@ -971,27 +954,27 @@ abstract class XmlVisitor<R> {
|
| */
|
| class HtmlScanner implements Source_ContentReceiver {
|
| List<String> _SCRIPT_TAG = <String> ["script"];
|
| -
|
| +
|
| /**
|
| * The source being scanned (not {@code null})
|
| */
|
| Source _source;
|
| -
|
| +
|
| /**
|
| * The time at which the contents of the source were last set.
|
| */
|
| int _modificationTime = 0;
|
| -
|
| +
|
| /**
|
| * The scanner used to scan the source
|
| */
|
| AbstractScanner _scanner;
|
| -
|
| +
|
| /**
|
| * The first token in the token stream.
|
| */
|
| Token _token;
|
| -
|
| +
|
| /**
|
| * Construct a new instance to scan the specified source.
|
| * @param source the source to be scanned (not {@code null})
|
| @@ -1011,31 +994,30 @@ class HtmlScanner implements Source_ContentReceiver {
|
| _scanner.passThroughElements = _SCRIPT_TAG;
|
| _token = _scanner.tokenize();
|
| }
|
| -
|
| +
|
| /**
|
| * Answer the result of scanning the source
|
| * @return the result (not {@code null})
|
| */
|
| HtmlScanResult get result => new HtmlScanResult(_modificationTime, _token, _scanner.lineStarts);
|
| }
|
| -
|
| /**
|
| * Instances of the class {@code XmlParser} are used to parse tokens into a AST structure comprised
|
| * of {@link XmlNode}s.
|
| * @coverage dart.engine.html
|
| */
|
| class XmlParser {
|
| -
|
| +
|
| /**
|
| * The source being parsed.
|
| */
|
| Source _source;
|
| -
|
| +
|
| /**
|
| * The next token to be parsed.
|
| */
|
| Token _currentToken;
|
| -
|
| +
|
| /**
|
| * Construct a parser for the specified source.
|
| * @param source the source being parsed
|
| @@ -1043,13 +1025,13 @@ class XmlParser {
|
| XmlParser(Source source) {
|
| this._source = source;
|
| }
|
| -
|
| +
|
| /**
|
| * Answer the source being parsed.
|
| * @return the source
|
| */
|
| Source get source => _source;
|
| -
|
| +
|
| /**
|
| * Answer {@code true} if the specified tag is self closing and thus should never have content or
|
| * child tag nodes.
|
| @@ -1057,7 +1039,7 @@ class XmlParser {
|
| * @return {@code true} if self closing
|
| */
|
| bool isSelfClosing(Token tag) => false;
|
| -
|
| +
|
| /**
|
| * Parse the entire token stream and in the process, advance the current token to the end of the
|
| * token stream.
|
| @@ -1082,13 +1064,13 @@ class XmlParser {
|
| }
|
| }
|
| }
|
| -
|
| +
|
| /**
|
| * Answer the current token.
|
| * @return the current token
|
| */
|
| Token get currentToken => _currentToken;
|
| -
|
| +
|
| /**
|
| * Insert a synthetic token of the specified type before the current token
|
| * @param type the type of token to be inserted (not {@code null})
|
| @@ -1100,7 +1082,7 @@ class XmlParser {
|
| token.setNext(_currentToken);
|
| return token;
|
| }
|
| -
|
| +
|
| /**
|
| * Parse the token stream for an attribute. This method advances the current token over the
|
| * attribute, but should not be called if the {@link #currentToken} is not {@link TokenType#TAG}.
|
| @@ -1127,7 +1109,7 @@ class XmlParser {
|
| }
|
| return new XmlAttributeNode(name, equals, value);
|
| }
|
| -
|
| +
|
| /**
|
| * Parse the stream for a sequence of attributes. This method advances the current token to the
|
| * next {@link TokenType#GT}, {@link TokenType#SLASH_GT}, or {@link TokenType#EOF}.
|
| @@ -1153,7 +1135,7 @@ class XmlParser {
|
| }
|
| }
|
| }
|
| -
|
| +
|
| /**
|
| * Parse the stream for a sequence of tag nodes existing within a parent tag node. This method
|
| * advances the current token to the next {@link TokenType#LT_SLASH} or {@link TokenType#EOF}.
|
| @@ -1181,7 +1163,7 @@ class XmlParser {
|
| }
|
| }
|
| }
|
| -
|
| +
|
| /**
|
| * Parse the token stream for the next tag node. This method advances current token over the
|
| * parsed tag node, but should only be called if the current token is {@link TokenType#LT}
|
| @@ -1237,55 +1219,54 @@ class XmlParser {
|
| }
|
| return new XmlTagNode(nodeStart, tag, attributes, attributeEnd, tagNodes, contentEnd, closingTag, nodeEnd);
|
| }
|
| -
|
| +
|
| /**
|
| * Report the current token as unexpected
|
| */
|
| void reportUnexpectedToken() {
|
| }
|
| }
|
| -
|
| /**
|
| * Instances of {@code XmlTagNode} represent XML or HTML elements such as {@code <p>} and{@code <body foo="bar"> ... </body>}.
|
| * @coverage dart.engine.html
|
| */
|
| class XmlTagNode extends XmlNode {
|
| -
|
| +
|
| /**
|
| * Constant representing empty list of attributes.
|
| */
|
| static List<XmlAttributeNode> NO_ATTRIBUTES = new UnmodifiableListView(new List<XmlAttributeNode>());
|
| -
|
| +
|
| /**
|
| * Constant representing empty list of tag nodes.
|
| */
|
| static List<XmlTagNode> NO_TAG_NODES = new UnmodifiableListView(new List<XmlTagNode>());
|
| -
|
| +
|
| /**
|
| * The starting {@link TokenType#LT} token (not {@code null}).
|
| */
|
| Token _nodeStart;
|
| -
|
| +
|
| /**
|
| * The {@link TokenType#TAG} token after the starting '<' (not {@code null}).
|
| */
|
| Token _tag;
|
| -
|
| +
|
| /**
|
| * The attributes contained by the receiver (not {@code null}, contains no {@code null}s).
|
| */
|
| List<XmlAttributeNode> _attributes;
|
| -
|
| +
|
| /**
|
| * The {@link TokenType#GT} or {@link TokenType#SLASH_GT} token after the attributes (not{@code null}). The token may be the same token as {@link #nodeEnd} if there are no child{@link #tagNodes}.
|
| */
|
| Token _attributeEnd;
|
| -
|
| +
|
| /**
|
| * The tag nodes contained in the receiver (not {@code null}, contains no {@code null}s).
|
| */
|
| List<XmlTagNode> _tagNodes;
|
| -
|
| +
|
| /**
|
| * The token (not {@code null}) after the content, which may be
|
| * <ul>
|
| @@ -1298,18 +1279,18 @@ class XmlTagNode extends XmlNode {
|
| * </ul>
|
| */
|
| Token _contentEnd;
|
| -
|
| +
|
| /**
|
| * The closing {@link TokenType#TAG} after the child elements or {@code null} if there is no
|
| * content and the attributes ended with {@link TokenType#SLASH_GT}
|
| */
|
| Token _closingTag;
|
| -
|
| +
|
| /**
|
| * The ending {@link TokenType#GT} or {@link TokenType#SLASH_GT} token (not {@code null}).
|
| */
|
| Token _nodeEnd;
|
| -
|
| +
|
| /**
|
| * Construct a new instance representing an XML or HTML element
|
| * @param nodeStart the starting {@link TokenType#LT} token (not {@code null})
|
| @@ -1343,7 +1324,7 @@ class XmlTagNode extends XmlNode {
|
| this._nodeEnd = nodeEnd;
|
| }
|
| accept(XmlVisitor visitor) => visitor.visitXmlTagNode(this);
|
| -
|
| +
|
| /**
|
| * Answer the attribute with the specified name.
|
| * @param name the attribute name
|
| @@ -1357,20 +1338,20 @@ class XmlTagNode extends XmlNode {
|
| }
|
| return null;
|
| }
|
| -
|
| +
|
| /**
|
| * The {@link TokenType#GT} or {@link TokenType#SLASH_GT} token after the attributes (not{@code null}). The token may be the same token as {@link #nodeEnd} if there are no child{@link #tagNodes}.
|
| * @return the token (not {@code null})
|
| */
|
| Token get attributeEnd => _attributeEnd;
|
| -
|
| +
|
| /**
|
| * Answer the receiver's attributes. Callers should not manipulate the returned list to edit the
|
| * AST structure.
|
| * @return the attributes (not {@code null}, contains no {@code null}s)
|
| */
|
| List<XmlAttributeNode> get attributes => _attributes;
|
| -
|
| +
|
| /**
|
| * Find the attribute with the given name (see {@link #getAttribute(String)} and answer the lexeme
|
| * for the attribute's value token without the leading and trailing quotes (see{@link XmlAttributeNode#getText()}).
|
| @@ -1382,14 +1363,14 @@ class XmlTagNode extends XmlNode {
|
| return attribute != null ? attribute.text : null;
|
| }
|
| Token get beginToken => _nodeStart;
|
| -
|
| +
|
| /**
|
| * The the closing {@link TokenType#TAG} after the child elements or {@code null} if there is no
|
| * content and the attributes ended with {@link TokenType#SLASH_GT}
|
| * @return the closing tag or {@code null}
|
| */
|
| Token get closingTag => _closingTag;
|
| -
|
| +
|
| /**
|
| * Answer a string representing the content contained in the receiver. This includes the textual
|
| * representation of any child tag nodes ({@link #getTagNodes()}). Whitespace between '<',
|
| @@ -1413,7 +1394,7 @@ class XmlTagNode extends XmlNode {
|
| }
|
| return buffer.toString();
|
| }
|
| -
|
| +
|
| /**
|
| * Answer the token (not {@code null}) after the content, which may be
|
| * <ul>
|
| @@ -1448,25 +1429,25 @@ class XmlTagNode extends XmlNode {
|
| }
|
| return _tag;
|
| }
|
| -
|
| +
|
| /**
|
| * Answer the ending {@link TokenType#GT} or {@link TokenType#SLASH_GT} token.
|
| * @return the token (not {@code null})
|
| */
|
| Token get nodeEnd => _nodeEnd;
|
| -
|
| +
|
| /**
|
| * Answer the starting {@link TokenType#LT} token.
|
| * @return the token (not {@code null})
|
| */
|
| Token get nodeStart => _nodeStart;
|
| -
|
| +
|
| /**
|
| * Answer the {@link TokenType#TAG} token after the starting '<'.
|
| * @return the token (not {@code null})
|
| */
|
| Token get tag => _tag;
|
| -
|
| +
|
| /**
|
| * Answer the tag nodes contained in the receiver. Callers should not manipulate the returned list
|
| * to edit the AST structure.
|
| @@ -1481,7 +1462,7 @@ class XmlTagNode extends XmlNode {
|
| node.accept(visitor);
|
| }
|
| }
|
| -
|
| +
|
| /**
|
| * Same as {@link #becomeParentOf(List)}, but returns given "ifEmpty" if "children" is empty
|
| */
|
| @@ -1492,7 +1473,6 @@ class XmlTagNode extends XmlNode {
|
| return becomeParentOf(children);
|
| }
|
| }
|
| -
|
| /**
|
| * Instances of the class {@code HtmlParser} are used to parse tokens into a AST structure comprised
|
| * of {@link XmlNode}s.
|
| @@ -1500,14 +1480,14 @@ class XmlTagNode extends XmlNode {
|
| */
|
| class HtmlParser extends XmlParser {
|
| static Set<String> SELF_CLOSING = new Set<String>();
|
| -
|
| +
|
| /**
|
| * Construct a parser for the specified source.
|
| * @param source the source being parsed
|
| */
|
| HtmlParser(Source source) : super(source) {
|
| }
|
| -
|
| +
|
| /**
|
| * Parse the tokens specified by the given scan result.
|
| * @param scanResult the result of scanning an HTML source (not {@code null})
|
| @@ -1519,7 +1499,7 @@ class HtmlParser extends XmlParser {
|
| HtmlUnit unit = new HtmlUnit(firstToken, tagNodes, currentToken);
|
| return new HtmlParseResult(scanResult.modificationTime, firstToken, scanResult.lineStarts, unit);
|
| }
|
| -
|
| +
|
| /**
|
| * Scan then parse the specified source.
|
| * @param source the source to be scanned and parsed (not {@code null})
|
| @@ -1532,34 +1512,33 @@ class HtmlParser extends XmlParser {
|
| }
|
| bool isSelfClosing(Token tag) => SELF_CLOSING.contains(tag.lexeme);
|
| }
|
| -
|
| /**
|
| * Instances of the class {@code HtmlUnit} represent the contents of an HTML file.
|
| * @coverage dart.engine.html
|
| */
|
| class HtmlUnit extends XmlNode {
|
| -
|
| +
|
| /**
|
| * The first token in the token stream that was parsed to form this HTML unit.
|
| */
|
| Token _beginToken;
|
| -
|
| +
|
| /**
|
| * The last token in the token stream that was parsed to form this compilation unit. This token
|
| * should always have a type of {@link TokenType.EOF}.
|
| */
|
| Token _endToken;
|
| -
|
| +
|
| /**
|
| * The tag nodes contained in the receiver (not {@code null}, contains no {@code null}s).
|
| */
|
| List<XmlTagNode> _tagNodes;
|
| -
|
| +
|
| /**
|
| * The element associated with this HTML unit or {@code null} if the receiver is not resolved.
|
| */
|
| HtmlElementImpl _element;
|
| -
|
| +
|
| /**
|
| * Construct a new instance representing the content of an HTML file.
|
| * @param beginToken the first token in the file (not {@code null})
|
| @@ -1573,21 +1552,21 @@ class HtmlUnit extends XmlNode {
|
| }
|
| accept(XmlVisitor visitor) => visitor.visitHtmlUnit(this);
|
| Token get beginToken => _beginToken;
|
| -
|
| +
|
| /**
|
| * Return the element associated with this HTML unit.
|
| * @return the element or {@code null} if the receiver is not resolved
|
| */
|
| HtmlElementImpl get element => _element;
|
| Token get endToken => _endToken;
|
| -
|
| +
|
| /**
|
| * Answer the tag nodes contained in the receiver. Callers should not manipulate the returned list
|
| * to edit the AST structure.
|
| * @return the children (not {@code null}, contains no {@code null}s)
|
| */
|
| List<XmlTagNode> get tagNodes => _tagNodes;
|
| -
|
| +
|
| /**
|
| * Set the element associated with this HTML unit.
|
| * @param element the element
|
|
|