| 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 /** |
| 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 |
| 8 * code is modeled by the [AST structure](../ast/ast.dart). |
| 9 * |
| 10 * The element model consists of two closely related kinds of objects: elements |
| 11 * (instances of a subclass of [Element]) and types. This library defines the |
| 12 * elements, the types are defined in [type.dart](type.dart). |
| 13 * |
| 14 * Generally speaking, an element represents something that is declared in the |
| 15 * code, such as a class, method, or variable. Elements are organized in a tree |
| 16 * structure in which the children of an element are the elements that are |
| 17 * logically (and often syntactically) part of the declaration of the parent. |
| 18 * For example, the elements representing the methods and fields in a class are |
| 19 * children of the element representing the class. |
| 20 * |
| 21 * Every complete element structure is rooted by an instance of the class |
| 22 * [LibraryElement]. A library element represents a single Dart library. Every |
| 23 * library is defined by one or more compilation units (the library and all of |
| 24 * its parts). The compilation units are represented by the class |
| 25 * [CompilationUnitElement] and are children of the library that is defined by |
| 26 * them. Each compilation unit can contain zero or more top-level declarations, |
| 27 * such as classes, functions, and variables. Each of these is in turn |
| 28 * represented as an element that is a child of the compilation unit. Classes |
| 29 * contain methods and fields, methods can contain local variables, etc. |
| 30 * |
| 31 * The element model does not contain everything in the code, only those things |
| 32 * that are declared by the code. For example, it does not include any |
| 33 * representation of the statements in a method body, but if one of those |
| 34 * statements declares a local variable then the local variable will be |
| 35 * represented by an element. |
| 36 */ |
| 5 library analyzer.dart.element.element; | 37 library analyzer.dart.element.element; |
| 6 | 38 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 39 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/element/type.dart'; | 40 import 'package:analyzer/dart/element/type.dart'; |
| 9 import 'package:analyzer/src/generated/constant.dart' show DartObject; | 41 import 'package:analyzer/src/generated/constant.dart' show DartObject; |
| 10 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; | 42 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; |
| 11 import 'package:analyzer/src/generated/java_core.dart'; | 43 import 'package:analyzer/src/generated/java_core.dart'; |
| 12 import 'package:analyzer/src/generated/java_engine.dart'; | 44 import 'package:analyzer/src/generated/java_engine.dart'; |
| 13 import 'package:analyzer/src/generated/resolver.dart'; | 45 import 'package:analyzer/src/generated/resolver.dart'; |
| 14 import 'package:analyzer/src/generated/source.dart'; | 46 import 'package:analyzer/src/generated/source.dart'; |
| (...skipping 1886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1901 */ | 1933 */ |
| 1902 bool get isStatic; | 1934 bool get isStatic; |
| 1903 | 1935 |
| 1904 /** | 1936 /** |
| 1905 * Return the declared type of this variable, or `null` if the variable did | 1937 * Return the declared type of this variable, or `null` if the variable did |
| 1906 * not have a declared type (such as if it was declared using the keyword | 1938 * not have a declared type (such as if it was declared using the keyword |
| 1907 * 'var'). | 1939 * 'var'). |
| 1908 */ | 1940 */ |
| 1909 DartType get type; | 1941 DartType get type; |
| 1910 } | 1942 } |
| OLD | NEW |