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

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

Issue 23852002: java2dart improvements and new analyzer_experimental snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 library engine.element; 3 library engine.element;
4 import 'dart:collection'; 4 import 'dart:collection';
5 import 'java_core.dart'; 5 import 'java_core.dart';
6 import 'java_engine.dart'; 6 import 'java_engine.dart';
7 import 'utilities_collection.dart'; 7 import 'utilities_collection.dart';
8 import 'source.dart'; 8 import 'source.dart';
9 import 'scanner.dart' show Keyword; 9 import 'scanner.dart' show Keyword;
10 import 'ast.dart' show Identifier, LibraryIdentifier; 10 import 'ast.dart' show Identifier, LibraryIdentifier;
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 * @return `true` if this element is synthetic 540 * @return `true` if this element is synthetic
541 */ 541 */
542 bool get isSynthetic; 542 bool get isSynthetic;
543 543
544 /** 544 /**
545 * Use the given visitor to visit all of the children of this element. There i s no guarantee of 545 * Use the given visitor to visit all of the children of this element. There i s no guarantee of
546 * the order in which the children will be visited. 546 * the order in which the children will be visited.
547 * 547 *
548 * @param visitor the visitor that will be used to visit the children of this element 548 * @param visitor the visitor that will be used to visit the children of this element
549 */ 549 */
550 void visitChildren(ElementVisitor<Object> visitor); 550 void visitChildren(ElementVisitor visitor);
551 } 551 }
552 /** 552 /**
553 * The interface `ElementAnnotation` defines the behavior of objects representin g a single 553 * The interface `ElementAnnotation` defines the behavior of objects representin g a single
554 * annotation associated with an element. 554 * annotation associated with an element.
555 * 555 *
556 * @coverage dart.engine.element 556 * @coverage dart.engine.element
557 */ 557 */
558 abstract class ElementAnnotation { 558 abstract class ElementAnnotation {
559 559
560 /** 560 /**
561 * Return the element representing the field, variable, or const constructor b eing used as an 561 * Return the element representing the field, variable, or const constructor b eing used as an
562 * annotation. 562 * annotation.
563 * 563 *
564 * @return the field, variable, or constructor being used as an annotation 564 * @return the field, variable, or constructor being used as an annotation
565 */ 565 */
566 Element get element; 566 Element get element;
567 } 567 }
568 /** 568 /**
569 * The enumeration `ElementKind` defines the various kinds of elements in the el ement model. 569 * The enumeration `ElementKind` defines the various kinds of elements in the el ement model.
570 * 570 *
571 * @coverage dart.engine.element 571 * @coverage dart.engine.element
572 */ 572 */
573 class ElementKind implements Enum<ElementKind> { 573 class ElementKind extends Enum<ElementKind> {
574 static final ElementKind CLASS = new ElementKind('CLASS', 0, "class"); 574 static final ElementKind CLASS = new ElementKind('CLASS', 0, "class");
575 static final ElementKind COMPILATION_UNIT = new ElementKind('COMPILATION_UNIT' , 1, "compilation unit"); 575 static final ElementKind COMPILATION_UNIT = new ElementKind('COMPILATION_UNIT' , 1, "compilation unit");
576 static final ElementKind CONSTRUCTOR = new ElementKind('CONSTRUCTOR', 2, "cons tructor"); 576 static final ElementKind CONSTRUCTOR = new ElementKind('CONSTRUCTOR', 2, "cons tructor");
577 static final ElementKind DYNAMIC = new ElementKind('DYNAMIC', 3, "<dynamic>"); 577 static final ElementKind DYNAMIC = new ElementKind('DYNAMIC', 3, "<dynamic>");
578 static final ElementKind EMBEDDED_HTML_SCRIPT = new ElementKind('EMBEDDED_HTML _SCRIPT', 4, "embedded html script"); 578 static final ElementKind EMBEDDED_HTML_SCRIPT = new ElementKind('EMBEDDED_HTML _SCRIPT', 4, "embedded html script");
579 static final ElementKind ERROR = new ElementKind('ERROR', 5, "<error>"); 579 static final ElementKind ERROR = new ElementKind('ERROR', 5, "<error>");
580 static final ElementKind EXPORT = new ElementKind('EXPORT', 6, "export directi ve"); 580 static final ElementKind EXPORT = new ElementKind('EXPORT', 6, "export directi ve");
581 static final ElementKind EXTERNAL_HTML_SCRIPT = new ElementKind('EXTERNAL_HTML _SCRIPT', 7, "external html script"); 581 static final ElementKind EXTERNAL_HTML_SCRIPT = new ElementKind('EXTERNAL_HTML _SCRIPT', 7, "external html script");
582 static final ElementKind FIELD = new ElementKind('FIELD', 8, "field"); 582 static final ElementKind FIELD = new ElementKind('FIELD', 8, "field");
583 static final ElementKind FUNCTION = new ElementKind('FUNCTION', 9, "function") ; 583 static final ElementKind FUNCTION = new ElementKind('FUNCTION', 9, "function") ;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 METHOD, 616 METHOD,
617 NAME, 617 NAME,
618 PARAMETER, 618 PARAMETER,
619 PREFIX, 619 PREFIX,
620 SETTER, 620 SETTER,
621 TOP_LEVEL_VARIABLE, 621 TOP_LEVEL_VARIABLE,
622 FUNCTION_TYPE_ALIAS, 622 FUNCTION_TYPE_ALIAS,
623 TYPE_VARIABLE, 623 TYPE_VARIABLE,
624 UNIVERSE]; 624 UNIVERSE];
625 625
626 /// The name of this enum constant, as declared in the enum declaration.
627 final String name;
628
629 /// The position in the enum declaration.
630 final int ordinal;
631
632 /** 626 /**
633 * Return the kind of the given element, or [ERROR] if the element is `null`. This is 627 * Return the kind of the given element, or [ERROR] if the element is `null`. This is
634 * a utility method that can reduce the need for null checks in other places. 628 * a utility method that can reduce the need for null checks in other places.
635 * 629 *
636 * @param element the element whose kind is to be returned 630 * @param element the element whose kind is to be returned
637 * @return the kind of the given element 631 * @return the kind of the given element
638 */ 632 */
639 static ElementKind of(Element element) { 633 static ElementKind of(Element element) {
640 if (element == null) { 634 if (element == null) {
641 return ERROR; 635 return ERROR;
642 } 636 }
643 return element.kind; 637 return element.kind;
644 } 638 }
645 639
646 /** 640 /**
647 * The name displayed in the UI for this kind of element. 641 * The name displayed in the UI for this kind of element.
648 */ 642 */
649 String _displayName; 643 String _displayName;
650 644
651 /** 645 /**
652 * Initialize a newly created element kind to have the given display name. 646 * Initialize a newly created element kind to have the given display name.
653 * 647 *
654 * @param displayName the name displayed in the UI for this kind of element 648 * @param displayName the name displayed in the UI for this kind of element
655 */ 649 */
656 ElementKind(this.name, this.ordinal, String displayName) { 650 ElementKind(String name, int ordinal, String displayName) : super(name, ordina l) {
657 this._displayName = displayName; 651 this._displayName = displayName;
658 } 652 }
659 653
660 /** 654 /**
661 * Return the name displayed in the UI for this kind of element. 655 * Return the name displayed in the UI for this kind of element.
662 * 656 *
663 * @return the name of this [ElementKind] to display in UI. 657 * @return the name of this [ElementKind] to display in UI.
664 */ 658 */
665 String get displayName => _displayName; 659 String get displayName => _displayName;
666 int compareTo(ElementKind other) => ordinal - other.ordinal;
667 int get hashCode => ordinal;
668 String toString() => name;
669 } 660 }
670 /** 661 /**
671 * The interface `ElementLocation` defines the behavior of objects that represen t the location 662 * The interface `ElementLocation` defines the behavior of objects that represen t the location
672 * of an element within the element model. 663 * of an element within the element model.
673 * 664 *
674 * @coverage dart.engine.element 665 * @coverage dart.engine.element
675 */ 666 */
676 abstract class ElementLocation { 667 abstract class ElementLocation {
677 668
678 /** 669 /**
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
1558 R visitFieldFormalParameterElement(FieldFormalParameterElement element) => vis itParameterElement(element); 1549 R visitFieldFormalParameterElement(FieldFormalParameterElement element) => vis itParameterElement(element);
1559 R visitFunctionElement(FunctionElement element) => visitLocalElement(element); 1550 R visitFunctionElement(FunctionElement element) => visitLocalElement(element);
1560 R visitFunctionTypeAliasElement(FunctionTypeAliasElement element) => visitElem ent(element); 1551 R visitFunctionTypeAliasElement(FunctionTypeAliasElement element) => visitElem ent(element);
1561 R visitHtmlElement(HtmlElement element) => visitElement(element); 1552 R visitHtmlElement(HtmlElement element) => visitElement(element);
1562 R visitHtmlScriptElement(HtmlScriptElement element) => visitElement(element); 1553 R visitHtmlScriptElement(HtmlScriptElement element) => visitElement(element);
1563 R visitImportElement(ImportElement element) => visitElement(element); 1554 R visitImportElement(ImportElement element) => visitElement(element);
1564 R visitLabelElement(LabelElement element) => visitElement(element); 1555 R visitLabelElement(LabelElement element) => visitElement(element);
1565 R visitLibraryElement(LibraryElement element) => visitElement(element); 1556 R visitLibraryElement(LibraryElement element) => visitElement(element);
1566 R visitLocalElement(LocalElement element) { 1557 R visitLocalElement(LocalElement element) {
1567 if (element is LocalVariableElement) { 1558 if (element is LocalVariableElement) {
1568 return visitVariableElement((element as LocalVariableElement)); 1559 return visitVariableElement(element as LocalVariableElement);
1569 } else if (element is ParameterElement) { 1560 } else if (element is ParameterElement) {
1570 return visitVariableElement((element as ParameterElement)); 1561 return visitVariableElement(element as ParameterElement);
1571 } else if (element is FunctionElement) { 1562 } else if (element is FunctionElement) {
1572 return visitExecutableElement((element as FunctionElement)); 1563 return visitExecutableElement(element as FunctionElement);
1573 } 1564 }
1574 return null; 1565 return null;
1575 } 1566 }
1576 R visitLocalVariableElement(LocalVariableElement element) => visitLocalElement (element); 1567 R visitLocalVariableElement(LocalVariableElement element) => visitLocalElement (element);
1577 R visitMethodElement(MethodElement element) => visitExecutableElement(element) ; 1568 R visitMethodElement(MethodElement element) => visitExecutableElement(element) ;
1578 R visitMultiplyDefinedElement(MultiplyDefinedElement element) => visitElement( element); 1569 R visitMultiplyDefinedElement(MultiplyDefinedElement element) => visitElement( element);
1579 R visitParameterElement(ParameterElement element) => visitLocalElement(element ); 1570 R visitParameterElement(ParameterElement element) => visitLocalElement(element );
1580 R visitPrefixElement(PrefixElement element) => visitElement(element); 1571 R visitPrefixElement(PrefixElement element) => visitElement(element);
1581 R visitPropertyAccessorElement(PropertyAccessorElement element) => visitExecut ableElement(element); 1572 R visitPropertyAccessorElement(PropertyAccessorElement element) => visitExecut ableElement(element);
1582 R visitPropertyInducingElement(PropertyInducingElement element) => visitVariab leElement(element); 1573 R visitPropertyInducingElement(PropertyInducingElement element) => visitVariab leElement(element);
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1712 R visitLocalVariableElement(LocalVariableElement element) => null; 1703 R visitLocalVariableElement(LocalVariableElement element) => null;
1713 R visitMethodElement(MethodElement element) => null; 1704 R visitMethodElement(MethodElement element) => null;
1714 R visitMultiplyDefinedElement(MultiplyDefinedElement element) => null; 1705 R visitMultiplyDefinedElement(MultiplyDefinedElement element) => null;
1715 R visitParameterElement(ParameterElement element) => null; 1706 R visitParameterElement(ParameterElement element) => null;
1716 R visitPrefixElement(PrefixElement element) => null; 1707 R visitPrefixElement(PrefixElement element) => null;
1717 R visitPropertyAccessorElement(PropertyAccessorElement element) => null; 1708 R visitPropertyAccessorElement(PropertyAccessorElement element) => null;
1718 R visitTopLevelVariableElement(TopLevelVariableElement element) => null; 1709 R visitTopLevelVariableElement(TopLevelVariableElement element) => null;
1719 R visitTypeVariableElement(TypeVariableElement element) => null; 1710 R visitTypeVariableElement(TypeVariableElement element) => null;
1720 } 1711 }
1721 /** 1712 /**
1713 * For AST nodes that could be in both the getter and setter contexts ([IndexExp ression]s and
1714 * [SimpleIdentifier]s), the additional resolved elements are stored in the AST node, in an
1715 * [AuxiliaryElements]. Since resolved elements are either statically resolved o r resolved
1716 * using propagated type information, this class is a wrapper for a pair of
1717 * [ExecutableElement]s, not just a single [ExecutableElement].
1718 */
1719 class AuxiliaryElements {
1720
1721 /**
1722 * The element based on propagated type information, or `null` if the AST stru cture has not
1723 * been resolved or if this identifier could not be resolved.
1724 */
1725 ExecutableElement _propagatedElement;
1726
1727 /**
1728 * The element associated with this identifier based on static type informatio n, or `null`
1729 * if the AST structure has not been resolved or if this identifier could not be resolved.
1730 */
1731 ExecutableElement _staticElement;
1732
1733 /**
1734 * Create the [AuxiliaryElements] with a static and propagated [ExecutableElem ent].
1735 *
1736 * @param staticElement the static element
1737 * @param propagatedElement the propagated element
1738 */
1739 AuxiliaryElements(ExecutableElement staticElement, ExecutableElement propagate dElement) {
1740 this._staticElement = staticElement;
1741 this._propagatedElement = propagatedElement;
1742 }
1743
1744 /**
1745 * Get the propagated element.
1746 */
1747 ExecutableElement get propagatedElement => _propagatedElement;
1748
1749 /**
1750 * Get the static element.
1751 */
1752 ExecutableElement get staticElement => _staticElement;
1753 }
1754 /**
1722 * Instances of the class `ClassElementImpl` implement a `ClassElement`. 1755 * Instances of the class `ClassElementImpl` implement a `ClassElement`.
1723 * 1756 *
1724 * @coverage dart.engine.element 1757 * @coverage dart.engine.element
1725 */ 1758 */
1726 class ClassElementImpl extends ElementImpl implements ClassElement { 1759 class ClassElementImpl extends ElementImpl implements ClassElement {
1727 1760
1728 /** 1761 /**
1729 * An array containing all of the accessors (getters and setters) contained in this class. 1762 * An array containing all of the accessors (getters and setters) contained in this class.
1730 */ 1763 */
1731 List<PropertyAccessorElement> _accessors = PropertyAccessorElementImpl.EMPTY_A RRAY; 1764 List<PropertyAccessorElement> _accessors = PropertyAccessorElementImpl.EMPTY_A RRAY;
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
2122 } 2155 }
2123 2156
2124 /** 2157 /**
2125 * Set whether this class is a valid mixin to correspond to the given value. 2158 * Set whether this class is a valid mixin to correspond to the given value.
2126 * 2159 *
2127 * @param isValidMixin `true` if this class can be used as a mixin 2160 * @param isValidMixin `true` if this class can be used as a mixin
2128 */ 2161 */
2129 void set validMixin(bool isValidMixin) { 2162 void set validMixin(bool isValidMixin) {
2130 setModifier(Modifier.MIXIN, isValidMixin); 2163 setModifier(Modifier.MIXIN, isValidMixin);
2131 } 2164 }
2132 void visitChildren(ElementVisitor<Object> visitor) { 2165 void visitChildren(ElementVisitor visitor) {
2133 super.visitChildren(visitor); 2166 super.visitChildren(visitor);
2134 safelyVisitChildren(_accessors, visitor); 2167 safelyVisitChildren(_accessors, visitor);
2135 safelyVisitChildren(_constructors, visitor); 2168 safelyVisitChildren(_constructors, visitor);
2136 safelyVisitChildren(_fields, visitor); 2169 safelyVisitChildren(_fields, visitor);
2137 safelyVisitChildren(_methods, visitor); 2170 safelyVisitChildren(_methods, visitor);
2138 safelyVisitChildren(_typeVariables, visitor); 2171 safelyVisitChildren(_typeVariables, visitor);
2139 } 2172 }
2140 void appendTo(JavaStringBuilder builder) { 2173 void appendTo(JavaStringBuilder builder) {
2141 String name = displayName; 2174 String name = displayName;
2142 if (name == null) { 2175 if (name == null) {
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
2362 } 2395 }
2363 2396
2364 /** 2397 /**
2365 * Set the URI that is specified by the "part" directive in the enclosing libr ary. 2398 * Set the URI that is specified by the "part" directive in the enclosing libr ary.
2366 * 2399 *
2367 * @param uri the URI that is specified by the "part" directive in the enclosi ng library. 2400 * @param uri the URI that is specified by the "part" directive in the enclosi ng library.
2368 */ 2401 */
2369 void set uri(String uri2) { 2402 void set uri(String uri2) {
2370 this._uri = uri2; 2403 this._uri = uri2;
2371 } 2404 }
2372 void visitChildren(ElementVisitor<Object> visitor) { 2405 void visitChildren(ElementVisitor visitor) {
2373 super.visitChildren(visitor); 2406 super.visitChildren(visitor);
2374 safelyVisitChildren(_accessors, visitor); 2407 safelyVisitChildren(_accessors, visitor);
2375 safelyVisitChildren(_functions, visitor); 2408 safelyVisitChildren(_functions, visitor);
2376 safelyVisitChildren(_typeAliases, visitor); 2409 safelyVisitChildren(_typeAliases, visitor);
2377 safelyVisitChildren(_types, visitor); 2410 safelyVisitChildren(_types, visitor);
2378 safelyVisitChildren(_variables, visitor); 2411 safelyVisitChildren(_variables, visitor);
2379 } 2412 }
2380 void appendTo(JavaStringBuilder builder) { 2413 void appendTo(JavaStringBuilder builder) {
2381 if (_source == null) { 2414 if (_source == null) {
2382 builder.append("{compilation unit}"); 2415 builder.append("{compilation unit}");
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
2797 * @param isSynthetic `true` if the element is synthetic 2830 * @param isSynthetic `true` if the element is synthetic
2798 */ 2831 */
2799 void set synthetic(bool isSynthetic) { 2832 void set synthetic(bool isSynthetic) {
2800 setModifier(Modifier.SYNTHETIC, isSynthetic); 2833 setModifier(Modifier.SYNTHETIC, isSynthetic);
2801 } 2834 }
2802 String toString() { 2835 String toString() {
2803 JavaStringBuilder builder = new JavaStringBuilder(); 2836 JavaStringBuilder builder = new JavaStringBuilder();
2804 appendTo(builder); 2837 appendTo(builder);
2805 return builder.toString(); 2838 return builder.toString();
2806 } 2839 }
2807 void visitChildren(ElementVisitor<Object> visitor) { 2840 void visitChildren(ElementVisitor visitor) {
2808 } 2841 }
2809 2842
2810 /** 2843 /**
2811 * Append a textual representation of this type to the given builder. 2844 * Append a textual representation of this type to the given builder.
2812 * 2845 *
2813 * @param builder the builder to which the text is to be appended 2846 * @param builder the builder to which the text is to be appended
2814 */ 2847 */
2815 void appendTo(JavaStringBuilder builder) { 2848 void appendTo(JavaStringBuilder builder) {
2816 if (_name == null) { 2849 if (_name == null) {
2817 builder.append("<unnamed "); 2850 builder.append("<unnamed ");
(...skipping 19 matching lines...) Expand all
2837 * @return `true` if this element has the given modifier associated with it 2870 * @return `true` if this element has the given modifier associated with it
2838 */ 2871 */
2839 bool hasModifier(Modifier modifier) => BooleanArray.get(_modifiers, modifier); 2872 bool hasModifier(Modifier modifier) => BooleanArray.get(_modifiers, modifier);
2840 2873
2841 /** 2874 /**
2842 * If the given child is not `null`, use the given visitor to visit it. 2875 * If the given child is not `null`, use the given visitor to visit it.
2843 * 2876 *
2844 * @param child the child to be visited 2877 * @param child the child to be visited
2845 * @param visitor the visitor to be used to visit the child 2878 * @param visitor the visitor to be used to visit the child
2846 */ 2879 */
2847 void safelyVisitChild(Element child, ElementVisitor<Object> visitor) { 2880 void safelyVisitChild(Element child, ElementVisitor visitor) {
2848 if (child != null) { 2881 if (child != null) {
2849 child.accept(visitor); 2882 child.accept(visitor);
2850 } 2883 }
2851 } 2884 }
2852 2885
2853 /** 2886 /**
2854 * Use the given visitor to visit all of the children in the given array. 2887 * Use the given visitor to visit all of the children in the given array.
2855 * 2888 *
2856 * @param children the children to be visited 2889 * @param children the children to be visited
2857 * @param visitor the visitor being used to visit the children 2890 * @param visitor the visitor being used to visit the children
2858 */ 2891 */
2859 void safelyVisitChildren(List<Element> children, ElementVisitor<Object> visito r) { 2892 void safelyVisitChildren(List<Element> children, ElementVisitor visitor) {
2860 if (children != null) { 2893 if (children != null) {
2861 for (Element child in children) { 2894 for (Element child in children) {
2862 child.accept(visitor); 2895 child.accept(visitor);
2863 } 2896 }
2864 } 2897 }
2865 } 2898 }
2866 2899
2867 /** 2900 /**
2868 * Set the enclosing element of this element to the given element. 2901 * Set the enclosing element of this element to the given element.
2869 * 2902 *
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
3089 3122
3090 /** 3123 /**
3091 * Set the script library defined by the script tag's content. 3124 * Set the script library defined by the script tag's content.
3092 * 3125 *
3093 * @param scriptLibrary the library or `null` if none 3126 * @param scriptLibrary the library or `null` if none
3094 */ 3127 */
3095 void set scriptLibrary(LibraryElementImpl scriptLibrary2) { 3128 void set scriptLibrary(LibraryElementImpl scriptLibrary2) {
3096 scriptLibrary2.enclosingElement = this; 3129 scriptLibrary2.enclosingElement = this;
3097 this._scriptLibrary = scriptLibrary2; 3130 this._scriptLibrary = scriptLibrary2;
3098 } 3131 }
3099 void visitChildren(ElementVisitor<Object> visitor) { 3132 void visitChildren(ElementVisitor visitor) {
3100 safelyVisitChild(_scriptLibrary, visitor); 3133 safelyVisitChild(_scriptLibrary, visitor);
3101 } 3134 }
3102 } 3135 }
3103 /** 3136 /**
3104 * The abstract class `ExecutableElementImpl` implements the behavior common to 3137 * The abstract class `ExecutableElementImpl` implements the behavior common to
3105 * `ExecutableElement`s. 3138 * `ExecutableElement`s.
3106 * 3139 *
3107 * @coverage dart.engine.element 3140 * @coverage dart.engine.element
3108 */ 3141 */
3109 abstract class ExecutableElementImpl extends ElementImpl implements ExecutableEl ement { 3142 abstract class ExecutableElementImpl extends ElementImpl implements ExecutableEl ement {
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
3247 } 3280 }
3248 3281
3249 /** 3282 /**
3250 * Set the type of function defined by this executable element to the given ty pe. 3283 * Set the type of function defined by this executable element to the given ty pe.
3251 * 3284 *
3252 * @param type the type of function defined by this executable element 3285 * @param type the type of function defined by this executable element
3253 */ 3286 */
3254 void set type(FunctionType type2) { 3287 void set type(FunctionType type2) {
3255 this._type = type2; 3288 this._type = type2;
3256 } 3289 }
3257 void visitChildren(ElementVisitor<Object> visitor) { 3290 void visitChildren(ElementVisitor visitor) {
3258 super.visitChildren(visitor); 3291 super.visitChildren(visitor);
3259 safelyVisitChildren(_functions, visitor); 3292 safelyVisitChildren(_functions, visitor);
3260 safelyVisitChildren(_labels, visitor); 3293 safelyVisitChildren(_labels, visitor);
3261 safelyVisitChildren(_localVariables, visitor); 3294 safelyVisitChildren(_localVariables, visitor);
3262 safelyVisitChildren(_parameters, visitor); 3295 safelyVisitChildren(_parameters, visitor);
3263 } 3296 }
3264 void appendTo(JavaStringBuilder builder) { 3297 void appendTo(JavaStringBuilder builder) {
3265 builder.append("("); 3298 builder.append("(");
3266 int parameterCount = _parameters.length; 3299 int parameterCount = _parameters.length;
3267 for (int i = 0; i < parameterCount; i++) { 3300 for (int i = 0; i < parameterCount; i++) {
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
3642 /** 3675 /**
3643 * Set the type variables defined for this type to the given variables without becoming the parent 3676 * Set the type variables defined for this type to the given variables without becoming the parent
3644 * of the variables. This should only be used by the [TypeResolverVisitor] whe n creating a 3677 * of the variables. This should only be used by the [TypeResolverVisitor] whe n creating a
3645 * synthetic type alias. 3678 * synthetic type alias.
3646 * 3679 *
3647 * @param typeVariables the type variables defined for this type 3680 * @param typeVariables the type variables defined for this type
3648 */ 3681 */
3649 void shareTypeVariables(List<TypeVariableElement> typeVariables2) { 3682 void shareTypeVariables(List<TypeVariableElement> typeVariables2) {
3650 this._typeVariables = typeVariables2; 3683 this._typeVariables = typeVariables2;
3651 } 3684 }
3652 void visitChildren(ElementVisitor<Object> visitor) { 3685 void visitChildren(ElementVisitor visitor) {
3653 super.visitChildren(visitor); 3686 super.visitChildren(visitor);
3654 safelyVisitChildren(_parameters, visitor); 3687 safelyVisitChildren(_parameters, visitor);
3655 safelyVisitChildren(_typeVariables, visitor); 3688 safelyVisitChildren(_typeVariables, visitor);
3656 } 3689 }
3657 void appendTo(JavaStringBuilder builder) { 3690 void appendTo(JavaStringBuilder builder) {
3658 builder.append("typedef "); 3691 builder.append("typedef ");
3659 builder.append(displayName); 3692 builder.append(displayName);
3660 int variableCount = _typeVariables.length; 3693 int variableCount = _typeVariables.length;
3661 if (variableCount > 0) { 3694 if (variableCount > 0) {
3662 builder.append("<"); 3695 builder.append("<");
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
3780 } 3813 }
3781 3814
3782 /** 3815 /**
3783 * Set the source that corresponds to this HTML file to the given source. 3816 * Set the source that corresponds to this HTML file to the given source.
3784 * 3817 *
3785 * @param source the source that corresponds to this HTML file 3818 * @param source the source that corresponds to this HTML file
3786 */ 3819 */
3787 void set source(Source source2) { 3820 void set source(Source source2) {
3788 this._source = source2; 3821 this._source = source2;
3789 } 3822 }
3790 void visitChildren(ElementVisitor<Object> visitor) { 3823 void visitChildren(ElementVisitor visitor) {
3791 super.visitChildren(visitor); 3824 super.visitChildren(visitor);
3792 safelyVisitChildren(_scripts, visitor); 3825 safelyVisitChildren(_scripts, visitor);
3793 } 3826 }
3794 void appendTo(JavaStringBuilder builder) { 3827 void appendTo(JavaStringBuilder builder) {
3795 if (_source == null) { 3828 if (_source == null) {
3796 builder.append("{HTML file}"); 3829 builder.append("{HTML file}");
3797 } else { 3830 } else {
3798 builder.append(_source.fullName); 3831 builder.append(_source.fullName);
3799 } 3832 }
3800 } 3833 }
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
3888 } 3921 }
3889 3922
3890 /** 3923 /**
3891 * Set the URI that is specified by this directive. 3924 * Set the URI that is specified by this directive.
3892 * 3925 *
3893 * @param uri the URI that is specified by this directive. 3926 * @param uri the URI that is specified by this directive.
3894 */ 3927 */
3895 void set uri(String uri2) { 3928 void set uri(String uri2) {
3896 this._uri = uri2; 3929 this._uri = uri2;
3897 } 3930 }
3898 void visitChildren(ElementVisitor<Object> visitor) { 3931 void visitChildren(ElementVisitor visitor) {
3899 super.visitChildren(visitor); 3932 super.visitChildren(visitor);
3900 safelyVisitChild(_prefix, visitor); 3933 safelyVisitChild(_prefix, visitor);
3901 } 3934 }
3902 void appendTo(JavaStringBuilder builder) { 3935 void appendTo(JavaStringBuilder builder) {
3903 builder.append("import "); 3936 builder.append("import ");
3904 ((_importedLibrary as LibraryElementImpl)).appendTo(builder); 3937 ((_importedLibrary as LibraryElementImpl)).appendTo(builder);
3905 } 3938 }
3906 String get identifier => ((_importedLibrary as LibraryElementImpl)).identifier ; 3939 String get identifier => ((_importedLibrary as LibraryElementImpl)).identifier ;
3907 } 3940 }
3908 /** 3941 /**
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
4184 * 4217 *
4185 * @param parts the compilation units that are included in this library using a `part` 4218 * @param parts the compilation units that are included in this library using a `part`
4186 * directive 4219 * directive
4187 */ 4220 */
4188 void set parts(List<CompilationUnitElement> parts2) { 4221 void set parts(List<CompilationUnitElement> parts2) {
4189 for (CompilationUnitElement compilationUnit in parts2) { 4222 for (CompilationUnitElement compilationUnit in parts2) {
4190 ((compilationUnit as CompilationUnitElementImpl)).enclosingElement = this; 4223 ((compilationUnit as CompilationUnitElementImpl)).enclosingElement = this;
4191 } 4224 }
4192 this._parts = parts2; 4225 this._parts = parts2;
4193 } 4226 }
4194 void visitChildren(ElementVisitor<Object> visitor) { 4227 void visitChildren(ElementVisitor visitor) {
4195 super.visitChildren(visitor); 4228 super.visitChildren(visitor);
4196 safelyVisitChild(_definingCompilationUnit, visitor); 4229 safelyVisitChild(_definingCompilationUnit, visitor);
4197 safelyVisitChildren(_exports, visitor); 4230 safelyVisitChildren(_exports, visitor);
4198 safelyVisitChildren(_imports, visitor); 4231 safelyVisitChildren(_imports, visitor);
4199 safelyVisitChildren(_parts, visitor); 4232 safelyVisitChildren(_parts, visitor);
4200 } 4233 }
4201 4234
4202 /** 4235 /**
4203 * Answer `true` if the receiver directly or indirectly imports the dart:html libraries. 4236 * Answer `true` if the receiver directly or indirectly imports the dart:html libraries.
4204 * 4237 *
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
4358 builder.append(displayName); 4391 builder.append(displayName);
4359 super.appendTo(builder); 4392 super.appendTo(builder);
4360 } 4393 }
4361 } 4394 }
4362 /** 4395 /**
4363 * The enumeration `Modifier` defines constants for all of the modifiers defined by the Dart 4396 * The enumeration `Modifier` defines constants for all of the modifiers defined by the Dart
4364 * language and for a few additional flags that are useful. 4397 * language and for a few additional flags that are useful.
4365 * 4398 *
4366 * @coverage dart.engine.element 4399 * @coverage dart.engine.element
4367 */ 4400 */
4368 class Modifier implements Enum<Modifier> { 4401 class Modifier extends Enum<Modifier> {
4369 static final Modifier ABSTRACT = new Modifier('ABSTRACT', 0); 4402 static final Modifier ABSTRACT = new Modifier('ABSTRACT', 0);
4370 static final Modifier CONST = new Modifier('CONST', 1); 4403 static final Modifier CONST = new Modifier('CONST', 1);
4371 static final Modifier FACTORY = new Modifier('FACTORY', 2); 4404 static final Modifier FACTORY = new Modifier('FACTORY', 2);
4372 static final Modifier FINAL = new Modifier('FINAL', 3); 4405 static final Modifier FINAL = new Modifier('FINAL', 3);
4373 static final Modifier GETTER = new Modifier('GETTER', 4); 4406 static final Modifier GETTER = new Modifier('GETTER', 4);
4374 static final Modifier MIXIN = new Modifier('MIXIN', 5); 4407 static final Modifier MIXIN = new Modifier('MIXIN', 5);
4375 static final Modifier REFERENCES_SUPER = new Modifier('REFERENCES_SUPER', 6); 4408 static final Modifier REFERENCES_SUPER = new Modifier('REFERENCES_SUPER', 6);
4376 static final Modifier SETTER = new Modifier('SETTER', 7); 4409 static final Modifier SETTER = new Modifier('SETTER', 7);
4377 static final Modifier STATIC = new Modifier('STATIC', 8); 4410 static final Modifier STATIC = new Modifier('STATIC', 8);
4378 static final Modifier SYNTHETIC = new Modifier('SYNTHETIC', 9); 4411 static final Modifier SYNTHETIC = new Modifier('SYNTHETIC', 9);
4379 static final Modifier TYPEDEF = new Modifier('TYPEDEF', 10); 4412 static final Modifier TYPEDEF = new Modifier('TYPEDEF', 10);
4380 static final List<Modifier> values = [ 4413 static final List<Modifier> values = [
4381 ABSTRACT, 4414 ABSTRACT,
4382 CONST, 4415 CONST,
4383 FACTORY, 4416 FACTORY,
4384 FINAL, 4417 FINAL,
4385 GETTER, 4418 GETTER,
4386 MIXIN, 4419 MIXIN,
4387 REFERENCES_SUPER, 4420 REFERENCES_SUPER,
4388 SETTER, 4421 SETTER,
4389 STATIC, 4422 STATIC,
4390 SYNTHETIC, 4423 SYNTHETIC,
4391 TYPEDEF]; 4424 TYPEDEF];
4392 4425 Modifier(String name, int ordinal) : super(name, ordinal);
4393 /// The name of this enum constant, as declared in the enum declaration.
4394 final String name;
4395
4396 /// The position in the enum declaration.
4397 final int ordinal;
4398 Modifier(this.name, this.ordinal);
4399 int compareTo(Modifier other) => ordinal - other.ordinal;
4400 int get hashCode => ordinal;
4401 String toString() => name;
4402 } 4426 }
4403 /** 4427 /**
4404 * Instances of the class `MultiplyDefinedElementImpl` represent a collection of elements that 4428 * Instances of the class `MultiplyDefinedElementImpl` represent a collection of elements that
4405 * have the same name within the same scope. 4429 * have the same name within the same scope.
4406 * 4430 *
4407 * @coverage dart.engine.element 4431 * @coverage dart.engine.element
4408 */ 4432 */
4409 class MultiplyDefinedElementImpl implements MultiplyDefinedElement { 4433 class MultiplyDefinedElementImpl implements MultiplyDefinedElement {
4410 4434
4411 /** 4435 /**
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
4464 int count = _conflictingElements.length; 4488 int count = _conflictingElements.length;
4465 for (int i = 0; i < count; i++) { 4489 for (int i = 0; i < count; i++) {
4466 if (i > 0) { 4490 if (i > 0) {
4467 builder.append(", "); 4491 builder.append(", ");
4468 } 4492 }
4469 ((_conflictingElements[i] as ElementImpl)).appendTo(builder); 4493 ((_conflictingElements[i] as ElementImpl)).appendTo(builder);
4470 } 4494 }
4471 builder.append("]"); 4495 builder.append("]");
4472 return builder.toString(); 4496 return builder.toString();
4473 } 4497 }
4474 void visitChildren(ElementVisitor<Object> visitor) { 4498 void visitChildren(ElementVisitor visitor) {
4475 } 4499 }
4476 4500
4477 /** 4501 /**
4478 * Add the given element to the list of elements. If the element is a multiply -defined element, 4502 * Add the given element to the list of elements. If the element is a multiply -defined element,
4479 * add all of the conflicting elements that it represents. 4503 * add all of the conflicting elements that it represents.
4480 * 4504 *
4481 * @param elements the list to which the element(s) are to be added 4505 * @param elements the list to which the element(s) are to be added
4482 * @param element the element(s) to be added 4506 * @param element the element(s) to be added
4483 */ 4507 */
4484 void add(List<Element> elements, Element element) { 4508 void add(List<Element> elements, Element element) {
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
4624 * length. 4648 * length.
4625 * 4649 *
4626 * @param offset the offset to the beginning of the visible range for this ele ment 4650 * @param offset the offset to the beginning of the visible range for this ele ment
4627 * @param length the length of the visible range for this element, or `-1` if this element 4651 * @param length the length of the visible range for this element, or `-1` if this element
4628 * does not have a visible range 4652 * does not have a visible range
4629 */ 4653 */
4630 void setVisibleRange(int offset, int length) { 4654 void setVisibleRange(int offset, int length) {
4631 _visibleRangeOffset = offset; 4655 _visibleRangeOffset = offset;
4632 _visibleRangeLength = length; 4656 _visibleRangeLength = length;
4633 } 4657 }
4634 void visitChildren(ElementVisitor<Object> visitor) { 4658 void visitChildren(ElementVisitor visitor) {
4635 super.visitChildren(visitor); 4659 super.visitChildren(visitor);
4636 safelyVisitChildren(_parameters, visitor); 4660 safelyVisitChildren(_parameters, visitor);
4637 } 4661 }
4638 void appendTo(JavaStringBuilder builder) { 4662 void appendTo(JavaStringBuilder builder) {
4639 String left = ""; 4663 String left = "";
4640 String right = ""; 4664 String right = "";
4641 while (true) { 4665 while (true) {
4642 if (parameterKind == ParameterKind.NAMED) { 4666 if (parameterKind == ParameterKind.NAMED) {
4643 left = "{"; 4667 left = "{";
4644 right = "}"; 4668 right = "}";
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
5095 } 5119 }
5096 5120
5097 /** 5121 /**
5098 * Set the declared type of this variable to the given type. 5122 * Set the declared type of this variable to the given type.
5099 * 5123 *
5100 * @param type the declared type of this variable 5124 * @param type the declared type of this variable
5101 */ 5125 */
5102 void set type(Type2 type2) { 5126 void set type(Type2 type2) {
5103 this._type = type2; 5127 this._type = type2;
5104 } 5128 }
5105 void visitChildren(ElementVisitor<Object> visitor) { 5129 void visitChildren(ElementVisitor visitor) {
5106 super.visitChildren(visitor); 5130 super.visitChildren(visitor);
5107 safelyVisitChild(_initializer, visitor); 5131 safelyVisitChild(_initializer, visitor);
5108 } 5132 }
5109 void appendTo(JavaStringBuilder builder) { 5133 void appendTo(JavaStringBuilder builder) {
5110 builder.append(type); 5134 builder.append(type);
5111 builder.append(" "); 5135 builder.append(" ");
5112 builder.append(displayName); 5136 builder.append(displayName);
5113 } 5137 }
5114 } 5138 }
5115 /** 5139 /**
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
5220 List<ParameterElement> parameterizedParameters = new List<ParameterElement>( parameterCount); 5244 List<ParameterElement> parameterizedParameters = new List<ParameterElement>( parameterCount);
5221 for (int i = 0; i < parameterCount; i++) { 5245 for (int i = 0; i < parameterCount; i++) {
5222 parameterizedParameters[i] = ParameterMember.from(baseParameters[i], defin ingType); 5246 parameterizedParameters[i] = ParameterMember.from(baseParameters[i], defin ingType);
5223 } 5247 }
5224 return parameterizedParameters; 5248 return parameterizedParameters;
5225 } 5249 }
5226 Type2 get returnType => substituteFor(baseElement.returnType); 5250 Type2 get returnType => substituteFor(baseElement.returnType);
5227 FunctionType get type => substituteFor(baseElement.type); 5251 FunctionType get type => substituteFor(baseElement.type);
5228 bool get isOperator => baseElement.isOperator; 5252 bool get isOperator => baseElement.isOperator;
5229 bool get isStatic => baseElement.isStatic; 5253 bool get isStatic => baseElement.isStatic;
5230 void visitChildren(ElementVisitor<Object> visitor) { 5254 void visitChildren(ElementVisitor visitor) {
5231 super.visitChildren(visitor); 5255 super.visitChildren(visitor);
5232 safelyVisitChildren(baseElement.functions, visitor); 5256 safelyVisitChildren(baseElement.functions, visitor);
5233 safelyVisitChildren(labels, visitor); 5257 safelyVisitChildren(labels, visitor);
5234 safelyVisitChildren(baseElement.localVariables, visitor); 5258 safelyVisitChildren(baseElement.localVariables, visitor);
5235 safelyVisitChildren(parameters, visitor); 5259 safelyVisitChildren(parameters, visitor);
5236 } 5260 }
5237 } 5261 }
5238 /** 5262 /**
5239 * Instances of the class `FieldMember` represent a field element defined in a p arameterized 5263 * Instances of the class `FieldMember` represent a field element defined in a p arameterized
5240 * type where the values of the type parameters are known. 5264 * type where the values of the type parameters are known.
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
5323 String get displayName => _baseElement.displayName; 5347 String get displayName => _baseElement.displayName;
5324 ElementKind get kind => _baseElement.kind; 5348 ElementKind get kind => _baseElement.kind;
5325 LibraryElement get library => _baseElement.library; 5349 LibraryElement get library => _baseElement.library;
5326 ElementLocation get location => _baseElement.location; 5350 ElementLocation get location => _baseElement.location;
5327 List<ElementAnnotation> get metadata => _baseElement.metadata; 5351 List<ElementAnnotation> get metadata => _baseElement.metadata;
5328 String get name => _baseElement.name; 5352 String get name => _baseElement.name;
5329 int get nameOffset => _baseElement.nameOffset; 5353 int get nameOffset => _baseElement.nameOffset;
5330 Source get source => _baseElement.source; 5354 Source get source => _baseElement.source;
5331 bool isAccessibleIn(LibraryElement library) => _baseElement.isAccessibleIn(lib rary); 5355 bool isAccessibleIn(LibraryElement library) => _baseElement.isAccessibleIn(lib rary);
5332 bool get isSynthetic => _baseElement.isSynthetic; 5356 bool get isSynthetic => _baseElement.isSynthetic;
5333 void visitChildren(ElementVisitor<Object> visitor) { 5357 void visitChildren(ElementVisitor visitor) {
5334 } 5358 }
5335 5359
5336 /** 5360 /**
5337 * Return the type in which the element is defined. 5361 * Return the type in which the element is defined.
5338 * 5362 *
5339 * @return the type in which the element is defined 5363 * @return the type in which the element is defined
5340 */ 5364 */
5341 ParameterizedType get definingType => _definingType; 5365 ParameterizedType get definingType => _definingType;
5342 5366
5343 /** 5367 /**
5344 * If the given child is not `null`, use the given visitor to visit it. 5368 * If the given child is not `null`, use the given visitor to visit it.
5345 * 5369 *
5346 * @param child the child to be visited 5370 * @param child the child to be visited
5347 * @param visitor the visitor to be used to visit the child 5371 * @param visitor the visitor to be used to visit the child
5348 */ 5372 */
5349 void safelyVisitChild(Element child, ElementVisitor<Object> visitor) { 5373 void safelyVisitChild(Element child, ElementVisitor visitor) {
5350 if (child != null) { 5374 if (child != null) {
5351 child.accept(visitor); 5375 child.accept(visitor);
5352 } 5376 }
5353 } 5377 }
5354 5378
5355 /** 5379 /**
5356 * Use the given visitor to visit all of the children in the given array. 5380 * Use the given visitor to visit all of the children in the given array.
5357 * 5381 *
5358 * @param children the children to be visited 5382 * @param children the children to be visited
5359 * @param visitor the visitor being used to visit the children 5383 * @param visitor the visitor being used to visit the children
5360 */ 5384 */
5361 void safelyVisitChildren(List<Element> children, ElementVisitor<Object> visito r) { 5385 void safelyVisitChildren(List<Element> children, ElementVisitor visitor) {
5362 if (children != null) { 5386 if (children != null) {
5363 for (Element child in children) { 5387 for (Element child in children) {
5364 child.accept(visitor); 5388 child.accept(visitor);
5365 } 5389 }
5366 } 5390 }
5367 } 5391 }
5368 5392
5369 /** 5393 /**
5370 * Return the type that results from replacing the type parameters in the give n type with the type 5394 * Return the type that results from replacing the type parameters in the give n type with the type
5371 * arguments. 5395 * arguments.
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
5499 * @param definingType the type in which the element is defined 5523 * @param definingType the type in which the element is defined
5500 */ 5524 */
5501 ParameterMember(ParameterElement baseElement, ParameterizedType definingType) : super(baseElement, definingType); 5525 ParameterMember(ParameterElement baseElement, ParameterizedType definingType) : super(baseElement, definingType);
5502 accept(ElementVisitor visitor) => visitor.visitParameterElement(this); 5526 accept(ElementVisitor visitor) => visitor.visitParameterElement(this);
5503 Element getAncestor(Type elementClass) { 5527 Element getAncestor(Type elementClass) {
5504 Element element = baseElement.getAncestor(elementClass); 5528 Element element = baseElement.getAncestor(elementClass);
5505 ParameterizedType definingType = this.definingType; 5529 ParameterizedType definingType = this.definingType;
5506 if (definingType is InterfaceType) { 5530 if (definingType is InterfaceType) {
5507 InterfaceType definingInterfaceType = definingType as InterfaceType; 5531 InterfaceType definingInterfaceType = definingType as InterfaceType;
5508 if (element is ConstructorElement) { 5532 if (element is ConstructorElement) {
5509 return ConstructorMember.from((element as ConstructorElement), definingI nterfaceType) as Element; 5533 return ConstructorMember.from(element as ConstructorElement, definingInt erfaceType) as Element;
5510 } else if (element is MethodElement) { 5534 } else if (element is MethodElement) {
5511 return MethodMember.from((element as MethodElement), definingInterfaceTy pe) as Element; 5535 return MethodMember.from(element as MethodElement, definingInterfaceType ) as Element;
5512 } else if (element is PropertyAccessorElement) { 5536 } else if (element is PropertyAccessorElement) {
5513 return PropertyAccessorMember.from((element as PropertyAccessorElement), definingInterfaceType) as Element; 5537 return PropertyAccessorMember.from(element as PropertyAccessorElement, d efiningInterfaceType) as Element;
5514 } 5538 }
5515 } 5539 }
5516 return element; 5540 return element;
5517 } 5541 }
5518 ParameterElement get baseElement => super.baseElement as ParameterElement; 5542 ParameterElement get baseElement => super.baseElement as ParameterElement;
5519 SourceRange get defaultValueRange => baseElement.defaultValueRange; 5543 SourceRange get defaultValueRange => baseElement.defaultValueRange;
5520 Element get enclosingElement => baseElement.enclosingElement; 5544 Element get enclosingElement => baseElement.enclosingElement;
5521 ParameterKind get parameterKind => baseElement.parameterKind; 5545 ParameterKind get parameterKind => baseElement.parameterKind;
5522 List<ParameterElement> get parameters { 5546 List<ParameterElement> get parameters {
5523 List<ParameterElement> baseParameters = baseElement.parameters; 5547 List<ParameterElement> baseParameters = baseElement.parameters;
(...skipping 24 matching lines...) Expand all
5548 break; 5572 break;
5549 } 5573 }
5550 JavaStringBuilder builder = new JavaStringBuilder(); 5574 JavaStringBuilder builder = new JavaStringBuilder();
5551 builder.append(left); 5575 builder.append(left);
5552 builder.append(type); 5576 builder.append(type);
5553 builder.append(" "); 5577 builder.append(" ");
5554 builder.append(baseElement.displayName); 5578 builder.append(baseElement.displayName);
5555 builder.append(right); 5579 builder.append(right);
5556 return builder.toString(); 5580 return builder.toString();
5557 } 5581 }
5558 void visitChildren(ElementVisitor<Object> visitor) { 5582 void visitChildren(ElementVisitor visitor) {
5559 super.visitChildren(visitor); 5583 super.visitChildren(visitor);
5560 safelyVisitChildren(parameters, visitor); 5584 safelyVisitChildren(parameters, visitor);
5561 } 5585 }
5562 } 5586 }
5563 /** 5587 /**
5564 * Instances of the class `PropertyAccessorMember` represent a property accessor element 5588 * Instances of the class `PropertyAccessorMember` represent a property accessor element
5565 * defined in a parameterized type where the values of the type parameters are k nown. 5589 * defined in a parameterized type where the values of the type parameters are k nown.
5566 */ 5590 */
5567 class PropertyAccessorMember extends ExecutableMember implements PropertyAccesso rElement { 5591 class PropertyAccessorMember extends ExecutableMember implements PropertyAccesso rElement {
5568 5592
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
5600 */ 5624 */
5601 PropertyAccessorMember(PropertyAccessorElement baseElement, InterfaceType defi ningType) : super(baseElement, definingType); 5625 PropertyAccessorMember(PropertyAccessorElement baseElement, InterfaceType defi ningType) : super(baseElement, definingType);
5602 accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this); 5626 accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this);
5603 PropertyAccessorElement get baseElement => super.baseElement as PropertyAccess orElement; 5627 PropertyAccessorElement get baseElement => super.baseElement as PropertyAccess orElement;
5604 PropertyAccessorElement get correspondingGetter => from(baseElement.correspond ingGetter, definingType); 5628 PropertyAccessorElement get correspondingGetter => from(baseElement.correspond ingGetter, definingType);
5605 PropertyAccessorElement get correspondingSetter => from(baseElement.correspond ingSetter, definingType); 5629 PropertyAccessorElement get correspondingSetter => from(baseElement.correspond ingSetter, definingType);
5606 Element get enclosingElement => baseElement.enclosingElement; 5630 Element get enclosingElement => baseElement.enclosingElement;
5607 PropertyInducingElement get variable { 5631 PropertyInducingElement get variable {
5608 PropertyInducingElement variable = baseElement.variable; 5632 PropertyInducingElement variable = baseElement.variable;
5609 if (variable is FieldElement) { 5633 if (variable is FieldElement) {
5610 return FieldMember.from(((variable as FieldElement)), definingType); 5634 return FieldMember.from(variable as FieldElement, definingType);
5611 } 5635 }
5612 return variable; 5636 return variable;
5613 } 5637 }
5614 bool get isAbstract => baseElement.isAbstract; 5638 bool get isAbstract => baseElement.isAbstract;
5615 bool get isGetter => baseElement.isGetter; 5639 bool get isGetter => baseElement.isGetter;
5616 bool get isSetter => baseElement.isSetter; 5640 bool get isSetter => baseElement.isSetter;
5617 String toString() { 5641 String toString() {
5618 PropertyAccessorElement baseElement = this.baseElement; 5642 PropertyAccessorElement baseElement = this.baseElement;
5619 List<ParameterElement> parameters = this.parameters; 5643 List<ParameterElement> parameters = this.parameters;
5620 FunctionType type = this.type; 5644 FunctionType type = this.type;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
5659 * @param definingType the type in which the element is defined 5683 * @param definingType the type in which the element is defined
5660 */ 5684 */
5661 VariableMember(VariableElement baseElement, ParameterizedType definingType) : super(baseElement, definingType); 5685 VariableMember(VariableElement baseElement, ParameterizedType definingType) : super(baseElement, definingType);
5662 VariableElement get baseElement => super.baseElement as VariableElement; 5686 VariableElement get baseElement => super.baseElement as VariableElement;
5663 FunctionElement get initializer { 5687 FunctionElement get initializer {
5664 throw new UnsupportedOperationException(); 5688 throw new UnsupportedOperationException();
5665 } 5689 }
5666 Type2 get type => substituteFor(baseElement.type); 5690 Type2 get type => substituteFor(baseElement.type);
5667 bool get isConst => baseElement.isConst; 5691 bool get isConst => baseElement.isConst;
5668 bool get isFinal => baseElement.isFinal; 5692 bool get isFinal => baseElement.isFinal;
5669 void visitChildren(ElementVisitor<Object> visitor) { 5693 void visitChildren(ElementVisitor visitor) {
5670 super.visitChildren(visitor); 5694 super.visitChildren(visitor);
5671 safelyVisitChild(baseElement.initializer, visitor); 5695 safelyVisitChild(baseElement.initializer, visitor);
5672 } 5696 }
5673 } 5697 }
5674 /** 5698 /**
5675 * The unique instance of the class `BottomTypeImpl` implements the type `bottom `. 5699 * The unique instance of the class `BottomTypeImpl` implements the type `bottom `.
5676 * 5700 *
5677 * @coverage dart.engine.type 5701 * @coverage dart.engine.type
5678 */ 5702 */
5679 class BottomTypeImpl extends TypeImpl { 5703 class BottomTypeImpl extends TypeImpl {
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
6039 } 6063 }
6040 FunctionTypeImpl substitute3(List<Type2> argumentTypes) => substitute2(argumen tTypes, typeArguments); 6064 FunctionTypeImpl substitute3(List<Type2> argumentTypes) => substitute2(argumen tTypes, typeArguments);
6041 FunctionTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameterT ypes) { 6065 FunctionTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameterT ypes) {
6042 if (argumentTypes.length != parameterTypes.length) { 6066 if (argumentTypes.length != parameterTypes.length) {
6043 throw new IllegalArgumentException("argumentTypes.length (${argumentTypes. length}) != parameterTypes.length (${parameterTypes.length})"); 6067 throw new IllegalArgumentException("argumentTypes.length (${argumentTypes. length}) != parameterTypes.length (${parameterTypes.length})");
6044 } 6068 }
6045 if (argumentTypes.length == 0) { 6069 if (argumentTypes.length == 0) {
6046 return this; 6070 return this;
6047 } 6071 }
6048 Element element = this.element; 6072 Element element = this.element;
6049 FunctionTypeImpl newType = (element is ExecutableElement) ? new FunctionType Impl.con1((element as ExecutableElement)) : new FunctionTypeImpl.con2((element a s FunctionTypeAliasElement)); 6073 FunctionTypeImpl newType = (element is ExecutableElement) ? new FunctionType Impl.con1(element as ExecutableElement) : new FunctionTypeImpl.con2(element as F unctionTypeAliasElement);
6050 newType.typeArguments = TypeImpl.substitute(_typeArguments, argumentTypes, p arameterTypes); 6074 newType.typeArguments = TypeImpl.substitute(_typeArguments, argumentTypes, p arameterTypes);
6051 return newType; 6075 return newType;
6052 } 6076 }
6053 void appendTo(JavaStringBuilder builder) { 6077 void appendTo(JavaStringBuilder builder) {
6054 List<Type2> normalParameterTypes = this.normalParameterTypes; 6078 List<Type2> normalParameterTypes = this.normalParameterTypes;
6055 List<Type2> optionalParameterTypes = this.optionalParameterTypes; 6079 List<Type2> optionalParameterTypes = this.optionalParameterTypes;
6056 Map<String, Type2> namedParameterTypes = this.namedParameterTypes; 6080 Map<String, Type2> namedParameterTypes = this.namedParameterTypes;
6057 Type2 returnType = this.returnType; 6081 Type2 returnType = this.returnType;
6058 builder.append("("); 6082 builder.append("(");
6059 bool needsComma = false; 6083 bool needsComma = false;
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
6491 } 6515 }
6492 } 6516 }
6493 return false; 6517 return false;
6494 } 6518 }
6495 bool isMoreSpecificThan(Type2 type) { 6519 bool isMoreSpecificThan(Type2 type) {
6496 if (identical(type, DynamicTypeImpl.instance)) { 6520 if (identical(type, DynamicTypeImpl.instance)) {
6497 return true; 6521 return true;
6498 } else if (type is! InterfaceType) { 6522 } else if (type is! InterfaceType) {
6499 return false; 6523 return false;
6500 } 6524 }
6501 return isMoreSpecificThan2((type as InterfaceType), new Set<ClassElement>()) ; 6525 return isMoreSpecificThan2(type as InterfaceType, new Set<ClassElement>());
6502 } 6526 }
6503 bool get isObject => element.supertype == null; 6527 bool get isObject => element.supertype == null;
6504 bool isSubtypeOf(Type2 type2) { 6528 bool isSubtypeOf(Type2 type2) {
6505 if (identical(type2, DynamicTypeImpl.instance)) { 6529 if (identical(type2, DynamicTypeImpl.instance)) {
6506 return true; 6530 return true;
6507 } else if (type2 is TypeVariableType) { 6531 } else if (type2 is TypeVariableType) {
6508 return true; 6532 return true;
6509 } else if (type2 is FunctionType) { 6533 } else if (type2 is FunctionType) {
6510 ClassElement element = this.element; 6534 ClassElement element = this.element;
6511 MethodElement callMethod = element.lookUpMethod("call", element.library); 6535 MethodElement callMethod = element.lookUpMethod("call", element.library);
6512 if (callMethod != null) { 6536 if (callMethod != null) {
6513 return callMethod.type.isSubtypeOf(type2); 6537 return callMethod.type.isSubtypeOf(type2);
6514 } 6538 }
6515 return false; 6539 return false;
6516 } else if (type2 is! InterfaceType) { 6540 } else if (type2 is! InterfaceType) {
6517 return false; 6541 return false;
6518 } else if (this == type2) { 6542 } else if (this == type2) {
6519 return true; 6543 return true;
6520 } 6544 }
6521 return isSubtypeOf2((type2 as InterfaceType), new Set<ClassElement>()); 6545 return isSubtypeOf2(type2 as InterfaceType, new Set<ClassElement>());
6522 } 6546 }
6523 ConstructorElement lookUpConstructor(String constructorName, LibraryElement li brary) { 6547 ConstructorElement lookUpConstructor(String constructorName, LibraryElement li brary) {
6524 ConstructorElement constructorElement; 6548 ConstructorElement constructorElement;
6525 if (constructorName == null) { 6549 if (constructorName == null) {
6526 constructorElement = element.unnamedConstructor; 6550 constructorElement = element.unnamedConstructor;
6527 } else { 6551 } else {
6528 constructorElement = element.getNamedConstructor(constructorName); 6552 constructorElement = element.getNamedConstructor(constructorName);
6529 } 6553 }
6530 if (constructorElement == null || !constructorElement.isAccessibleIn(library )) { 6554 if (constructorElement == null || !constructorElement.isAccessibleIn(library )) {
6531 return null; 6555 return null;
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
7529 } 7553 }
7530 /** 7554 /**
7531 * The interface `VoidType` defines the behavior of the unique object representi ng the type 7555 * The interface `VoidType` defines the behavior of the unique object representi ng the type
7532 * `void`. 7556 * `void`.
7533 * 7557 *
7534 * @coverage dart.engine.type 7558 * @coverage dart.engine.type
7535 */ 7559 */
7536 abstract class VoidType implements Type2 { 7560 abstract class VoidType implements Type2 {
7537 VoidType substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes); 7561 VoidType substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes);
7538 } 7562 }
OLDNEW
« no previous file with comments | « pkg/analyzer_experimental/lib/src/generated/constant.dart ('k') | pkg/analyzer_experimental/lib/src/generated/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698