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

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

Issue 229653004: New analyzer snapshot with MapIterator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 // 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.element; 8 library engine.element;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 * @return the class with the given name that is defined in this compilation u nit 405 * @return the class with the given name that is defined in this compilation u nit
406 */ 406 */
407 ClassElement getType(String className); 407 ClassElement getType(String className);
408 408
409 /** 409 /**
410 * Return an array containing all of the classes contained in this compilation unit. 410 * Return an array containing all of the classes contained in this compilation unit.
411 * 411 *
412 * @return the classes contained in this compilation unit 412 * @return the classes contained in this compilation unit
413 */ 413 */
414 List<ClassElement> get types; 414 List<ClassElement> get types;
415
416 /**
417 * Return `true` if this compilation unit defines a top-level function named
418 * `loadLibrary`.
419 *
420 * @return `true` if this compilation unit defines a top-level function named
421 * `loadLibrary`
422 */
423 bool get hasLoadLibraryFunction;
415 } 424 }
416 425
417 /** 426 /**
418 * The interface `ConstructorElement` defines the behavior of elements represent ing a 427 * The interface `ConstructorElement` defines the behavior of elements represent ing a
419 * constructor or a factory method defined within a type. 428 * constructor or a factory method defined within a type.
420 */ 429 */
421 abstract class ConstructorElement implements ClassMemberElement, ExecutableEleme nt { 430 abstract class ConstructorElement implements ClassMemberElement, ExecutableEleme nt {
422 /** 431 /**
423 * Return the resolved [ConstructorDeclaration] node that declares this 432 * Return the resolved [ConstructorDeclaration] node that declares this
424 * [ConstructorElement] . 433 * [ConstructorElement] .
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 static const ElementKind LIBRARY = const ElementKind('LIBRARY', 22, "library") ; 787 static const ElementKind LIBRARY = const ElementKind('LIBRARY', 22, "library") ;
779 788
780 static const ElementKind LOCAL_VARIABLE = const ElementKind('LOCAL_VARIABLE', 23, "local variable"); 789 static const ElementKind LOCAL_VARIABLE = const ElementKind('LOCAL_VARIABLE', 23, "local variable");
781 790
782 static const ElementKind METHOD = const ElementKind('METHOD', 24, "method"); 791 static const ElementKind METHOD = const ElementKind('METHOD', 24, "method");
783 792
784 static const ElementKind NAME = const ElementKind('NAME', 25, "<name>"); 793 static const ElementKind NAME = const ElementKind('NAME', 25, "<name>");
785 794
786 static const ElementKind PARAMETER = const ElementKind('PARAMETER', 26, "param eter"); 795 static const ElementKind PARAMETER = const ElementKind('PARAMETER', 26, "param eter");
787 796
788 static const ElementKind PREFIX = const ElementKind('PREFIX', 27, "import pref ix"); 797 static const ElementKind POLYMER_ATTRIBUTE = const ElementKind('POLYMER_ATTRIB UTE', 27, "Polymer attribute");
789 798
790 static const ElementKind SETTER = const ElementKind('SETTER', 28, "setter"); 799 static const ElementKind POLYMER_TAG_DART = const ElementKind('POLYMER_TAG_DAR T', 28, "Polymer Dart tag");
791 800
792 static const ElementKind TOP_LEVEL_VARIABLE = const ElementKind('TOP_LEVEL_VAR IABLE', 29, "top level variable"); 801 static const ElementKind POLYMER_TAG_HTML = const ElementKind('POLYMER_TAG_HTM L', 29, "Polymer HTML tag");
793 802
794 static const ElementKind FUNCTION_TYPE_ALIAS = const ElementKind('FUNCTION_TYP E_ALIAS', 30, "function type alias"); 803 static const ElementKind PREFIX = const ElementKind('PREFIX', 30, "import pref ix");
795 804
796 static const ElementKind TYPE_PARAMETER = const ElementKind('TYPE_PARAMETER', 31, "type parameter"); 805 static const ElementKind SETTER = const ElementKind('SETTER', 31, "setter");
797 806
798 static const ElementKind UNIVERSE = const ElementKind('UNIVERSE', 32, "<univer se>"); 807 static const ElementKind TOP_LEVEL_VARIABLE = const ElementKind('TOP_LEVEL_VAR IABLE', 32, "top level variable");
808
809 static const ElementKind FUNCTION_TYPE_ALIAS = const ElementKind('FUNCTION_TYP E_ALIAS', 33, "function type alias");
810
811 static const ElementKind TYPE_PARAMETER = const ElementKind('TYPE_PARAMETER', 34, "type parameter");
812
813 static const ElementKind UNIVERSE = const ElementKind('UNIVERSE', 35, "<univer se>");
799 814
800 static const List<ElementKind> values = const [ 815 static const List<ElementKind> values = const [
801 ANGULAR_FILTER, 816 ANGULAR_FILTER,
802 ANGULAR_COMPONENT, 817 ANGULAR_COMPONENT,
803 ANGULAR_CONTROLLER, 818 ANGULAR_CONTROLLER,
804 ANGULAR_DIRECTIVE, 819 ANGULAR_DIRECTIVE,
805 ANGULAR_PROPERTY, 820 ANGULAR_PROPERTY,
806 ANGULAR_SCOPE_PROPERTY, 821 ANGULAR_SCOPE_PROPERTY,
807 ANGULAR_SELECTOR, 822 ANGULAR_SELECTOR,
808 ANGULAR_VIEW, 823 ANGULAR_VIEW,
809 CLASS, 824 CLASS,
810 COMPILATION_UNIT, 825 COMPILATION_UNIT,
811 CONSTRUCTOR, 826 CONSTRUCTOR,
812 DYNAMIC, 827 DYNAMIC,
813 EMBEDDED_HTML_SCRIPT, 828 EMBEDDED_HTML_SCRIPT,
814 ERROR, 829 ERROR,
815 EXPORT, 830 EXPORT,
816 EXTERNAL_HTML_SCRIPT, 831 EXTERNAL_HTML_SCRIPT,
817 FIELD, 832 FIELD,
818 FUNCTION, 833 FUNCTION,
819 GETTER, 834 GETTER,
820 HTML, 835 HTML,
821 IMPORT, 836 IMPORT,
822 LABEL, 837 LABEL,
823 LIBRARY, 838 LIBRARY,
824 LOCAL_VARIABLE, 839 LOCAL_VARIABLE,
825 METHOD, 840 METHOD,
826 NAME, 841 NAME,
827 PARAMETER, 842 PARAMETER,
843 POLYMER_ATTRIBUTE,
844 POLYMER_TAG_DART,
845 POLYMER_TAG_HTML,
828 PREFIX, 846 PREFIX,
829 SETTER, 847 SETTER,
830 TOP_LEVEL_VARIABLE, 848 TOP_LEVEL_VARIABLE,
831 FUNCTION_TYPE_ALIAS, 849 FUNCTION_TYPE_ALIAS,
832 TYPE_PARAMETER, 850 TYPE_PARAMETER,
833 UNIVERSE]; 851 UNIVERSE];
834 852
835 /** 853 /**
836 * Return the kind of the given element, or [ERROR] if the element is `null`. This is 854 * Return the kind of the given element, or [ERROR] if the element is `null`. This is
837 * a utility method that can reduce the need for null checks in other places. 855 * a utility method that can reduce the need for null checks in other places.
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 R visitLibraryElement(LibraryElement element); 941 R visitLibraryElement(LibraryElement element);
924 942
925 R visitLocalVariableElement(LocalVariableElement element); 943 R visitLocalVariableElement(LocalVariableElement element);
926 944
927 R visitMethodElement(MethodElement element); 945 R visitMethodElement(MethodElement element);
928 946
929 R visitMultiplyDefinedElement(MultiplyDefinedElement element); 947 R visitMultiplyDefinedElement(MultiplyDefinedElement element);
930 948
931 R visitParameterElement(ParameterElement element); 949 R visitParameterElement(ParameterElement element);
932 950
951 R visitPolymerAttributeElement(PolymerAttributeElement element);
952
953 R visitPolymerTagDartElement(PolymerTagDartElement element);
954
955 R visitPolymerTagHtmlElement(PolymerTagHtmlElement element);
956
933 R visitPrefixElement(PrefixElement element); 957 R visitPrefixElement(PrefixElement element);
934 958
935 R visitPropertyAccessorElement(PropertyAccessorElement element); 959 R visitPropertyAccessorElement(PropertyAccessorElement element);
936 960
937 R visitTopLevelVariableElement(TopLevelVariableElement element); 961 R visitTopLevelVariableElement(TopLevelVariableElement element);
938 962
939 R visitTypeParameterElement(TypeParameterElement element); 963 R visitTypeParameterElement(TypeParameterElement element);
940 } 964 }
941 965
942 /** 966 /**
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 * @return the field element associated with this field formal parameter 1101 * @return the field element associated with this field formal parameter
1078 */ 1102 */
1079 FieldElement get field; 1103 FieldElement get field;
1080 } 1104 }
1081 1105
1082 /** 1106 /**
1083 * The interface `FunctionElement` defines the behavior of elements representing a function. 1107 * The interface `FunctionElement` defines the behavior of elements representing a function.
1084 */ 1108 */
1085 abstract class FunctionElement implements ExecutableElement, LocalElement { 1109 abstract class FunctionElement implements ExecutableElement, LocalElement {
1086 /** 1110 /**
1111 * The name of the synthetic function defined for libraries that are deferred.
1112 */
1113 static final String LOAD_LIBRARY_NAME = "loadLibrary";
1114
1115 /**
1087 * Return the resolved [FunctionDeclaration] node that declares this [Function Element] 1116 * Return the resolved [FunctionDeclaration] node that declares this [Function Element]
1088 * . 1117 * .
1089 * 1118 *
1090 * This method is expensive, because resolved AST might be evicted from cache, so parsing and 1119 * This method is expensive, because resolved AST might be evicted from cache, so parsing and
1091 * resolving will be performed. 1120 * resolving will be performed.
1092 * 1121 *
1093 * @return the resolved [FunctionDeclaration], not `null`. 1122 * @return the resolved [FunctionDeclaration], not `null`.
1094 */ 1123 */
1095 @override 1124 @override
1096 FunctionDeclaration get node; 1125 FunctionDeclaration get node;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 * The interface `HtmlElement` defines the behavior of elements representing an HTML file. 1197 * The interface `HtmlElement` defines the behavior of elements representing an HTML file.
1169 */ 1198 */
1170 abstract class HtmlElement implements Element { 1199 abstract class HtmlElement implements Element {
1171 /** 1200 /**
1172 * Return the [CompilationUnitElement] associated with this Angular HTML file, maybe 1201 * Return the [CompilationUnitElement] associated with this Angular HTML file, maybe
1173 * `null` if not an Angular file. 1202 * `null` if not an Angular file.
1174 */ 1203 */
1175 CompilationUnitElement get angularCompilationUnit; 1204 CompilationUnitElement get angularCompilationUnit;
1176 1205
1177 /** 1206 /**
1207 * Return an array containing all of the [PolymerTagHtmlElement]s defined in t he HTML file.
1208 *
1209 * @return the [PolymerTagHtmlElement]s elements in the HTML file (not `null`,
1210 * contains no `null`s)
1211 */
1212 List<PolymerTagHtmlElement> get polymerTags;
1213
1214 /**
1178 * Return an array containing all of the script elements contained in the HTML file. This includes 1215 * Return an array containing all of the script elements contained in the HTML file. This includes
1179 * scripts with libraries that are defined by the content of a script tag as w ell as libraries 1216 * scripts with libraries that are defined by the content of a script tag as w ell as libraries
1180 * that are referenced in the {@core source} attribute of a script tag. 1217 * that are referenced in the {@core source} attribute of a script tag.
1181 * 1218 *
1182 * @return the script elements in the HTML file (not `null`, contains no `null `s) 1219 * @return the script elements in the HTML file (not `null`, contains no `null `s)
1183 */ 1220 */
1184 List<HtmlScriptElement> get scripts; 1221 List<HtmlScriptElement> get scripts;
1185 } 1222 }
1186 1223
1187 /** 1224 /**
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 PrefixElement get prefix; 1265 PrefixElement get prefix;
1229 1266
1230 /** 1267 /**
1231 * Return the offset of the prefix of this import in the file that contains th is import directive, 1268 * Return the offset of the prefix of this import in the file that contains th is import directive,
1232 * or `-1` if this import is synthetic, does not have a prefix, or otherwise d oes not have 1269 * or `-1` if this import is synthetic, does not have a prefix, or otherwise d oes not have
1233 * an offset. 1270 * an offset.
1234 * 1271 *
1235 * @return the offset of the prefix of this import 1272 * @return the offset of the prefix of this import
1236 */ 1273 */
1237 int get prefixOffset; 1274 int get prefixOffset;
1275
1276 /**
1277 * Return `true` if this import is for a deferred library.
1278 *
1279 * @return `true` if this import is for a deferred library
1280 */
1281 bool get isDeferred;
1238 } 1282 }
1239 1283
1240 /** 1284 /**
1241 * The interface `LabelElement` defines the behavior of elements representing a label 1285 * The interface `LabelElement` defines the behavior of elements representing a label
1242 * associated with a statement. 1286 * associated with a statement.
1243 */ 1287 */
1244 abstract class LabelElement implements Element { 1288 abstract class LabelElement implements Element {
1245 /** 1289 /**
1246 * Return the executable element in which this label is defined. 1290 * Return the executable element in which this label is defined.
1247 * 1291 *
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 */ 1386 */
1343 List<LibraryElement> get visibleLibraries; 1387 List<LibraryElement> get visibleLibraries;
1344 1388
1345 /** 1389 /**
1346 * Return `true` if the defining compilation unit of this library contains at least one 1390 * Return `true` if the defining compilation unit of this library contains at least one
1347 * import directive whose URI uses the "dart-ext" scheme. 1391 * import directive whose URI uses the "dart-ext" scheme.
1348 */ 1392 */
1349 bool get hasExtUri; 1393 bool get hasExtUri;
1350 1394
1351 /** 1395 /**
1396 * Return `true` if this library defines a top-level function named `loadLibra ry`.
1397 *
1398 * @return `true` if this library defines a top-level function named `loadLibr ary`
1399 */
1400 bool get hasLoadLibraryFunction;
1401
1402 /**
1352 * Return `true` if this library is created for Angular analysis. If this libr ary has not 1403 * Return `true` if this library is created for Angular analysis. If this libr ary has not
1353 * yet had toolkit references resolved, then `false` will be returned. 1404 * yet had toolkit references resolved, then `false` will be returned.
1354 * 1405 *
1355 * @return `true` if this library is created for Angular analysis 1406 * @return `true` if this library is created for Angular analysis
1356 */ 1407 */
1357 bool get isAngularHtml; 1408 bool get isAngularHtml;
1358 1409
1359 /** 1410 /**
1360 * Answer `true` if this library is an application that can be run in the brow ser. 1411 * Answer `true` if this library is an application that can be run in the brow ser.
1361 * 1412 *
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
1869 */ 1920 */
1870 bool isClass(String name); 1921 bool isClass(String name);
1871 } 1922 }
1872 1923
1873 /** 1924 /**
1874 * The interface `AngularElement` defines the behavior of objects representing i nformation 1925 * The interface `AngularElement` defines the behavior of objects representing i nformation
1875 * about an Angular specific element. 1926 * about an Angular specific element.
1876 */ 1927 */
1877 abstract class AngularElement implements ToolkitObjectElement { 1928 abstract class AngularElement implements ToolkitObjectElement {
1878 /** 1929 /**
1879 * An empty array of angular elements. 1930 * An empty array of Angular elements.
1880 */ 1931 */
1881 static final List<AngularElement> EMPTY_ARRAY = new List<AngularElement>(0); 1932 static final List<AngularElement> EMPTY_ARRAY = new List<AngularElement>(0);
1882 1933
1883 /** 1934 /**
1884 * Returns the [AngularApplication] this element is used in. 1935 * Returns the [AngularApplication] this element is used in.
1885 * 1936 *
1886 * @return the [AngularApplication] this element is used in 1937 * @return the [AngularApplication] this element is used in
1887 */ 1938 */
1888 AngularApplication get application; 1939 AngularApplication get application;
1889 } 1940 }
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
2080 * <code>view('views/create.html')</code>. 2131 * <code>view('views/create.html')</code>.
2081 */ 2132 */
2082 abstract class AngularViewElement implements AngularHasTemplateElement { 2133 abstract class AngularViewElement implements AngularHasTemplateElement {
2083 /** 2134 /**
2084 * An empty array of view elements. 2135 * An empty array of view elements.
2085 */ 2136 */
2086 static final List<AngularViewElement> EMPTY_ARRAY = new List<AngularViewElemen t>(0); 2137 static final List<AngularViewElement> EMPTY_ARRAY = new List<AngularViewElemen t>(0);
2087 } 2138 }
2088 2139
2089 /** 2140 /**
2141 * The interface `PolymerAttributeElement` defines an attribute in
2142 * [PolymerTagHtmlElement].
2143 *
2144 * <pre>
2145 * <polymer-element name="my-example" attributes='attrA attrB'>
2146 * </polymer-element>
2147 * </pre>
2148 */
2149 abstract class PolymerAttributeElement implements PolymerElement {
2150 /**
2151 * An empty array of Polymer custom tag attributes.
2152 */
2153 static final List<PolymerAttributeElement> EMPTY_ARRAY = new List<PolymerAttri buteElement>(0);
2154
2155 /**
2156 * Return the [FieldElement] associated with this attribute. Maybe `null` if
2157 * [PolymerTagDartElement] does not have a field associated with it.
2158 */
2159 FieldElement get field;
2160 }
2161
2162 /**
2163 * The interface `PolymerElement` defines the behavior of objects representing i nformation
2164 * about a Polymer specific element.
2165 */
2166 abstract class PolymerElement implements ToolkitObjectElement {
2167 /**
2168 * An empty array of Polymer elements.
2169 */
2170 static final List<PolymerElement> EMPTY_ARRAY = new List<PolymerElement>(0);
2171 }
2172
2173 /**
2174 * The interface `PolymerTagDartElement` defines a Polymer custom tag in Dart.
2175 *
2176 * <pre>
2177 * @CustomTag('my-example')
2178 * </pre>
2179 */
2180 abstract class PolymerTagDartElement implements PolymerElement {
2181 /**
2182 * Return the [ClassElement] that is associated with this Polymer custom tag. Not
2183 * `null`, because [PolymerTagDartElement]s are created for [ClassElement]s
2184 * marked with the `@CustomTag` annotation.
2185 */
2186 ClassElement get classElement;
2187
2188 /**
2189 * Return the [PolymerTagHtmlElement] part of this Polymer custom tag. Maybe ` null` if
2190 * it has not been resolved yet or there are no corresponding Dart part define d.
2191 */
2192 PolymerTagHtmlElement get htmlElement;
2193 }
2194
2195 /**
2196 * The interface `PolymerTagHtmlElement` defines a Polymer custom tag in HTML.
2197 *
2198 * <pre>
2199 * <polymer-element name="my-example" attributes='attrA attrB'>
2200 * </polymer-element>
2201 * </pre>
2202 */
2203 abstract class PolymerTagHtmlElement implements PolymerElement {
2204 /**
2205 * An empty array of [PolymerTagHtmlElement]s.
2206 */
2207 static final List<PolymerTagHtmlElement> EMPTY_ARRAY = new List<PolymerTagHtml Element>(0);
2208
2209 /**
2210 * Return an array containing all of the attributes declared by this tag.
2211 */
2212 List<PolymerAttributeElement> get attributes;
2213
2214 /**
2215 * Return the [PolymerTagDartElement] part on this Polymer custom tag. Maybe ` null` if
2216 * it has not been resolved yet or there are no corresponding Dart part define d.
2217 */
2218 PolymerTagDartElement get dartElement;
2219 }
2220
2221 /**
2090 * Instances of the class `GeneralizingElementVisitor` implement an element visi tor that will 2222 * Instances of the class `GeneralizingElementVisitor` implement an element visi tor that will
2091 * recursively visit all of the elements in an element model (like instances of the class 2223 * recursively visit all of the elements in an element model (like instances of the class
2092 * [RecursiveElementVisitor]). In addition, when an element of a specific type i s visited not 2224 * [RecursiveElementVisitor]). In addition, when an element of a specific type i s visited not
2093 * only will the visit method for that specific type of element be invoked, but additional methods 2225 * only will the visit method for that specific type of element be invoked, but additional methods
2094 * for the supertypes of that element will also be invoked. For example, using a n instance of this 2226 * for the supertypes of that element will also be invoked. For example, using a n instance of this
2095 * class to visit a [MethodElement] will cause the method 2227 * class to visit a [MethodElement] will cause the method
2096 * [visitMethodElement] to be invoked but will also cause the methods 2228 * [visitMethodElement] to be invoked but will also cause the methods
2097 * [visitExecutableElement] and [visitElement] to be 2229 * [visitExecutableElement] and [visitElement] to be
2098 * subsequently invoked. This allows visitors to be written that visit all execu table elements 2230 * subsequently invoked. This allows visitors to be written that visit all execu table elements
2099 * without needing to override the visit method for each of the specific subclas ses of 2231 * without needing to override the visit method for each of the specific subclas ses of
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
2238 @override 2370 @override
2239 R visitMethodElement(MethodElement element) => visitExecutableElement(element) ; 2371 R visitMethodElement(MethodElement element) => visitExecutableElement(element) ;
2240 2372
2241 @override 2373 @override
2242 R visitMultiplyDefinedElement(MultiplyDefinedElement element) => visitElement( element); 2374 R visitMultiplyDefinedElement(MultiplyDefinedElement element) => visitElement( element);
2243 2375
2244 @override 2376 @override
2245 R visitParameterElement(ParameterElement element) => visitLocalElement(element ); 2377 R visitParameterElement(ParameterElement element) => visitLocalElement(element );
2246 2378
2247 @override 2379 @override
2380 R visitPolymerAttributeElement(PolymerAttributeElement element) => visitPolyme rElement(element);
2381
2382 R visitPolymerElement(PolymerElement element) => visitToolkitObjectElement(ele ment);
2383
2384 @override
2385 R visitPolymerTagDartElement(PolymerTagDartElement element) => visitPolymerEle ment(element);
2386
2387 @override
2388 R visitPolymerTagHtmlElement(PolymerTagHtmlElement element) => visitPolymerEle ment(element);
2389
2390 @override
2248 R visitPrefixElement(PrefixElement element) => visitElement(element); 2391 R visitPrefixElement(PrefixElement element) => visitElement(element);
2249 2392
2250 @override 2393 @override
2251 R visitPropertyAccessorElement(PropertyAccessorElement element) => visitExecut ableElement(element); 2394 R visitPropertyAccessorElement(PropertyAccessorElement element) => visitExecut ableElement(element);
2252 2395
2253 R visitPropertyInducingElement(PropertyInducingElement element) => visitVariab leElement(element); 2396 R visitPropertyInducingElement(PropertyInducingElement element) => visitVariab leElement(element);
2254 2397
2255 R visitToolkitObjectElement(ToolkitObjectElement element) => visitElement(elem ent); 2398 R visitToolkitObjectElement(ToolkitObjectElement element) => visitElement(elem ent);
2256 2399
2257 @override 2400 @override
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
2424 return null; 2567 return null;
2425 } 2568 }
2426 2569
2427 @override 2570 @override
2428 R visitParameterElement(ParameterElement element) { 2571 R visitParameterElement(ParameterElement element) {
2429 element.visitChildren(this); 2572 element.visitChildren(this);
2430 return null; 2573 return null;
2431 } 2574 }
2432 2575
2433 @override 2576 @override
2577 R visitPolymerAttributeElement(PolymerAttributeElement element) {
2578 element.visitChildren(this);
2579 return null;
2580 }
2581
2582 @override
2583 R visitPolymerTagDartElement(PolymerTagDartElement element) {
2584 element.visitChildren(this);
2585 return null;
2586 }
2587
2588 @override
2589 R visitPolymerTagHtmlElement(PolymerTagHtmlElement element) {
2590 element.visitChildren(this);
2591 return null;
2592 }
2593
2594 @override
2434 R visitPrefixElement(PrefixElement element) { 2595 R visitPrefixElement(PrefixElement element) {
2435 element.visitChildren(this); 2596 element.visitChildren(this);
2436 return null; 2597 return null;
2437 } 2598 }
2438 2599
2439 @override 2600 @override
2440 R visitPropertyAccessorElement(PropertyAccessorElement element) { 2601 R visitPropertyAccessorElement(PropertyAccessorElement element) {
2441 element.visitChildren(this); 2602 element.visitChildren(this);
2442 return null; 2603 return null;
2443 } 2604 }
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
2534 @override 2695 @override
2535 R visitMethodElement(MethodElement element) => null; 2696 R visitMethodElement(MethodElement element) => null;
2536 2697
2537 @override 2698 @override
2538 R visitMultiplyDefinedElement(MultiplyDefinedElement element) => null; 2699 R visitMultiplyDefinedElement(MultiplyDefinedElement element) => null;
2539 2700
2540 @override 2701 @override
2541 R visitParameterElement(ParameterElement element) => null; 2702 R visitParameterElement(ParameterElement element) => null;
2542 2703
2543 @override 2704 @override
2705 R visitPolymerAttributeElement(PolymerAttributeElement element) => null;
2706
2707 @override
2708 R visitPolymerTagDartElement(PolymerTagDartElement element) => null;
2709
2710 @override
2711 R visitPolymerTagHtmlElement(PolymerTagHtmlElement element) => null;
2712
2713 @override
2544 R visitPrefixElement(PrefixElement element) => null; 2714 R visitPrefixElement(PrefixElement element) => null;
2545 2715
2546 @override 2716 @override
2547 R visitPropertyAccessorElement(PropertyAccessorElement element) => null; 2717 R visitPropertyAccessorElement(PropertyAccessorElement element) => null;
2548 2718
2549 @override 2719 @override
2550 R visitTopLevelVariableElement(TopLevelVariableElement element) => null; 2720 R visitTopLevelVariableElement(TopLevelVariableElement element) => null;
2551 2721
2552 @override 2722 @override
2553 R visitTypeParameterElement(TypeParameterElement element) => null; 2723 R visitTypeParameterElement(TypeParameterElement element) => null;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
2645 /** 2815 /**
2646 * Initialize a newly created class element to have the given name. 2816 * Initialize a newly created class element to have the given name.
2647 * 2817 *
2648 * @param name the name of this element 2818 * @param name the name of this element
2649 */ 2819 */
2650 ClassElementImpl(Identifier name) : super.forNode(name); 2820 ClassElementImpl(Identifier name) : super.forNode(name);
2651 2821
2652 @override 2822 @override
2653 accept(ElementVisitor visitor) => visitor.visitClassElement(this); 2823 accept(ElementVisitor visitor) => visitor.visitClassElement(this);
2654 2824
2825 /**
2826 * Set the toolkit specific information objects attached to this class.
2827 *
2828 * @param toolkitObjects the toolkit objects attached to this class
2829 */
2830 void addToolkitObjects(ToolkitObjectElement toolkitObject) {
2831 (toolkitObject as ToolkitObjectElementImpl).enclosingElement = this;
2832 _toolkitObjects = ArrayUtils.add(_toolkitObjects, toolkitObject);
2833 }
2834
2655 @override 2835 @override
2656 List<PropertyAccessorElement> get accessors => _accessors; 2836 List<PropertyAccessorElement> get accessors => _accessors;
2657 2837
2658 @override 2838 @override
2659 List<InterfaceType> get allSupertypes { 2839 List<InterfaceType> get allSupertypes {
2660 List<InterfaceType> list = new List<InterfaceType>(); 2840 List<InterfaceType> list = new List<InterfaceType>();
2661 _collectAllSupertypes(list); 2841 _collectAllSupertypes(list);
2662 return new List.from(list); 2842 return new List.from(list);
2663 } 2843 }
2664 2844
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
3001 * @param methods the methods contained in this class 3181 * @param methods the methods contained in this class
3002 */ 3182 */
3003 void set methods(List<MethodElement> methods) { 3183 void set methods(List<MethodElement> methods) {
3004 for (MethodElement method in methods) { 3184 for (MethodElement method in methods) {
3005 (method as MethodElementImpl).enclosingElement = this; 3185 (method as MethodElementImpl).enclosingElement = this;
3006 } 3186 }
3007 this._methods = methods; 3187 this._methods = methods;
3008 } 3188 }
3009 3189
3010 /** 3190 /**
3011 * Set the toolkit specific information objects attached to this class.
3012 *
3013 * @param toolkitObjects the toolkit objects attached to this class
3014 */
3015 void set toolkitObjects(List<ToolkitObjectElement> toolkitObjects) {
3016 for (ToolkitObjectElement toolkitObject in toolkitObjects) {
3017 (toolkitObject as ToolkitObjectElementImpl).enclosingElement = this;
3018 }
3019 this._toolkitObjects = toolkitObjects;
3020 }
3021
3022 /**
3023 * Set whether this class is defined by a typedef construct to correspond to t he given value. 3191 * Set whether this class is defined by a typedef construct to correspond to t he given value.
3024 * 3192 *
3025 * @param isTypedef `true` if the class is defined by a typedef construct 3193 * @param isTypedef `true` if the class is defined by a typedef construct
3026 */ 3194 */
3027 void set typedef(bool isTypedef) { 3195 void set typedef(bool isTypedef) {
3028 setModifier(Modifier.TYPEDEF, isTypedef); 3196 setModifier(Modifier.TYPEDEF, isTypedef);
3029 } 3197 }
3030 3198
3031 /** 3199 /**
3032 * Set the type parameters defined for this class to the given type parameters . 3200 * Set the type parameters defined for this class to the given type parameters .
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
3267 } 3435 }
3268 return null; 3436 return null;
3269 } 3437 }
3270 3438
3271 @override 3439 @override
3272 List<ClassElement> get types => _types; 3440 List<ClassElement> get types => _types;
3273 3441
3274 @override 3442 @override
3275 int get hashCode => source.hashCode; 3443 int get hashCode => source.hashCode;
3276 3444
3445 @override
3446 bool get hasLoadLibraryFunction {
3447 for (int i = 0; i < _functions.length; i++) {
3448 if (_functions[i].name == FunctionElement.LOAD_LIBRARY_NAME) {
3449 return true;
3450 }
3451 }
3452 return false;
3453 }
3454
3277 /** 3455 /**
3278 * Set the top-level accessors (getters and setters) contained in this compila tion unit to the 3456 * Set the top-level accessors (getters and setters) contained in this compila tion unit to the
3279 * given accessors. 3457 * given accessors.
3280 * 3458 *
3281 * @param the top-level accessors (getters and setters) contained in this comp ilation unit 3459 * @param the top-level accessors (getters and setters) contained in this comp ilation unit
3282 */ 3460 */
3283 void set accessors(List<PropertyAccessorElement> accessors) { 3461 void set accessors(List<PropertyAccessorElement> accessors) {
3284 for (PropertyAccessorElement accessor in accessors) { 3462 for (PropertyAccessorElement accessor in accessors) {
3285 (accessor as PropertyAccessorElementImpl).enclosingElement = this; 3463 (accessor as PropertyAccessorElementImpl).enclosingElement = this;
3286 } 3464 }
(...skipping 1664 matching lines...) Expand 10 before | Expand all | Expand 10 after
4951 * The analysis context in which this library is defined. 5129 * The analysis context in which this library is defined.
4952 */ 5130 */
4953 final AnalysisContext context; 5131 final AnalysisContext context;
4954 5132
4955 /** 5133 /**
4956 * The scripts contained in or referenced from script tags in the HTML file. 5134 * The scripts contained in or referenced from script tags in the HTML file.
4957 */ 5135 */
4958 List<HtmlScriptElement> _scripts = HtmlScriptElementImpl.EMPTY_ARRAY; 5136 List<HtmlScriptElement> _scripts = HtmlScriptElementImpl.EMPTY_ARRAY;
4959 5137
4960 /** 5138 /**
5139 * The [PolymerTagHtmlElement]s defined in the HTML file.
5140 */
5141 List<PolymerTagHtmlElement> _polymerTags = PolymerTagHtmlElement.EMPTY_ARRAY;
5142
5143 /**
4961 * The source that corresponds to this HTML file. 5144 * The source that corresponds to this HTML file.
4962 */ 5145 */
4963 Source source; 5146 Source source;
4964 5147
4965 /** 5148 /**
4966 * The element associated with Dart pieces in this HTML unit or `null` if the receiver is 5149 * The element associated with Dart pieces in this HTML unit or `null` if the receiver is
4967 * not resolved. 5150 * not resolved.
4968 */ 5151 */
4969 CompilationUnitElement angularCompilationUnit; 5152 CompilationUnitElement angularCompilationUnit;
4970 5153
(...skipping 16 matching lines...) Expand all
4987 if (object == null) { 5170 if (object == null) {
4988 return false; 5171 return false;
4989 } 5172 }
4990 return runtimeType == object.runtimeType && source == (object as HtmlElement Impl).source; 5173 return runtimeType == object.runtimeType && source == (object as HtmlElement Impl).source;
4991 } 5174 }
4992 5175
4993 @override 5176 @override
4994 ElementKind get kind => ElementKind.HTML; 5177 ElementKind get kind => ElementKind.HTML;
4995 5178
4996 @override 5179 @override
5180 List<PolymerTagHtmlElement> get polymerTags => _polymerTags;
5181
5182 @override
4997 List<HtmlScriptElement> get scripts => _scripts; 5183 List<HtmlScriptElement> get scripts => _scripts;
4998 5184
4999 @override 5185 @override
5000 int get hashCode => source.hashCode; 5186 int get hashCode => source.hashCode;
5001 5187
5002 /** 5188 /**
5189 * Set the [PolymerTagHtmlElement]s defined in the HTML file.
5190 */
5191 void set polymerTags(List<PolymerTagHtmlElement> polymerTags) {
5192 if (polymerTags.length == 0) {
5193 this._polymerTags = PolymerTagHtmlElement.EMPTY_ARRAY;
5194 return;
5195 }
5196 for (PolymerTagHtmlElement tag in polymerTags) {
5197 (tag as PolymerTagHtmlElementImpl).enclosingElement = this;
5198 }
5199 this._polymerTags = polymerTags;
5200 }
5201
5202 /**
5003 * Set the scripts contained in the HTML file to the given scripts. 5203 * Set the scripts contained in the HTML file to the given scripts.
5004 * 5204 *
5005 * @param scripts the scripts 5205 * @param scripts the scripts
5006 */ 5206 */
5007 void set scripts(List<HtmlScriptElement> scripts) { 5207 void set scripts(List<HtmlScriptElement> scripts) {
5008 if (scripts.length == 0) { 5208 if (scripts.length == 0) {
5009 scripts = HtmlScriptElementImpl.EMPTY_ARRAY; 5209 this._scripts = HtmlScriptElementImpl.EMPTY_ARRAY;
5210 return;
5010 } 5211 }
5011 for (HtmlScriptElement script in scripts) { 5212 for (HtmlScriptElement script in scripts) {
5012 (script as HtmlScriptElementImpl).enclosingElement = this; 5213 (script as HtmlScriptElementImpl).enclosingElement = this;
5013 } 5214 }
5014 this._scripts = scripts; 5215 this._scripts = scripts;
5015 } 5216 }
5016 5217
5017 @override 5218 @override
5018 void visitChildren(ElementVisitor visitor) { 5219 void visitChildren(ElementVisitor visitor) {
5019 super.visitChildren(visitor); 5220 super.visitChildren(visitor);
5020 safelyVisitChildren(_scripts, visitor); 5221 safelyVisitChildren(_scripts, visitor);
5222 safelyVisitChildren(_polymerTags, visitor);
5021 } 5223 }
5022 5224
5023 @override 5225 @override
5024 void appendTo(JavaStringBuilder builder) { 5226 void appendTo(JavaStringBuilder builder) {
5025 if (source == null) { 5227 if (source == null) {
5026 builder.append("{HTML file}"); 5228 builder.append("{HTML file}");
5027 } else { 5229 } else {
5028 builder.append(source.fullName); 5230 builder.append(source.fullName);
5029 } 5231 }
5030 } 5232 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
5081 */ 5283 */
5082 ImportElementImpl(int offset) : super(null, offset); 5284 ImportElementImpl(int offset) : super(null, offset);
5083 5285
5084 @override 5286 @override
5085 accept(ElementVisitor visitor) => visitor.visitImportElement(this); 5287 accept(ElementVisitor visitor) => visitor.visitImportElement(this);
5086 5288
5087 @override 5289 @override
5088 ElementKind get kind => ElementKind.IMPORT; 5290 ElementKind get kind => ElementKind.IMPORT;
5089 5291
5090 @override 5292 @override
5293 bool get isDeferred => hasModifier(Modifier.DEFERRED);
5294
5295 /**
5296 * Set whether this import is for a deferred library to correspond to the give n value.
5297 *
5298 * @param isDeferred `true` if this import is for a deferred library
5299 */
5300 void set deferred(bool isDeferred) {
5301 setModifier(Modifier.DEFERRED, isDeferred);
5302 }
5303
5304 @override
5091 void visitChildren(ElementVisitor visitor) { 5305 void visitChildren(ElementVisitor visitor) {
5092 super.visitChildren(visitor); 5306 super.visitChildren(visitor);
5093 safelyVisitChild(prefix, visitor); 5307 safelyVisitChild(prefix, visitor);
5094 } 5308 }
5095 5309
5096 @override 5310 @override
5097 void appendTo(JavaStringBuilder builder) { 5311 void appendTo(JavaStringBuilder builder) {
5098 builder.append("import "); 5312 builder.append("import ");
5099 (importedLibrary as LibraryElementImpl).appendTo(builder); 5313 (importedLibrary as LibraryElementImpl).appendTo(builder);
5100 } 5314 }
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
5369 return new List.from(visibleLibraries); 5583 return new List.from(visibleLibraries);
5370 } 5584 }
5371 5585
5372 @override 5586 @override
5373 bool get hasExtUri => hasModifier(Modifier.HAS_EXT_URI); 5587 bool get hasExtUri => hasModifier(Modifier.HAS_EXT_URI);
5374 5588
5375 @override 5589 @override
5376 int get hashCode => _definingCompilationUnit.hashCode; 5590 int get hashCode => _definingCompilationUnit.hashCode;
5377 5591
5378 @override 5592 @override
5593 bool get hasLoadLibraryFunction {
5594 if (_definingCompilationUnit.hasLoadLibraryFunction) {
5595 return true;
5596 }
5597 for (int i = 0; i < _parts.length; i++) {
5598 if (_parts[i].hasLoadLibraryFunction) {
5599 return true;
5600 }
5601 }
5602 return false;
5603 }
5604
5605 @override
5379 bool get isAngularHtml => _isAngularHtml; 5606 bool get isAngularHtml => _isAngularHtml;
5380 5607
5381 @override 5608 @override
5382 bool get isBrowserApplication => entryPoint != null && isOrImportsBrowserLibra ry; 5609 bool get isBrowserApplication => entryPoint != null && isOrImportsBrowserLibra ry;
5383 5610
5384 @override 5611 @override
5385 bool get isDartCore => name == "dart.core"; 5612 bool get isDartCore => name == "dart.core";
5386 5613
5387 @override 5614 @override
5388 bool get isInSdk => StringUtilities.startsWith5(name, 0, 0x64, 0x61, 0x72, 0x7 4, 0x2E); 5615 bool get isInSdk => StringUtilities.startsWith5(name, 0, 0x64, 0x61, 0x72, 0x7 4, 0x2E);
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
5745 * Indicates that the modifier 'abstract' was applied to the element. 5972 * Indicates that the modifier 'abstract' was applied to the element.
5746 */ 5973 */
5747 static const Modifier ABSTRACT = const Modifier('ABSTRACT', 0); 5974 static const Modifier ABSTRACT = const Modifier('ABSTRACT', 0);
5748 5975
5749 /** 5976 /**
5750 * Indicates that the modifier 'const' was applied to the element. 5977 * Indicates that the modifier 'const' was applied to the element.
5751 */ 5978 */
5752 static const Modifier CONST = const Modifier('CONST', 1); 5979 static const Modifier CONST = const Modifier('CONST', 1);
5753 5980
5754 /** 5981 /**
5982 * Indicates that the import element represents a deferred library.
5983 */
5984 static const Modifier DEFERRED = const Modifier('DEFERRED', 2);
5985
5986 /**
5755 * Indicates that the modifier 'factory' was applied to the element. 5987 * Indicates that the modifier 'factory' was applied to the element.
5756 */ 5988 */
5757 static const Modifier FACTORY = const Modifier('FACTORY', 2); 5989 static const Modifier FACTORY = const Modifier('FACTORY', 3);
5758 5990
5759 /** 5991 /**
5760 * Indicates that the modifier 'final' was applied to the element. 5992 * Indicates that the modifier 'final' was applied to the element.
5761 */ 5993 */
5762 static const Modifier FINAL = const Modifier('FINAL', 3); 5994 static const Modifier FINAL = const Modifier('FINAL', 4);
5763 5995
5764 /** 5996 /**
5765 * Indicates that the pseudo-modifier 'get' was applied to the element. 5997 * Indicates that the pseudo-modifier 'get' was applied to the element.
5766 */ 5998 */
5767 static const Modifier GETTER = const Modifier('GETTER', 4); 5999 static const Modifier GETTER = const Modifier('GETTER', 5);
5768 6000
5769 /** 6001 /**
5770 * A flag used for libraries indicating that the defining compilation unit con tains at least one 6002 * A flag used for libraries indicating that the defining compilation unit con tains at least one
5771 * import directive whose URI uses the "dart-ext" scheme. 6003 * import directive whose URI uses the "dart-ext" scheme.
5772 */ 6004 */
5773 static const Modifier HAS_EXT_URI = const Modifier('HAS_EXT_URI', 5); 6005 static const Modifier HAS_EXT_URI = const Modifier('HAS_EXT_URI', 6);
5774 6006
5775 static const Modifier MIXIN = const Modifier('MIXIN', 6); 6007 static const Modifier MIXIN = const Modifier('MIXIN', 7);
5776 6008
5777 static const Modifier REFERENCES_SUPER = const Modifier('REFERENCES_SUPER', 7) ; 6009 static const Modifier REFERENCES_SUPER = const Modifier('REFERENCES_SUPER', 8) ;
5778 6010
5779 /** 6011 /**
5780 * Indicates that the pseudo-modifier 'set' was applied to the element. 6012 * Indicates that the pseudo-modifier 'set' was applied to the element.
5781 */ 6013 */
5782 static const Modifier SETTER = const Modifier('SETTER', 8); 6014 static const Modifier SETTER = const Modifier('SETTER', 9);
5783 6015
5784 /** 6016 /**
5785 * Indicates that the modifier 'static' was applied to the element. 6017 * Indicates that the modifier 'static' was applied to the element.
5786 */ 6018 */
5787 static const Modifier STATIC = const Modifier('STATIC', 9); 6019 static const Modifier STATIC = const Modifier('STATIC', 10);
5788 6020
5789 /** 6021 /**
5790 * Indicates that the element does not appear in the source code but was impli citly created. For 6022 * Indicates that the element does not appear in the source code but was impli citly created. For
5791 * example, if a class does not define any constructors, an implicit zero-argu ment constructor 6023 * example, if a class does not define any constructors, an implicit zero-argu ment constructor
5792 * will be created and it will be marked as being synthetic. 6024 * will be created and it will be marked as being synthetic.
5793 */ 6025 */
5794 static const Modifier SYNTHETIC = const Modifier('SYNTHETIC', 10); 6026 static const Modifier SYNTHETIC = const Modifier('SYNTHETIC', 11);
5795 6027
5796 static const Modifier TYPEDEF = const Modifier('TYPEDEF', 11); 6028 static const Modifier TYPEDEF = const Modifier('TYPEDEF', 12);
5797 6029
5798 static const List<Modifier> values = const [ 6030 static const List<Modifier> values = const [
5799 ABSTRACT, 6031 ABSTRACT,
5800 CONST, 6032 CONST,
6033 DEFERRED,
5801 FACTORY, 6034 FACTORY,
5802 FINAL, 6035 FINAL,
5803 GETTER, 6036 GETTER,
5804 HAS_EXT_URI, 6037 HAS_EXT_URI,
5805 MIXIN, 6038 MIXIN,
5806 REFERENCES_SUPER, 6039 REFERENCES_SUPER,
5807 SETTER, 6040 SETTER,
5808 STATIC, 6041 STATIC,
5809 SYNTHETIC, 6042 SYNTHETIC,
5810 TYPEDEF]; 6043 TYPEDEF];
(...skipping 2194 matching lines...) Expand 10 before | Expand all | Expand 10 after
8005 @override 8238 @override
8006 void visitChildren(ElementVisitor visitor) { 8239 void visitChildren(ElementVisitor visitor) {
8007 // TODO(brianwilkerson) We need to finish implementing the accessors used be low so that we can 8240 // TODO(brianwilkerson) We need to finish implementing the accessors used be low so that we can
8008 // safely invoke them. 8241 // safely invoke them.
8009 super.visitChildren(visitor); 8242 super.visitChildren(visitor);
8010 safelyVisitChild(baseElement.initializer, visitor); 8243 safelyVisitChild(baseElement.initializer, visitor);
8011 } 8244 }
8012 } 8245 }
8013 8246
8014 /** 8247 /**
8248 * Implementation of `PolymerAttributeElement`.
8249 */
8250 class PolymerAttributeElementImpl extends PolymerElementImpl implements PolymerA ttributeElement {
8251 /**
8252 * The [FieldElement] associated with this attribute.
8253 */
8254 FieldElement field;
8255
8256 /**
8257 * Initialize a newly created Polymer attribute to have the given name.
8258 *
8259 * @param name the name of this element
8260 * @param nameOffset the offset of the name of this element in the file that c ontains the
8261 * declaration of this element
8262 */
8263 PolymerAttributeElementImpl(String name, int nameOffset) : super(name, nameOff set);
8264
8265 @override
8266 accept(ElementVisitor visitor) => visitor.visitPolymerAttributeElement(this);
8267
8268 @override
8269 ElementKind get kind => ElementKind.POLYMER_ATTRIBUTE;
8270 }
8271
8272 /**
8273 * Implementation of `PolymerElement`.
8274 */
8275 abstract class PolymerElementImpl extends ToolkitObjectElementImpl implements Po lymerElement {
8276 /**
8277 * Initialize a newly created Polymer element to have the given name.
8278 *
8279 * @param name the name of this element
8280 * @param nameOffset the offset of the name of this element in the file that c ontains the
8281 * declaration of this element
8282 */
8283 PolymerElementImpl(String name, int nameOffset) : super(name, nameOffset);
8284 }
8285
8286 /**
8287 * Implementation of `PolymerTagDartElement`.
8288 */
8289 class PolymerTagDartElementImpl extends PolymerElementImpl implements PolymerTag DartElement {
8290 /**
8291 * The [ClassElement] that is associated with this Polymer custom tag.
8292 */
8293 final ClassElement classElement;
8294
8295 /**
8296 * The [PolymerTagHtmlElement] part of this Polymer custom tag. Maybe `null` i f it has
8297 * not been resolved yet or there are no corresponding Dart part defined.
8298 */
8299 PolymerTagHtmlElement htmlElement;
8300
8301 /**
8302 * Initialize a newly created Dart part of a Polymer tag to have the given nam e.
8303 *
8304 * @param name the name of this element
8305 * @param nameOffset the offset of the name of this element in the file that c ontains the
8306 * declaration of this element
8307 */
8308 PolymerTagDartElementImpl(String name, int nameOffset, this.classElement) : su per(name, nameOffset);
8309
8310 @override
8311 accept(ElementVisitor visitor) => visitor.visitPolymerTagDartElement(this);
8312
8313 @override
8314 ElementKind get kind => ElementKind.POLYMER_TAG_DART;
8315 }
8316
8317 /**
8318 * Implementation of `PolymerTagHtmlElement`.
8319 */
8320 class PolymerTagHtmlElementImpl extends PolymerElementImpl implements PolymerTag HtmlElement {
8321 /**
8322 * The [PolymerTagDartElement] part of this Polymer custom tag. Maybe `null` i f it has
8323 * not been resolved yet or there are no corresponding Dart part defined.
8324 */
8325 PolymerTagDartElement dartElement;
8326
8327 /**
8328 * The array containing all of the attributes declared by this tag.
8329 */
8330 List<PolymerAttributeElement> _attributes = PolymerAttributeElement.EMPTY_ARRA Y;
8331
8332 /**
8333 * Initialize a newly created HTML part of a Polymer tag to have the given nam e.
8334 *
8335 * @param name the name of this element
8336 * @param nameOffset the offset of the name of this element in the file that c ontains the
8337 * declaration of this element
8338 */
8339 PolymerTagHtmlElementImpl(String name, int nameOffset) : super(name, nameOffse t);
8340
8341 @override
8342 accept(ElementVisitor visitor) => visitor.visitPolymerTagHtmlElement(this);
8343
8344 @override
8345 List<PolymerAttributeElement> get attributes => _attributes;
8346
8347 @override
8348 ElementKind get kind => ElementKind.POLYMER_TAG_HTML;
8349
8350 /**
8351 * Set an array containing all of the attributes declared by this tag.
8352 *
8353 * @param attributes the properties to set
8354 */
8355 void set attributes(List<PolymerAttributeElement> attributes) {
8356 for (PolymerAttributeElement property in attributes) {
8357 encloseElement(property as PolymerAttributeElementImpl);
8358 }
8359 this._attributes = attributes;
8360 }
8361
8362 @override
8363 void visitChildren(ElementVisitor visitor) {
8364 safelyVisitChildren(_attributes, visitor);
8365 super.visitChildren(visitor);
8366 }
8367 }
8368
8369 /**
8015 * The unique instance of the class `BottomTypeImpl` implements the type `bottom `. 8370 * The unique instance of the class `BottomTypeImpl` implements the type `bottom `.
8016 */ 8371 */
8017 class BottomTypeImpl extends TypeImpl { 8372 class BottomTypeImpl extends TypeImpl {
8018 /** 8373 /**
8019 * The unique instance of this class. 8374 * The unique instance of this class.
8020 */ 8375 */
8021 static BottomTypeImpl _INSTANCE = new BottomTypeImpl(); 8376 static BottomTypeImpl _INSTANCE = new BottomTypeImpl();
8022 8377
8023 /** 8378 /**
8024 * Return the unique instance of this class. 8379 * Return the unique instance of this class.
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
8133 * @param firstTypes the first map of name/type pairs being compared 8488 * @param firstTypes the first map of name/type pairs being compared
8134 * @param secondTypes the second map of name/type pairs being compared 8489 * @param secondTypes the second map of name/type pairs being compared
8135 * @param visitedElementPairs a set of visited element pairs 8490 * @param visitedElementPairs a set of visited element pairs
8136 * @return `true` if all of the name/type pairs in the first map are equal to the 8491 * @return `true` if all of the name/type pairs in the first map are equal to the
8137 * corresponding name/type pairs in the second map 8492 * corresponding name/type pairs in the second map
8138 */ 8493 */
8139 static bool _equals(Map<String, DartType> firstTypes, Map<String, DartType> se condTypes, Set<ElementPair> visitedElementPairs) { 8494 static bool _equals(Map<String, DartType> firstTypes, Map<String, DartType> se condTypes, Set<ElementPair> visitedElementPairs) {
8140 if (secondTypes.length != firstTypes.length) { 8495 if (secondTypes.length != firstTypes.length) {
8141 return false; 8496 return false;
8142 } 8497 }
8143 JavaIterator<MapEntry<String, DartType>> firstIterator = new JavaIterator(ge tMapEntrySet(firstTypes)); 8498 MapIterator<String, DartType> firstIterator = SingleMapIterator.forMap(first Types);
8144 JavaIterator<MapEntry<String, DartType>> secondIterator = new JavaIterator(g etMapEntrySet(secondTypes)); 8499 MapIterator<String, DartType> secondIterator = SingleMapIterator.forMap(seco ndTypes);
8145 while (firstIterator.hasNext) { 8500 while (firstIterator.moveNext() && secondIterator.moveNext()) {
8146 MapEntry<String, DartType> firstEntry = firstIterator.next(); 8501 if (firstIterator.key != secondIterator.key || !(firstIterator.value as Ty peImpl).internalEquals(secondIterator.value, visitedElementPairs)) {
8147 MapEntry<String, DartType> secondEntry = secondIterator.next();
8148 if (firstEntry.getKey() != secondEntry.getKey() || !(firstEntry.getValue() as TypeImpl).internalEquals(secondEntry.getValue(), visitedElementPairs)) {
8149 return false; 8502 return false;
8150 } 8503 }
8151 } 8504 }
8152 return true; 8505 return true;
8153 } 8506 }
8154 8507
8155 /** 8508 /**
8156 * An array containing the actual types of the type arguments. 8509 * An array containing the actual types of the type arguments.
8157 */ 8510 */
8158 List<DartType> typeArguments = TypeImpl.EMPTY_ARRAY; 8511 List<DartType> typeArguments = TypeImpl.EMPTY_ARRAY;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
8214 } 8567 }
8215 builder.append("]"); 8568 builder.append("]");
8216 needsComma = true; 8569 needsComma = true;
8217 } 8570 }
8218 if (namedParameterTypes.length > 0) { 8571 if (namedParameterTypes.length > 0) {
8219 if (needsComma) { 8572 if (needsComma) {
8220 builder.append(", "); 8573 builder.append(", ");
8221 needsComma = false; 8574 needsComma = false;
8222 } 8575 }
8223 builder.append("{"); 8576 builder.append("{");
8224 for (MapEntry<String, DartType> entry in getMapEntrySet(namedParameterTy pes)) { 8577 for (MapIterator<String, DartType> iter = SingleMapIterator.forMap(named ParameterTypes); iter.moveNext();) {
8225 if (needsComma) { 8578 if (needsComma) {
8226 builder.append(", "); 8579 builder.append(", ");
8227 } else { 8580 } else {
8228 needsComma = true; 8581 needsComma = true;
8229 } 8582 }
8230 builder.append(entry.getKey()); 8583 builder.append(iter.key);
8231 builder.append(": "); 8584 builder.append(": ");
8232 builder.append(entry.getValue().displayName); 8585 builder.append(iter.value.displayName);
8233 } 8586 }
8234 builder.append("}"); 8587 builder.append("}");
8235 needsComma = true; 8588 needsComma = true;
8236 } 8589 }
8237 builder.append(")"); 8590 builder.append(")");
8238 builder.append(Element.RIGHT_ARROW); 8591 builder.append(Element.RIGHT_ARROW);
8239 if (returnType == null) { 8592 if (returnType == null) {
8240 builder.append("null"); 8593 builder.append("null");
8241 } else { 8594 } else {
8242 builder.append(returnType.displayName); 8595 builder.append(returnType.displayName);
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
8393 } 8746 }
8394 } 8747 }
8395 Map<String, DartType> namedTypesT = t.namedParameterTypes; 8748 Map<String, DartType> namedTypesT = t.namedParameterTypes;
8396 Map<String, DartType> namedTypesS = s.namedParameterTypes; 8749 Map<String, DartType> namedTypesS = s.namedParameterTypes;
8397 // if k >= m is false, return false: the passed function type has more nam ed parameter types than this 8750 // if k >= m is false, return false: the passed function type has more nam ed parameter types than this
8398 if (namedTypesT.length < namedTypesS.length) { 8751 if (namedTypesT.length < namedTypesS.length) {
8399 return false; 8752 return false;
8400 } 8753 }
8401 // Loop through each element in S verifying that T has a matching paramete r name and that the 8754 // Loop through each element in S verifying that T has a matching paramete r name and that the
8402 // corresponding type is more specific then the type in S. 8755 // corresponding type is more specific then the type in S.
8403 JavaIterator<MapEntry<String, DartType>> iteratorS = new JavaIterator(getM apEntrySet(namedTypesS)); 8756 MapIterator<String, DartType> iteratorS = SingleMapIterator.forMap(namedTy pesS);
8404 while (iteratorS.hasNext) { 8757 while (iteratorS.moveNext()) {
8405 MapEntry<String, DartType> entryS = iteratorS.next(); 8758 DartType typeT = namedTypesT[iteratorS.key];
8406 DartType typeT = namedTypesT[entryS.getKey()];
8407 if (typeT == null) { 8759 if (typeT == null) {
8408 return false; 8760 return false;
8409 } 8761 }
8410 if (!(typeT as TypeImpl).isMoreSpecificThan2(entryS.getValue(), withDyna mic, visitedTypePairs)) { 8762 if (!(typeT as TypeImpl).isMoreSpecificThan2(iteratorS.value, withDynami c, visitedTypePairs)) {
8411 return false; 8763 return false;
8412 } 8764 }
8413 } 8765 }
8414 } else if (s.namedParameterTypes.length > 0) { 8766 } else if (s.namedParameterTypes.length > 0) {
8415 return false; 8767 return false;
8416 } else { 8768 } else {
8417 // positional parameter case 8769 // positional parameter case
8418 int tArgLength = tTypes.length + tOpTypes.length; 8770 int tArgLength = tTypes.length + tOpTypes.length;
8419 int sArgLength = sTypes.length + sOpTypes.length; 8771 int sArgLength = sTypes.length + sOpTypes.length;
8420 // Check that the total number of parameters in t is greater than or equal to the number of 8772 // Check that the total number of parameters in t is greater than or equal to the number of
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
8513 } 8865 }
8514 builder.append("]"); 8866 builder.append("]");
8515 needsComma = true; 8867 needsComma = true;
8516 } 8868 }
8517 if (namedParameterTypes.length > 0) { 8869 if (namedParameterTypes.length > 0) {
8518 if (needsComma) { 8870 if (needsComma) {
8519 builder.append(", "); 8871 builder.append(", ");
8520 needsComma = false; 8872 needsComma = false;
8521 } 8873 }
8522 builder.append("{"); 8874 builder.append("{");
8523 for (MapEntry<String, DartType> entry in getMapEntrySet(namedParameterType s)) { 8875 for (MapIterator<String, DartType> iter = SingleMapIterator.forMap(namedPa rameterTypes); iter.moveNext();) {
8524 if (needsComma) { 8876 if (needsComma) {
8525 builder.append(", "); 8877 builder.append(", ");
8526 } else { 8878 } else {
8527 needsComma = true; 8879 needsComma = true;
8528 } 8880 }
8529 builder.append(entry.getKey()); 8881 builder.append(iter.key);
8530 builder.append(": "); 8882 builder.append(": ");
8531 (entry.getValue() as TypeImpl).appendTo(builder); 8883 (iter.value as TypeImpl).appendTo(builder);
8532 } 8884 }
8533 builder.append("}"); 8885 builder.append("}");
8534 needsComma = true; 8886 needsComma = true;
8535 } 8887 }
8536 builder.append(")"); 8888 builder.append(")");
8537 builder.append(Element.RIGHT_ARROW); 8889 builder.append(Element.RIGHT_ARROW);
8538 if (returnType == null) { 8890 if (returnType == null) {
8539 builder.append("null"); 8891 builder.append("null");
8540 } else { 8892 } else {
8541 (returnType as TypeImpl).appendTo(builder); 8893 (returnType as TypeImpl).appendTo(builder);
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
8609 } 8961 }
8610 } 8962 }
8611 Map<String, DartType> namedTypesT = t.namedParameterTypes; 8963 Map<String, DartType> namedTypesT = t.namedParameterTypes;
8612 Map<String, DartType> namedTypesS = s.namedParameterTypes; 8964 Map<String, DartType> namedTypesS = s.namedParameterTypes;
8613 // if k >= m is false, return false: the passed function type has more nam ed parameter types than this 8965 // if k >= m is false, return false: the passed function type has more nam ed parameter types than this
8614 if (namedTypesT.length < namedTypesS.length) { 8966 if (namedTypesT.length < namedTypesS.length) {
8615 return false; 8967 return false;
8616 } 8968 }
8617 // Loop through each element in S verifying that T has a matching paramete r name and that the 8969 // Loop through each element in S verifying that T has a matching paramete r name and that the
8618 // corresponding type is assignable to the type in S. 8970 // corresponding type is assignable to the type in S.
8619 JavaIterator<MapEntry<String, DartType>> iteratorS = new JavaIterator(getM apEntrySet(namedTypesS)); 8971 MapIterator<String, DartType> iteratorS = SingleMapIterator.forMap(namedTy pesS);
8620 while (iteratorS.hasNext) { 8972 while (iteratorS.moveNext()) {
8621 MapEntry<String, DartType> entryS = iteratorS.next(); 8973 DartType typeT = namedTypesT[iteratorS.key];
8622 DartType typeT = namedTypesT[entryS.getKey()];
8623 if (typeT == null) { 8974 if (typeT == null) {
8624 return false; 8975 return false;
8625 } 8976 }
8626 if (!(typeT as TypeImpl).isAssignableTo2(entryS.getValue(), visitedTypeP airs)) { 8977 if (!(typeT as TypeImpl).isAssignableTo2(iteratorS.value, visitedTypePai rs)) {
8627 return false; 8978 return false;
8628 } 8979 }
8629 } 8980 }
8630 } else if (s.namedParameterTypes.length > 0) { 8981 } else if (s.namedParameterTypes.length > 0) {
8631 return false; 8982 return false;
8632 } else { 8983 } else {
8633 // positional parameter case 8984 // positional parameter case
8634 int tArgLength = tTypes.length + tOpTypes.length; 8985 int tArgLength = tTypes.length + tOpTypes.length;
8635 int sArgLength = sTypes.length + sOpTypes.length; 8986 int sArgLength = sTypes.length + sOpTypes.length;
8636 // Check that the total number of parameters in t is greater than or equal to the number of 8987 // Check that the total number of parameters in t is greater than or equal to the number of
(...skipping 1778 matching lines...) Expand 10 before | Expand all | Expand 10 after
10415 } 10766 }
10416 10767
10417 /** 10768 /**
10418 * The interface `VoidType` defines the behavior of the unique object representi ng the type 10769 * The interface `VoidType` defines the behavior of the unique object representi ng the type
10419 * `void`. 10770 * `void`.
10420 */ 10771 */
10421 abstract class VoidType implements DartType { 10772 abstract class VoidType implements DartType {
10422 @override 10773 @override
10423 VoidType substitute2(List<DartType> argumentTypes, List<DartType> parameterTyp es); 10774 VoidType substitute2(List<DartType> argumentTypes, List<DartType> parameterTyp es);
10424 } 10775 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/constant.dart ('k') | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698