| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 * This file is an "idl" style description of the summary format. It is not | 6 * This file is an "idl" style description of the summary format. It |
| 7 * executed directly; instead it is parsed and transformed into code that | 7 * contains abstract classes which declare the interface for reading data from |
| 8 * implements the summary format. | 8 * summaries. It is parsed and transformed into code that implements the |
| 9 * summary format. |
| 9 * | 10 * |
| 10 * The code generation process introduces the following non-typical semantics: | 11 * The code generation process introduces the following semantics: |
| 11 * - Fields of type List are never null, and have a default value of the empty | 12 * - Getters of type List never return null, and have a default value of the |
| 12 * list. | 13 * empty list. |
| 13 * - Fields of type int are unsigned 32-bit integers, never null, and have a | 14 * - Getters of type int return unsigned 32-bit integers, never null, and have |
| 14 * default value of zero. | 15 * a default value of zero. |
| 15 * - Fields of type String are never null, and have a default value of ''. | 16 * - Getters of type String never return null, and have a default value of ''. |
| 16 * - Fields of type bool are never null, and have a default value of false. | 17 * - Getters of type bool never return null, and have a default value of false. |
| 17 * - Fields whose type is an enum are never null, and have a default value of | 18 * - Getters whose type is an enum never return null, and have a default value |
| 18 * the first value declared in the enum. | 19 * of the first value declared in the enum. |
| 19 * | 20 * |
| 20 * Terminology used in this document: | 21 * Terminology used in this document: |
| 21 * - "Unlinked" refers to information that can be determined from reading a | 22 * - "Unlinked" refers to information that can be determined from reading a |
| 22 * single .dart file in isolation. | 23 * single .dart file in isolation. |
| 23 * - "Prelinked" refers to information that can be determined from the defining | 24 * - "Prelinked" refers to information that can be determined from the defining |
| 24 * compilation unit of a library, plus direct imports, plus the transitive | 25 * compilation unit of a library, plus direct imports, plus the transitive |
| 25 * closure of exports reachable from those libraries, plus all part files | 26 * closure of exports reachable from those libraries, plus all part files |
| 26 * constituting those libraries. | 27 * constituting those libraries. |
| 27 * - "Linked" refers to all other information; in theory, this information may | 28 * - "Linked" refers to all other information; in theory, this information may |
| 28 * depend on all files in the transitive import/export closure. However, in | 29 * depend on all files in the transitive import/export closure. However, in |
| 29 * practice we expect that the number of additional dependencies will usually | 30 * practice we expect that the number of additional dependencies will usually |
| 30 * be small, since the additional dependencies only need to be consulted for | 31 * be small, since the additional dependencies only need to be consulted for |
| 31 * type propagation, type inference, and constant evaluation, which typically | 32 * type propagation, type inference, and constant evaluation, which typically |
| 32 * have short dependency chains. | 33 * have short dependency chains. |
| 33 * | 34 * |
| 34 * Since we expect "linked" and "prelinked" dependencies to be similar, we only | 35 * Since we expect "linked" and "prelinked" dependencies to be similar, we only |
| 35 * rarely distinguish between them; most information is that is not "unlinked" | 36 * rarely distinguish between them; most information is that is not "unlinked" |
| 36 * is typically considered "linked" for simplicity. | 37 * is typically considered "linked" for simplicity. |
| 37 * | 38 * |
| 38 * Except as otherwise noted, synthetic elements are not stored in the summary; | 39 * Except as otherwise noted, synthetic elements are not stored in the summary; |
| 39 * they are re-synthesized at the time the summary is read. | 40 * they are re-synthesized at the time the summary is read. |
| 40 */ | 41 */ |
| 41 library analyzer.tool.summary.idl; | 42 library analyzer.tool.summary.idl; |
| 42 | 43 |
| 44 import 'base.dart' as base; |
| 45 import 'format.dart' as generated; |
| 46 |
| 43 /** | 47 /** |
| 44 * Annotation describing information which is not part of Dart semantics; in | 48 * Annotation describing information which is not part of Dart semantics; in |
| 45 * other words, if this information (or any information it refers to) changes, | 49 * other words, if this information (or any information it refers to) changes, |
| 46 * static analysis and runtime behavior of the library are unaffected. | 50 * static analysis and runtime behavior of the library are unaffected. |
| 47 * | 51 * |
| 48 * TODO(paulberry): some informative information is currently missing from the | 52 * TODO(paulberry): some informative information is currently missing from the |
| 49 * summary format. | 53 * summary format. |
| 50 */ | 54 */ |
| 51 const informative = null; | 55 const informative = null; |
| 52 | 56 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 63 /** | 67 /** |
| 64 * Annotation describing a class which can be the top level object in an | 68 * Annotation describing a class which can be the top level object in an |
| 65 * encoded summary. | 69 * encoded summary. |
| 66 */ | 70 */ |
| 67 const topLevel = null; | 71 const topLevel = null; |
| 68 | 72 |
| 69 /** | 73 /** |
| 70 * Summary information about a reference to a an entity such as a type, top | 74 * Summary information about a reference to a an entity such as a type, top |
| 71 * level executable, or executable within a class. | 75 * level executable, or executable within a class. |
| 72 */ | 76 */ |
| 73 class EntityRef { | 77 abstract class EntityRef extends base.SummaryClass { |
| 74 /** | 78 /** |
| 75 * If this [EntityRef] is contained within [LinkedUnit.types], slot id (which | 79 * If this [EntityRef] is contained within [LinkedUnit.types], slot id (which |
| 76 * is unique within the compilation unit) identifying the target of type | 80 * is unique within the compilation unit) identifying the target of type |
| 77 * propagation or type inference with which this [EntityRef] is associated. | 81 * propagation or type inference with which this [EntityRef] is associated. |
| 78 * | 82 * |
| 79 * Otherwise zero. | 83 * Otherwise zero. |
| 80 */ | 84 */ |
| 81 int slot; | 85 int get slot; |
| 82 | 86 |
| 83 /** | 87 /** |
| 84 * Index into [UnlinkedUnit.references] for the entity being referred to, or | 88 * Index into [UnlinkedUnit.references] for the entity being referred to, or |
| 85 * zero if this is a reference to a type parameter. | 89 * zero if this is a reference to a type parameter. |
| 86 */ | 90 */ |
| 87 int reference; | 91 int get reference; |
| 88 | 92 |
| 89 /** | 93 /** |
| 90 * If this is a reference to a type parameter, one-based index into the list | 94 * If this is a reference to a type parameter, one-based index into the list |
| 91 * of [UnlinkedTypeParam]s currently in effect. Indexing is done using De | 95 * of [UnlinkedTypeParam]s currently in effect. Indexing is done using De |
| 92 * Bruijn index conventions; that is, innermost parameters come first, and | 96 * Bruijn index conventions; that is, innermost parameters come first, and |
| 93 * if a class or method has multiple parameters, they are indexed from right | 97 * if a class or method has multiple parameters, they are indexed from right |
| 94 * to left. So for instance, if the enclosing declaration is | 98 * to left. So for instance, if the enclosing declaration is |
| 95 * | 99 * |
| 96 * class C<T,U> { | 100 * class C<T,U> { |
| 97 * m<V,W> { | 101 * m<V,W> { |
| 98 * ... | 102 * ... |
| 99 * } | 103 * } |
| 100 * } | 104 * } |
| 101 * | 105 * |
| 102 * Then [paramReference] values of 1, 2, 3, and 4 represent W, V, U, and T, | 106 * Then [paramReference] values of 1, 2, 3, and 4 represent W, V, U, and T, |
| 103 * respectively. | 107 * respectively. |
| 104 * | 108 * |
| 105 * If the type being referred to is not a type parameter, [paramReference] is | 109 * If the type being referred to is not a type parameter, [paramReference] is |
| 106 * zero. | 110 * zero. |
| 107 */ | 111 */ |
| 108 int paramReference; | 112 int get paramReference; |
| 109 | 113 |
| 110 /** | 114 /** |
| 111 * If this is a reference to a function type implicitly defined by a | 115 * If this is a reference to a function type implicitly defined by a |
| 112 * function-typed parameter, a list of zero-based indices indicating the path | 116 * function-typed parameter, a list of zero-based indices indicating the path |
| 113 * from the entity referred to by [reference] to the appropriate type | 117 * from the entity referred to by [reference] to the appropriate type |
| 114 * parameter. Otherwise the empty list. | 118 * parameter. Otherwise the empty list. |
| 115 * | 119 * |
| 116 * If there are N indices in this list, then the entity being referred to is | 120 * If there are N indices in this list, then the entity being referred to is |
| 117 * the function type implicitly defined by a function-typed parameter of a | 121 * the function type implicitly defined by a function-typed parameter of a |
| 118 * function-typed parameter, to N levels of nesting. The first index in the | 122 * function-typed parameter, to N levels of nesting. The first index in the |
| 119 * list refers to the outermost level of nesting; for example if [reference] | 123 * list refers to the outermost level of nesting; for example if [reference] |
| 120 * refers to the entity defined by: | 124 * refers to the entity defined by: |
| 121 * | 125 * |
| 122 * void f(x, void g(y, z, int h(String w))) { ... } | 126 * void f(x, void g(y, z, int h(String w))) { ... } |
| 123 * | 127 * |
| 124 * Then to refer to the function type implicitly defined by parameter `h` | 128 * Then to refer to the function type implicitly defined by parameter `h` |
| 125 * (which is parameter 2 of parameter 1 of `f`), then | 129 * (which is parameter 2 of parameter 1 of `f`), then |
| 126 * [implicitFunctionTypeIndices] should be [1, 2]. | 130 * [implicitFunctionTypeIndices] should be [1, 2]. |
| 127 * | 131 * |
| 128 * Note that if the entity being referred to is a generic method inside a | 132 * Note that if the entity being referred to is a generic method inside a |
| 129 * generic class, then the type arguments in [typeArguments] are applied | 133 * generic class, then the type arguments in [typeArguments] are applied |
| 130 * first to the class and then to the method. | 134 * first to the class and then to the method. |
| 131 */ | 135 */ |
| 132 List<int> implicitFunctionTypeIndices; | 136 List<int> get implicitFunctionTypeIndices; |
| 133 | 137 |
| 134 /** | 138 /** |
| 135 * If this is an instantiation of a generic type or generic executable, the | 139 * If this is an instantiation of a generic type or generic executable, the |
| 136 * type arguments used to instantiate it. Trailing type arguments of type | 140 * type arguments used to instantiate it. Trailing type arguments of type |
| 137 * `dynamic` are omitted. | 141 * `dynamic` are omitted. |
| 138 */ | 142 */ |
| 139 List<EntityRef> typeArguments; | 143 List<EntityRef> get typeArguments; |
| 140 } | 144 } |
| 141 | 145 |
| 142 /** | 146 /** |
| 143 * Information about a dependency that exists between one library and another | 147 * Information about a dependency that exists between one library and another |
| 144 * due to an "import" declaration. | 148 * due to an "import" declaration. |
| 145 */ | 149 */ |
| 146 class LinkedDependency { | 150 abstract class LinkedDependency extends base.SummaryClass { |
| 147 /** | 151 /** |
| 148 * The relative URI of the dependent library. This URI is relative to the | 152 * The relative URI of the dependent library. This URI is relative to the |
| 149 * importing library, even if there are intervening `export` declarations. | 153 * importing library, even if there are intervening `export` declarations. |
| 150 * So, for example, if `a.dart` imports `b/c.dart` and `b/c.dart` exports | 154 * So, for example, if `a.dart` imports `b/c.dart` and `b/c.dart` exports |
| 151 * `d/e.dart`, the URI listed for `a.dart`'s dependency on `e.dart` will be | 155 * `d/e.dart`, the URI listed for `a.dart`'s dependency on `e.dart` will be |
| 152 * `b/d/e.dart`. | 156 * `b/d/e.dart`. |
| 153 */ | 157 */ |
| 154 String uri; | 158 String get uri; |
| 155 | 159 |
| 156 /** | 160 /** |
| 157 * URI for the compilation units listed in the library's `part` declarations. | 161 * URI for the compilation units listed in the library's `part` declarations. |
| 158 * These URIs are relative to the importing library. | 162 * These URIs are relative to the importing library. |
| 159 */ | 163 */ |
| 160 List<String> parts; | 164 List<String> get parts; |
| 161 } | 165 } |
| 162 | 166 |
| 163 /** | 167 /** |
| 164 * Information about a single name in the export namespace of the library that | 168 * Information about a single name in the export namespace of the library that |
| 165 * is not in the public namespace. | 169 * is not in the public namespace. |
| 166 */ | 170 */ |
| 167 class LinkedExportName { | 171 abstract class LinkedExportName extends base.SummaryClass { |
| 168 /** | 172 /** |
| 169 * Name of the exported entity. For an exported setter, this name includes | 173 * Name of the exported entity. For an exported setter, this name includes |
| 170 * the trailing '='. | 174 * the trailing '='. |
| 171 */ | 175 */ |
| 172 String name; | 176 String get name; |
| 173 | 177 |
| 174 /** | 178 /** |
| 175 * Index into [LinkedLibrary.dependencies] for the library in which the | 179 * Index into [LinkedLibrary.dependencies] for the library in which the |
| 176 * entity is defined. | 180 * entity is defined. |
| 177 */ | 181 */ |
| 178 int dependency; | 182 int get dependency; |
| 179 | 183 |
| 180 /** | 184 /** |
| 181 * Integer index indicating which unit in the exported library contains the | 185 * Integer index indicating which unit in the exported library contains the |
| 182 * definition of the entity. As with indices into [LinkedLibrary.units], | 186 * definition of the entity. As with indices into [LinkedLibrary.units], |
| 183 * zero represents the defining compilation unit, and nonzero values | 187 * zero represents the defining compilation unit, and nonzero values |
| 184 * represent parts in the order of the corresponding `part` declarations. | 188 * represent parts in the order of the corresponding `part` declarations. |
| 185 */ | 189 */ |
| 186 int unit; | 190 int get unit; |
| 187 | 191 |
| 188 /** | 192 /** |
| 189 * The kind of the entity being referred to. | 193 * The kind of the entity being referred to. |
| 190 */ | 194 */ |
| 191 ReferenceKind kind; | 195 ReferenceKind get kind; |
| 192 } | 196 } |
| 193 | 197 |
| 194 /** | 198 /** |
| 195 * Linked summary of a library. | 199 * Linked summary of a library. |
| 196 */ | 200 */ |
| 197 @topLevel | 201 @topLevel |
| 198 class LinkedLibrary { | 202 abstract class LinkedLibrary extends base.SummaryClass { |
| 203 factory LinkedLibrary.fromBuffer(List<int> buffer) => |
| 204 generated.readLinkedLibrary(buffer); |
| 205 |
| 199 /** | 206 /** |
| 200 * The linked summary of all the compilation units constituting the | 207 * The linked summary of all the compilation units constituting the |
| 201 * library. The summary of the defining compilation unit is listed first, | 208 * library. The summary of the defining compilation unit is listed first, |
| 202 * followed by the summary of each part, in the order of the `part` | 209 * followed by the summary of each part, in the order of the `part` |
| 203 * declarations in the defining compilation unit. | 210 * declarations in the defining compilation unit. |
| 204 */ | 211 */ |
| 205 List<LinkedUnit> units; | 212 List<LinkedUnit> get units; |
| 206 | 213 |
| 207 /** | 214 /** |
| 208 * The libraries that this library depends on (either via an explicit import | 215 * The libraries that this library depends on (either via an explicit import |
| 209 * statement or via the implicit dependencies on `dart:core` and | 216 * statement or via the implicit dependencies on `dart:core` and |
| 210 * `dart:async`). The first element of this array is a pseudo-dependency | 217 * `dart:async`). The first element of this array is a pseudo-dependency |
| 211 * representing the library itself (it is also used for `dynamic` and | 218 * representing the library itself (it is also used for `dynamic` and |
| 212 * `void`). This is followed by elements representing "prelinked" | 219 * `void`). This is followed by elements representing "prelinked" |
| 213 * dependencies (direct imports and the transitive closure of exports). | 220 * dependencies (direct imports and the transitive closure of exports). |
| 214 * After the prelinked dependencies are elements representing "linked" | 221 * After the prelinked dependencies are elements representing "linked" |
| 215 * dependencies. | 222 * dependencies. |
| 216 * | 223 * |
| 217 * A library is only included as a "linked" dependency if it is a true | 224 * A library is only included as a "linked" dependency if it is a true |
| 218 * dependency (e.g. a propagated or inferred type or constant value | 225 * dependency (e.g. a propagated or inferred type or constant value |
| 219 * implicitly refers to an element declared in the library) or | 226 * implicitly refers to an element declared in the library) or |
| 220 * anti-dependency (e.g. the result of type propagation or type inference | 227 * anti-dependency (e.g. the result of type propagation or type inference |
| 221 * depends on the lack of a certain declaration in the library). | 228 * depends on the lack of a certain declaration in the library). |
| 222 */ | 229 */ |
| 223 List<LinkedDependency> dependencies; | 230 List<LinkedDependency> get dependencies; |
| 224 | 231 |
| 225 /** | 232 /** |
| 226 * For each import in [UnlinkedUnit.imports], an index into [dependencies] | 233 * For each import in [UnlinkedUnit.imports], an index into [dependencies] |
| 227 * of the library being imported. | 234 * of the library being imported. |
| 228 */ | 235 */ |
| 229 List<int> importDependencies; | 236 List<int> get importDependencies; |
| 230 | 237 |
| 231 /** | 238 /** |
| 232 * Information about entities in the export namespace of the library that are | 239 * Information about entities in the export namespace of the library that are |
| 233 * not in the public namespace of the library (that is, entities that are | 240 * not in the public namespace of the library (that is, entities that are |
| 234 * brought into the namespace via `export` directives). | 241 * brought into the namespace via `export` directives). |
| 235 * | 242 * |
| 236 * Sorted by name. | 243 * Sorted by name. |
| 237 */ | 244 */ |
| 238 List<LinkedExportName> exportNames; | 245 List<LinkedExportName> get exportNames; |
| 239 | 246 |
| 240 /** | 247 /** |
| 241 * The number of elements in [dependencies] which are not "linked" | 248 * The number of elements in [dependencies] which are not "linked" |
| 242 * dependencies (that is, the number of libraries in the direct imports plus | 249 * dependencies (that is, the number of libraries in the direct imports plus |
| 243 * the transitive closure of exports, plus the library itself). | 250 * the transitive closure of exports, plus the library itself). |
| 244 */ | 251 */ |
| 245 int numPrelinkedDependencies; | 252 int get numPrelinkedDependencies; |
| 246 } | 253 } |
| 247 | 254 |
| 248 /** | 255 /** |
| 249 * Information about the resolution of an [UnlinkedReference]. | 256 * Information about the resolution of an [UnlinkedReference]. |
| 250 */ | 257 */ |
| 251 class LinkedReference { | 258 abstract class LinkedReference extends base.SummaryClass { |
| 252 /** | 259 /** |
| 253 * Index into [LinkedLibrary.dependencies] indicating which imported library | 260 * Index into [LinkedLibrary.dependencies] indicating which imported library |
| 254 * declares the entity being referred to. | 261 * declares the entity being referred to. |
| 255 * | 262 * |
| 256 * Zero if this entity is contained within another entity (e.g. a class | 263 * Zero if this entity is contained within another entity (e.g. a class |
| 257 * member). | 264 * member). |
| 258 */ | 265 */ |
| 259 int dependency; | 266 int get dependency; |
| 260 | 267 |
| 261 /** | 268 /** |
| 262 * The kind of the entity being referred to. For the pseudo-types `dynamic` | 269 * The kind of the entity being referred to. For the pseudo-types `dynamic` |
| 263 * and `void`, the kind is [ReferenceKind.classOrEnum]. | 270 * and `void`, the kind is [ReferenceKind.classOrEnum]. |
| 264 */ | 271 */ |
| 265 ReferenceKind kind; | 272 ReferenceKind get kind; |
| 266 | 273 |
| 267 /** | 274 /** |
| 268 * Integer index indicating which unit in the imported library contains the | 275 * Integer index indicating which unit in the imported library contains the |
| 269 * definition of the entity. As with indices into [LinkedLibrary.units], | 276 * definition of the entity. As with indices into [LinkedLibrary.units], |
| 270 * zero represents the defining compilation unit, and nonzero values | 277 * zero represents the defining compilation unit, and nonzero values |
| 271 * represent parts in the order of the corresponding `part` declarations. | 278 * represent parts in the order of the corresponding `part` declarations. |
| 272 * | 279 * |
| 273 * Zero if this entity is contained within another entity (e.g. a class | 280 * Zero if this entity is contained within another entity (e.g. a class |
| 274 * member). | 281 * member). |
| 275 */ | 282 */ |
| 276 int unit; | 283 int get unit; |
| 277 | 284 |
| 278 /** | 285 /** |
| 279 * If the entity being referred to is generic, the number of type parameters | 286 * If the entity being referred to is generic, the number of type parameters |
| 280 * it accepts. Otherwise zero. | 287 * it accepts. Otherwise zero. |
| 281 */ | 288 */ |
| 282 int numTypeParameters; | 289 int get numTypeParameters; |
| 283 | 290 |
| 284 /** | 291 /** |
| 285 * If this [LinkedReference] doesn't have an associated [UnlinkedReference], | 292 * If this [LinkedReference] doesn't have an associated [UnlinkedReference], |
| 286 * name of the entity being referred to. For the pseudo-type `dynamic`, the | 293 * name of the entity being referred to. For the pseudo-type `dynamic`, the |
| 287 * string is "dynamic". For the pseudo-type `void`, the string is "void". | 294 * string is "dynamic". For the pseudo-type `void`, the string is "void". |
| 288 */ | 295 */ |
| 289 String name; | 296 String get name; |
| 290 | 297 |
| 291 /** | 298 /** |
| 292 * If this [LinkedReference] doesn't have an associated [UnlinkedReference], | 299 * If this [LinkedReference] doesn't have an associated [UnlinkedReference], |
| 293 * and the entity being referred to is contained within another entity, index | 300 * and the entity being referred to is contained within another entity, index |
| 294 * of the containing entity. This behaves similarly to | 301 * of the containing entity. This behaves similarly to |
| 295 * [UnlinkedReference.prefixReference], however it is only used for class | 302 * [UnlinkedReference.prefixReference], however it is only used for class |
| 296 * members, not for prefixed imports. | 303 * members, not for prefixed imports. |
| 297 * | 304 * |
| 298 * Containing references must always point backward; that is, for all i, if | 305 * Containing references must always point backward; that is, for all i, if |
| 299 * LinkedUnit.references[i].containingReference != 0, then | 306 * LinkedUnit.references[i].containingReference != 0, then |
| 300 * LinkedUnit.references[i].containingReference < i. | 307 * LinkedUnit.references[i].containingReference < i. |
| 301 */ | 308 */ |
| 302 int containingReference; | 309 int get containingReference; |
| 303 } | 310 } |
| 304 | 311 |
| 305 /** | 312 /** |
| 306 * Linked summary of a compilation unit. | 313 * Linked summary of a compilation unit. |
| 307 */ | 314 */ |
| 308 class LinkedUnit { | 315 abstract class LinkedUnit extends base.SummaryClass { |
| 309 /** | 316 /** |
| 310 * Information about the resolution of references within the compilation | 317 * Information about the resolution of references within the compilation |
| 311 * unit. Each element of [UnlinkedUnit.references] has a corresponding | 318 * unit. Each element of [UnlinkedUnit.references] has a corresponding |
| 312 * element in this list (at the same index). If this list has additional | 319 * element in this list (at the same index). If this list has additional |
| 313 * elements beyond the number of elements in [UnlinkedUnit.references], those | 320 * elements beyond the number of elements in [UnlinkedUnit.references], those |
| 314 * additional elements are references that are only referred to implicitly | 321 * additional elements are references that are only referred to implicitly |
| 315 * (e.g. elements involved in inferred or propagated types). | 322 * (e.g. elements involved in inferred or propagated types). |
| 316 */ | 323 */ |
| 317 List<LinkedReference> references; | 324 List<LinkedReference> get references; |
| 318 | 325 |
| 319 /** | 326 /** |
| 320 * List associating slot ids found inside the unlinked summary for the | 327 * List associating slot ids found inside the unlinked summary for the |
| 321 * compilation unit with propagated and inferred types. | 328 * compilation unit with propagated and inferred types. |
| 322 */ | 329 */ |
| 323 List<EntityRef> types; | 330 List<EntityRef> get types; |
| 324 } | 331 } |
| 325 | 332 |
| 326 /** | 333 /** |
| 327 * Enum used to indicate the kind of entity referred to by a | 334 * Enum used to indicate the kind of entity referred to by a |
| 328 * [LinkedReference]. | 335 * [LinkedReference]. |
| 329 */ | 336 */ |
| 330 enum ReferenceKind { | 337 enum ReferenceKind { |
| 331 /** | 338 /** |
| 332 * The entity is a class or enum. | 339 * The entity is a class or enum. |
| 333 */ | 340 */ |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 /** | 385 /** |
| 379 * The entity being referred to does not exist. | 386 * The entity being referred to does not exist. |
| 380 */ | 387 */ |
| 381 unresolved | 388 unresolved |
| 382 } | 389 } |
| 383 | 390 |
| 384 /** | 391 /** |
| 385 * Information about SDK. | 392 * Information about SDK. |
| 386 */ | 393 */ |
| 387 @topLevel | 394 @topLevel |
| 388 class SdkBundle { | 395 abstract class SdkBundle extends base.SummaryClass { |
| 396 factory SdkBundle.fromBuffer(List<int> buffer) => |
| 397 generated.readSdkBundle(buffer); |
| 398 |
| 389 /** | 399 /** |
| 390 * The list of URIs of items in [linkedLibraries], e.g. `dart:core`. | 400 * The list of URIs of items in [linkedLibraries], e.g. `dart:core`. |
| 391 */ | 401 */ |
| 392 List<String> linkedLibraryUris; | 402 List<String> get linkedLibraryUris; |
| 393 | 403 |
| 394 /** | 404 /** |
| 395 * Linked libraries. | 405 * Linked libraries. |
| 396 */ | 406 */ |
| 397 List<LinkedLibrary> linkedLibraries; | 407 List<LinkedLibrary> get linkedLibraries; |
| 398 | 408 |
| 399 /** | 409 /** |
| 400 * The list of URIs of items in [unlinkedUnits], e.g. `dart:core/bool.dart`. | 410 * The list of URIs of items in [unlinkedUnits], e.g. `dart:core/bool.dart`. |
| 401 */ | 411 */ |
| 402 List<String> unlinkedUnitUris; | 412 List<String> get unlinkedUnitUris; |
| 403 | 413 |
| 404 /** | 414 /** |
| 405 * Unlinked information for the compilation units constituting the SDK. | 415 * Unlinked information for the compilation units constituting the SDK. |
| 406 */ | 416 */ |
| 407 List<UnlinkedUnit> unlinkedUnits; | 417 List<UnlinkedUnit> get unlinkedUnits; |
| 408 } | 418 } |
| 409 | 419 |
| 410 /** | 420 /** |
| 411 * Unlinked summary information about a class declaration. | 421 * Unlinked summary information about a class declaration. |
| 412 */ | 422 */ |
| 413 class UnlinkedClass { | 423 abstract class UnlinkedClass extends base.SummaryClass { |
| 414 /** | 424 /** |
| 415 * Name of the class. | 425 * Name of the class. |
| 416 */ | 426 */ |
| 417 String name; | 427 String get name; |
| 418 | 428 |
| 419 /** | 429 /** |
| 420 * Offset of the class name relative to the beginning of the file. | 430 * Offset of the class name relative to the beginning of the file. |
| 421 */ | 431 */ |
| 422 @informative | 432 @informative |
| 423 int nameOffset; | 433 int get nameOffset; |
| 424 | 434 |
| 425 /** | 435 /** |
| 426 * Documentation comment for the class, or `null` if there is no | 436 * Documentation comment for the class, or `null` if there is no |
| 427 * documentation comment. | 437 * documentation comment. |
| 428 */ | 438 */ |
| 429 @informative | 439 @informative |
| 430 UnlinkedDocumentationComment documentationComment; | 440 UnlinkedDocumentationComment get documentationComment; |
| 431 | 441 |
| 432 /** | 442 /** |
| 433 * Type parameters of the class, if any. | 443 * Type parameters of the class, if any. |
| 434 */ | 444 */ |
| 435 List<UnlinkedTypeParam> typeParameters; | 445 List<UnlinkedTypeParam> get typeParameters; |
| 436 | 446 |
| 437 /** | 447 /** |
| 438 * Supertype of the class, or `null` if either (a) the class doesn't | 448 * Supertype of the class, or `null` if either (a) the class doesn't |
| 439 * explicitly declare a supertype (and hence has supertype `Object`), or (b) | 449 * explicitly declare a supertype (and hence has supertype `Object`), or (b) |
| 440 * the class *is* `Object` (and hence has no supertype). | 450 * the class *is* `Object` (and hence has no supertype). |
| 441 */ | 451 */ |
| 442 EntityRef supertype; | 452 EntityRef get supertype; |
| 443 | 453 |
| 444 /** | 454 /** |
| 445 * Mixins appearing in a `with` clause, if any. | 455 * Mixins appearing in a `with` clause, if any. |
| 446 */ | 456 */ |
| 447 List<EntityRef> mixins; | 457 List<EntityRef> get mixins; |
| 448 | 458 |
| 449 /** | 459 /** |
| 450 * Interfaces appearing in an `implements` clause, if any. | 460 * Interfaces appearing in an `implements` clause, if any. |
| 451 */ | 461 */ |
| 452 List<EntityRef> interfaces; | 462 List<EntityRef> get interfaces; |
| 453 | 463 |
| 454 /** | 464 /** |
| 455 * Field declarations contained in the class. | 465 * Field declarations contained in the class. |
| 456 */ | 466 */ |
| 457 List<UnlinkedVariable> fields; | 467 List<UnlinkedVariable> get fields; |
| 458 | 468 |
| 459 /** | 469 /** |
| 460 * Executable objects (methods, getters, and setters) contained in the class. | 470 * Executable objects (methods, getters, and setters) contained in the class. |
| 461 */ | 471 */ |
| 462 List<UnlinkedExecutable> executables; | 472 List<UnlinkedExecutable> get executables; |
| 463 | 473 |
| 464 /** | 474 /** |
| 465 * Indicates whether the class is declared with the `abstract` keyword. | 475 * Indicates whether the class is declared with the `abstract` keyword. |
| 466 */ | 476 */ |
| 467 bool isAbstract; | 477 bool get isAbstract; |
| 468 | 478 |
| 469 /** | 479 /** |
| 470 * Indicates whether the class is declared using mixin application syntax. | 480 * Indicates whether the class is declared using mixin application syntax. |
| 471 */ | 481 */ |
| 472 bool isMixinApplication; | 482 bool get isMixinApplication; |
| 473 | 483 |
| 474 /** | 484 /** |
| 475 * Indicates whether this class is the core "Object" class (and hence has no | 485 * Indicates whether this class is the core "Object" class (and hence has no |
| 476 * supertype) | 486 * supertype) |
| 477 */ | 487 */ |
| 478 bool hasNoSupertype; | 488 bool get hasNoSupertype; |
| 479 } | 489 } |
| 480 | 490 |
| 481 /** | 491 /** |
| 482 * Unlinked summary information about a `show` or `hide` combinator in an | 492 * Unlinked summary information about a `show` or `hide` combinator in an |
| 483 * import or export declaration. | 493 * import or export declaration. |
| 484 */ | 494 */ |
| 485 class UnlinkedCombinator { | 495 abstract class UnlinkedCombinator extends base.SummaryClass { |
| 486 /** | 496 /** |
| 487 * List of names which are shown. Empty if this is a `hide` combinator. | 497 * List of names which are shown. Empty if this is a `hide` combinator. |
| 488 */ | 498 */ |
| 489 List<String> shows; | 499 List<String> get shows; |
| 490 | 500 |
| 491 /** | 501 /** |
| 492 * List of names which are hidden. Empty if this is a `show` combinator. | 502 * List of names which are hidden. Empty if this is a `show` combinator. |
| 493 */ | 503 */ |
| 494 List<String> hides; | 504 List<String> get hides; |
| 495 } | 505 } |
| 496 | 506 |
| 497 /** | 507 /** |
| 498 * Unlinked summary information about a compile-time constant expression, or a | 508 * Unlinked summary information about a compile-time constant expression, or a |
| 499 * potentially constant expression. | 509 * potentially constant expression. |
| 500 * | 510 * |
| 501 * Constant expressions are represented using a simple stack-based language | 511 * Constant expressions are represented using a simple stack-based language |
| 502 * where [operations] is a sequence of operations to execute starting with an | 512 * where [operations] is a sequence of operations to execute starting with an |
| 503 * empty stack. Once all operations have been executed, the stack should | 513 * empty stack. Once all operations have been executed, the stack should |
| 504 * contain a single value which is the value of the constant. Note that some | 514 * contain a single value which is the value of the constant. Note that some |
| 505 * operations consume additional data from the other fields of this class. | 515 * operations consume additional data from the other fields of this class. |
| 506 */ | 516 */ |
| 507 class UnlinkedConst { | 517 abstract class UnlinkedConst extends base.SummaryClass { |
| 508 /** | 518 /** |
| 509 * Sequence of operations to execute (starting with an empty stack) to form | 519 * Sequence of operations to execute (starting with an empty stack) to form |
| 510 * the constant value. | 520 * the constant value. |
| 511 */ | 521 */ |
| 512 List<UnlinkedConstOperation> operations; | 522 List<UnlinkedConstOperation> get operations; |
| 513 | 523 |
| 514 /** | 524 /** |
| 515 * Sequence of unsigned 32-bit integers consumed by the operations | 525 * Sequence of unsigned 32-bit integers consumed by the operations |
| 516 * `pushArgument`, `pushInt`, `shiftOr`, `concatenate`, `invokeConstructor`, | 526 * `pushArgument`, `pushInt`, `shiftOr`, `concatenate`, `invokeConstructor`, |
| 517 * `makeList`, and `makeMap`. | 527 * `makeList`, and `makeMap`. |
| 518 */ | 528 */ |
| 519 List<int> ints; | 529 List<int> get ints; |
| 520 | 530 |
| 521 /** | 531 /** |
| 522 * Sequence of 64-bit doubles consumed by the operation `pushDouble`. | 532 * Sequence of 64-bit doubles consumed by the operation `pushDouble`. |
| 523 */ | 533 */ |
| 524 List<double> doubles; | 534 List<double> get doubles; |
| 525 | 535 |
| 526 /** | 536 /** |
| 527 * Sequence of strings consumed by the operations `pushString` and | 537 * Sequence of strings consumed by the operations `pushString` and |
| 528 * `invokeConstructor`. | 538 * `invokeConstructor`. |
| 529 */ | 539 */ |
| 530 List<String> strings; | 540 List<String> get strings; |
| 531 | 541 |
| 532 /** | 542 /** |
| 533 * Sequence of language constructs consumed by the operations | 543 * Sequence of language constructs consumed by the operations |
| 534 * `pushReference`, `invokeConstructor`, `makeList`, and `makeMap`. Note | 544 * `pushReference`, `invokeConstructor`, `makeList`, and `makeMap`. Note |
| 535 * that in the case of `pushReference` (and sometimes `invokeConstructor` the | 545 * that in the case of `pushReference` (and sometimes `invokeConstructor` the |
| 536 * actual entity being referred to may be something other than a type. | 546 * actual entity being referred to may be something other than a type. |
| 537 */ | 547 */ |
| 538 List<EntityRef> references; | 548 List<EntityRef> get references; |
| 539 } | 549 } |
| 540 | 550 |
| 541 /** | 551 /** |
| 542 * Enum representing the various kinds of operations which may be performed to | 552 * Enum representing the various kinds of operations which may be performed to |
| 543 * produce a constant value. These options are assumed to execute in the | 553 * produce a constant value. These options are assumed to execute in the |
| 544 * context of a stack which is initially empty. | 554 * context of a stack which is initially empty. |
| 545 */ | 555 */ |
| 546 enum UnlinkedConstOperation { | 556 enum UnlinkedConstOperation { |
| 547 /** | 557 /** |
| 548 * Push the next value from [UnlinkedConst.ints] (a 32-bit unsigned integer) | 558 * Push the next value from [UnlinkedConst.ints] (a 32-bit unsigned integer) |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 /** | 828 /** |
| 819 * Pop the top value from the stack, evaluate `v.length`, and push the result | 829 * Pop the top value from the stack, evaluate `v.length`, and push the result |
| 820 * back onto the stack. | 830 * back onto the stack. |
| 821 */ | 831 */ |
| 822 length, | 832 length, |
| 823 } | 833 } |
| 824 | 834 |
| 825 /** | 835 /** |
| 826 * Unlinked summary information about a documentation comment. | 836 * Unlinked summary information about a documentation comment. |
| 827 */ | 837 */ |
| 828 class UnlinkedDocumentationComment { | 838 abstract class UnlinkedDocumentationComment extends base.SummaryClass { |
| 829 /** | 839 /** |
| 830 * Text of the documentation comment, with '\r\n' replaced by '\n'. | 840 * Text of the documentation comment, with '\r\n' replaced by '\n'. |
| 831 * | 841 * |
| 832 * References appearing within the doc comment in square brackets are not | 842 * References appearing within the doc comment in square brackets are not |
| 833 * specially encoded. | 843 * specially encoded. |
| 834 */ | 844 */ |
| 835 String text; | 845 String get text; |
| 836 | 846 |
| 837 /** | 847 /** |
| 838 * Offset of the beginning of the documentation comment relative to the | 848 * Offset of the beginning of the documentation comment relative to the |
| 839 * beginning of the file. | 849 * beginning of the file. |
| 840 */ | 850 */ |
| 841 int offset; | 851 int get offset; |
| 842 | 852 |
| 843 /** | 853 /** |
| 844 * Length of the documentation comment (prior to replacing '\r\n' with '\n'). | 854 * Length of the documentation comment (prior to replacing '\r\n' with '\n'). |
| 845 */ | 855 */ |
| 846 int length; | 856 int get length; |
| 847 } | 857 } |
| 848 | 858 |
| 849 /** | 859 /** |
| 850 * Unlinked summary information about an enum declaration. | 860 * Unlinked summary information about an enum declaration. |
| 851 */ | 861 */ |
| 852 class UnlinkedEnum { | 862 abstract class UnlinkedEnum extends base.SummaryClass { |
| 853 /** | 863 /** |
| 854 * Name of the enum type. | 864 * Name of the enum type. |
| 855 */ | 865 */ |
| 856 String name; | 866 String get name; |
| 857 | 867 |
| 858 /** | 868 /** |
| 859 * Offset of the enum name relative to the beginning of the file. | 869 * Offset of the enum name relative to the beginning of the file. |
| 860 */ | 870 */ |
| 861 @informative | 871 @informative |
| 862 int nameOffset; | 872 int get nameOffset; |
| 863 | 873 |
| 864 /** | 874 /** |
| 865 * Documentation comment for the enum, or `null` if there is no documentation | 875 * Documentation comment for the enum, or `null` if there is no documentation |
| 866 * comment. | 876 * comment. |
| 867 */ | 877 */ |
| 868 @informative | 878 @informative |
| 869 UnlinkedDocumentationComment documentationComment; | 879 UnlinkedDocumentationComment get documentationComment; |
| 870 | 880 |
| 871 /** | 881 /** |
| 872 * Values listed in the enum declaration, in declaration order. | 882 * Values listed in the enum declaration, in declaration order. |
| 873 */ | 883 */ |
| 874 List<UnlinkedEnumValue> values; | 884 List<UnlinkedEnumValue> get values; |
| 875 } | 885 } |
| 876 | 886 |
| 877 /** | 887 /** |
| 878 * Unlinked summary information about a single enumerated value in an enum | 888 * Unlinked summary information about a single enumerated value in an enum |
| 879 * declaration. | 889 * declaration. |
| 880 */ | 890 */ |
| 881 class UnlinkedEnumValue { | 891 abstract class UnlinkedEnumValue extends base.SummaryClass { |
| 882 /** | 892 /** |
| 883 * Name of the enumerated value. | 893 * Name of the enumerated value. |
| 884 */ | 894 */ |
| 885 String name; | 895 String get name; |
| 886 | 896 |
| 887 /** | 897 /** |
| 888 * Offset of the enum value name relative to the beginning of the file. | 898 * Offset of the enum value name relative to the beginning of the file. |
| 889 */ | 899 */ |
| 890 @informative | 900 @informative |
| 891 int nameOffset; | 901 int get nameOffset; |
| 892 | 902 |
| 893 /** | 903 /** |
| 894 * Documentation comment for the enum value, or `null` if there is no | 904 * Documentation comment for the enum value, or `null` if there is no |
| 895 * documentation comment. | 905 * documentation comment. |
| 896 */ | 906 */ |
| 897 @informative | 907 @informative |
| 898 UnlinkedDocumentationComment documentationComment; | 908 UnlinkedDocumentationComment get documentationComment; |
| 899 } | 909 } |
| 900 | 910 |
| 901 /** | 911 /** |
| 902 * Unlinked summary information about a function, method, getter, or setter | 912 * Unlinked summary information about a function, method, getter, or setter |
| 903 * declaration. | 913 * declaration. |
| 904 */ | 914 */ |
| 905 class UnlinkedExecutable { | 915 abstract class UnlinkedExecutable extends base.SummaryClass { |
| 906 /** | 916 /** |
| 907 * Name of the executable. For setters, this includes the trailing "=". For | 917 * Name of the executable. For setters, this includes the trailing "=". For |
| 908 * named constructors, this excludes the class name and excludes the ".". | 918 * named constructors, this excludes the class name and excludes the ".". |
| 909 * For unnamed constructors, this is the empty string. | 919 * For unnamed constructors, this is the empty string. |
| 910 */ | 920 */ |
| 911 String name; | 921 String get name; |
| 912 | 922 |
| 913 /** | 923 /** |
| 914 * Offset of the executable name relative to the beginning of the file. For | 924 * Offset of the executable name relative to the beginning of the file. For |
| 915 * named constructors, this excludes the class name and excludes the ".". | 925 * named constructors, this excludes the class name and excludes the ".". |
| 916 * For unnamed constructors, this is the offset of the class name (i.e. the | 926 * For unnamed constructors, this is the offset of the class name (i.e. the |
| 917 * offset of the second "C" in "class C { C(); }"). | 927 * offset of the second "C" in "class C { C(); }"). |
| 918 */ | 928 */ |
| 919 @informative | 929 @informative |
| 920 int nameOffset; | 930 int get nameOffset; |
| 921 | 931 |
| 922 /** | 932 /** |
| 923 * Documentation comment for the executable, or `null` if there is no | 933 * Documentation comment for the executable, or `null` if there is no |
| 924 * documentation comment. | 934 * documentation comment. |
| 925 */ | 935 */ |
| 926 @informative | 936 @informative |
| 927 UnlinkedDocumentationComment documentationComment; | 937 UnlinkedDocumentationComment get documentationComment; |
| 928 | 938 |
| 929 /** | 939 /** |
| 930 * Type parameters of the executable, if any. Empty if support for generic | 940 * Type parameters of the executable, if any. Empty if support for generic |
| 931 * method syntax is disabled. | 941 * method syntax is disabled. |
| 932 */ | 942 */ |
| 933 List<UnlinkedTypeParam> typeParameters; | 943 List<UnlinkedTypeParam> get typeParameters; |
| 934 | 944 |
| 935 /** | 945 /** |
| 936 * Declared return type of the executable. Absent if the executable is a | 946 * Declared return type of the executable. Absent if the executable is a |
| 937 * constructor or the return type is implicit. | 947 * constructor or the return type is implicit. |
| 938 */ | 948 */ |
| 939 EntityRef returnType; | 949 EntityRef get returnType; |
| 940 | 950 |
| 941 /** | 951 /** |
| 942 * Parameters of the executable, if any. Note that getters have no | 952 * Parameters of the executable, if any. Note that getters have no |
| 943 * parameters (hence this will be the empty list), and setters have a single | 953 * parameters (hence this will be the empty list), and setters have a single |
| 944 * parameter. | 954 * parameter. |
| 945 */ | 955 */ |
| 946 List<UnlinkedParam> parameters; | 956 List<UnlinkedParam> get parameters; |
| 947 | 957 |
| 948 /** | 958 /** |
| 949 * The kind of the executable (function/method, getter, setter, or | 959 * The kind of the executable (function/method, getter, setter, or |
| 950 * constructor). | 960 * constructor). |
| 951 */ | 961 */ |
| 952 UnlinkedExecutableKind kind; | 962 UnlinkedExecutableKind get kind; |
| 953 | 963 |
| 954 /** | 964 /** |
| 955 * Indicates whether the executable is declared using the `abstract` keyword. | 965 * Indicates whether the executable is declared using the `abstract` keyword. |
| 956 */ | 966 */ |
| 957 bool isAbstract; | 967 bool get isAbstract; |
| 958 | 968 |
| 959 /** | 969 /** |
| 960 * Indicates whether the executable is declared using the `static` keyword. | 970 * Indicates whether the executable is declared using the `static` keyword. |
| 961 * | 971 * |
| 962 * Note that for top level executables, this flag is false, since they are | 972 * Note that for top level executables, this flag is false, since they are |
| 963 * not declared using the `static` keyword (even though they are considered | 973 * not declared using the `static` keyword (even though they are considered |
| 964 * static for semantic purposes). | 974 * static for semantic purposes). |
| 965 */ | 975 */ |
| 966 bool isStatic; | 976 bool get isStatic; |
| 967 | 977 |
| 968 /** | 978 /** |
| 969 * Indicates whether the executable is declared using the `const` keyword. | 979 * Indicates whether the executable is declared using the `const` keyword. |
| 970 */ | 980 */ |
| 971 bool isConst; | 981 bool get isConst; |
| 972 | 982 |
| 973 /** | 983 /** |
| 974 * Indicates whether the executable is declared using the `factory` keyword. | 984 * Indicates whether the executable is declared using the `factory` keyword. |
| 975 */ | 985 */ |
| 976 bool isFactory; | 986 bool get isFactory; |
| 977 | 987 |
| 978 /** | 988 /** |
| 979 * Indicates whether the executable is declared using the `external` keyword. | 989 * Indicates whether the executable is declared using the `external` keyword. |
| 980 */ | 990 */ |
| 981 bool isExternal; | 991 bool get isExternal; |
| 982 | 992 |
| 983 /** | 993 /** |
| 984 * If this executable's return type is inferrable, nonzero slot id | 994 * If this executable's return type is inferrable, nonzero slot id |
| 985 * identifying which entry in [LinkedLibrary.types] contains the inferred | 995 * identifying which entry in [LinkedLibrary.types] contains the inferred |
| 986 * return type. If there is no matching entry in [LinkedLibrary.types], then | 996 * return type. If there is no matching entry in [LinkedLibrary.types], then |
| 987 * no return type was inferred for this variable, so its static type is | 997 * no return type was inferred for this variable, so its static type is |
| 988 * `dynamic`. | 998 * `dynamic`. |
| 989 */ | 999 */ |
| 990 int inferredReturnTypeSlot; | 1000 int get inferredReturnTypeSlot; |
| 991 } | 1001 } |
| 992 | 1002 |
| 993 /** | 1003 /** |
| 994 * Enum used to indicate the kind of an executable. | 1004 * Enum used to indicate the kind of an executable. |
| 995 */ | 1005 */ |
| 996 enum UnlinkedExecutableKind { | 1006 enum UnlinkedExecutableKind { |
| 997 /** | 1007 /** |
| 998 * Executable is a function or method. | 1008 * Executable is a function or method. |
| 999 */ | 1009 */ |
| 1000 functionOrMethod, | 1010 functionOrMethod, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1012 /** | 1022 /** |
| 1013 * Executable is a constructor. | 1023 * Executable is a constructor. |
| 1014 */ | 1024 */ |
| 1015 constructor | 1025 constructor |
| 1016 } | 1026 } |
| 1017 | 1027 |
| 1018 /** | 1028 /** |
| 1019 * Unlinked summary information about an export declaration (stored outside | 1029 * Unlinked summary information about an export declaration (stored outside |
| 1020 * [UnlinkedPublicNamespace]). | 1030 * [UnlinkedPublicNamespace]). |
| 1021 */ | 1031 */ |
| 1022 class UnlinkedExportNonPublic { | 1032 abstract class UnlinkedExportNonPublic extends base.SummaryClass { |
| 1023 /** | 1033 /** |
| 1024 * Offset of the "export" keyword. | 1034 * Offset of the "export" keyword. |
| 1025 */ | 1035 */ |
| 1026 @informative | 1036 @informative |
| 1027 int offset; | 1037 int get offset; |
| 1028 | 1038 |
| 1029 /** | 1039 /** |
| 1030 * Offset of the URI string (including quotes) relative to the beginning of | 1040 * Offset of the URI string (including quotes) relative to the beginning of |
| 1031 * the file. | 1041 * the file. |
| 1032 */ | 1042 */ |
| 1033 @informative | 1043 @informative |
| 1034 int uriOffset; | 1044 int get uriOffset; |
| 1035 | 1045 |
| 1036 /** | 1046 /** |
| 1037 * End of the URI string (including quotes) relative to the beginning of the | 1047 * End of the URI string (including quotes) relative to the beginning of the |
| 1038 * file. | 1048 * file. |
| 1039 */ | 1049 */ |
| 1040 @informative | 1050 @informative |
| 1041 int uriEnd; | 1051 int get uriEnd; |
| 1042 } | 1052 } |
| 1043 | 1053 |
| 1044 /** | 1054 /** |
| 1045 * Unlinked summary information about an export declaration (stored inside | 1055 * Unlinked summary information about an export declaration (stored inside |
| 1046 * [UnlinkedPublicNamespace]). | 1056 * [UnlinkedPublicNamespace]). |
| 1047 */ | 1057 */ |
| 1048 class UnlinkedExportPublic { | 1058 abstract class UnlinkedExportPublic extends base.SummaryClass { |
| 1049 /** | 1059 /** |
| 1050 * URI used in the source code to reference the exported library. | 1060 * URI used in the source code to reference the exported library. |
| 1051 */ | 1061 */ |
| 1052 String uri; | 1062 String get uri; |
| 1053 | 1063 |
| 1054 /** | 1064 /** |
| 1055 * Combinators contained in this import declaration. | 1065 * Combinators contained in this import declaration. |
| 1056 */ | 1066 */ |
| 1057 List<UnlinkedCombinator> combinators; | 1067 List<UnlinkedCombinator> get combinators; |
| 1058 } | 1068 } |
| 1059 | 1069 |
| 1060 /** | 1070 /** |
| 1061 * Unlinked summary information about an import declaration. | 1071 * Unlinked summary information about an import declaration. |
| 1062 */ | 1072 */ |
| 1063 class UnlinkedImport { | 1073 abstract class UnlinkedImport extends base.SummaryClass { |
| 1064 /** | 1074 /** |
| 1065 * URI used in the source code to reference the imported library. | 1075 * URI used in the source code to reference the imported library. |
| 1066 */ | 1076 */ |
| 1067 String uri; | 1077 String get uri; |
| 1068 | 1078 |
| 1069 /** | 1079 /** |
| 1070 * If [isImplicit] is false, offset of the "import" keyword. If [isImplicit] | 1080 * If [isImplicit] is false, offset of the "import" keyword. If [isImplicit] |
| 1071 * is true, zero. | 1081 * is true, zero. |
| 1072 */ | 1082 */ |
| 1073 @informative | 1083 @informative |
| 1074 int offset; | 1084 int get offset; |
| 1075 | 1085 |
| 1076 /** | 1086 /** |
| 1077 * Index into [UnlinkedUnit.references] of the prefix declared by this | 1087 * Index into [UnlinkedUnit.references] of the prefix declared by this |
| 1078 * import declaration, or zero if this import declaration declares no prefix. | 1088 * import declaration, or zero if this import declaration declares no prefix. |
| 1079 * | 1089 * |
| 1080 * Note that multiple imports can declare the same prefix. | 1090 * Note that multiple imports can declare the same prefix. |
| 1081 */ | 1091 */ |
| 1082 int prefixReference; | 1092 int get prefixReference; |
| 1083 | 1093 |
| 1084 /** | 1094 /** |
| 1085 * Combinators contained in this import declaration. | 1095 * Combinators contained in this import declaration. |
| 1086 */ | 1096 */ |
| 1087 List<UnlinkedCombinator> combinators; | 1097 List<UnlinkedCombinator> get combinators; |
| 1088 | 1098 |
| 1089 /** | 1099 /** |
| 1090 * Indicates whether the import declaration uses the `deferred` keyword. | 1100 * Indicates whether the import declaration uses the `deferred` keyword. |
| 1091 */ | 1101 */ |
| 1092 bool isDeferred; | 1102 bool get isDeferred; |
| 1093 | 1103 |
| 1094 /** | 1104 /** |
| 1095 * Indicates whether the import declaration is implicit. | 1105 * Indicates whether the import declaration is implicit. |
| 1096 */ | 1106 */ |
| 1097 bool isImplicit; | 1107 bool get isImplicit; |
| 1098 | 1108 |
| 1099 /** | 1109 /** |
| 1100 * Offset of the URI string (including quotes) relative to the beginning of | 1110 * Offset of the URI string (including quotes) relative to the beginning of |
| 1101 * the file. If [isImplicit] is true, zero. | 1111 * the file. If [isImplicit] is true, zero. |
| 1102 */ | 1112 */ |
| 1103 @informative | 1113 @informative |
| 1104 int uriOffset; | 1114 int get uriOffset; |
| 1105 | 1115 |
| 1106 /** | 1116 /** |
| 1107 * End of the URI string (including quotes) relative to the beginning of the | 1117 * End of the URI string (including quotes) relative to the beginning of the |
| 1108 * file. If [isImplicit] is true, zero. | 1118 * file. If [isImplicit] is true, zero. |
| 1109 */ | 1119 */ |
| 1110 @informative | 1120 @informative |
| 1111 int uriEnd; | 1121 int get uriEnd; |
| 1112 | 1122 |
| 1113 /** | 1123 /** |
| 1114 * Offset of the prefix name relative to the beginning of the file, or zero | 1124 * Offset of the prefix name relative to the beginning of the file, or zero |
| 1115 * if there is no prefix. | 1125 * if there is no prefix. |
| 1116 */ | 1126 */ |
| 1117 @informative | 1127 @informative |
| 1118 int prefixOffset; | 1128 int get prefixOffset; |
| 1119 } | 1129 } |
| 1120 | 1130 |
| 1121 /** | 1131 /** |
| 1122 * Unlinked summary information about a function parameter. | 1132 * Unlinked summary information about a function parameter. |
| 1123 */ | 1133 */ |
| 1124 class UnlinkedParam { | 1134 abstract class UnlinkedParam extends base.SummaryClass { |
| 1125 /** | 1135 /** |
| 1126 * Name of the parameter. | 1136 * Name of the parameter. |
| 1127 */ | 1137 */ |
| 1128 String name; | 1138 String get name; |
| 1129 | 1139 |
| 1130 /** | 1140 /** |
| 1131 * Offset of the parameter name relative to the beginning of the file. | 1141 * Offset of the parameter name relative to the beginning of the file. |
| 1132 */ | 1142 */ |
| 1133 @informative | 1143 @informative |
| 1134 int nameOffset; | 1144 int get nameOffset; |
| 1135 | 1145 |
| 1136 /** | 1146 /** |
| 1137 * If [isFunctionTyped] is `true`, the declared return type. If | 1147 * If [isFunctionTyped] is `true`, the declared return type. If |
| 1138 * [isFunctionTyped] is `false`, the declared type. Absent if the type is | 1148 * [isFunctionTyped] is `false`, the declared type. Absent if the type is |
| 1139 * implicit. | 1149 * implicit. |
| 1140 */ | 1150 */ |
| 1141 EntityRef type; | 1151 EntityRef get type; |
| 1142 | 1152 |
| 1143 /** | 1153 /** |
| 1144 * If [isFunctionTyped] is `true`, the parameters of the function type. | 1154 * If [isFunctionTyped] is `true`, the parameters of the function type. |
| 1145 */ | 1155 */ |
| 1146 List<UnlinkedParam> parameters; | 1156 List<UnlinkedParam> get parameters; |
| 1147 | 1157 |
| 1148 /** | 1158 /** |
| 1149 * Kind of the parameter. | 1159 * Kind of the parameter. |
| 1150 */ | 1160 */ |
| 1151 UnlinkedParamKind kind; | 1161 UnlinkedParamKind get kind; |
| 1152 | 1162 |
| 1153 /** | 1163 /** |
| 1154 * Indicates whether this is a function-typed parameter. | 1164 * Indicates whether this is a function-typed parameter. |
| 1155 */ | 1165 */ |
| 1156 bool isFunctionTyped; | 1166 bool get isFunctionTyped; |
| 1157 | 1167 |
| 1158 /** | 1168 /** |
| 1159 * Indicates whether this is an initializing formal parameter (i.e. it is | 1169 * Indicates whether this is an initializing formal parameter (i.e. it is |
| 1160 * declared using `this.` syntax). | 1170 * declared using `this.` syntax). |
| 1161 */ | 1171 */ |
| 1162 bool isInitializingFormal; | 1172 bool get isInitializingFormal; |
| 1163 | 1173 |
| 1164 /** | 1174 /** |
| 1165 * If this parameter's type is inferrable, nonzero slot id identifying which | 1175 * If this parameter's type is inferrable, nonzero slot id identifying which |
| 1166 * entry in [LinkedLibrary.types] contains the inferred type. If there is no | 1176 * entry in [LinkedLibrary.types] contains the inferred type. If there is no |
| 1167 * matching entry in [LinkedLibrary.types], then no type was inferred for | 1177 * matching entry in [LinkedLibrary.types], then no type was inferred for |
| 1168 * this variable, so its static type is `dynamic`. | 1178 * this variable, so its static type is `dynamic`. |
| 1169 * | 1179 * |
| 1170 * Note that although strong mode considers initializing formals to be | 1180 * Note that although strong mode considers initializing formals to be |
| 1171 * inferrable, they are not marked as such in the summary; if their type is | 1181 * inferrable, they are not marked as such in the summary; if their type is |
| 1172 * not specified, they always inherit the static type of the corresponding | 1182 * not specified, they always inherit the static type of the corresponding |
| 1173 * field. | 1183 * field. |
| 1174 */ | 1184 */ |
| 1175 int inferredTypeSlot; | 1185 int get inferredTypeSlot; |
| 1176 } | 1186 } |
| 1177 | 1187 |
| 1178 /** | 1188 /** |
| 1179 * Enum used to indicate the kind of a parameter. | 1189 * Enum used to indicate the kind of a parameter. |
| 1180 */ | 1190 */ |
| 1181 enum UnlinkedParamKind { | 1191 enum UnlinkedParamKind { |
| 1182 /** | 1192 /** |
| 1183 * Parameter is required. | 1193 * Parameter is required. |
| 1184 */ | 1194 */ |
| 1185 required, | 1195 required, |
| 1186 | 1196 |
| 1187 /** | 1197 /** |
| 1188 * Parameter is positional optional (enclosed in `[]`) | 1198 * Parameter is positional optional (enclosed in `[]`) |
| 1189 */ | 1199 */ |
| 1190 positional, | 1200 positional, |
| 1191 | 1201 |
| 1192 /** | 1202 /** |
| 1193 * Parameter is named optional (enclosed in `{}`) | 1203 * Parameter is named optional (enclosed in `{}`) |
| 1194 */ | 1204 */ |
| 1195 named | 1205 named |
| 1196 } | 1206 } |
| 1197 | 1207 |
| 1198 /** | 1208 /** |
| 1199 * Unlinked summary information about a part declaration. | 1209 * Unlinked summary information about a part declaration. |
| 1200 */ | 1210 */ |
| 1201 class UnlinkedPart { | 1211 abstract class UnlinkedPart extends base.SummaryClass { |
| 1202 /** | 1212 /** |
| 1203 * Offset of the URI string (including quotes) relative to the beginning of | 1213 * Offset of the URI string (including quotes) relative to the beginning of |
| 1204 * the file. | 1214 * the file. |
| 1205 */ | 1215 */ |
| 1206 @informative | 1216 @informative |
| 1207 int uriOffset; | 1217 int get uriOffset; |
| 1208 | 1218 |
| 1209 /** | 1219 /** |
| 1210 * End of the URI string (including quotes) relative to the beginning of the | 1220 * End of the URI string (including quotes) relative to the beginning of the |
| 1211 * file. | 1221 * file. |
| 1212 */ | 1222 */ |
| 1213 @informative | 1223 @informative |
| 1214 int uriEnd; | 1224 int get uriEnd; |
| 1215 } | 1225 } |
| 1216 | 1226 |
| 1217 /** | 1227 /** |
| 1218 * Unlinked summary information about a specific name contributed by a | 1228 * Unlinked summary information about a specific name contributed by a |
| 1219 * compilation unit to a library's public namespace. | 1229 * compilation unit to a library's public namespace. |
| 1220 * | 1230 * |
| 1221 * TODO(paulberry): some of this information is redundant with information | 1231 * TODO(paulberry): some of this information is redundant with information |
| 1222 * elsewhere in the summary. Consider reducing the redundancy to reduce | 1232 * elsewhere in the summary. Consider reducing the redundancy to reduce |
| 1223 * summary size. | 1233 * summary size. |
| 1224 */ | 1234 */ |
| 1225 class UnlinkedPublicName { | 1235 abstract class UnlinkedPublicName extends base.SummaryClass { |
| 1226 /** | 1236 /** |
| 1227 * The name itself. | 1237 * The name itself. |
| 1228 */ | 1238 */ |
| 1229 String name; | 1239 String get name; |
| 1230 | 1240 |
| 1231 /** | 1241 /** |
| 1232 * The kind of object referred to by the name. | 1242 * The kind of object referred to by the name. |
| 1233 */ | 1243 */ |
| 1234 ReferenceKind kind; | 1244 ReferenceKind get kind; |
| 1235 | 1245 |
| 1236 /** | 1246 /** |
| 1237 * If the entity being referred to is generic, the number of type parameters | 1247 * If the entity being referred to is generic, the number of type parameters |
| 1238 * it accepts. Otherwise zero. | 1248 * it accepts. Otherwise zero. |
| 1239 */ | 1249 */ |
| 1240 int numTypeParameters; | 1250 int get numTypeParameters; |
| 1241 | 1251 |
| 1242 /** | 1252 /** |
| 1243 * If this [UnlinkedPublicName] is a class, the list of members which can be | 1253 * If this [UnlinkedPublicName] is a class, the list of members which can be |
| 1244 * referenced from constants - static constant fields, static methods, and | 1254 * referenced from constants - static constant fields, static methods, and |
| 1245 * constructors. Otherwise empty. | 1255 * constructors. Otherwise empty. |
| 1246 */ | 1256 */ |
| 1247 List<UnlinkedPublicName> constMembers; | 1257 List<UnlinkedPublicName> get constMembers; |
| 1248 } | 1258 } |
| 1249 | 1259 |
| 1250 /** | 1260 /** |
| 1251 * Unlinked summary information about what a compilation unit contributes to a | 1261 * Unlinked summary information about what a compilation unit contributes to a |
| 1252 * library's public namespace. This is the subset of [UnlinkedUnit] that is | 1262 * library's public namespace. This is the subset of [UnlinkedUnit] that is |
| 1253 * required from dependent libraries in order to perform prelinking. | 1263 * required from dependent libraries in order to perform prelinking. |
| 1254 */ | 1264 */ |
| 1255 @topLevel | 1265 @topLevel |
| 1256 class UnlinkedPublicNamespace { | 1266 abstract class UnlinkedPublicNamespace extends base.SummaryClass { |
| 1267 factory UnlinkedPublicNamespace.fromBuffer(List<int> buffer) => |
| 1268 generated.readUnlinkedPublicNamespace(buffer); |
| 1269 |
| 1257 /** | 1270 /** |
| 1258 * Public names defined in the compilation unit. | 1271 * Public names defined in the compilation unit. |
| 1259 * | 1272 * |
| 1260 * TODO(paulberry): consider sorting these names to reduce unnecessary | 1273 * TODO(paulberry): consider sorting these names to reduce unnecessary |
| 1261 * relinking. | 1274 * relinking. |
| 1262 */ | 1275 */ |
| 1263 List<UnlinkedPublicName> names; | 1276 List<UnlinkedPublicName> get names; |
| 1264 | 1277 |
| 1265 /** | 1278 /** |
| 1266 * Export declarations in the compilation unit. | 1279 * Export declarations in the compilation unit. |
| 1267 */ | 1280 */ |
| 1268 List<UnlinkedExportPublic> exports; | 1281 List<UnlinkedExportPublic> get exports; |
| 1269 | 1282 |
| 1270 /** | 1283 /** |
| 1271 * URIs referenced by part declarations in the compilation unit. | 1284 * URIs referenced by part declarations in the compilation unit. |
| 1272 */ | 1285 */ |
| 1273 List<String> parts; | 1286 List<String> get parts; |
| 1274 } | 1287 } |
| 1275 | 1288 |
| 1276 /** | 1289 /** |
| 1277 * Unlinked summary information about a name referred to in one library that | 1290 * Unlinked summary information about a name referred to in one library that |
| 1278 * might be defined in another. | 1291 * might be defined in another. |
| 1279 */ | 1292 */ |
| 1280 class UnlinkedReference { | 1293 abstract class UnlinkedReference extends base.SummaryClass { |
| 1281 /** | 1294 /** |
| 1282 * Name of the entity being referred to. For the pseudo-type `dynamic`, the | 1295 * Name of the entity being referred to. For the pseudo-type `dynamic`, the |
| 1283 * string is "dynamic". For the pseudo-type `void`, the string is "void". | 1296 * string is "dynamic". For the pseudo-type `void`, the string is "void". |
| 1284 */ | 1297 */ |
| 1285 String name; | 1298 String get name; |
| 1286 | 1299 |
| 1287 /** | 1300 /** |
| 1288 * Prefix used to refer to the entity, or zero if no prefix is used. This is | 1301 * Prefix used to refer to the entity, or zero if no prefix is used. This is |
| 1289 * an index into [UnlinkedUnit.references]. | 1302 * an index into [UnlinkedUnit.references]. |
| 1290 * | 1303 * |
| 1291 * Prefix references must always point backward; that is, for all i, if | 1304 * Prefix references must always point backward; that is, for all i, if |
| 1292 * UnlinkedUnit.references[i].prefixReference != 0, then | 1305 * UnlinkedUnit.references[i].prefixReference != 0, then |
| 1293 * UnlinkedUnit.references[i].prefixReference < i. | 1306 * UnlinkedUnit.references[i].prefixReference < i. |
| 1294 */ | 1307 */ |
| 1295 int prefixReference; | 1308 int get prefixReference; |
| 1296 } | 1309 } |
| 1297 | 1310 |
| 1298 /** | 1311 /** |
| 1299 * Unlinked summary information about a typedef declaration. | 1312 * Unlinked summary information about a typedef declaration. |
| 1300 */ | 1313 */ |
| 1301 class UnlinkedTypedef { | 1314 abstract class UnlinkedTypedef extends base.SummaryClass { |
| 1302 /** | 1315 /** |
| 1303 * Name of the typedef. | 1316 * Name of the typedef. |
| 1304 */ | 1317 */ |
| 1305 String name; | 1318 String get name; |
| 1306 | 1319 |
| 1307 /** | 1320 /** |
| 1308 * Offset of the typedef name relative to the beginning of the file. | 1321 * Offset of the typedef name relative to the beginning of the file. |
| 1309 */ | 1322 */ |
| 1310 @informative | 1323 @informative |
| 1311 int nameOffset; | 1324 int get nameOffset; |
| 1312 | 1325 |
| 1313 /** | 1326 /** |
| 1314 * Documentation comment for the typedef, or `null` if there is no | 1327 * Documentation comment for the typedef, or `null` if there is no |
| 1315 * documentation comment. | 1328 * documentation comment. |
| 1316 */ | 1329 */ |
| 1317 @informative | 1330 @informative |
| 1318 UnlinkedDocumentationComment documentationComment; | 1331 UnlinkedDocumentationComment get documentationComment; |
| 1319 | 1332 |
| 1320 /** | 1333 /** |
| 1321 * Type parameters of the typedef, if any. | 1334 * Type parameters of the typedef, if any. |
| 1322 */ | 1335 */ |
| 1323 List<UnlinkedTypeParam> typeParameters; | 1336 List<UnlinkedTypeParam> get typeParameters; |
| 1324 | 1337 |
| 1325 /** | 1338 /** |
| 1326 * Return type of the typedef. | 1339 * Return type of the typedef. |
| 1327 */ | 1340 */ |
| 1328 EntityRef returnType; | 1341 EntityRef get returnType; |
| 1329 | 1342 |
| 1330 /** | 1343 /** |
| 1331 * Parameters of the executable, if any. | 1344 * Parameters of the executable, if any. |
| 1332 */ | 1345 */ |
| 1333 List<UnlinkedParam> parameters; | 1346 List<UnlinkedParam> get parameters; |
| 1334 } | 1347 } |
| 1335 | 1348 |
| 1336 /** | 1349 /** |
| 1337 * Unlinked summary information about a type parameter declaration. | 1350 * Unlinked summary information about a type parameter declaration. |
| 1338 */ | 1351 */ |
| 1339 class UnlinkedTypeParam { | 1352 abstract class UnlinkedTypeParam extends base.SummaryClass { |
| 1340 /** | 1353 /** |
| 1341 * Name of the type parameter. | 1354 * Name of the type parameter. |
| 1342 */ | 1355 */ |
| 1343 String name; | 1356 String get name; |
| 1344 | 1357 |
| 1345 /** | 1358 /** |
| 1346 * Offset of the type parameter name relative to the beginning of the file. | 1359 * Offset of the type parameter name relative to the beginning of the file. |
| 1347 */ | 1360 */ |
| 1348 @informative | 1361 @informative |
| 1349 int nameOffset; | 1362 int get nameOffset; |
| 1350 | 1363 |
| 1351 /** | 1364 /** |
| 1352 * Bound of the type parameter, if a bound is explicitly declared. Otherwise | 1365 * Bound of the type parameter, if a bound is explicitly declared. Otherwise |
| 1353 * null. | 1366 * null. |
| 1354 */ | 1367 */ |
| 1355 EntityRef bound; | 1368 EntityRef get bound; |
| 1356 } | 1369 } |
| 1357 | 1370 |
| 1358 /** | 1371 /** |
| 1359 * Unlinked summary information about a compilation unit ("part file"). | 1372 * Unlinked summary information about a compilation unit ("part file"). |
| 1360 */ | 1373 */ |
| 1361 @topLevel | 1374 @topLevel |
| 1362 class UnlinkedUnit { | 1375 abstract class UnlinkedUnit extends base.SummaryClass { |
| 1376 factory UnlinkedUnit.fromBuffer(List<int> buffer) => |
| 1377 generated.readUnlinkedUnit(buffer); |
| 1378 |
| 1363 /** | 1379 /** |
| 1364 * Name of the library (from a "library" declaration, if present). | 1380 * Name of the library (from a "library" declaration, if present). |
| 1365 */ | 1381 */ |
| 1366 String libraryName; | 1382 String get libraryName; |
| 1367 | 1383 |
| 1368 /** | 1384 /** |
| 1369 * Offset of the library name relative to the beginning of the file (or 0 if | 1385 * Offset of the library name relative to the beginning of the file (or 0 if |
| 1370 * the library has no name). | 1386 * the library has no name). |
| 1371 */ | 1387 */ |
| 1372 @informative | 1388 @informative |
| 1373 int libraryNameOffset; | 1389 int get libraryNameOffset; |
| 1374 | 1390 |
| 1375 /** | 1391 /** |
| 1376 * Length of the library name as it appears in the source code (or 0 if the | 1392 * Length of the library name as it appears in the source code (or 0 if the |
| 1377 * library has no name). | 1393 * library has no name). |
| 1378 */ | 1394 */ |
| 1379 @informative | 1395 @informative |
| 1380 int libraryNameLength; | 1396 int get libraryNameLength; |
| 1381 | 1397 |
| 1382 /** | 1398 /** |
| 1383 * Documentation comment for the library, or `null` if there is no | 1399 * Documentation comment for the library, or `null` if there is no |
| 1384 * documentation comment. | 1400 * documentation comment. |
| 1385 */ | 1401 */ |
| 1386 @informative | 1402 @informative |
| 1387 UnlinkedDocumentationComment libraryDocumentationComment; | 1403 UnlinkedDocumentationComment get libraryDocumentationComment; |
| 1388 | 1404 |
| 1389 /** | 1405 /** |
| 1390 * Unlinked public namespace of this compilation unit. | 1406 * Unlinked public namespace of this compilation unit. |
| 1391 */ | 1407 */ |
| 1392 UnlinkedPublicNamespace publicNamespace; | 1408 UnlinkedPublicNamespace get publicNamespace; |
| 1393 | 1409 |
| 1394 /** | 1410 /** |
| 1395 * Top level and prefixed names referred to by this compilation unit. The | 1411 * Top level and prefixed names referred to by this compilation unit. The |
| 1396 * zeroth element of this array is always populated and is used to represent | 1412 * zeroth element of this array is always populated and is used to represent |
| 1397 * the absence of a reference in places where a reference is optional (for | 1413 * the absence of a reference in places where a reference is optional (for |
| 1398 * example [UnlinkedReference.prefixReference or | 1414 * example [UnlinkedReference.prefixReference or |
| 1399 * UnlinkedImport.prefixReference]). | 1415 * UnlinkedImport.prefixReference]). |
| 1400 */ | 1416 */ |
| 1401 List<UnlinkedReference> references; | 1417 List<UnlinkedReference> get references; |
| 1402 | 1418 |
| 1403 /** | 1419 /** |
| 1404 * Classes declared in the compilation unit. | 1420 * Classes declared in the compilation unit. |
| 1405 */ | 1421 */ |
| 1406 List<UnlinkedClass> classes; | 1422 List<UnlinkedClass> get classes; |
| 1407 | 1423 |
| 1408 /** | 1424 /** |
| 1409 * Enums declared in the compilation unit. | 1425 * Enums declared in the compilation unit. |
| 1410 */ | 1426 */ |
| 1411 List<UnlinkedEnum> enums; | 1427 List<UnlinkedEnum> get enums; |
| 1412 | 1428 |
| 1413 /** | 1429 /** |
| 1414 * Top level executable objects (functions, getters, and setters) declared in | 1430 * Top level executable objects (functions, getters, and setters) declared in |
| 1415 * the compilation unit. | 1431 * the compilation unit. |
| 1416 */ | 1432 */ |
| 1417 List<UnlinkedExecutable> executables; | 1433 List<UnlinkedExecutable> get executables; |
| 1418 | 1434 |
| 1419 /** | 1435 /** |
| 1420 * Export declarations in the compilation unit. | 1436 * Export declarations in the compilation unit. |
| 1421 */ | 1437 */ |
| 1422 List<UnlinkedExportNonPublic> exports; | 1438 List<UnlinkedExportNonPublic> get exports; |
| 1423 | 1439 |
| 1424 /** | 1440 /** |
| 1425 * Import declarations in the compilation unit. | 1441 * Import declarations in the compilation unit. |
| 1426 */ | 1442 */ |
| 1427 List<UnlinkedImport> imports; | 1443 List<UnlinkedImport> get imports; |
| 1428 | 1444 |
| 1429 /** | 1445 /** |
| 1430 * Part declarations in the compilation unit. | 1446 * Part declarations in the compilation unit. |
| 1431 */ | 1447 */ |
| 1432 List<UnlinkedPart> parts; | 1448 List<UnlinkedPart> get parts; |
| 1433 | 1449 |
| 1434 /** | 1450 /** |
| 1435 * Typedefs declared in the compilation unit. | 1451 * Typedefs declared in the compilation unit. |
| 1436 */ | 1452 */ |
| 1437 List<UnlinkedTypedef> typedefs; | 1453 List<UnlinkedTypedef> get typedefs; |
| 1438 | 1454 |
| 1439 /** | 1455 /** |
| 1440 * Top level variables declared in the compilation unit. | 1456 * Top level variables declared in the compilation unit. |
| 1441 */ | 1457 */ |
| 1442 List<UnlinkedVariable> variables; | 1458 List<UnlinkedVariable> get variables; |
| 1443 } | 1459 } |
| 1444 | 1460 |
| 1445 /** | 1461 /** |
| 1446 * Unlinked summary information about a top level variable, local variable, or | 1462 * Unlinked summary information about a top level variable, local variable, or |
| 1447 * a field. | 1463 * a field. |
| 1448 */ | 1464 */ |
| 1449 class UnlinkedVariable { | 1465 abstract class UnlinkedVariable extends base.SummaryClass { |
| 1450 /** | 1466 /** |
| 1451 * Name of the variable. | 1467 * Name of the variable. |
| 1452 */ | 1468 */ |
| 1453 String name; | 1469 String get name; |
| 1454 | 1470 |
| 1455 /** | 1471 /** |
| 1456 * Offset of the variable name relative to the beginning of the file. | 1472 * Offset of the variable name relative to the beginning of the file. |
| 1457 */ | 1473 */ |
| 1458 @informative | 1474 @informative |
| 1459 int nameOffset; | 1475 int get nameOffset; |
| 1460 | 1476 |
| 1461 /** | 1477 /** |
| 1462 * Documentation comment for the variable, or `null` if there is no | 1478 * Documentation comment for the variable, or `null` if there is no |
| 1463 * documentation comment. | 1479 * documentation comment. |
| 1464 */ | 1480 */ |
| 1465 @informative | 1481 @informative |
| 1466 UnlinkedDocumentationComment documentationComment; | 1482 UnlinkedDocumentationComment get documentationComment; |
| 1467 | 1483 |
| 1468 /** | 1484 /** |
| 1469 * Declared type of the variable. Absent if the type is implicit. | 1485 * Declared type of the variable. Absent if the type is implicit. |
| 1470 */ | 1486 */ |
| 1471 EntityRef type; | 1487 EntityRef get type; |
| 1472 | 1488 |
| 1473 /** | 1489 /** |
| 1474 * If [isConst] is true, and the variable has an initializer, the constant | 1490 * If [isConst] is true, and the variable has an initializer, the constant |
| 1475 * expression in the initializer. | 1491 * expression in the initializer. |
| 1476 */ | 1492 */ |
| 1477 UnlinkedConst constExpr; | 1493 UnlinkedConst get constExpr; |
| 1478 | 1494 |
| 1479 /** | 1495 /** |
| 1480 * Indicates whether the variable is declared using the `static` keyword. | 1496 * Indicates whether the variable is declared using the `static` keyword. |
| 1481 * | 1497 * |
| 1482 * Note that for top level variables, this flag is false, since they are not | 1498 * Note that for top level variables, this flag is false, since they are not |
| 1483 * declared using the `static` keyword (even though they are considered | 1499 * declared using the `static` keyword (even though they are considered |
| 1484 * static for semantic purposes). | 1500 * static for semantic purposes). |
| 1485 */ | 1501 */ |
| 1486 bool isStatic; | 1502 bool get isStatic; |
| 1487 | 1503 |
| 1488 /** | 1504 /** |
| 1489 * Indicates whether the variable is declared using the `final` keyword. | 1505 * Indicates whether the variable is declared using the `final` keyword. |
| 1490 */ | 1506 */ |
| 1491 bool isFinal; | 1507 bool get isFinal; |
| 1492 | 1508 |
| 1493 /** | 1509 /** |
| 1494 * Indicates whether the variable is declared using the `const` keyword. | 1510 * Indicates whether the variable is declared using the `const` keyword. |
| 1495 */ | 1511 */ |
| 1496 bool isConst; | 1512 bool get isConst; |
| 1497 | 1513 |
| 1498 /** | 1514 /** |
| 1499 * If this variable is propagable, nonzero slot id identifying which entry in | 1515 * If this variable is propagable, nonzero slot id identifying which entry in |
| 1500 * [LinkedLibrary.types] contains the propagated type for this variable. If | 1516 * [LinkedLibrary.types] contains the propagated type for this variable. If |
| 1501 * there is no matching entry in [LinkedLibrary.types], then this variable's | 1517 * there is no matching entry in [LinkedLibrary.types], then this variable's |
| 1502 * propagated type is the same as its declared type. | 1518 * propagated type is the same as its declared type. |
| 1503 * | 1519 * |
| 1504 * Non-propagable variables have a [propagatedTypeSlot] of zero. | 1520 * Non-propagable variables have a [propagatedTypeSlot] of zero. |
| 1505 */ | 1521 */ |
| 1506 int propagatedTypeSlot; | 1522 int get propagatedTypeSlot; |
| 1507 | 1523 |
| 1508 /** | 1524 /** |
| 1509 * If this variable is inferrable, nonzero slot id identifying which entry in | 1525 * If this variable is inferrable, nonzero slot id identifying which entry in |
| 1510 * [LinkedLibrary.types] contains the inferred type for this variable. If | 1526 * [LinkedLibrary.types] contains the inferred type for this variable. If |
| 1511 * there is no matching entry in [LinkedLibrary.types], then no type was | 1527 * there is no matching entry in [LinkedLibrary.types], then no type was |
| 1512 * inferred for this variable, so its static type is `dynamic`. | 1528 * inferred for this variable, so its static type is `dynamic`. |
| 1513 */ | 1529 */ |
| 1514 int inferredTypeSlot; | 1530 int get inferredTypeSlot; |
| 1515 } | 1531 } |
| OLD | NEW |