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

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

Issue 294903015: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 * <blockquote>It is a compile-time error if a declared or derived mixin refer s to super. It is a 1035 * <blockquote>It is a compile-time error if a declared or derived mixin refer s to super. It is a
1036 * compile-time error if a declared or derived mixin explicitly declares a con structor. It is a 1036 * compile-time error if a declared or derived mixin explicitly declares a con structor. It is a
1037 * compile-time error if a mixin is derived from a class whose superclass is n ot 1037 * compile-time error if a mixin is derived from a class whose superclass is n ot
1038 * Object.</blockquote> 1038 * Object.</blockquote>
1039 * 1039 *
1040 * @return `true` if this class can validly be used as a mixin 1040 * @return `true` if this class can validly be used as a mixin
1041 */ 1041 */
1042 bool get isValidMixin; 1042 bool get isValidMixin;
1043 1043
1044 /** 1044 /**
1045 * Return the element representing the method that results from looking up the given method in
1046 * this class with respect to the given library, ignoring abstract methods, or `null` if the
1047 * look up fails. The behavior of this method is defined by the Dart Language Specification in
1048 * section 12.15.1: <blockquote> The result of looking up method <i>m</i> in c lass <i>C</i> with
1049 * respect to library <i>L</i> is:
1050 * * If <i>C</i> declares an instance method named <i>m</i> that is accessible to <i>L</i>, then
1051 * that method is the result of the lookup. Otherwise, if <i>C</i> has a super class <i>S</i>, then
1052 * the result of the lookup is the result of looking up method <i>m</i> in <i> S</i> with respect
1053 * to <i>L</i>. Otherwise, we say that the lookup has failed.
1054 * </blockquote>
1055 *
1056 * @param methodName the name of the method being looked up
1057 * @param library the library with respect to which the lookup is being perfor med
1058 * @return the result of looking up the given method in this class with respec t to the given
1059 * library
1060 */
1061 MethodElement lookUpConcreteMethod(String methodName, LibraryElement library);
1062
1063 /**
1045 * Return the element representing the getter that results from looking up the given getter in 1064 * Return the element representing the getter that results from looking up the given getter in
1046 * this class with respect to the given library, or `null` if the look up fail s. The 1065 * this class with respect to the given library, or `null` if the look up fail s. The
1047 * behavior of this method is defined by the Dart Language Specification in se ction 12.15.1: 1066 * behavior of this method is defined by the Dart Language Specification in se ction 12.15.1:
1048 * <blockquote>The result of looking up getter (respectively setter) <i>m</i> in class <i>C</i> 1067 * <blockquote>The result of looking up getter (respectively setter) <i>m</i> in class <i>C</i>
1049 * with respect to library <i>L</i> is: 1068 * with respect to library <i>L</i> is:
1050 * * If <i>C</i> declares an instance getter (respectively setter) named <i>m< /i> that is 1069 * * If <i>C</i> declares an instance getter (respectively setter) named <i>m< /i> that is
1051 * accessible to <i>L</i>, then that getter (respectively setter) is the resul t of the lookup. 1070 * accessible to <i>L</i>, then that getter (respectively setter) is the resul t of the lookup.
1052 * Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lo okup is the result 1071 * Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lo okup is the result
1053 * of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respec t to <i>L</i>. 1072 * of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respec t to <i>L</i>.
1054 * Otherwise, we say that the lookup has failed. 1073 * Otherwise, we say that the lookup has failed.
1055 * </blockquote> 1074 * </blockquote>
1056 * 1075 *
1057 * @param getterName the name of the getter being looked up 1076 * @param getterName the name of the getter being looked up
1058 * @param library the library with respect to which the lookup is being perfor med 1077 * @param library the library with respect to which the lookup is being perfor med
1059 * @return the result of looking up the given getter in this class with respec t to the given 1078 * @return the result of looking up the given getter in this class with respec t to the given
1060 * library 1079 * library
1061 */ 1080 */
1062 PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library ); 1081 PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library );
1063 1082
1064 /** 1083 /**
1084 * Return the element representing the getter that results from looking up the given getter in the
1085 * superclass of this class with respect to the given library, ignoring abstra ct getters, or
1086 * `null` if the look up fails. The behavior of this method is defined by the Dart Language
1087 * Specification in section 12.15.1: <blockquote>The result of looking up gett er (respectively
1088 * setter) <i>m</i> in class <i>C</i> with respect to library <i>L</i> is:
1089 * * If <i>C</i> declares an instance getter (respectively setter) named <i>m< /i> that is
1090 * accessible to <i>L</i>, then that getter (respectively setter) is the resul t of the lookup.
1091 * Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lo okup is the result
1092 * of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respec t to <i>L</i>.
1093 * Otherwise, we say that the lookup has failed.
1094 * </blockquote>
1095 *
1096 * @param getterName the name of the getter being looked up
1097 * @param library the library with respect to which the lookup is being perfor med
1098 * @return the result of looking up the given getter in this class with respec t to the given
1099 * library
1100 */
1101 PropertyAccessorElement lookUpInheritedConcreteGetter(String getterName, Libra ryElement library);
1102
1103 /**
1104 * Return the element representing the method that results from looking up the given method in the
1105 * superclass of this class with respect to the given library, ignoring abstra ct methods, or
1106 * `null` if the look up fails. The behavior of this method is defined by the Dart Language
1107 * Specification in section 12.15.1: <blockquote> The result of looking up met hod <i>m</i> in
1108 * class <i>C</i> with respect to library <i>L</i> is:
1109 * * If <i>C</i> declares an instance method named <i>m</i> that is accessible to <i>L</i>, then
1110 * that method is the result of the lookup. Otherwise, if <i>C</i> has a super class <i>S</i>, then
1111 * the result of the lookup is the result of looking up method <i>m</i> in <i> S</i> with respect
1112 * to <i>L</i>. Otherwise, we say that the lookup has failed.
1113 * </blockquote>
1114 *
1115 * @param methodName the name of the method being looked up
1116 * @param library the library with respect to which the lookup is being perfor med
1117 * @return the result of looking up the given method in the superclass of this class with respect
1118 * to the given library
1119 */
1120 MethodElement lookUpInheritedConcreteMethod(String methodName, LibraryElement library);
1121
1122 /**
1123 * Return the element representing the setter that results from looking up the given setter in the
1124 * superclass of this class with respect to the given library, ignoring abstra ct setters, or
1125 * `null` if the look up fails. The behavior of this method is defined by the Dart Language
1126 * Specification in section 12.16: <blockquote> The result of looking up gette r (respectively
1127 * setter) <i>m</i> in class <i>C</i> with respect to library <i>L</i> is:
1128 * * If <i>C</i> declares an instance getter (respectively setter) named <i>m< /i> that is
1129 * accessible to <i>L</i>, then that getter (respectively setter) is the resul t of the lookup.
1130 * Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lo okup is the result
1131 * of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respec t to <i>L</i>.
1132 * Otherwise, we say that the lookup has failed.
1133 * </blockquote>
1134 *
1135 * @param setterName the name of the setter being looked up
1136 * @param library the library with respect to which the lookup is being perfor med
1137 * @return the result of looking up the given setter in this class with respec t to the given
1138 * library
1139 */
1140 PropertyAccessorElement lookUpInheritedConcreteSetter(String setterName, Libra ryElement library);
1141
1142 /**
1065 * Return the element representing the method that results from looking up the given method in the 1143 * Return the element representing the method that results from looking up the given method in the
1066 * superclass of this class with respect to the given library, or `null` if th e look up 1144 * superclass of this class with respect to the given library, or `null` if th e look up
1067 * fails. The behavior of this method is defined by the Dart Language Specific ation in section 1145 * fails. The behavior of this method is defined by the Dart Language Specific ation in section
1068 * 12.15.1: <blockquote> The result of looking up method <i>m</i> in class <i> C</i> with respect 1146 * 12.15.1: <blockquote> The result of looking up method <i>m</i> in class <i> C</i> with respect
1069 * to library <i>L</i> is: 1147 * to library <i>L</i> is:
1070 * * If <i>C</i> declares an instance method named <i>m</i> that is accessible to <i>L</i>, then 1148 * * If <i>C</i> declares an instance method named <i>m</i> that is accessible to <i>L</i>, then
1071 * that method is the result of the lookup. Otherwise, if <i>C</i> has a super class <i>S</i>, then 1149 * that method is the result of the lookup. Otherwise, if <i>C</i> has a super class <i>S</i>, then
1072 * the result of the lookup is the result of looking up method <i>m</i> in <i> S</i> with respect 1150 * the result of the lookup is the result of looking up method <i>m</i> in <i> S</i> with respect
1073 * to <i>L</i>. Otherwise, we say that the lookup has failed. 1151 * to <i>L</i>. Otherwise, we say that the lookup has failed.
1074 * </blockquote> 1152 * </blockquote>
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
1399 return false; 1477 return false;
1400 } 1478 }
1401 1479
1402 @override 1480 @override
1403 bool get isTypedef => hasModifier(Modifier.TYPEDEF); 1481 bool get isTypedef => hasModifier(Modifier.TYPEDEF);
1404 1482
1405 @override 1483 @override
1406 bool get isValidMixin => hasModifier(Modifier.MIXIN); 1484 bool get isValidMixin => hasModifier(Modifier.MIXIN);
1407 1485
1408 @override 1486 @override
1409 PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library ) { 1487 MethodElement lookUpConcreteMethod(String methodName, LibraryElement library) => _internalLookUpConcreteMethod(methodName, library, true);
1410 Set<ClassElement> visitedClasses = new Set<ClassElement>(); 1488
1411 ClassElement currentElement = this; 1489 @override
1412 while (currentElement != null && !visitedClasses.contains(currentElement)) { 1490 PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library ) => _internalLookUpGetter(getterName, library, true);
1413 visitedClasses.add(currentElement); 1491
1414 PropertyAccessorElement element = currentElement.getGetter(getterName); 1492 @override
1415 if (element != null && element.isAccessibleIn(library)) { 1493 PropertyAccessorElement lookUpInheritedConcreteGetter(String getterName, Libra ryElement library) => _internalLookUpConcreteGetter(getterName, library, false);
1416 return element; 1494
1417 } 1495 @override
1418 for (InterfaceType mixin in currentElement.mixins) { 1496 MethodElement lookUpInheritedConcreteMethod(String methodName, LibraryElement library) => _internalLookUpConcreteMethod(methodName, library, false);
1419 ClassElement mixinElement = mixin.element; 1497
1420 if (mixinElement != null) { 1498 @override
1421 element = mixinElement.getGetter(getterName); 1499 PropertyAccessorElement lookUpInheritedConcreteSetter(String setterName, Libra ryElement library) => _internalLookUpConcreteSetter(setterName, library, false);
1422 if (element != null && element.isAccessibleIn(library)) {
1423 return element;
1424 }
1425 }
1426 }
1427 InterfaceType supertype = currentElement.supertype;
1428 if (supertype == null) {
1429 return null;
1430 }
1431 currentElement = supertype.element;
1432 }
1433 return null;
1434 }
1435 1500
1436 @override 1501 @override
1437 MethodElement lookUpInheritedMethod(String methodName, LibraryElement library) => _internalLookUpMethod(methodName, library, false); 1502 MethodElement lookUpInheritedMethod(String methodName, LibraryElement library) => _internalLookUpMethod(methodName, library, false);
1438 1503
1439 @override 1504 @override
1440 MethodElement lookUpMethod(String methodName, LibraryElement library) => _inte rnalLookUpMethod(methodName, library, true); 1505 MethodElement lookUpMethod(String methodName, LibraryElement library) => _inte rnalLookUpMethod(methodName, library, true);
1441 1506
1442 @override 1507 @override
1443 PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library ) { 1508 PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library ) => _internalLookUpSetter(setterName, library, true);
1444 Set<ClassElement> visitedClasses = new Set<ClassElement>();
1445 ClassElement currentElement = this;
1446 while (currentElement != null && !visitedClasses.contains(currentElement)) {
1447 visitedClasses.add(currentElement);
1448 PropertyAccessorElement element = currentElement.getSetter(setterName);
1449 if (element != null && element.isAccessibleIn(library)) {
1450 return element;
1451 }
1452 for (InterfaceType mixin in currentElement.mixins) {
1453 ClassElement mixinElement = mixin.element;
1454 if (mixinElement != null) {
1455 element = mixinElement.getSetter(setterName);
1456 if (element != null && element.isAccessibleIn(library)) {
1457 return element;
1458 }
1459 }
1460 }
1461 InterfaceType supertype = currentElement.supertype;
1462 if (supertype == null) {
1463 return null;
1464 }
1465 currentElement = supertype.element;
1466 }
1467 return null;
1468 }
1469 1509
1470 /** 1510 /**
1471 * Set whether this class is abstract to correspond to the given value. 1511 * Set whether this class is abstract to correspond to the given value.
1472 * 1512 *
1473 * @param isAbstract `true` if the class is abstract 1513 * @param isAbstract `true` if the class is abstract
1474 */ 1514 */
1475 void set abstract(bool isAbstract) { 1515 void set abstract(bool isAbstract) {
1476 setModifier(Modifier.ABSTRACT, isAbstract); 1516 setModifier(Modifier.ABSTRACT, isAbstract);
1477 } 1517 }
1478 1518
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1617 for (InterfaceType type in currentElement.mixins) { 1657 for (InterfaceType type in currentElement.mixins) {
1618 ClassElement element = type.element; 1658 ClassElement element = type.element;
1619 if (!visitedClasses.contains(element)) { 1659 if (!visitedClasses.contains(element)) {
1620 supertypes.add(type); 1660 supertypes.add(type);
1621 } 1661 }
1622 } 1662 }
1623 } 1663 }
1624 } 1664 }
1625 } 1665 }
1626 1666
1667 PropertyAccessorElement _internalLookUpConcreteGetter(String getterName, Libra ryElement library, bool includeThisClass) {
1668 PropertyAccessorElement getter = _internalLookUpGetter(getterName, library, includeThisClass);
1669 while (getter != null && getter.isAbstract) {
1670 Element definingClass = getter.enclosingElement;
1671 if (definingClass is! ClassElementImpl) {
1672 return null;
1673 }
1674 getter = (definingClass as ClassElementImpl)._internalLookUpGetter(getterN ame, library, false);
1675 }
1676 return getter;
1677 }
1678
1679 MethodElement _internalLookUpConcreteMethod(String methodName, LibraryElement library, bool includeThisClass) {
1680 MethodElement method = _internalLookUpMethod(methodName, library, includeThi sClass);
1681 while (method != null && method.isAbstract) {
1682 ClassElement definingClass = method.enclosingElement;
1683 if (definingClass == null) {
1684 return null;
1685 }
1686 method = definingClass.lookUpInheritedMethod(methodName, library);
1687 }
1688 return method;
1689 }
1690
1691 PropertyAccessorElement _internalLookUpConcreteSetter(String setterName, Libra ryElement library, bool includeThisClass) {
1692 PropertyAccessorElement setter = _internalLookUpSetter(setterName, library, includeThisClass);
1693 while (setter != null && setter.isAbstract) {
1694 Element definingClass = setter.enclosingElement;
1695 if (definingClass is! ClassElementImpl) {
1696 return null;
1697 }
1698 setter = (definingClass as ClassElementImpl)._internalLookUpSetter(setterN ame, library, false);
1699 }
1700 return setter;
1701 }
1702
1703 PropertyAccessorElement _internalLookUpGetter(String getterName, LibraryElemen t library, bool includeThisClass) {
1704 Set<ClassElement> visitedClasses = new Set<ClassElement>();
1705 ClassElement currentElement = this;
1706 if (includeThisClass) {
1707 PropertyAccessorElement element = currentElement.getGetter(getterName);
1708 if (element != null && element.isAccessibleIn(library)) {
1709 return element;
1710 }
1711 }
1712 while (currentElement != null && visitedClasses.add(currentElement)) {
1713 for (InterfaceType mixin in currentElement.mixins) {
1714 ClassElement mixinElement = mixin.element;
1715 if (mixinElement != null) {
1716 PropertyAccessorElement element = mixinElement.getGetter(getterName);
1717 if (element != null && element.isAccessibleIn(library)) {
1718 return element;
1719 }
1720 }
1721 }
1722 InterfaceType supertype = currentElement.supertype;
1723 if (supertype == null) {
1724 return null;
1725 }
1726 currentElement = supertype.element;
1727 PropertyAccessorElement element = currentElement.getGetter(getterName);
1728 if (element != null && element.isAccessibleIn(library)) {
1729 return element;
1730 }
1731 }
1732 return null;
1733 }
1734
1627 MethodElement _internalLookUpMethod(String methodName, LibraryElement library, bool includeThisClass) { 1735 MethodElement _internalLookUpMethod(String methodName, LibraryElement library, bool includeThisClass) {
1628 Set<ClassElement> visitedClasses = new Set<ClassElement>(); 1736 Set<ClassElement> visitedClasses = new Set<ClassElement>();
1629 ClassElement currentElement = this; 1737 ClassElement currentElement = this;
1630 if (includeThisClass) { 1738 if (includeThisClass) {
1631 MethodElement element = currentElement.getMethod(methodName); 1739 MethodElement element = currentElement.getMethod(methodName);
1632 if (element != null && element.isAccessibleIn(library)) { 1740 if (element != null && element.isAccessibleIn(library)) {
1633 return element; 1741 return element;
1634 } 1742 }
1635 } 1743 }
1636 while (currentElement != null && visitedClasses.add(currentElement)) { 1744 while (currentElement != null && visitedClasses.add(currentElement)) {
(...skipping 12 matching lines...) Expand all
1649 } 1757 }
1650 currentElement = supertype.element; 1758 currentElement = supertype.element;
1651 MethodElement element = currentElement.getMethod(methodName); 1759 MethodElement element = currentElement.getMethod(methodName);
1652 if (element != null && element.isAccessibleIn(library)) { 1760 if (element != null && element.isAccessibleIn(library)) {
1653 return element; 1761 return element;
1654 } 1762 }
1655 } 1763 }
1656 return null; 1764 return null;
1657 } 1765 }
1658 1766
1767 PropertyAccessorElement _internalLookUpSetter(String setterName, LibraryElemen t library, bool includeThisClass) {
1768 Set<ClassElement> visitedClasses = new Set<ClassElement>();
1769 ClassElement currentElement = this;
1770 if (includeThisClass) {
1771 PropertyAccessorElement element = currentElement.getSetter(setterName);
1772 if (element != null && element.isAccessibleIn(library)) {
1773 return element;
1774 }
1775 }
1776 while (currentElement != null && visitedClasses.add(currentElement)) {
1777 for (InterfaceType mixin in currentElement.mixins) {
1778 ClassElement mixinElement = mixin.element;
1779 if (mixinElement != null) {
1780 PropertyAccessorElement element = mixinElement.getSetter(setterName);
1781 if (element != null && element.isAccessibleIn(library)) {
1782 return element;
1783 }
1784 }
1785 }
1786 InterfaceType supertype = currentElement.supertype;
1787 if (supertype == null) {
1788 return null;
1789 }
1790 currentElement = supertype.element;
1791 PropertyAccessorElement element = currentElement.getSetter(setterName);
1792 if (element != null && element.isAccessibleIn(library)) {
1793 return element;
1794 }
1795 }
1796 return null;
1797 }
1798
1659 bool _safeIsOrInheritsProxy(ClassElement classElt, Set<ClassElement> visitedCl assElts) { 1799 bool _safeIsOrInheritsProxy(ClassElement classElt, Set<ClassElement> visitedCl assElts) {
1660 if (visitedClassElts.contains(classElt)) { 1800 if (visitedClassElts.contains(classElt)) {
1661 return false; 1801 return false;
1662 } 1802 }
1663 visitedClassElts.add(classElt); 1803 visitedClassElts.add(classElt);
1664 if (classElt.isProxy) { 1804 if (classElt.isProxy) {
1665 return true; 1805 return true;
1666 } else if (classElt.supertype != null && _safeIsOrInheritsProxy(classElt.sup ertype.element, visitedClassElts)) { 1806 } else if (classElt.supertype != null && _safeIsOrInheritsProxy(classElt.sup ertype.element, visitedClassElts)) {
1667 return true; 1807 return true;
1668 } 1808 }
(...skipping 9280 matching lines...) Expand 10 before | Expand all | Expand 10 after
10949 11089
10950 @override 11090 @override
10951 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) => id entical(object, this); 11091 bool internalEquals(Object object, Set<ElementPair> visitedElementPairs) => id entical(object, this);
10952 11092
10953 @override 11093 @override
10954 bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_ TypePair> visitedTypePairs) => isSubtypeOf(type); 11094 bool internalIsMoreSpecificThan(DartType type, bool withDynamic, Set<TypeImpl_ TypePair> visitedTypePairs) => isSubtypeOf(type);
10955 11095
10956 @override 11096 @override
10957 bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePair s) => identical(type, this) || identical(type, DynamicTypeImpl.instance); 11097 bool internalIsSubtypeOf(DartType type, Set<TypeImpl_TypePair> visitedTypePair s) => identical(type, this) || identical(type, DynamicTypeImpl.instance);
10958 } 11098 }
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