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 '../constants/expressions.dart'; | 8 import '../constants/expressions.dart'; |
9 import '../tree/tree.dart'; | 9 import '../tree/tree.dart'; |
10 import '../util/util.dart'; | 10 import '../util/util.dart'; |
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 Name get memberName; | 991 Name get memberName; |
992 } | 992 } |
993 | 993 |
994 /// A function, variable or parameter defined in an executable context. | 994 /// A function, variable or parameter defined in an executable context. |
995 abstract class LocalElement extends Element implements TypedElement, Local { | 995 abstract class LocalElement extends Element implements TypedElement, Local { |
996 } | 996 } |
997 | 997 |
998 /// A top level, static or instance field, a formal parameter or local variable. | 998 /// A top level, static or instance field, a formal parameter or local variable. |
999 abstract class VariableElement extends ExecutableElement { | 999 abstract class VariableElement extends ExecutableElement { |
1000 Expression get initializer; | 1000 Expression get initializer; |
| 1001 |
| 1002 /// The constant expression defining the value of the variable if `const`, |
| 1003 /// `null` otherwise. |
| 1004 ConstantExpression get constant; |
1001 } | 1005 } |
1002 | 1006 |
1003 /// An entity that defines a local entity (memory slot) in generated code. | 1007 /// An entity that defines a local entity (memory slot) in generated code. |
1004 /// | 1008 /// |
1005 /// Parameters, local variables and local functions (can) define local entity | 1009 /// Parameters, local variables and local functions (can) define local entity |
1006 /// and thus implement [Local] through [LocalElement]. For non-element locals, | 1010 /// and thus implement [Local] through [LocalElement]. For non-element locals, |
1007 /// like `this` and boxes, specialized [Local] classes are created. | 1011 /// like `this` and boxes, specialized [Local] classes are created. |
1008 /// | 1012 /// |
1009 /// Type variables can introduce locals in factories and constructors | 1013 /// Type variables can introduce locals in factories and constructors |
1010 /// but since one type variable can introduce different locals in different | 1014 /// but since one type variable can introduce different locals in different |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1249 /// Consider for instance this hierarchy: | 1253 /// Consider for instance this hierarchy: |
1250 /// | 1254 /// |
1251 /// class C { C.c(a, {b}); | 1255 /// class C { C.c(a, {b}); |
1252 /// class D {} | 1256 /// class D {} |
1253 /// class E = C with D; | 1257 /// class E = C with D; |
1254 /// | 1258 /// |
1255 /// Class `E` has a synthesized constructor, `E.c`, whose defining constructor | 1259 /// Class `E` has a synthesized constructor, `E.c`, whose defining constructor |
1256 /// is `C.c`. | 1260 /// is `C.c`. |
1257 ConstructorElement get definingConstructor; | 1261 ConstructorElement get definingConstructor; |
1258 | 1262 |
| 1263 /// The constant constructor defining the binding of fields if `const`, |
| 1264 /// `null` otherwise. |
| 1265 ConstantConstructor get constantConstructor; |
| 1266 |
| 1267 /// `true` if this constructor is either `bool.fromEnviroment` |
| 1268 bool get isFromEnvironmentConstructor; |
| 1269 |
1259 /// Use [enclosingClass] instead. | 1270 /// Use [enclosingClass] instead. |
1260 @deprecated | 1271 @deprecated |
1261 get enclosingElement; | 1272 get enclosingElement; |
1262 } | 1273 } |
1263 | 1274 |
1264 /// JavaScript backend specific element for the body of constructor. | 1275 /// JavaScript backend specific element for the body of constructor. |
1265 // TODO(johnniwinther): Remove this class from the element model. | 1276 // TODO(johnniwinther): Remove this class from the element model. |
1266 abstract class ConstructorBodyElement extends MethodElement { | 1277 abstract class ConstructorBodyElement extends MethodElement { |
1267 FunctionElement get constructor; | 1278 FunctionElement get constructor; |
1268 } | 1279 } |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1632 bool get isDeclaredByField; | 1643 bool get isDeclaredByField; |
1633 | 1644 |
1634 /// Returns `true` if this member is abstract. | 1645 /// Returns `true` if this member is abstract. |
1635 bool get isAbstract; | 1646 bool get isAbstract; |
1636 | 1647 |
1637 /// If abstract, [implementation] points to the overridden concrete member, | 1648 /// If abstract, [implementation] points to the overridden concrete member, |
1638 /// if any. Otherwise [implementation] points to the member itself. | 1649 /// if any. Otherwise [implementation] points to the member itself. |
1639 Member get implementation; | 1650 Member get implementation; |
1640 } | 1651 } |
1641 | 1652 |
OLD | NEW |