Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: pkg/analyzer/lib/src/generated/html.dart

Issue 708263002: Clean up references in comments (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.html; 8 library engine.html;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after
1652 */ 1652 */
1653 Token _insertSyntheticToken(TokenType type) { 1653 Token _insertSyntheticToken(TokenType type) {
1654 Token token = new Token.con2(type, _currentToken.offset, ""); 1654 Token token = new Token.con2(type, _currentToken.offset, "");
1655 _currentToken.previous.setNext(token); 1655 _currentToken.previous.setNext(token);
1656 token.setNext(_currentToken); 1656 token.setNext(_currentToken);
1657 return token; 1657 return token;
1658 } 1658 }
1659 1659
1660 /** 1660 /**
1661 * Parse the token stream for an attribute. This method advances the current t oken over the 1661 * Parse the token stream for an attribute. This method advances the current t oken over the
1662 * attribute, but should not be called if the [currentToken] is not [TokenType #TAG]. 1662 * attribute, but should not be called if the [currentToken] is not [TokenType .TAG].
1663 * 1663 *
1664 * @return the attribute (not `null`) 1664 * @return the attribute (not `null`)
1665 */ 1665 */
1666 XmlAttributeNode _parseAttribute() { 1666 XmlAttributeNode _parseAttribute() {
1667 // Assume the current token is a tag 1667 // Assume the current token is a tag
1668 Token name = _currentToken; 1668 Token name = _currentToken;
1669 _currentToken = _currentToken.next; 1669 _currentToken = _currentToken.next;
1670 // Equals sign 1670 // Equals sign
1671 Token equals; 1671 Token equals;
1672 if (_currentToken.type == TokenType.EQ) { 1672 if (_currentToken.type == TokenType.EQ) {
(...skipping 10 matching lines...) Expand all
1683 _currentToken = _currentToken.next; 1683 _currentToken = _currentToken.next;
1684 } else { 1684 } else {
1685 _reportUnexpectedToken(); 1685 _reportUnexpectedToken();
1686 value = _insertSyntheticToken(TokenType.STRING); 1686 value = _insertSyntheticToken(TokenType.STRING);
1687 } 1687 }
1688 return createAttributeNode(name, equals, value); 1688 return createAttributeNode(name, equals, value);
1689 } 1689 }
1690 1690
1691 /** 1691 /**
1692 * Parse the stream for a sequence of attributes. This method advances the cur rent token to the 1692 * Parse the stream for a sequence of attributes. This method advances the cur rent token to the
1693 * next [TokenType#GT], [TokenType#SLASH_GT], or [TokenType#EOF]. 1693 * next [TokenType.GT], [TokenType.SLASH_GT], or [TokenType.EOF].
1694 * 1694 *
1695 * @return a collection of zero or more attributes (not `null`, contains no `n ull`s) 1695 * @return a collection of zero or more attributes (not `null`, contains no `n ull`s)
1696 */ 1696 */
1697 List<XmlAttributeNode> _parseAttributes() { 1697 List<XmlAttributeNode> _parseAttributes() {
1698 TokenType type = _currentToken.type; 1698 TokenType type = _currentToken.type;
1699 if (type == TokenType.GT || type == TokenType.SLASH_GT || type == TokenType. EOF) { 1699 if (type == TokenType.GT || type == TokenType.SLASH_GT || type == TokenType. EOF) {
1700 return XmlTagNode.NO_ATTRIBUTES; 1700 return XmlTagNode.NO_ATTRIBUTES;
1701 } 1701 }
1702 List<XmlAttributeNode> attributes = new List<XmlAttributeNode>(); 1702 List<XmlAttributeNode> attributes = new List<XmlAttributeNode>();
1703 while (type != TokenType.GT && type != TokenType.SLASH_GT && type != TokenTy pe.EOF) { 1703 while (type != TokenType.GT && type != TokenType.SLASH_GT && type != TokenTy pe.EOF) {
1704 if (type == TokenType.TAG) { 1704 if (type == TokenType.TAG) {
1705 attributes.add(_parseAttribute()); 1705 attributes.add(_parseAttribute());
1706 } else { 1706 } else {
1707 _reportUnexpectedToken(); 1707 _reportUnexpectedToken();
1708 _currentToken = _currentToken.next; 1708 _currentToken = _currentToken.next;
1709 } 1709 }
1710 type = _currentToken.type; 1710 type = _currentToken.type;
1711 } 1711 }
1712 return attributes; 1712 return attributes;
1713 } 1713 }
1714 1714
1715 /** 1715 /**
1716 * Parse the stream for a sequence of tag nodes existing within a parent tag n ode. This method 1716 * Parse the stream for a sequence of tag nodes existing within a parent tag n ode. This method
1717 * advances the current token to the next [TokenType#LT_SLASH] or [TokenType#E OF]. 1717 * advances the current token to the next [TokenType.LT_SLASH] or [TokenType.E OF].
1718 * 1718 *
1719 * @return a list of nodes (not `null`, contains no `null`s) 1719 * @return a list of nodes (not `null`, contains no `null`s)
1720 */ 1720 */
1721 List<XmlTagNode> _parseChildTagNodes() { 1721 List<XmlTagNode> _parseChildTagNodes() {
1722 TokenType type = _currentToken.type; 1722 TokenType type = _currentToken.type;
1723 if (type == TokenType.LT_SLASH || type == TokenType.EOF) { 1723 if (type == TokenType.LT_SLASH || type == TokenType.EOF) {
1724 return XmlTagNode.NO_TAG_NODES; 1724 return XmlTagNode.NO_TAG_NODES;
1725 } 1725 }
1726 List<XmlTagNode> nodes = new List<XmlTagNode>(); 1726 List<XmlTagNode> nodes = new List<XmlTagNode>();
1727 while (type != TokenType.LT_SLASH && type != TokenType.EOF) { 1727 while (type != TokenType.LT_SLASH && type != TokenType.EOF) {
1728 if (type == TokenType.LT) { 1728 if (type == TokenType.LT) {
1729 nodes.add(_parseTagNode()); 1729 nodes.add(_parseTagNode());
1730 } else if (type == TokenType.COMMENT) { 1730 } else if (type == TokenType.COMMENT) {
1731 // ignored token 1731 // ignored token
1732 _currentToken = _currentToken.next; 1732 _currentToken = _currentToken.next;
1733 } else { 1733 } else {
1734 _reportUnexpectedToken(); 1734 _reportUnexpectedToken();
1735 _currentToken = _currentToken.next; 1735 _currentToken = _currentToken.next;
1736 } 1736 }
1737 type = _currentToken.type; 1737 type = _currentToken.type;
1738 } 1738 }
1739 return nodes; 1739 return nodes;
1740 } 1740 }
1741 1741
1742 /** 1742 /**
1743 * Parse the token stream for the next tag node. This method advances current token over the 1743 * Parse the token stream for the next tag node. This method advances current token over the
1744 * parsed tag node, but should only be called if the current token is [TokenTy pe#LT] 1744 * parsed tag node, but should only be called if the current token is [TokenTy pe.LT]
1745 * 1745 *
1746 * @return the tag node or `null` if none found 1746 * @return the tag node or `null` if none found
1747 */ 1747 */
1748 XmlTagNode _parseTagNode() { 1748 XmlTagNode _parseTagNode() {
1749 // Assume that the current node is a tag node start TokenType#LT 1749 // Assume that the current node is a tag node start TokenType.LT
1750 Token nodeStart = _currentToken; 1750 Token nodeStart = _currentToken;
1751 _currentToken = _currentToken.next; 1751 _currentToken = _currentToken.next;
1752 // Get the tag or create a synthetic tag and report an error 1752 // Get the tag or create a synthetic tag and report an error
1753 Token tag; 1753 Token tag;
1754 if (_currentToken.type == TokenType.TAG) { 1754 if (_currentToken.type == TokenType.TAG) {
1755 tag = _currentToken; 1755 tag = _currentToken;
1756 _currentToken = _currentToken.next; 1756 _currentToken = _currentToken.next;
1757 } else { 1757 } else {
1758 _reportUnexpectedToken(); 1758 _reportUnexpectedToken();
1759 tag = _insertSyntheticToken(TokenType.TAG); 1759 tag = _insertSyntheticToken(TokenType.TAG);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1824 * Constant representing empty list of attributes. 1824 * Constant representing empty list of attributes.
1825 */ 1825 */
1826 static List<XmlAttributeNode> NO_ATTRIBUTES = new UnmodifiableListView(new Lis t<XmlAttributeNode>()); 1826 static List<XmlAttributeNode> NO_ATTRIBUTES = new UnmodifiableListView(new Lis t<XmlAttributeNode>());
1827 1827
1828 /** 1828 /**
1829 * Constant representing empty list of tag nodes. 1829 * Constant representing empty list of tag nodes.
1830 */ 1830 */
1831 static List<XmlTagNode> NO_TAG_NODES = new UnmodifiableListView(new List<XmlTa gNode>()); 1831 static List<XmlTagNode> NO_TAG_NODES = new UnmodifiableListView(new List<XmlTa gNode>());
1832 1832
1833 /** 1833 /**
1834 * The starting [TokenType#LT] token (not `null`). 1834 * The starting [TokenType.LT] token (not `null`).
1835 */ 1835 */
1836 final Token nodeStart; 1836 final Token nodeStart;
1837 1837
1838 /** 1838 /**
1839 * The [TokenType#TAG] token after the starting '&lt;' (not `null`). 1839 * The [TokenType.TAG] token after the starting '&lt;' (not `null`).
1840 */ 1840 */
1841 final Token _tag; 1841 final Token _tag;
1842 1842
1843 /** 1843 /**
1844 * The attributes contained by the receiver (not `null`, contains no `null`s). 1844 * The attributes contained by the receiver (not `null`, contains no `null`s).
1845 */ 1845 */
1846 List<XmlAttributeNode> _attributes; 1846 List<XmlAttributeNode> _attributes;
1847 1847
1848 /** 1848 /**
1849 * The [TokenType#GT] or [TokenType#SLASH_GT] token after the attributes (not 1849 * The [TokenType.GT] or [TokenType.SLASH_GT] token after the attributes (not
1850 * `null`). The token may be the same token as [nodeEnd] if there are no child 1850 * `null`). The token may be the same token as [nodeEnd] if there are no child
1851 * [tagNodes]. 1851 * [tagNodes].
1852 */ 1852 */
1853 final Token attributeEnd; 1853 final Token attributeEnd;
1854 1854
1855 /** 1855 /**
1856 * The tag nodes contained in the receiver (not `null`, contains no `null`s). 1856 * The tag nodes contained in the receiver (not `null`, contains no `null`s).
1857 */ 1857 */
1858 List<XmlTagNode> _tagNodes; 1858 List<XmlTagNode> _tagNodes;
1859 1859
1860 /** 1860 /**
1861 * The token (not `null`) after the content, which may be 1861 * The token (not `null`) after the content, which may be
1862 * * (1) [TokenType#LT_SLASH] for nodes with open and close tags, or 1862 * * (1) [TokenType.LT_SLASH] for nodes with open and close tags, or
1863 * * (2) the [TokenType#LT] nodeStart of the next sibling node if this node is self 1863 * * (2) the [TokenType.LT] nodeStart of the next sibling node if this node is self
1864 * closing or the attributeEnd is [TokenType#SLASH_GT], or 1864 * closing or the attributeEnd is [TokenType.SLASH_GT], or
1865 * * (3) [TokenType#EOF] if the node does not have a closing tag and is the la st node in 1865 * * (3) [TokenType.EOF] if the node does not have a closing tag and is the la st node in
1866 * the stream [TokenType#LT_SLASH] token after the content, or `null` if there is no 1866 * the stream [TokenType.LT_SLASH] token after the content, or `null` if there is no
1867 * content and the attributes ended with [TokenType#SLASH_GT]. 1867 * content and the attributes ended with [TokenType.SLASH_GT].
1868 */ 1868 */
1869 final Token contentEnd; 1869 final Token contentEnd;
1870 1870
1871 /** 1871 /**
1872 * The closing [TokenType#TAG] after the child elements or `null` if there is no 1872 * The closing [TokenType.TAG] after the child elements or `null` if there is no
1873 * content and the attributes ended with [TokenType#SLASH_GT] 1873 * content and the attributes ended with [TokenType.SLASH_GT]
1874 */ 1874 */
1875 final Token closingTag; 1875 final Token closingTag;
1876 1876
1877 /** 1877 /**
1878 * The ending [TokenType#GT] or [TokenType#SLASH_GT] token (not `null`). 1878 * The ending [TokenType.GT] or [TokenType.SLASH_GT] token (not `null`).
1879 */ 1879 */
1880 final Token nodeEnd; 1880 final Token nodeEnd;
1881 1881
1882 /** 1882 /**
1883 * The expressions that are embedded in the tag's content. 1883 * The expressions that are embedded in the tag's content.
1884 */ 1884 */
1885 List<XmlExpression> expressions = XmlExpression.EMPTY_ARRAY; 1885 List<XmlExpression> expressions = XmlExpression.EMPTY_ARRAY;
1886 1886
1887 /** 1887 /**
1888 * Construct a new instance representing an XML or HTML element 1888 * Construct a new instance representing an XML or HTML element
1889 * 1889 *
1890 * @param nodeStart the starting [TokenType#LT] token (not `null`) 1890 * @param nodeStart the starting [TokenType.LT] token (not `null`)
1891 * @param tag the [TokenType#TAG] token after the starting '&lt;' (not `null`) . 1891 * @param tag the [TokenType.TAG] token after the starting '&lt;' (not `null`) .
1892 * @param attributes the attributes associated with this element or [NO_ATTRIB UTES] (not 1892 * @param attributes the attributes associated with this element or [NO_ATTRIB UTES] (not
1893 * `null`, contains no `null`s) 1893 * `null`, contains no `null`s)
1894 * @param attributeEnd The [TokenType#GT] or [TokenType#SLASH_GT] token after the 1894 * @param attributeEnd The [TokenType.GT] or [TokenType.SLASH_GT] token after the
1895 * attributes (not `null`). The token may be the same token as [nodeE nd] if 1895 * attributes (not `null`). The token may be the same token as [nodeE nd] if
1896 * there are no child [tagNodes]. 1896 * there are no child [tagNodes].
1897 * @param tagNodes child tag nodes of the receiver or [NO_TAG_NODES] (not `nul l`, 1897 * @param tagNodes child tag nodes of the receiver or [NO_TAG_NODES] (not `nul l`,
1898 * contains no `null`s) 1898 * contains no `null`s)
1899 * @param contentEnd the token (not `null`) after the content, which may be 1899 * @param contentEnd the token (not `null`) after the content, which may be
1900 * * (1) [TokenType#LT_SLASH] for nodes with open and close tags, or 1900 * * (1) [TokenType.LT_SLASH] for nodes with open and close tags, or
1901 * * (2) the [TokenType#LT] nodeStart of the next sibling node if thi s node is 1901 * * (2) the [TokenType.LT] nodeStart of the next sibling node if thi s node is
1902 * self closing or the attributeEnd is [TokenType#SLASH_GT], or 1902 * self closing or the attributeEnd is [TokenType.SLASH_GT], or
1903 * * (3) [TokenType#EOF] if the node does not have a closing tag and is the last 1903 * * (3) [TokenType.EOF] if the node does not have a closing tag and is the last
1904 * node in the stream [TokenType#LT_SLASH] token after the content, o r `null` 1904 * node in the stream [TokenType.LT_SLASH] token after the content, o r `null`
1905 * if there is no content and the attributes ended with [TokenType#SL ASH_GT]. 1905 * if there is no content and the attributes ended with [TokenType.SL ASH_GT].
1906 * @param closingTag the closing [TokenType#TAG] after the child elements or ` null` if 1906 * @param closingTag the closing [TokenType.TAG] after the child elements or ` null` if
1907 * there is no content and the attributes ended with [TokenType#SLASH _GT] 1907 * there is no content and the attributes ended with [TokenType.SLASH _GT]
1908 * @param nodeEnd the ending [TokenType#GT] or [TokenType#SLASH_GT] token (not 1908 * @param nodeEnd the ending [TokenType.GT] or [TokenType.SLASH_GT] token (not
1909 * `null`) 1909 * `null`)
1910 */ 1910 */
1911 XmlTagNode(this.nodeStart, this._tag, List<XmlAttributeNode> attributes, this. attributeEnd, List<XmlTagNode> tagNodes, this.contentEnd, this.closingTag, this. nodeEnd) { 1911 XmlTagNode(this.nodeStart, this._tag, List<XmlAttributeNode> attributes, this. attributeEnd, List<XmlTagNode> tagNodes, this.contentEnd, this.closingTag, this. nodeEnd) {
1912 this._attributes = becomeParentOfAll(attributes, ifEmpty: NO_ATTRIBUTES); 1912 this._attributes = becomeParentOfAll(attributes, ifEmpty: NO_ATTRIBUTES);
1913 this._tagNodes = becomeParentOfAll(tagNodes, ifEmpty: NO_TAG_NODES); 1913 this._tagNodes = becomeParentOfAll(tagNodes, ifEmpty: NO_TAG_NODES);
1914 } 1914 }
1915 1915
1916 @override 1916 @override
1917 accept(XmlVisitor visitor) => visitor.visitXmlTagNode(this); 1917 accept(XmlVisitor visitor) => visitor.visitXmlTagNode(this);
1918 1918
(...skipping 16 matching lines...) Expand all
1935 * Answer the receiver's attributes. Callers should not manipulate the returne d list to edit the 1935 * Answer the receiver's attributes. Callers should not manipulate the returne d list to edit the
1936 * AST structure. 1936 * AST structure.
1937 * 1937 *
1938 * @return the attributes (not `null`, contains no `null`s) 1938 * @return the attributes (not `null`, contains no `null`s)
1939 */ 1939 */
1940 List<XmlAttributeNode> get attributes => _attributes; 1940 List<XmlAttributeNode> get attributes => _attributes;
1941 1941
1942 /** 1942 /**
1943 * Find the attribute with the given name (see [getAttribute] and answer the l exeme 1943 * Find the attribute with the given name (see [getAttribute] and answer the l exeme
1944 * for the attribute's value token without the leading and trailing quotes (se e 1944 * for the attribute's value token without the leading and trailing quotes (se e
1945 * [XmlAttributeNode#getText]). 1945 * [XmlAttributeNode.getText]).
1946 * 1946 *
1947 * @param name the attribute name 1947 * @param name the attribute name
1948 * @return the attribute text or `null` if no matching attribute is found 1948 * @return the attribute text or `null` if no matching attribute is found
1949 */ 1949 */
1950 String getAttributeText(String name) { 1950 String getAttributeText(String name) {
1951 XmlAttributeNode attribute = getAttribute(name); 1951 XmlAttributeNode attribute = getAttribute(name);
1952 return attribute != null ? attribute.text : null; 1952 return attribute != null ? attribute.text : null;
1953 } 1953 }
1954 1954
1955 @override 1955 @override
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
2014 2014
2015 /** 2015 /**
2016 * Answer the tag nodes contained in the receiver. Callers should not manipula te the returned list 2016 * Answer the tag nodes contained in the receiver. Callers should not manipula te the returned list
2017 * to edit the AST structure. 2017 * to edit the AST structure.
2018 * 2018 *
2019 * @return the children (not `null`, contains no `null`s) 2019 * @return the children (not `null`, contains no `null`s)
2020 */ 2020 */
2021 List<XmlTagNode> get tagNodes => _tagNodes; 2021 List<XmlTagNode> get tagNodes => _tagNodes;
2022 2022
2023 /** 2023 /**
2024 * Answer the [TokenType#TAG] token after the starting '&lt;'. 2024 * Answer the [TokenType.TAG] token after the starting '&lt;'.
2025 * 2025 *
2026 * @return the token (not `null`) 2026 * @return the token (not `null`)
2027 */ 2027 */
2028 Token get tagToken => _tag; 2028 Token get tagToken => _tag;
2029 2029
2030 @override 2030 @override
2031 void visitChildren(XmlVisitor visitor) { 2031 void visitChildren(XmlVisitor visitor) {
2032 for (XmlAttributeNode node in _attributes) { 2032 for (XmlAttributeNode node in _attributes) {
2033 node.accept(visitor); 2033 node.accept(visitor);
2034 } 2034 }
2035 for (XmlTagNode node in _tagNodes) { 2035 for (XmlTagNode node in _tagNodes) {
2036 node.accept(visitor); 2036 node.accept(visitor);
2037 } 2037 }
2038 } 2038 }
2039 } 2039 }
2040 2040
2041 /** 2041 /**
2042 * The interface `XmlVisitor` defines the behavior of objects that can be used t o visit an 2042 * The interface `XmlVisitor` defines the behavior of objects that can be used t o visit an
2043 * [XmlNode] structure. 2043 * [XmlNode] structure.
2044 */ 2044 */
2045 abstract class XmlVisitor<R> { 2045 abstract class XmlVisitor<R> {
2046 R visitHtmlScriptTagNode(HtmlScriptTagNode node); 2046 R visitHtmlScriptTagNode(HtmlScriptTagNode node);
2047 2047
2048 R visitHtmlUnit(HtmlUnit htmlUnit); 2048 R visitHtmlUnit(HtmlUnit htmlUnit);
2049 2049
2050 R visitXmlAttributeNode(XmlAttributeNode xmlAttributeNode); 2050 R visitXmlAttributeNode(XmlAttributeNode xmlAttributeNode);
2051 2051
2052 R visitXmlTagNode(XmlTagNode xmlTagNode); 2052 R visitXmlTagNode(XmlTagNode xmlTagNode);
2053 } 2053 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/error_verifier.dart ('k') | pkg/analyzer/lib/src/generated/instrumentation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698