OLD | NEW |
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 /** | 5 /** |
6 * Defines the AST model. The AST (Abstract Syntax Tree) model describes the | 6 * Defines the AST model. The AST (Abstract Syntax Tree) model describes the |
7 * syntactic (as opposed to semantic) structure of Dart code. The semantic | 7 * syntactic (as opposed to semantic) structure of Dart code. The semantic |
8 * structure of the code is modeled by the | 8 * structure of the code is modeled by the |
9 * [element model](../element/element.dart). | 9 * [element model](../element/element.dart). |
10 * | 10 * |
(...skipping 4002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4013 * resolution was able to find a better element based on type propagation, | 4013 * resolution was able to find a better element based on type propagation, |
4014 * that element will be returned. Otherwise, the element found using the | 4014 * that element will be returned. Otherwise, the element found using the |
4015 * result of static analysis will be returned. If resolution has not been | 4015 * result of static analysis will be returned. If resolution has not been |
4016 * performed, then `null` will be returned. | 4016 * performed, then `null` will be returned. |
4017 */ | 4017 */ |
4018 ExecutableElement get bestElement; | 4018 ExecutableElement get bestElement; |
4019 | 4019 |
4020 /** | 4020 /** |
4021 * Return the expression producing the function being invoked. | 4021 * Return the expression producing the function being invoked. |
4022 */ | 4022 */ |
| 4023 @override |
4023 Expression get function; | 4024 Expression get function; |
4024 | 4025 |
4025 /** | 4026 /** |
4026 * Set the expression producing the function being invoked to the given | 4027 * Set the expression producing the function being invoked to the given |
4027 * [expression]. | 4028 * [expression]. |
4028 */ | 4029 */ |
4029 void set function(Expression expression); | 4030 void set function(Expression expression); |
4030 | 4031 |
4031 /** | 4032 /** |
4032 * Return the element associated with the function being invoked based on | 4033 * Return the element associated with the function being invoked based on |
(...skipping 10 matching lines...) Expand all Loading... |
4043 | 4044 |
4044 /** | 4045 /** |
4045 * Return the function type of the method invocation based on the propagated | 4046 * Return the function type of the method invocation based on the propagated |
4046 * type information, or `null` if the AST structure has not been resolved, or | 4047 * type information, or `null` if the AST structure has not been resolved, or |
4047 * if the invoke could not be resolved. | 4048 * if the invoke could not be resolved. |
4048 * | 4049 * |
4049 * This will usually be a [FunctionType], but it can also be an | 4050 * This will usually be a [FunctionType], but it can also be an |
4050 * [InterfaceType] with a `call` method, `dynamic`, `Function`, or a `@proxy` | 4051 * [InterfaceType] with a `call` method, `dynamic`, `Function`, or a `@proxy` |
4051 * interface type that implements `Function`. | 4052 * interface type that implements `Function`. |
4052 */ | 4053 */ |
| 4054 @override |
4053 DartType get propagatedInvokeType; | 4055 DartType get propagatedInvokeType; |
4054 | 4056 |
4055 /** | 4057 /** |
4056 * Set the function type of the method invocation based on the propagated type | 4058 * Set the function type of the method invocation based on the propagated type |
4057 * information to the given [type]. | 4059 * information to the given [type]. |
4058 */ | 4060 */ |
| 4061 @override |
4059 void set propagatedInvokeType(DartType type); | 4062 void set propagatedInvokeType(DartType type); |
4060 | 4063 |
4061 /** | 4064 /** |
4062 * Return the element associated with the function being invoked based on | 4065 * Return the element associated with the function being invoked based on |
4063 * static type information, or `null` if the AST structure has not been | 4066 * static type information, or `null` if the AST structure has not been |
4064 * resolved or the function could not be resolved. | 4067 * resolved or the function could not be resolved. |
4065 */ | 4068 */ |
4066 ExecutableElement get staticElement; | 4069 ExecutableElement get staticElement; |
4067 | 4070 |
4068 /** | 4071 /** |
4069 * Set the element associated with the function being invoked based on static | 4072 * Set the element associated with the function being invoked based on static |
4070 * type information to the given [element]. | 4073 * type information to the given [element]. |
4071 */ | 4074 */ |
4072 void set staticElement(ExecutableElement element); | 4075 void set staticElement(ExecutableElement element); |
4073 | 4076 |
4074 /** | 4077 /** |
4075 * Return the function type of the method invocation based on the static type | 4078 * Return the function type of the method invocation based on the static type |
4076 * information, or `null` if the AST structure has not been resolved, or if | 4079 * information, or `null` if the AST structure has not been resolved, or if |
4077 * the invoke could not be resolved. | 4080 * the invoke could not be resolved. |
4078 * | 4081 * |
4079 * This will usually be a [FunctionType], but it can also be an | 4082 * This will usually be a [FunctionType], but it can also be an |
4080 * [InterfaceType] with a `call` method, `dynamic`, `Function`, or a `@proxy` | 4083 * [InterfaceType] with a `call` method, `dynamic`, `Function`, or a `@proxy` |
4081 * interface type that implements `Function`. | 4084 * interface type that implements `Function`. |
4082 */ | 4085 */ |
| 4086 @override |
4083 DartType get staticInvokeType; | 4087 DartType get staticInvokeType; |
4084 | 4088 |
4085 /** | 4089 /** |
4086 * Set the function type of the method invocation based on the static type | 4090 * Set the function type of the method invocation based on the static type |
4087 * information to the given [type]. | 4091 * information to the given [type]. |
4088 */ | 4092 */ |
| 4093 @override |
4089 void set staticInvokeType(DartType type); | 4094 void set staticInvokeType(DartType type); |
4090 | 4095 |
4091 /** | 4096 /** |
4092 * Set the type arguments to be applied to the method being invoked to the | 4097 * Set the type arguments to be applied to the method being invoked to the |
4093 * given [typeArguments]. | 4098 * given [typeArguments]. |
4094 */ | 4099 */ |
4095 void set typeArguments(TypeArgumentList typeArguments); | 4100 void set typeArguments(TypeArgumentList typeArguments); |
4096 } | 4101 } |
4097 | 4102 |
4098 /** | 4103 /** |
(...skipping 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5625 | 5630 |
5626 /** | 5631 /** |
5627 * Return the function type of the method invocation based on the propagated | 5632 * Return the function type of the method invocation based on the propagated |
5628 * type information, or `null` if the AST structure has not been resolved, or | 5633 * type information, or `null` if the AST structure has not been resolved, or |
5629 * if the invoke could not be resolved. | 5634 * if the invoke could not be resolved. |
5630 * | 5635 * |
5631 * This will usually be a [FunctionType], but it can also be an | 5636 * This will usually be a [FunctionType], but it can also be an |
5632 * [InterfaceType] with a `call` method, `dynamic`, `Function`, or a `@proxy` | 5637 * [InterfaceType] with a `call` method, `dynamic`, `Function`, or a `@proxy` |
5633 * interface type that implements `Function`. | 5638 * interface type that implements `Function`. |
5634 */ | 5639 */ |
| 5640 @override |
5635 DartType get propagatedInvokeType; | 5641 DartType get propagatedInvokeType; |
5636 | 5642 |
5637 /** | 5643 /** |
5638 * Set the function type of the method invocation based on the propagated type | 5644 * Set the function type of the method invocation based on the propagated type |
5639 * information to the given [type]. | 5645 * information to the given [type]. |
5640 */ | 5646 */ |
| 5647 @override |
5641 void set propagatedInvokeType(DartType type); | 5648 void set propagatedInvokeType(DartType type); |
5642 | 5649 |
5643 /** | 5650 /** |
5644 * Return the expression used to compute the receiver of the invocation. If | 5651 * Return the expression used to compute the receiver of the invocation. If |
5645 * this invocation is not part of a cascade expression, then this is the same | 5652 * this invocation is not part of a cascade expression, then this is the same |
5646 * as [target]. If this invocation is part of a cascade expression, then the | 5653 * as [target]. If this invocation is part of a cascade expression, then the |
5647 * target stored with the cascade expression is returned. | 5654 * target stored with the cascade expression is returned. |
5648 */ | 5655 */ |
5649 Expression get realTarget; | 5656 Expression get realTarget; |
5650 | 5657 |
5651 /** | 5658 /** |
5652 * Return the function type of the method invocation based on the static type | 5659 * Return the function type of the method invocation based on the static type |
5653 * information, or `null` if the AST structure has not been resolved, or if | 5660 * information, or `null` if the AST structure has not been resolved, or if |
5654 * the invoke could not be resolved. | 5661 * the invoke could not be resolved. |
5655 * | 5662 * |
5656 * This will usually be a [FunctionType], but it can also be an | 5663 * This will usually be a [FunctionType], but it can also be an |
5657 * [InterfaceType] with a `call` method, `dynamic`, `Function`, or a `@proxy` | 5664 * [InterfaceType] with a `call` method, `dynamic`, `Function`, or a `@proxy` |
5658 * interface type that implements `Function`. | 5665 * interface type that implements `Function`. |
5659 */ | 5666 */ |
| 5667 @override |
5660 DartType get staticInvokeType; | 5668 DartType get staticInvokeType; |
5661 | 5669 |
5662 /** | 5670 /** |
5663 * Set the function type of the method invocation based on the static type | 5671 * Set the function type of the method invocation based on the static type |
5664 * information to the given [type]. | 5672 * information to the given [type]. |
5665 */ | 5673 */ |
| 5674 @override |
5666 void set staticInvokeType(DartType type); | 5675 void set staticInvokeType(DartType type); |
5667 | 5676 |
5668 /** | 5677 /** |
5669 * Return the expression producing the object on which the method is defined, | 5678 * Return the expression producing the object on which the method is defined, |
5670 * or `null` if there is no target (that is, the target is implicitly `this`) | 5679 * or `null` if there is no target (that is, the target is implicitly `this`) |
5671 * or if this method invocation is part of a cascade expression. | 5680 * or if this method invocation is part of a cascade expression. |
5672 * | 5681 * |
5673 * Use [realTarget] to get the target independent of whether this is part of a | 5682 * Use [realTarget] to get the target independent of whether this is part of a |
5674 * cascade expression. | 5683 * cascade expression. |
5675 */ | 5684 */ |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5913 * Set the node that is the parent of each of the elements in the list to the | 5922 * Set the node that is the parent of each of the elements in the list to the |
5914 * given [node]. | 5923 * given [node]. |
5915 */ | 5924 */ |
5916 @deprecated // Never intended for public use. | 5925 @deprecated // Never intended for public use. |
5917 void set owner(AstNode node); | 5926 void set owner(AstNode node); |
5918 | 5927 |
5919 /** | 5928 /** |
5920 * Return the node at the given [index] in the list or throw a [RangeError] if | 5929 * Return the node at the given [index] in the list or throw a [RangeError] if |
5921 * [index] is out of bounds. | 5930 * [index] is out of bounds. |
5922 */ | 5931 */ |
| 5932 @override |
5923 E operator [](int index); | 5933 E operator [](int index); |
5924 | 5934 |
5925 /** | 5935 /** |
5926 * Set the node at the given [index] in the list to the given [node] or throw | 5936 * Set the node at the given [index] in the list to the given [node] or throw |
5927 * a [RangeError] if [index] is out of bounds. | 5937 * a [RangeError] if [index] is out of bounds. |
5928 */ | 5938 */ |
| 5939 @override |
5929 void operator []=(int index, E node); | 5940 void operator []=(int index, E node); |
5930 | 5941 |
5931 /** | 5942 /** |
5932 * Use the given [visitor] to visit each of the nodes in this list. | 5943 * Use the given [visitor] to visit each of the nodes in this list. |
5933 */ | 5944 */ |
5934 accept(AstVisitor visitor); | 5945 accept(AstVisitor visitor); |
5935 } | 5946 } |
5936 | 5947 |
5937 /** | 5948 /** |
5938 * A formal parameter that is required (is not optional). | 5949 * A formal parameter that is required (is not optional). |
(...skipping 2142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8081 /** | 8092 /** |
8082 * Return the 'yield' keyword. | 8093 * Return the 'yield' keyword. |
8083 */ | 8094 */ |
8084 Token get yieldKeyword; | 8095 Token get yieldKeyword; |
8085 | 8096 |
8086 /** | 8097 /** |
8087 * Return the 'yield' keyword to the given [token]. | 8098 * Return the 'yield' keyword to the given [token]. |
8088 */ | 8099 */ |
8089 void set yieldKeyword(Token token); | 8100 void set yieldKeyword(Token token); |
8090 } | 8101 } |
OLD | NEW |