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 2052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2063 * Return the token for the right parenthesis. | 2063 * Return the token for the right parenthesis. |
2064 */ | 2064 */ |
2065 Token get rightParenthesis; | 2065 Token get rightParenthesis; |
2066 | 2066 |
2067 /** | 2067 /** |
2068 * Set the token for the right parenthesis to the given [token]. | 2068 * Set the token for the right parenthesis to the given [token]. |
2069 */ | 2069 */ |
2070 void set rightParenthesis(Token token); | 2070 void set rightParenthesis(Token token); |
2071 | 2071 |
2072 /** | 2072 /** |
| 2073 * Return the source to which the [libraryUri] was resolved. |
| 2074 */ |
| 2075 Source get uriSource; |
| 2076 |
| 2077 /** |
| 2078 * Set the source to which the [libraryUri] was resolved to the given [source]
. |
| 2079 */ |
| 2080 void set uriSource(Source source); |
| 2081 |
| 2082 /** |
2073 * Return the value to which the value of the declared variable will be | 2083 * Return the value to which the value of the declared variable will be |
2074 * compared, or `null` if the condition does not include an equality test. | 2084 * compared, or `null` if the condition does not include an equality test. |
2075 */ | 2085 */ |
2076 StringLiteral get value; | 2086 StringLiteral get value; |
2077 | 2087 |
2078 /** | 2088 /** |
2079 * Set the value to which the value of the declared variable will be | 2089 * Set the value to which the value of the declared variable will be |
2080 * compared to the given [value]. | 2090 * compared to the given [value]. |
2081 */ | 2091 */ |
2082 void set value(StringLiteral value); | 2092 void set value(StringLiteral value); |
(...skipping 3838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5921 */ | 5931 */ |
5922 NodeList<Configuration> get configurations; | 5932 NodeList<Configuration> get configurations; |
5923 | 5933 |
5924 /** | 5934 /** |
5925 * Set the token representing the keyword that introduces this directive | 5935 * Set the token representing the keyword that introduces this directive |
5926 * ('import', 'export', 'library' or 'part') to the given [token]. | 5936 * ('import', 'export', 'library' or 'part') to the given [token]. |
5927 */ | 5937 */ |
5928 void set keyword(Token token); | 5938 void set keyword(Token token); |
5929 | 5939 |
5930 /** | 5940 /** |
| 5941 * Return the source that was selected based on the declared variables. This |
| 5942 * will be the source from the first configuration whose condition is true, or |
| 5943 * the [uriSource] if either there are no configurations or if there are no |
| 5944 * configurations whose condition is true. |
| 5945 */ |
| 5946 Source get selectedSource; |
| 5947 |
| 5948 /** |
5931 * Return the semicolon terminating the directive. | 5949 * Return the semicolon terminating the directive. |
5932 */ | 5950 */ |
5933 Token get semicolon; | 5951 Token get semicolon; |
5934 | 5952 |
5935 /** | 5953 /** |
5936 * Set the semicolon terminating the directive to the given [token]. | 5954 * Set the semicolon terminating the directive to the given [token]. |
5937 */ | 5955 */ |
5938 void set semicolon(Token token); | 5956 void set semicolon(Token token); |
5939 } | 5957 } |
5940 | 5958 |
(...skipping 1903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7844 * [ExportDirective] | 7862 * [ExportDirective] |
7845 * | [ImportDirective] | 7863 * | [ImportDirective] |
7846 * | [PartDirective] | 7864 * | [PartDirective] |
7847 * | 7865 * |
7848 * Clients may not extend, implement or mix-in this class. | 7866 * Clients may not extend, implement or mix-in this class. |
7849 */ | 7867 */ |
7850 abstract class UriBasedDirective extends Directive { | 7868 abstract class UriBasedDirective extends Directive { |
7851 /** | 7869 /** |
7852 * Return the source to which the URI was resolved. | 7870 * Return the source to which the URI was resolved. |
7853 */ | 7871 */ |
| 7872 @deprecated |
7854 Source get source; | 7873 Source get source; |
7855 | 7874 |
7856 /** | 7875 /** |
7857 * Set the source to which the URI was resolved to the given [source]. | 7876 * Set the source to which the URI was resolved to the given [source]. |
7858 */ | 7877 */ |
| 7878 @deprecated |
7859 void set source(Source source); | 7879 void set source(Source source); |
7860 | 7880 |
7861 /** | 7881 /** |
7862 * Return the URI referenced by this directive. | 7882 * Return the URI referenced by this directive. |
7863 */ | 7883 */ |
7864 StringLiteral get uri; | 7884 StringLiteral get uri; |
7865 | 7885 |
7866 /** | 7886 /** |
7867 * Set the URI referenced by this directive to the given [uri]. | 7887 * Set the URI referenced by this directive to the given [uri]. |
7868 */ | 7888 */ |
7869 void set uri(StringLiteral uri); | 7889 void set uri(StringLiteral uri); |
7870 | 7890 |
7871 /** | 7891 /** |
7872 * Return the content of the URI. | 7892 * Return the content of the [uri]. |
7873 */ | 7893 */ |
7874 String get uriContent; | 7894 String get uriContent; |
7875 | 7895 |
7876 /** | 7896 /** |
7877 * Set the content of the URI to the given [content]. | 7897 * Set the content of the [uri] to the given [content]. |
7878 */ | 7898 */ |
7879 void set uriContent(String content); | 7899 void set uriContent(String content); |
7880 | 7900 |
7881 /** | 7901 /** |
7882 * Return the element associated with the URI of this directive, or `null` if | 7902 * Return the element associated with the [uri] of this directive, or `null` |
7883 * the AST structure has not been resolved or if the URI could not be | 7903 * if the AST structure has not been resolved or if the URI could not be |
7884 * resolved. Examples of the latter case include a directive that contains an | 7904 * resolved. Examples of the latter case include a directive that contains an |
7885 * invalid URL or a URL that does not exist. | 7905 * invalid URL or a URL that does not exist. |
7886 */ | 7906 */ |
7887 Element get uriElement; | 7907 Element get uriElement; |
7888 | 7908 |
7889 /** | 7909 /** |
| 7910 * Return the source to which the [uri] was resolved. |
| 7911 */ |
| 7912 Source get uriSource; |
| 7913 |
| 7914 /** |
| 7915 * Set the source to which the [uri] was resolved to the given [source]. |
| 7916 */ |
| 7917 void set uriSource(Source source); |
| 7918 |
| 7919 /** |
7890 * Validate this directive, but do not check for existence. Return a code | 7920 * Validate this directive, but do not check for existence. Return a code |
7891 * indicating the problem if there is one, or `null` no problem | 7921 * indicating the problem if there is one, or `null` no problem |
7892 */ | 7922 */ |
7893 UriValidationCode validate(); | 7923 UriValidationCode validate(); |
7894 } | 7924 } |
7895 | 7925 |
7896 /** | 7926 /** |
7897 * Validation codes returned by [UriBasedDirective.validate]. | 7927 * Validation codes returned by [UriBasedDirective.validate]. |
7898 * | 7928 * |
7899 * Clients may not extend, implement or mix-in this class. | 7929 * Clients may not extend, implement or mix-in this class. |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8240 /** | 8270 /** |
8241 * Return the 'yield' keyword. | 8271 * Return the 'yield' keyword. |
8242 */ | 8272 */ |
8243 Token get yieldKeyword; | 8273 Token get yieldKeyword; |
8244 | 8274 |
8245 /** | 8275 /** |
8246 * Return the 'yield' keyword to the given [token]. | 8276 * Return the 'yield' keyword to the given [token]. |
8247 */ | 8277 */ |
8248 void set yieldKeyword(Token token); | 8278 void set yieldKeyword(Token token); |
8249 } | 8279 } |
OLD | NEW |