OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 library elements; | 5 library elements; |
6 | 6 |
7 | 7 |
8 import '../tree/tree.dart'; | 8 import '../tree/tree.dart'; |
9 import '../util/util.dart'; | 9 import '../util/util.dart'; |
10 import '../resolution/resolution.dart'; | 10 import '../resolution/resolution.dart'; |
(...skipping 10 matching lines...) Expand all Loading... |
21 Selector, | 21 Selector, |
22 Constant, | 22 Constant, |
23 Compiler; | 23 Compiler; |
24 | 24 |
25 import '../dart_types.dart'; | 25 import '../dart_types.dart'; |
26 | 26 |
27 import '../scanner/scannerlib.dart' show Token, | 27 import '../scanner/scannerlib.dart' show Token, |
28 isUserDefinableOperator, | 28 isUserDefinableOperator, |
29 isMinusOperator; | 29 isMinusOperator; |
30 | 30 |
| 31 import '../ordered_typeset.dart' show OrderedTypeSet; |
| 32 |
31 const int STATE_NOT_STARTED = 0; | 33 const int STATE_NOT_STARTED = 0; |
32 const int STATE_STARTED = 1; | 34 const int STATE_STARTED = 1; |
33 const int STATE_DONE = 2; | 35 const int STATE_DONE = 2; |
34 | 36 |
35 class ElementCategory { | 37 class ElementCategory { |
36 /** | 38 /** |
37 * Represents things that we don't expect to find when looking in a | 39 * Represents things that we don't expect to find when looking in a |
38 * scope. | 40 * scope. |
39 */ | 41 */ |
40 static const int NONE = 0; | 42 static const int NONE = 0; |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 * available until the type of the element has been computed through | 831 * available until the type of the element has been computed through |
830 * [computeType]. | 832 * [computeType]. |
831 */ | 833 */ |
832 Link<DartType> get typeVariables; | 834 Link<DartType> get typeVariables; |
833 } | 835 } |
834 | 836 |
835 abstract class ClassElement extends TypeDeclarationElement | 837 abstract class ClassElement extends TypeDeclarationElement |
836 implements ScopeContainerElement { | 838 implements ScopeContainerElement { |
837 int get id; | 839 int get id; |
838 | 840 |
| 841 /// The length of the longest inheritance path from [:Object:]. |
| 842 int get hierarchyDepth; |
| 843 |
839 InterfaceType get rawType; | 844 InterfaceType get rawType; |
840 InterfaceType get thisType; | 845 InterfaceType get thisType; |
841 | 846 |
842 ClassElement get superclass; | 847 ClassElement get superclass; |
843 | 848 |
844 DartType get supertype; | 849 DartType get supertype; |
| 850 OrderedTypeSet get allSupertypesAndSelf; |
845 Link<DartType> get allSupertypes; | 851 Link<DartType> get allSupertypes; |
846 Link<DartType> get interfaces; | 852 Link<DartType> get interfaces; |
847 | 853 |
848 bool get hasConstructor; | 854 bool get hasConstructor; |
849 Link<Element> get constructors; | 855 Link<Element> get constructors; |
850 | 856 |
851 ClassElement get patch; | 857 ClassElement get patch; |
852 ClassElement get origin; | 858 ClassElement get origin; |
853 ClassElement get declaration; | 859 ClassElement get declaration; |
854 ClassElement get implementation; | 860 ClassElement get implementation; |
855 | 861 |
856 int get supertypeLoadState; | 862 int get supertypeLoadState; |
857 int get resolutionState; | 863 int get resolutionState; |
858 bool get isResolved; | 864 bool get isResolved; |
859 String get nativeTagInfo; | 865 String get nativeTagInfo; |
860 | 866 |
861 bool get isMixinApplication; | 867 bool get isMixinApplication; |
862 bool get isUnnamedMixinApplication; | 868 bool get isUnnamedMixinApplication; |
863 bool get hasBackendMembers; | 869 bool get hasBackendMembers; |
864 bool get hasLocalScopeMembers; | 870 bool get hasLocalScopeMembers; |
865 | 871 |
866 // TODO(kasperl): These are bit fishy. Do we really need them? | 872 // TODO(kasperl): These are bit fishy. Do we really need them? |
867 void set thisType(InterfaceType value); | 873 void set thisType(InterfaceType value); |
868 void set supertype(DartType value); | 874 void set supertype(DartType value); |
869 void set allSupertypes(Link<DartType> value); | |
870 void set interfaces(Link<DartType> value); | 875 void set interfaces(Link<DartType> value); |
871 void set patch(ClassElement value); | 876 void set patch(ClassElement value); |
872 void set origin(ClassElement value); | 877 void set origin(ClassElement value); |
873 void set supertypeLoadState(int value); | 878 void set supertypeLoadState(int value); |
874 void set resolutionState(int value); | 879 void set resolutionState(int value); |
875 void set nativeTagInfo(String value); | 880 void set nativeTagInfo(String value); |
876 | 881 |
877 bool isObject(Compiler compiler); | 882 bool isObject(Compiler compiler); |
878 bool isSubclassOf(ClassElement cls); | 883 bool isSubclassOf(ClassElement cls); |
879 bool implementsInterface(ClassElement intrface); | 884 bool implementsInterface(ClassElement intrface); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
978 int get resolutionState; | 983 int get resolutionState; |
979 Token get beginToken; | 984 Token get beginToken; |
980 Token get endToken; | 985 Token get endToken; |
981 | 986 |
982 // TODO(kasperl): Try to get rid of these. | 987 // TODO(kasperl): Try to get rid of these. |
983 void set annotatedElement(Element value); | 988 void set annotatedElement(Element value); |
984 void set resolutionState(int value); | 989 void set resolutionState(int value); |
985 | 990 |
986 MetadataAnnotation ensureResolved(Compiler compiler); | 991 MetadataAnnotation ensureResolved(Compiler compiler); |
987 } | 992 } |
OLD | NEW |