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

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

Issue 128443003: Analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for review comments. Created 6 years, 11 months 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 // This code was auto-generated, is not intended to be edited, and is subject to 1 // This code was auto-generated, is not intended to be edited, and is subject to
2 // significant change. Please see the README file for more information. 2 // significant change. Please see the README file for more information.
3 3
4 library engine.html; 4 library engine.html;
5 5
6 import 'dart:collection'; 6 import 'dart:collection';
7 import 'java_core.dart'; 7 import 'java_core.dart';
8 import 'java_engine.dart'; 8 import 'java_engine.dart';
9 import 'source.dart'; 9 import 'source.dart';
10 import 'error.dart' show AnalysisErrorListener; 10 import 'error.dart' show AnalysisErrorListener;
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 node.parent = this; 511 node.parent = this;
512 } 512 }
513 return child; 513 return child;
514 } 514 }
515 515
516 /** 516 /**
517 * This method exists for debugging purposes only. 517 * This method exists for debugging purposes only.
518 */ 518 */
519 void appendIdentifier(JavaStringBuilder builder, XmlNode node) { 519 void appendIdentifier(JavaStringBuilder builder, XmlNode node) {
520 if (node is XmlTagNode) { 520 if (node is XmlTagNode) {
521 builder.append((node as XmlTagNode).tag.lexeme); 521 builder.append((node as XmlTagNode).tag);
522 } else if (node is XmlAttributeNode) { 522 } else if (node is XmlAttributeNode) {
523 builder.append((node as XmlAttributeNode).name.lexeme); 523 builder.append((node as XmlAttributeNode).name);
524 } else { 524 } else {
525 builder.append("htmlUnit"); 525 builder.append("htmlUnit");
526 } 526 }
527 } 527 }
528 528
529 /** 529 /**
530 * This method exists for debugging purposes only. 530 * This method exists for debugging purposes only.
531 */ 531 */
532 String buildRecursiveStructureMessage(XmlNode newParent) { 532 String buildRecursiveStructureMessage(XmlNode newParent) {
533 JavaStringBuilder builder = new JavaStringBuilder(); 533 JavaStringBuilder builder = new JavaStringBuilder();
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 Object visitHtmlScriptTagNode(HtmlScriptTagNode node) => visitXmlTagNode(node) ; 1052 Object visitHtmlScriptTagNode(HtmlScriptTagNode node) => visitXmlTagNode(node) ;
1053 1053
1054 Object visitHtmlUnit(HtmlUnit node) { 1054 Object visitHtmlUnit(HtmlUnit node) {
1055 for (XmlTagNode child in node.tagNodes) { 1055 for (XmlTagNode child in node.tagNodes) {
1056 visit(child); 1056 visit(child);
1057 } 1057 }
1058 return null; 1058 return null;
1059 } 1059 }
1060 1060
1061 Object visitXmlAttributeNode(XmlAttributeNode node) { 1061 Object visitXmlAttributeNode(XmlAttributeNode node) {
1062 String name = node.name.lexeme; 1062 String name = node.name;
1063 Token value = node.value; 1063 Token value = node.valueToken;
1064 if (name.length == 0) { 1064 if (name.length == 0) {
1065 _writer.print("__"); 1065 _writer.print("__");
1066 } else { 1066 } else {
1067 _writer.print(name); 1067 _writer.print(name);
1068 } 1068 }
1069 _writer.print("="); 1069 _writer.print("=");
1070 if (value == null) { 1070 if (value == null) {
1071 _writer.print("__"); 1071 _writer.print("__");
1072 } else { 1072 } else {
1073 _writer.print(value.lexeme); 1073 _writer.print(value.lexeme);
1074 } 1074 }
1075 return null; 1075 return null;
1076 } 1076 }
1077 1077
1078 Object visitXmlTagNode(XmlTagNode node) { 1078 Object visitXmlTagNode(XmlTagNode node) {
1079 _writer.print("<"); 1079 _writer.print("<");
1080 String tagName = node.tag.lexeme; 1080 String tagName = node.tag;
1081 _writer.print(tagName); 1081 _writer.print(tagName);
1082 for (XmlAttributeNode attribute in node.attributes) { 1082 for (XmlAttributeNode attribute in node.attributes) {
1083 _writer.print(" "); 1083 _writer.print(" ");
1084 visit(attribute); 1084 visit(attribute);
1085 } 1085 }
1086 _writer.print(node.attributeEnd.lexeme); 1086 _writer.print(node.attributeEnd.lexeme);
1087 if (node.closingTag != null) { 1087 if (node.closingTag != null) {
1088 for (XmlTagNode child in node.tagNodes) { 1088 for (XmlTagNode child in node.tagNodes) {
1089 visit(child); 1089 visit(child);
1090 } 1090 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 1169
1170 String toString() => "-eof-"; 1170 String toString() => "-eof-";
1171 } 1171 }
1172 1172
1173 /** 1173 /**
1174 * Instances of `XmlAttributeNode` represent name/value pairs owned by an [XmlTa gNode]. 1174 * Instances of `XmlAttributeNode` represent name/value pairs owned by an [XmlTa gNode].
1175 * 1175 *
1176 * @coverage dart.engine.html 1176 * @coverage dart.engine.html
1177 */ 1177 */
1178 class XmlAttributeNode extends XmlNode { 1178 class XmlAttributeNode extends XmlNode {
1179 final Token name; 1179 Token _name;
1180 1180
1181 final Token equals; 1181 final Token equals;
1182 1182
1183 final Token value; 1183 Token _value;
1184 1184
1185 List<EmbeddedExpression> expressions = EmbeddedExpression.EMPTY_ARRAY; 1185 List<EmbeddedExpression> expressions = EmbeddedExpression.EMPTY_ARRAY;
1186 1186
1187 /** 1187 /**
1188 * Construct a new instance representing an XML attribute. 1188 * Construct a new instance representing an XML attribute.
1189 * 1189 *
1190 * @param name the name token (not `null`). This may be a zero length token if the attribute 1190 * @param name the name token (not `null`). This may be a zero length token if the attribute
1191 * is badly formed. 1191 * is badly formed.
1192 * @param equals the equals sign or `null` if none 1192 * @param equals the equals sign or `null` if none
1193 * @param value the value token (not `null`) 1193 * @param value the value token (not `null`)
1194 */ 1194 */
1195 XmlAttributeNode(this.name, this.equals, this.value); 1195 XmlAttributeNode(Token name, this.equals, Token value) {
1196 this._name = name;
1197 this._value = value;
1198 }
1196 1199
1197 accept(XmlVisitor visitor) => visitor.visitXmlAttributeNode(this); 1200 accept(XmlVisitor visitor) => visitor.visitXmlAttributeNode(this);
1198 1201
1199 Token get beginToken => name; 1202 Token get beginToken => _name;
1200 1203
1201 Token get endToken => value; 1204 Token get endToken => _value;
1205
1206 /**
1207 * Answer the attribute name. This may be a zero length string if the attribut e is badly formed.
1208 *
1209 * @return the name (not `null`)
1210 */
1211 String get name => _name.lexeme;
1212
1213 /**
1214 * Answer the attribute name token. This may be a zero length token if the att ribute is badly
1215 * formed.
1216 *
1217 * @return the name token (not `null`)
1218 */
1219 Token get nameToken => _name;
1202 1220
1203 /** 1221 /**
1204 * Answer the lexeme for the value token without the leading and trailing quot es. 1222 * Answer the lexeme for the value token without the leading and trailing quot es.
1205 * 1223 *
1206 * @return the text or `null` if the value is not specified 1224 * @return the text or `null` if the value is not specified
1207 */ 1225 */
1208 String get text { 1226 String get text {
1209 if (value == null) { 1227 if (_value == null) {
1210 return null; 1228 return null;
1211 } 1229 }
1212 String text = value.lexeme; 1230 String text = _value.lexeme;
1213 int len = text.length; 1231 int len = text.length;
1214 if (len > 0) { 1232 if (len > 0) {
1215 if (text.codeUnitAt(0) == 0x22) { 1233 if (text.codeUnitAt(0) == 0x22) {
1216 if (len > 1 && text.codeUnitAt(len - 1) == 0x22) { 1234 if (len > 1 && text.codeUnitAt(len - 1) == 0x22) {
1217 return text.substring(1, len - 1); 1235 return text.substring(1, len - 1);
1218 } else { 1236 } else {
1219 return text.substring(1); 1237 return text.substring(1);
1220 } 1238 }
1221 } else if (text.codeUnitAt(0) == 0x27) { 1239 } else if (text.codeUnitAt(0) == 0x27) {
1222 if (len > 1 && text.codeUnitAt(len - 1) == 0x27) { 1240 if (len > 1 && text.codeUnitAt(len - 1) == 0x27) {
1223 return text.substring(1, len - 1); 1241 return text.substring(1, len - 1);
1224 } else { 1242 } else {
1225 return text.substring(1); 1243 return text.substring(1);
1226 } 1244 }
1227 } 1245 }
1228 } 1246 }
1229 return text; 1247 return text;
1230 } 1248 }
1231 1249
1250 /**
1251 * Answer the attribute value token. A properly formed value will start and en d with matching
1252 * quote characters, but the value returned may not be properly formed.
1253 *
1254 * @return the value token or `null` if this represents a badly formed attribu te
1255 */
1256 Token get valueToken => _value;
1257
1232 void visitChildren(XmlVisitor visitor) { 1258 void visitChildren(XmlVisitor visitor) {
1233 } 1259 }
1234 } 1260 }
1235 1261
1236 /** 1262 /**
1237 * Instances of the class `EmbeddedDartVisitor` implement a recursive visitor fo r HTML files 1263 * Instances of the class `EmbeddedDartVisitor` implement a recursive visitor fo r HTML files
1238 * that will invoke another visitor on all embedded dart scripts and expressions . 1264 * that will invoke another visitor on all embedded dart scripts and expressions .
1239 */ 1265 */
1240 class EmbeddedDartVisitor<R> implements XmlVisitor<R> { 1266 class EmbeddedDartVisitor<R> implements XmlVisitor<R> {
1241 /** 1267 /**
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
1636 static List<XmlTagNode> NO_TAG_NODES = new UnmodifiableListView(new List<XmlTa gNode>()); 1662 static List<XmlTagNode> NO_TAG_NODES = new UnmodifiableListView(new List<XmlTa gNode>());
1637 1663
1638 /** 1664 /**
1639 * The starting [TokenType#LT] token (not `null`). 1665 * The starting [TokenType#LT] token (not `null`).
1640 */ 1666 */
1641 final Token nodeStart; 1667 final Token nodeStart;
1642 1668
1643 /** 1669 /**
1644 * The [TokenType#TAG] token after the starting '&lt;' (not `null`). 1670 * The [TokenType#TAG] token after the starting '&lt;' (not `null`).
1645 */ 1671 */
1646 final Token tag; 1672 Token _tag;
1647 1673
1648 /** 1674 /**
1649 * The attributes contained by the receiver (not `null`, contains no `null`s). 1675 * The attributes contained by the receiver (not `null`, contains no `null`s).
1650 */ 1676 */
1651 List<XmlAttributeNode> _attributes; 1677 List<XmlAttributeNode> _attributes;
1652 1678
1653 /** 1679 /**
1654 * The [TokenType#GT] or [TokenType#SLASH_GT] token after the attributes (not 1680 * The [TokenType#GT] or [TokenType#SLASH_GT] token after the attributes (not
1655 * `null`). The token may be the same token as [nodeEnd] if there are no child 1681 * `null`). The token may be the same token as [nodeEnd] if there are no child
1656 * [tagNodes]. 1682 * [tagNodes].
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1710 * self closing or the attributeEnd is [TokenType#SLASH_GT], or 1736 * self closing or the attributeEnd is [TokenType#SLASH_GT], or
1711 * * (3) [TokenType#EOF] if the node does not have a closing tag and is the last 1737 * * (3) [TokenType#EOF] if the node does not have a closing tag and is the last
1712 * node in the stream [TokenType#LT_SLASH] token after the content, o r `null` 1738 * node in the stream [TokenType#LT_SLASH] token after the content, o r `null`
1713 * if there is no content and the attributes ended with [TokenType#SL ASH_GT]. 1739 * if there is no content and the attributes ended with [TokenType#SL ASH_GT].
1714 * 1740 *
1715 * @param closingTag the closing [TokenType#TAG] after the child elements or ` null` if 1741 * @param closingTag the closing [TokenType#TAG] after the child elements or ` null` if
1716 * there is no content and the attributes ended with [TokenType#SLASH _GT] 1742 * there is no content and the attributes ended with [TokenType#SLASH _GT]
1717 * @param nodeEnd the ending [TokenType#GT] or [TokenType#SLASH_GT] token (not 1743 * @param nodeEnd the ending [TokenType#GT] or [TokenType#SLASH_GT] token (not
1718 * `null`) 1744 * `null`)
1719 */ 1745 */
1720 XmlTagNode(this.nodeStart, this.tag, List<XmlAttributeNode> attributes, this.a ttributeEnd, List<XmlTagNode> tagNodes, this.contentEnd, this.closingTag, this.n odeEnd) { 1746 XmlTagNode(this.nodeStart, Token tag, List<XmlAttributeNode> attributes, this. attributeEnd, List<XmlTagNode> tagNodes, this.contentEnd, this.closingTag, this. nodeEnd) {
1747 this._tag = tag;
1721 this._attributes = becomeParentOfEmpty(attributes, NO_ATTRIBUTES); 1748 this._attributes = becomeParentOfEmpty(attributes, NO_ATTRIBUTES);
1722 this._tagNodes = becomeParentOfEmpty(tagNodes, NO_TAG_NODES); 1749 this._tagNodes = becomeParentOfEmpty(tagNodes, NO_TAG_NODES);
1723 } 1750 }
1724 1751
1725 accept(XmlVisitor visitor) => visitor.visitXmlTagNode(this); 1752 accept(XmlVisitor visitor) => visitor.visitXmlTagNode(this);
1726 1753
1727 /** 1754 /**
1728 * Answer the attribute with the specified name. 1755 * Answer the attribute with the specified name.
1729 * 1756 *
1730 * @param name the attribute name 1757 * @param name the attribute name
1731 * @return the attribute or `null` if no matching attribute is found 1758 * @return the attribute or `null` if no matching attribute is found
1732 */ 1759 */
1733 XmlAttributeNode getAttribute(String name) { 1760 XmlAttributeNode getAttribute(String name) {
1734 for (XmlAttributeNode attribute in _attributes) { 1761 for (XmlAttributeNode attribute in _attributes) {
1735 if (attribute.name.lexeme == name) { 1762 if (attribute.name == name) {
1736 return attribute; 1763 return attribute;
1737 } 1764 }
1738 } 1765 }
1739 return null; 1766 return null;
1740 } 1767 }
1741 1768
1742 /** 1769 /**
1743 * Answer the receiver's attributes. Callers should not manipulate the returne d list to edit the 1770 * Answer the receiver's attributes. Callers should not manipulate the returne d list to edit the
1744 * AST structure. 1771 * AST structure.
1745 * 1772 *
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1799 } 1826 }
1800 if (!_tagNodes.isEmpty) { 1827 if (!_tagNodes.isEmpty) {
1801 return _tagNodes[_tagNodes.length - 1].endToken; 1828 return _tagNodes[_tagNodes.length - 1].endToken;
1802 } 1829 }
1803 if (attributeEnd != null) { 1830 if (attributeEnd != null) {
1804 return attributeEnd; 1831 return attributeEnd;
1805 } 1832 }
1806 if (!_attributes.isEmpty) { 1833 if (!_attributes.isEmpty) {
1807 return _attributes[_attributes.length - 1].endToken; 1834 return _attributes[_attributes.length - 1].endToken;
1808 } 1835 }
1809 return tag; 1836 return _tag;
1810 } 1837 }
1811 1838
1812 /** 1839 /**
1840 * Answer the tag name after the starting '&lt;'.
1841 *
1842 * @return the tag name (not `null`)
1843 */
1844 String get tag => _tag.lexeme;
1845
1846 /**
1813 * Answer the tag nodes contained in the receiver. Callers should not manipula te the returned list 1847 * Answer the tag nodes contained in the receiver. Callers should not manipula te the returned list
1814 * to edit the AST structure. 1848 * to edit the AST structure.
1815 * 1849 *
1816 * @return the children (not `null`, contains no `null`s) 1850 * @return the children (not `null`, contains no `null`s)
1817 */ 1851 */
1818 List<XmlTagNode> get tagNodes => _tagNodes; 1852 List<XmlTagNode> get tagNodes => _tagNodes;
1819 1853
1854 /**
1855 * Answer the [TokenType#TAG] token after the starting '&lt;'.
1856 *
1857 * @return the token (not `null`)
1858 */
1859 Token get tagToken => _tag;
1860
1820 void visitChildren(XmlVisitor visitor) { 1861 void visitChildren(XmlVisitor visitor) {
1821 for (XmlAttributeNode node in _attributes) { 1862 for (XmlAttributeNode node in _attributes) {
1822 node.accept(visitor); 1863 node.accept(visitor);
1823 } 1864 }
1824 for (XmlTagNode node in _tagNodes) { 1865 for (XmlTagNode node in _tagNodes) {
1825 node.accept(visitor); 1866 node.accept(visitor);
1826 } 1867 }
1827 } 1868 }
1828 1869
1829 /** 1870 /**
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1959 * Determine if the specified node is a Dart script. 2000 * Determine if the specified node is a Dart script.
1960 * 2001 *
1961 * @param node the node to be tested (not `null`) 2002 * @param node the node to be tested (not `null`)
1962 * @return `true` if the node is a Dart script 2003 * @return `true` if the node is a Dart script
1963 */ 2004 */
1964 bool isScriptNode(Token tag, List<XmlAttributeNode> attributes, List<XmlTagNod e> tagNodes) { 2005 bool isScriptNode(Token tag, List<XmlAttributeNode> attributes, List<XmlTagNod e> tagNodes) {
1965 if (tagNodes.length != 0 || tag.lexeme != _SCRIPT) { 2006 if (tagNodes.length != 0 || tag.lexeme != _SCRIPT) {
1966 return false; 2007 return false;
1967 } 2008 }
1968 for (XmlAttributeNode attribute in attributes) { 2009 for (XmlAttributeNode attribute in attributes) {
1969 if (attribute.name.lexeme == _TYPE) { 2010 if (attribute.name == _TYPE) {
1970 Token valueToken = attribute.value; 2011 Token valueToken = attribute.valueToken;
1971 if (valueToken != null) { 2012 if (valueToken != null) {
1972 String value = valueToken.lexeme; 2013 String value = valueToken.lexeme;
1973 if (value == _APPLICATION_DART_IN_DOUBLE_QUOTES || value == _APPLICATI ON_DART_IN_SINGLE_QUOTES) { 2014 if (value == _APPLICATION_DART_IN_DOUBLE_QUOTES || value == _APPLICATI ON_DART_IN_SINGLE_QUOTES) {
1974 return true; 2015 return true;
1975 } 2016 }
1976 } 2017 }
1977 } 2018 }
1978 } 2019 }
1979 return false; 2020 return false;
1980 } 2021 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
2034 * @return the children (not `null`, contains no `null`s) 2075 * @return the children (not `null`, contains no `null`s)
2035 */ 2076 */
2036 List<XmlTagNode> get tagNodes => _tagNodes; 2077 List<XmlTagNode> get tagNodes => _tagNodes;
2037 2078
2038 void visitChildren(XmlVisitor visitor) { 2079 void visitChildren(XmlVisitor visitor) {
2039 for (XmlTagNode node in _tagNodes) { 2080 for (XmlTagNode node in _tagNodes) {
2040 node.accept(visitor); 2081 node.accept(visitor);
2041 } 2082 }
2042 } 2083 }
2043 } 2084 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/error.dart ('k') | pkg/analyzer/lib/src/generated/instrumentation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698