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 element model. The element model describes the semantic (as | 6 * Defines the element model. The element model describes the semantic (as |
7 * opposed to syntactic) structure of Dart code. The syntactic structure of the | 7 * opposed to syntactic) structure of Dart code. The syntactic structure of the |
8 * code is modeled by the [AST structure](../ast/ast.dart). | 8 * code is modeled by the [AST structure](../ast/ast.dart). |
9 * | 9 * |
10 * The element model consists of two closely related kinds of objects: elements | 10 * The element model consists of two closely related kinds of objects: elements |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 * an entire library or class. | 405 * an entire library or class. |
406 */ | 406 */ |
407 bool get isStatic; | 407 bool get isStatic; |
408 } | 408 } |
409 | 409 |
410 /** | 410 /** |
411 * An element representing a compilation unit. | 411 * An element representing a compilation unit. |
412 * | 412 * |
413 * Clients may not extend, implement or mix-in this class. | 413 * Clients may not extend, implement or mix-in this class. |
414 */ | 414 */ |
415 abstract class CompilationUnitElement implements Element { | 415 abstract class CompilationUnitElement implements Element, UriReferencedElement { |
416 /** | 416 /** |
417 * An empty list of compilation unit elements. | 417 * An empty list of compilation unit elements. |
418 */ | 418 */ |
419 static const List<CompilationUnitElement> EMPTY_LIST = | 419 static const List<CompilationUnitElement> EMPTY_LIST = |
420 const <CompilationUnitElement>[]; | 420 const <CompilationUnitElement>[]; |
421 | 421 |
422 /** | 422 /** |
423 * Return a list containing all of the top-level accessors (getters and | 423 * Return a list containing all of the top-level accessors (getters and |
424 * setters) contained in this compilation unit. | 424 * setters) contained in this compilation unit. |
425 */ | 425 */ |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1154 * synchronous. | 1154 * synchronous. |
1155 */ | 1155 */ |
1156 bool get isSynchronous; | 1156 bool get isSynchronous; |
1157 } | 1157 } |
1158 | 1158 |
1159 /** | 1159 /** |
1160 * An export directive within a library. | 1160 * An export directive within a library. |
1161 * | 1161 * |
1162 * Clients may not extend, implement or mix-in this class. | 1162 * Clients may not extend, implement or mix-in this class. |
1163 */ | 1163 */ |
1164 abstract class ExportElement implements Element { | 1164 abstract class ExportElement implements Element, UriReferencedElement { |
1165 /** | 1165 /** |
1166 * An empty list of export elements. | 1166 * An empty list of export elements. |
1167 */ | 1167 */ |
1168 static const List<ExportElement> EMPTY_LIST = const <ExportElement>[]; | 1168 static const List<ExportElement> EMPTY_LIST = const <ExportElement>[]; |
1169 | 1169 |
1170 /** | 1170 /** |
1171 * Return a list containing the combinators that were specified as part of the | 1171 * Return a list containing the combinators that were specified as part of the |
1172 * export directive in the order in which they were specified. | 1172 * export directive in the order in which they were specified. |
1173 */ | 1173 */ |
1174 List<NamespaceCombinator> get combinators; | 1174 List<NamespaceCombinator> get combinators; |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1342 * importing library even if they are defined in the imported library. | 1342 * importing library even if they are defined in the imported library. |
1343 */ | 1343 */ |
1344 List<String> get hiddenNames; | 1344 List<String> get hiddenNames; |
1345 } | 1345 } |
1346 | 1346 |
1347 /** | 1347 /** |
1348 * A single import directive within a library. | 1348 * A single import directive within a library. |
1349 * | 1349 * |
1350 * Clients may not extend, implement or mix-in this class. | 1350 * Clients may not extend, implement or mix-in this class. |
1351 */ | 1351 */ |
1352 abstract class ImportElement implements Element { | 1352 abstract class ImportElement implements Element, UriReferencedElement { |
1353 /** | 1353 /** |
1354 * An empty list of import elements. | 1354 * An empty list of import elements. |
1355 */ | 1355 */ |
1356 static const List<ImportElement> EMPTY_LIST = const <ImportElement>[]; | 1356 static const List<ImportElement> EMPTY_LIST = const <ImportElement>[]; |
1357 | 1357 |
1358 /** | 1358 /** |
1359 * Return a list containing the combinators that were specified as part of the | 1359 * Return a list containing the combinators that were specified as part of the |
1360 * import directive in the order in which they were specified. | 1360 * import directive in the order in which they were specified. |
1361 */ | 1361 */ |
1362 List<NamespaceCombinator> get combinators; | 1362 List<NamespaceCombinator> get combinators; |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1942 * A pseudo-elements that represents names that are undefined. This situation is | 1942 * A pseudo-elements that represents names that are undefined. This situation is |
1943 * not allowed by the language, so objects implementing this interface always | 1943 * not allowed by the language, so objects implementing this interface always |
1944 * represent an error. As a result, most of the normal operations on elements do | 1944 * represent an error. As a result, most of the normal operations on elements do |
1945 * not make sense and will return useless results. | 1945 * not make sense and will return useless results. |
1946 * | 1946 * |
1947 * Clients may not extend, implement or mix-in this class. | 1947 * Clients may not extend, implement or mix-in this class. |
1948 */ | 1948 */ |
1949 abstract class UndefinedElement implements Element {} | 1949 abstract class UndefinedElement implements Element {} |
1950 | 1950 |
1951 /** | 1951 /** |
| 1952 * An element included into a library using some URI. |
| 1953 * |
| 1954 * Clients may not extend, implement or mix-in this class. |
| 1955 */ |
| 1956 abstract class UriReferencedElement implements Element { |
| 1957 /** |
| 1958 * Return the URI that is used to include this element into the enclosing |
| 1959 * library, or `null` if this is the defining compilation unit of a library. |
| 1960 */ |
| 1961 String get uri; |
| 1962 |
| 1963 /** |
| 1964 * Return the offset of the character immediately following the last character |
| 1965 * of this node's URI, or `-1` for synthetic import. |
| 1966 */ |
| 1967 int get uriEnd; |
| 1968 |
| 1969 /** |
| 1970 * Return the offset of the URI in the file, or `-1` if this element is |
| 1971 * synthetic. |
| 1972 */ |
| 1973 int get uriOffset; |
| 1974 } |
| 1975 |
| 1976 /** |
1952 * A variable. There are more specific subclasses for more specific kinds of | 1977 * A variable. There are more specific subclasses for more specific kinds of |
1953 * variables. | 1978 * variables. |
1954 * | 1979 * |
1955 * Clients may not extend, implement or mix-in this class. | 1980 * Clients may not extend, implement or mix-in this class. |
1956 */ | 1981 */ |
1957 abstract class VariableElement implements Element, ConstantEvaluationTarget { | 1982 abstract class VariableElement implements Element, ConstantEvaluationTarget { |
1958 /** | 1983 /** |
1959 * An empty list of variable elements. | 1984 * An empty list of variable elements. |
1960 */ | 1985 */ |
1961 static const List<VariableElement> EMPTY_LIST = const <VariableElement>[]; | 1986 static const List<VariableElement> EMPTY_LIST = const <VariableElement>[]; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2042 DartType get type; | 2067 DartType get type; |
2043 | 2068 |
2044 /** | 2069 /** |
2045 * Return a representation of the value of this variable, forcing the value | 2070 * Return a representation of the value of this variable, forcing the value |
2046 * to be computed if it had not previously been computed, or `null` if either | 2071 * to be computed if it had not previously been computed, or `null` if either |
2047 * this variable was not declared with the 'const' modifier or if the value of | 2072 * this variable was not declared with the 'const' modifier or if the value of |
2048 * this variable could not be computed because of errors. | 2073 * this variable could not be computed because of errors. |
2049 */ | 2074 */ |
2050 DartObject computeConstantValue(); | 2075 DartObject computeConstantValue(); |
2051 } | 2076 } |
OLD | NEW |