Chromium Code Reviews| 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 | 6 * This file is an "idl" style description of the summary format. It |
| 7 * contains abstract classes which declare the interface for reading data from | 7 * contains abstract classes which declare the interface for reading data from |
| 8 * summaries. It is parsed and transformed into code that implements the | 8 * summaries. It is parsed and transformed into code that implements the |
| 9 * summary format. | 9 * summary format. |
| 10 * | 10 * |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 * 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 |
| 36 * rarely distinguish between them; most information is that is not "unlinked" | 36 * rarely distinguish between them; most information is that is not "unlinked" |
| 37 * is typically considered "linked" for simplicity. | 37 * is typically considered "linked" for simplicity. |
| 38 * | 38 * |
| 39 * 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; |
| 40 * they are re-synthesized at the time the summary is read. | 40 * they are re-synthesized at the time the summary is read. |
| 41 */ | 41 */ |
| 42 library analyzer.tool.summary.idl; | 42 library analyzer.tool.summary.idl; |
| 43 | 43 |
| 44 import 'base.dart' as base; | 44 import 'base.dart' as base; |
| 45 import 'base.dart' show Id; | |
| 45 import 'format.dart' as generated; | 46 import 'format.dart' as generated; |
| 46 | 47 |
| 47 /** | 48 /** |
| 48 * Annotation describing information which is not part of Dart semantics; in | 49 * Annotation describing information which is not part of Dart semantics; in |
| 49 * other words, if this information (or any information it refers to) changes, | 50 * other words, if this information (or any information it refers to) changes, |
| 50 * static analysis and runtime behavior of the library are unaffected. | 51 * static analysis and runtime behavior of the library are unaffected. |
| 51 */ | 52 */ |
| 52 const informative = null; | 53 const informative = null; |
| 53 | 54 |
| 54 /** | 55 /** |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 77 * void f(x, void g(y, z, int h(String w))) { ... } | 78 * void f(x, void g(y, z, int h(String w))) { ... } |
| 78 * | 79 * |
| 79 * Then to refer to the function type implicitly defined by parameter `h` | 80 * Then to refer to the function type implicitly defined by parameter `h` |
| 80 * (which is parameter 2 of parameter 1 of `f`), then | 81 * (which is parameter 2 of parameter 1 of `f`), then |
| 81 * [implicitFunctionTypeIndices] should be [1, 2]. | 82 * [implicitFunctionTypeIndices] should be [1, 2]. |
| 82 * | 83 * |
| 83 * Note that if the entity being referred to is a generic method inside a | 84 * Note that if the entity being referred to is a generic method inside a |
| 84 * generic class, then the type arguments in [typeArguments] are applied | 85 * generic class, then the type arguments in [typeArguments] are applied |
| 85 * first to the class and then to the method. | 86 * first to the class and then to the method. |
| 86 */ | 87 */ |
| 88 @Id(4) | |
|
Paul Berry
2016/02/11 19:10:27
Note: I used smaller ids for the most frequently u
| |
| 87 List<int> get implicitFunctionTypeIndices; | 89 List<int> get implicitFunctionTypeIndices; |
| 88 | 90 |
| 89 /** | 91 /** |
| 90 * If this is a reference to a type parameter, one-based index into the list | 92 * 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 | 93 * of [UnlinkedTypeParam]s currently in effect. Indexing is done using De |
| 92 * Bruijn index conventions; that is, innermost parameters come first, and | 94 * Bruijn index conventions; that is, innermost parameters come first, and |
| 93 * if a class or method has multiple parameters, they are indexed from right | 95 * if a class or method has multiple parameters, they are indexed from right |
| 94 * to left. So for instance, if the enclosing declaration is | 96 * to left. So for instance, if the enclosing declaration is |
| 95 * | 97 * |
| 96 * class C<T,U> { | 98 * class C<T,U> { |
| 97 * m<V,W> { | 99 * m<V,W> { |
| 98 * ... | 100 * ... |
| 99 * } | 101 * } |
| 100 * } | 102 * } |
| 101 * | 103 * |
| 102 * Then [paramReference] values of 1, 2, 3, and 4 represent W, V, U, and T, | 104 * Then [paramReference] values of 1, 2, 3, and 4 represent W, V, U, and T, |
| 103 * respectively. | 105 * respectively. |
| 104 * | 106 * |
| 105 * If the type being referred to is not a type parameter, [paramReference] is | 107 * If the type being referred to is not a type parameter, [paramReference] is |
| 106 * zero. | 108 * zero. |
| 107 */ | 109 */ |
| 110 @Id(3) | |
| 108 int get paramReference; | 111 int get paramReference; |
| 109 | 112 |
| 110 /** | 113 /** |
| 111 * Index into [UnlinkedUnit.references] for the entity being referred to, or | 114 * Index into [UnlinkedUnit.references] for the entity being referred to, or |
| 112 * zero if this is a reference to a type parameter. | 115 * zero if this is a reference to a type parameter. |
| 113 */ | 116 */ |
| 117 @Id(0) | |
| 114 int get reference; | 118 int get reference; |
| 115 | 119 |
| 116 /** | 120 /** |
| 117 * If this [EntityRef] is contained within [LinkedUnit.types], slot id (which | 121 * If this [EntityRef] is contained within [LinkedUnit.types], slot id (which |
| 118 * is unique within the compilation unit) identifying the target of type | 122 * is unique within the compilation unit) identifying the target of type |
| 119 * propagation or type inference with which this [EntityRef] is associated. | 123 * propagation or type inference with which this [EntityRef] is associated. |
| 120 * | 124 * |
| 121 * Otherwise zero. | 125 * Otherwise zero. |
| 122 */ | 126 */ |
| 127 @Id(2) | |
| 123 int get slot; | 128 int get slot; |
| 124 | 129 |
| 125 /** | 130 /** |
| 126 * If this is an instantiation of a generic type or generic executable, the | 131 * If this is an instantiation of a generic type or generic executable, the |
| 127 * type arguments used to instantiate it. Trailing type arguments of type | 132 * type arguments used to instantiate it. Trailing type arguments of type |
| 128 * `dynamic` are omitted. | 133 * `dynamic` are omitted. |
| 129 */ | 134 */ |
| 135 @Id(1) | |
| 130 List<EntityRef> get typeArguments; | 136 List<EntityRef> get typeArguments; |
| 131 } | 137 } |
| 132 | 138 |
| 133 /** | 139 /** |
| 134 * Information about a dependency that exists between one library and another | 140 * Information about a dependency that exists between one library and another |
| 135 * due to an "import" declaration. | 141 * due to an "import" declaration. |
| 136 */ | 142 */ |
| 137 abstract class LinkedDependency extends base.SummaryClass { | 143 abstract class LinkedDependency extends base.SummaryClass { |
| 138 /** | 144 /** |
| 139 * URI for the compilation units listed in the library's `part` declarations. | 145 * URI for the compilation units listed in the library's `part` declarations. |
| 140 * These URIs are relative to the importing library. | 146 * These URIs are relative to the importing library. |
| 141 */ | 147 */ |
| 148 @Id(1) | |
| 142 List<String> get parts; | 149 List<String> get parts; |
| 143 | 150 |
| 144 /** | 151 /** |
| 145 * 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 |
| 146 * importing library, even if there are intervening `export` declarations. | 153 * importing library, even if there are intervening `export` declarations. |
| 147 * 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 |
| 148 * `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 |
| 149 * `b/d/e.dart`. | 156 * `b/d/e.dart`. |
| 150 */ | 157 */ |
| 158 @Id(0) | |
| 151 String get uri; | 159 String get uri; |
| 152 } | 160 } |
| 153 | 161 |
| 154 /** | 162 /** |
| 155 * Information about a single name in the export namespace of the library that | 163 * Information about a single name in the export namespace of the library that |
| 156 * is not in the public namespace. | 164 * is not in the public namespace. |
| 157 */ | 165 */ |
| 158 abstract class LinkedExportName extends base.SummaryClass { | 166 abstract class LinkedExportName extends base.SummaryClass { |
| 159 /** | 167 /** |
| 160 * Index into [LinkedLibrary.dependencies] for the library in which the | 168 * Index into [LinkedLibrary.dependencies] for the library in which the |
| 161 * entity is defined. | 169 * entity is defined. |
| 162 */ | 170 */ |
| 171 @Id(0) | |
| 163 int get dependency; | 172 int get dependency; |
| 164 | 173 |
| 165 /** | 174 /** |
| 166 * The kind of the entity being referred to. | 175 * The kind of the entity being referred to. |
| 167 */ | 176 */ |
| 177 @Id(3) | |
| 168 ReferenceKind get kind; | 178 ReferenceKind get kind; |
| 169 | 179 |
| 170 /** | 180 /** |
| 171 * Name of the exported entity. For an exported setter, this name includes | 181 * Name of the exported entity. For an exported setter, this name includes |
| 172 * the trailing '='. | 182 * the trailing '='. |
| 173 */ | 183 */ |
| 184 @Id(1) | |
| 174 String get name; | 185 String get name; |
| 175 | 186 |
| 176 /** | 187 /** |
| 177 * Integer index indicating which unit in the exported library contains the | 188 * Integer index indicating which unit in the exported library contains the |
| 178 * definition of the entity. As with indices into [LinkedLibrary.units], | 189 * definition of the entity. As with indices into [LinkedLibrary.units], |
| 179 * zero represents the defining compilation unit, and nonzero values | 190 * zero represents the defining compilation unit, and nonzero values |
| 180 * represent parts in the order of the corresponding `part` declarations. | 191 * represent parts in the order of the corresponding `part` declarations. |
| 181 */ | 192 */ |
| 193 @Id(2) | |
| 182 int get unit; | 194 int get unit; |
| 183 } | 195 } |
| 184 | 196 |
| 185 /** | 197 /** |
| 186 * Linked summary of a library. | 198 * Linked summary of a library. |
| 187 */ | 199 */ |
| 188 @topLevel | 200 @topLevel |
| 189 abstract class LinkedLibrary extends base.SummaryClass { | 201 abstract class LinkedLibrary extends base.SummaryClass { |
| 190 factory LinkedLibrary.fromBuffer(List<int> buffer) => | 202 factory LinkedLibrary.fromBuffer(List<int> buffer) => |
| 191 generated.readLinkedLibrary(buffer); | 203 generated.readLinkedLibrary(buffer); |
| 192 | 204 |
| 193 /** | 205 /** |
| 194 * The libraries that this library depends on (either via an explicit import | 206 * The libraries that this library depends on (either via an explicit import |
| 195 * statement or via the implicit dependencies on `dart:core` and | 207 * statement or via the implicit dependencies on `dart:core` and |
| 196 * `dart:async`). The first element of this array is a pseudo-dependency | 208 * `dart:async`). The first element of this array is a pseudo-dependency |
| 197 * representing the library itself (it is also used for `dynamic` and | 209 * representing the library itself (it is also used for `dynamic` and |
| 198 * `void`). This is followed by elements representing "prelinked" | 210 * `void`). This is followed by elements representing "prelinked" |
| 199 * dependencies (direct imports and the transitive closure of exports). | 211 * dependencies (direct imports and the transitive closure of exports). |
| 200 * After the prelinked dependencies are elements representing "linked" | 212 * After the prelinked dependencies are elements representing "linked" |
| 201 * dependencies. | 213 * dependencies. |
| 202 * | 214 * |
| 203 * A library is only included as a "linked" dependency if it is a true | 215 * A library is only included as a "linked" dependency if it is a true |
| 204 * dependency (e.g. a propagated or inferred type or constant value | 216 * dependency (e.g. a propagated or inferred type or constant value |
| 205 * implicitly refers to an element declared in the library) or | 217 * implicitly refers to an element declared in the library) or |
| 206 * anti-dependency (e.g. the result of type propagation or type inference | 218 * anti-dependency (e.g. the result of type propagation or type inference |
| 207 * depends on the lack of a certain declaration in the library). | 219 * depends on the lack of a certain declaration in the library). |
| 208 */ | 220 */ |
| 221 @Id(0) | |
| 209 List<LinkedDependency> get dependencies; | 222 List<LinkedDependency> get dependencies; |
| 210 | 223 |
| 211 /** | 224 /** |
| 212 * Information about entities in the export namespace of the library that are | 225 * Information about entities in the export namespace of the library that are |
| 213 * not in the public namespace of the library (that is, entities that are | 226 * not in the public namespace of the library (that is, entities that are |
| 214 * brought into the namespace via `export` directives). | 227 * brought into the namespace via `export` directives). |
| 215 * | 228 * |
| 216 * Sorted by name. | 229 * Sorted by name. |
| 217 */ | 230 */ |
| 231 @Id(4) | |
| 218 List<LinkedExportName> get exportNames; | 232 List<LinkedExportName> get exportNames; |
| 219 | 233 |
| 220 /** | 234 /** |
| 221 * For each import in [UnlinkedUnit.imports], an index into [dependencies] | 235 * For each import in [UnlinkedUnit.imports], an index into [dependencies] |
| 222 * of the library being imported. | 236 * of the library being imported. |
| 223 */ | 237 */ |
| 238 @Id(1) | |
| 224 List<int> get importDependencies; | 239 List<int> get importDependencies; |
| 225 | 240 |
| 226 /** | 241 /** |
| 227 * The number of elements in [dependencies] which are not "linked" | 242 * The number of elements in [dependencies] which are not "linked" |
| 228 * dependencies (that is, the number of libraries in the direct imports plus | 243 * dependencies (that is, the number of libraries in the direct imports plus |
| 229 * the transitive closure of exports, plus the library itself). | 244 * the transitive closure of exports, plus the library itself). |
| 230 */ | 245 */ |
| 246 @Id(2) | |
| 231 int get numPrelinkedDependencies; | 247 int get numPrelinkedDependencies; |
| 232 | 248 |
| 233 /** | 249 /** |
| 234 * The linked summary of all the compilation units constituting the | 250 * The linked summary of all the compilation units constituting the |
| 235 * library. The summary of the defining compilation unit is listed first, | 251 * library. The summary of the defining compilation unit is listed first, |
| 236 * followed by the summary of each part, in the order of the `part` | 252 * followed by the summary of each part, in the order of the `part` |
| 237 * declarations in the defining compilation unit. | 253 * declarations in the defining compilation unit. |
| 238 */ | 254 */ |
| 255 @Id(3) | |
| 239 List<LinkedUnit> get units; | 256 List<LinkedUnit> get units; |
| 240 } | 257 } |
| 241 | 258 |
| 242 /** | 259 /** |
| 243 * Information about the resolution of an [UnlinkedReference]. | 260 * Information about the resolution of an [UnlinkedReference]. |
| 244 */ | 261 */ |
| 245 abstract class LinkedReference extends base.SummaryClass { | 262 abstract class LinkedReference extends base.SummaryClass { |
| 246 /** | 263 /** |
| 247 * If this [LinkedReference] doesn't have an associated [UnlinkedReference], | 264 * If this [LinkedReference] doesn't have an associated [UnlinkedReference], |
| 248 * and the entity being referred to is contained within another entity, index | 265 * and the entity being referred to is contained within another entity, index |
| 249 * of the containing entity. This behaves similarly to | 266 * of the containing entity. This behaves similarly to |
| 250 * [UnlinkedReference.prefixReference], however it is only used for class | 267 * [UnlinkedReference.prefixReference], however it is only used for class |
| 251 * members, not for prefixed imports. | 268 * members, not for prefixed imports. |
| 252 * | 269 * |
| 253 * Containing references must always point backward; that is, for all i, if | 270 * Containing references must always point backward; that is, for all i, if |
| 254 * LinkedUnit.references[i].containingReference != 0, then | 271 * LinkedUnit.references[i].containingReference != 0, then |
| 255 * LinkedUnit.references[i].containingReference < i. | 272 * LinkedUnit.references[i].containingReference < i. |
| 256 */ | 273 */ |
| 274 @Id(5) | |
| 257 int get containingReference; | 275 int get containingReference; |
| 258 | 276 |
| 259 /** | 277 /** |
| 260 * Index into [LinkedLibrary.dependencies] indicating which imported library | 278 * Index into [LinkedLibrary.dependencies] indicating which imported library |
| 261 * declares the entity being referred to. | 279 * declares the entity being referred to. |
| 262 * | 280 * |
| 263 * Zero if this entity is contained within another entity (e.g. a class | 281 * Zero if this entity is contained within another entity (e.g. a class |
| 264 * member), or if [kind] is [ReferenceKind.prefix]. | 282 * member), or if [kind] is [ReferenceKind.prefix]. |
| 265 */ | 283 */ |
| 284 @Id(1) | |
| 266 int get dependency; | 285 int get dependency; |
| 267 | 286 |
| 268 /** | 287 /** |
| 269 * The kind of the entity being referred to. For the pseudo-types `dynamic` | 288 * The kind of the entity being referred to. For the pseudo-types `dynamic` |
| 270 * and `void`, the kind is [ReferenceKind.classOrEnum]. | 289 * and `void`, the kind is [ReferenceKind.classOrEnum]. |
| 271 */ | 290 */ |
| 291 @Id(2) | |
| 272 ReferenceKind get kind; | 292 ReferenceKind get kind; |
| 273 | 293 |
| 274 /** | 294 /** |
| 275 * If this [LinkedReference] doesn't have an associated [UnlinkedReference], | 295 * If this [LinkedReference] doesn't have an associated [UnlinkedReference], |
| 276 * name of the entity being referred to. For the pseudo-type `dynamic`, the | 296 * name of the entity being referred to. For the pseudo-type `dynamic`, the |
| 277 * string is "dynamic". For the pseudo-type `void`, the string is "void". | 297 * string is "dynamic". For the pseudo-type `void`, the string is "void". |
| 278 */ | 298 */ |
| 299 @Id(3) | |
| 279 String get name; | 300 String get name; |
| 280 | 301 |
| 281 /** | 302 /** |
| 282 * If the entity being referred to is generic, the number of type parameters | 303 * If the entity being referred to is generic, the number of type parameters |
| 283 * it accepts. Otherwise zero. | 304 * it accepts. Otherwise zero. |
| 284 */ | 305 */ |
| 306 @Id(4) | |
| 285 int get numTypeParameters; | 307 int get numTypeParameters; |
| 286 | 308 |
| 287 /** | 309 /** |
| 288 * Integer index indicating which unit in the imported library contains the | 310 * Integer index indicating which unit in the imported library contains the |
| 289 * definition of the entity. As with indices into [LinkedLibrary.units], | 311 * definition of the entity. As with indices into [LinkedLibrary.units], |
| 290 * zero represents the defining compilation unit, and nonzero values | 312 * zero represents the defining compilation unit, and nonzero values |
| 291 * represent parts in the order of the corresponding `part` declarations. | 313 * represent parts in the order of the corresponding `part` declarations. |
| 292 * | 314 * |
| 293 * Zero if this entity is contained within another entity (e.g. a class | 315 * Zero if this entity is contained within another entity (e.g. a class |
| 294 * member). | 316 * member). |
| 295 */ | 317 */ |
| 318 @Id(0) | |
| 296 int get unit; | 319 int get unit; |
| 297 } | 320 } |
| 298 | 321 |
| 299 /** | 322 /** |
| 300 * Linked summary of a compilation unit. | 323 * Linked summary of a compilation unit. |
| 301 */ | 324 */ |
| 302 abstract class LinkedUnit extends base.SummaryClass { | 325 abstract class LinkedUnit extends base.SummaryClass { |
| 303 /** | 326 /** |
| 304 * Information about the resolution of references within the compilation | 327 * Information about the resolution of references within the compilation |
| 305 * unit. Each element of [UnlinkedUnit.references] has a corresponding | 328 * unit. Each element of [UnlinkedUnit.references] has a corresponding |
| 306 * element in this list (at the same index). If this list has additional | 329 * element in this list (at the same index). If this list has additional |
| 307 * elements beyond the number of elements in [UnlinkedUnit.references], those | 330 * elements beyond the number of elements in [UnlinkedUnit.references], those |
| 308 * additional elements are references that are only referred to implicitly | 331 * additional elements are references that are only referred to implicitly |
| 309 * (e.g. elements involved in inferred or propagated types). | 332 * (e.g. elements involved in inferred or propagated types). |
| 310 */ | 333 */ |
| 334 @Id(0) | |
| 311 List<LinkedReference> get references; | 335 List<LinkedReference> get references; |
| 312 | 336 |
| 313 /** | 337 /** |
| 314 * List associating slot ids found inside the unlinked summary for the | 338 * List associating slot ids found inside the unlinked summary for the |
| 315 * compilation unit with propagated and inferred types. | 339 * compilation unit with propagated and inferred types. |
| 316 */ | 340 */ |
| 341 @Id(1) | |
| 317 List<EntityRef> get types; | 342 List<EntityRef> get types; |
| 318 } | 343 } |
| 319 | 344 |
| 320 /** | 345 /** |
| 321 * Enum used to indicate the kind of entity referred to by a | 346 * Enum used to indicate the kind of entity referred to by a |
| 322 * [LinkedReference]. | 347 * [LinkedReference]. |
| 323 */ | 348 */ |
| 324 enum ReferenceKind { | 349 enum ReferenceKind { |
| 325 /** | 350 /** |
| 326 * The entity is a class or enum. | 351 * The entity is a class or enum. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 379 * Information about SDK. | 404 * Information about SDK. |
| 380 */ | 405 */ |
| 381 @topLevel | 406 @topLevel |
| 382 abstract class SdkBundle extends base.SummaryClass { | 407 abstract class SdkBundle extends base.SummaryClass { |
| 383 factory SdkBundle.fromBuffer(List<int> buffer) => | 408 factory SdkBundle.fromBuffer(List<int> buffer) => |
| 384 generated.readSdkBundle(buffer); | 409 generated.readSdkBundle(buffer); |
| 385 | 410 |
| 386 /** | 411 /** |
| 387 * Linked libraries. | 412 * Linked libraries. |
| 388 */ | 413 */ |
| 414 @Id(0) | |
| 389 List<LinkedLibrary> get linkedLibraries; | 415 List<LinkedLibrary> get linkedLibraries; |
| 390 | 416 |
| 391 /** | 417 /** |
| 392 * The list of URIs of items in [linkedLibraries], e.g. `dart:core`. | 418 * The list of URIs of items in [linkedLibraries], e.g. `dart:core`. |
| 393 */ | 419 */ |
| 420 @Id(1) | |
| 394 List<String> get linkedLibraryUris; | 421 List<String> get linkedLibraryUris; |
| 395 | 422 |
| 396 /** | 423 /** |
| 397 * Unlinked information for the compilation units constituting the SDK. | 424 * Unlinked information for the compilation units constituting the SDK. |
| 398 */ | 425 */ |
| 426 @Id(2) | |
| 399 List<UnlinkedUnit> get unlinkedUnits; | 427 List<UnlinkedUnit> get unlinkedUnits; |
| 400 | 428 |
| 401 /** | 429 /** |
| 402 * The list of URIs of items in [unlinkedUnits], e.g. `dart:core/bool.dart`. | 430 * The list of URIs of items in [unlinkedUnits], e.g. `dart:core/bool.dart`. |
| 403 */ | 431 */ |
| 432 @Id(3) | |
| 404 List<String> get unlinkedUnitUris; | 433 List<String> get unlinkedUnitUris; |
| 405 } | 434 } |
| 406 | 435 |
| 407 /** | 436 /** |
| 408 * Unlinked summary information about a class declaration. | 437 * Unlinked summary information about a class declaration. |
| 409 */ | 438 */ |
| 410 abstract class UnlinkedClass extends base.SummaryClass { | 439 abstract class UnlinkedClass extends base.SummaryClass { |
| 411 /** | 440 /** |
| 412 * Annotations for this class. | 441 * Annotations for this class. |
| 413 */ | 442 */ |
| 443 @Id(5) | |
| 414 List<UnlinkedConst> get annotations; | 444 List<UnlinkedConst> get annotations; |
| 415 | 445 |
| 416 /** | 446 /** |
| 417 * Documentation comment for the class, or `null` if there is no | 447 * Documentation comment for the class, or `null` if there is no |
| 418 * documentation comment. | 448 * documentation comment. |
| 419 */ | 449 */ |
| 420 @informative | 450 @informative |
| 451 @Id(6) | |
| 421 UnlinkedDocumentationComment get documentationComment; | 452 UnlinkedDocumentationComment get documentationComment; |
| 422 | 453 |
| 423 /** | 454 /** |
| 424 * Executable objects (methods, getters, and setters) contained in the class. | 455 * Executable objects (methods, getters, and setters) contained in the class. |
| 425 */ | 456 */ |
| 457 @Id(2) | |
| 426 List<UnlinkedExecutable> get executables; | 458 List<UnlinkedExecutable> get executables; |
| 427 | 459 |
| 428 /** | 460 /** |
| 429 * Field declarations contained in the class. | 461 * Field declarations contained in the class. |
| 430 */ | 462 */ |
| 463 @Id(4) | |
| 431 List<UnlinkedVariable> get fields; | 464 List<UnlinkedVariable> get fields; |
| 432 | 465 |
| 433 /** | 466 /** |
| 434 * Indicates whether this class is the core "Object" class (and hence has no | 467 * Indicates whether this class is the core "Object" class (and hence has no |
| 435 * supertype) | 468 * supertype) |
| 436 */ | 469 */ |
| 470 @Id(12) | |
| 437 bool get hasNoSupertype; | 471 bool get hasNoSupertype; |
| 438 | 472 |
| 439 /** | 473 /** |
| 440 * Interfaces appearing in an `implements` clause, if any. | 474 * Interfaces appearing in an `implements` clause, if any. |
| 441 */ | 475 */ |
| 476 @Id(7) | |
| 442 List<EntityRef> get interfaces; | 477 List<EntityRef> get interfaces; |
| 443 | 478 |
| 444 /** | 479 /** |
| 445 * Indicates whether the class is declared with the `abstract` keyword. | 480 * Indicates whether the class is declared with the `abstract` keyword. |
| 446 */ | 481 */ |
| 482 @Id(8) | |
| 447 bool get isAbstract; | 483 bool get isAbstract; |
| 448 | 484 |
| 449 /** | 485 /** |
| 450 * Indicates whether the class is declared using mixin application syntax. | 486 * Indicates whether the class is declared using mixin application syntax. |
| 451 */ | 487 */ |
| 488 @Id(11) | |
| 452 bool get isMixinApplication; | 489 bool get isMixinApplication; |
| 453 | 490 |
| 454 /** | 491 /** |
| 455 * Mixins appearing in a `with` clause, if any. | 492 * Mixins appearing in a `with` clause, if any. |
| 456 */ | 493 */ |
| 494 @Id(10) | |
| 457 List<EntityRef> get mixins; | 495 List<EntityRef> get mixins; |
| 458 | 496 |
| 459 /** | 497 /** |
| 460 * Name of the class. | 498 * Name of the class. |
| 461 */ | 499 */ |
| 500 @Id(0) | |
| 462 String get name; | 501 String get name; |
| 463 | 502 |
| 464 /** | 503 /** |
| 465 * Offset of the class name relative to the beginning of the file. | 504 * Offset of the class name relative to the beginning of the file. |
| 466 */ | 505 */ |
| 467 @informative | 506 @informative |
| 507 @Id(1) | |
| 468 int get nameOffset; | 508 int get nameOffset; |
| 469 | 509 |
| 470 /** | 510 /** |
| 471 * Supertype of the class, or `null` if either (a) the class doesn't | 511 * Supertype of the class, or `null` if either (a) the class doesn't |
| 472 * explicitly declare a supertype (and hence has supertype `Object`), or (b) | 512 * explicitly declare a supertype (and hence has supertype `Object`), or (b) |
| 473 * the class *is* `Object` (and hence has no supertype). | 513 * the class *is* `Object` (and hence has no supertype). |
| 474 */ | 514 */ |
| 515 @Id(3) | |
| 475 EntityRef get supertype; | 516 EntityRef get supertype; |
| 476 | 517 |
| 477 /** | 518 /** |
| 478 * Type parameters of the class, if any. | 519 * Type parameters of the class, if any. |
| 479 */ | 520 */ |
| 521 @Id(9) | |
| 480 List<UnlinkedTypeParam> get typeParameters; | 522 List<UnlinkedTypeParam> get typeParameters; |
| 481 } | 523 } |
| 482 | 524 |
| 483 /** | 525 /** |
| 484 * Unlinked summary information about a `show` or `hide` combinator in an | 526 * Unlinked summary information about a `show` or `hide` combinator in an |
| 485 * import or export declaration. | 527 * import or export declaration. |
| 486 */ | 528 */ |
| 487 abstract class UnlinkedCombinator extends base.SummaryClass { | 529 abstract class UnlinkedCombinator extends base.SummaryClass { |
| 488 /** | 530 /** |
| 489 * List of names which are hidden. Empty if this is a `show` combinator. | 531 * List of names which are hidden. Empty if this is a `show` combinator. |
| 490 */ | 532 */ |
| 533 @Id(1) | |
| 491 List<String> get hides; | 534 List<String> get hides; |
| 492 | 535 |
| 493 /** | 536 /** |
| 494 * List of names which are shown. Empty if this is a `hide` combinator. | 537 * List of names which are shown. Empty if this is a `hide` combinator. |
| 495 */ | 538 */ |
| 539 @Id(0) | |
| 496 List<String> get shows; | 540 List<String> get shows; |
| 497 } | 541 } |
| 498 | 542 |
| 499 /** | 543 /** |
| 500 * Unlinked summary information about a compile-time constant expression, or a | 544 * Unlinked summary information about a compile-time constant expression, or a |
| 501 * potentially constant expression. | 545 * potentially constant expression. |
| 502 * | 546 * |
| 503 * Constant expressions are represented using a simple stack-based language | 547 * Constant expressions are represented using a simple stack-based language |
| 504 * where [operations] is a sequence of operations to execute starting with an | 548 * where [operations] is a sequence of operations to execute starting with an |
| 505 * empty stack. Once all operations have been executed, the stack should | 549 * empty stack. Once all operations have been executed, the stack should |
| 506 * contain a single value which is the value of the constant. Note that some | 550 * contain a single value which is the value of the constant. Note that some |
| 507 * operations consume additional data from the other fields of this class. | 551 * operations consume additional data from the other fields of this class. |
| 508 */ | 552 */ |
| 509 abstract class UnlinkedConst extends base.SummaryClass { | 553 abstract class UnlinkedConst extends base.SummaryClass { |
| 510 /** | 554 /** |
| 511 * Sequence of 64-bit doubles consumed by the operation `pushDouble`. | 555 * Sequence of 64-bit doubles consumed by the operation `pushDouble`. |
| 512 */ | 556 */ |
| 557 @Id(4) | |
| 513 List<double> get doubles; | 558 List<double> get doubles; |
| 514 | 559 |
| 515 /** | 560 /** |
| 516 * Sequence of unsigned 32-bit integers consumed by the operations | 561 * Sequence of unsigned 32-bit integers consumed by the operations |
| 517 * `pushArgument`, `pushInt`, `shiftOr`, `concatenate`, `invokeConstructor`, | 562 * `pushArgument`, `pushInt`, `shiftOr`, `concatenate`, `invokeConstructor`, |
| 518 * `makeList`, and `makeMap`. | 563 * `makeList`, and `makeMap`. |
| 519 */ | 564 */ |
| 565 @Id(1) | |
| 520 List<int> get ints; | 566 List<int> get ints; |
| 521 | 567 |
| 522 /** | 568 /** |
| 523 * Indicates whether the expression is not a valid potentially constant | 569 * Indicates whether the expression is not a valid potentially constant |
| 524 * expression. | 570 * expression. |
| 525 */ | 571 */ |
| 572 @Id(5) | |
| 526 bool get isInvalid; | 573 bool get isInvalid; |
| 527 | 574 |
| 528 /** | 575 /** |
| 529 * Sequence of operations to execute (starting with an empty stack) to form | 576 * Sequence of operations to execute (starting with an empty stack) to form |
| 530 * the constant value. | 577 * the constant value. |
| 531 */ | 578 */ |
| 579 @Id(0) | |
| 532 List<UnlinkedConstOperation> get operations; | 580 List<UnlinkedConstOperation> get operations; |
| 533 | 581 |
| 534 /** | 582 /** |
| 535 * Sequence of language constructs consumed by the operations | 583 * Sequence of language constructs consumed by the operations |
| 536 * `pushReference`, `invokeConstructor`, `makeList`, and `makeMap`. Note | 584 * `pushReference`, `invokeConstructor`, `makeList`, and `makeMap`. Note |
| 537 * that in the case of `pushReference` (and sometimes `invokeConstructor` the | 585 * that in the case of `pushReference` (and sometimes `invokeConstructor` the |
| 538 * actual entity being referred to may be something other than a type. | 586 * actual entity being referred to may be something other than a type. |
| 539 */ | 587 */ |
| 588 @Id(2) | |
| 540 List<EntityRef> get references; | 589 List<EntityRef> get references; |
| 541 | 590 |
| 542 /** | 591 /** |
| 543 * Sequence of strings consumed by the operations `pushString` and | 592 * Sequence of strings consumed by the operations `pushString` and |
| 544 * `invokeConstructor`. | 593 * `invokeConstructor`. |
| 545 */ | 594 */ |
| 595 @Id(3) | |
| 546 List<String> get strings; | 596 List<String> get strings; |
| 547 } | 597 } |
| 548 | 598 |
| 549 /** | 599 /** |
| 550 * Enum representing the various kinds of operations which may be performed to | 600 * Enum representing the various kinds of operations which may be performed to |
| 551 * produce a constant value. These options are assumed to execute in the | 601 * produce a constant value. These options are assumed to execute in the |
| 552 * context of a stack which is initially empty. | 602 * context of a stack which is initially empty. |
| 553 */ | 603 */ |
| 554 enum UnlinkedConstOperation { | 604 enum UnlinkedConstOperation { |
| 555 /** | 605 /** |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 837 } | 887 } |
| 838 | 888 |
| 839 /** | 889 /** |
| 840 * Unlinked summary information about a constructor initializer. | 890 * Unlinked summary information about a constructor initializer. |
| 841 */ | 891 */ |
| 842 abstract class UnlinkedConstructorInitializer extends base.SummaryClass { | 892 abstract class UnlinkedConstructorInitializer extends base.SummaryClass { |
| 843 /** | 893 /** |
| 844 * If [kind] is `thisInvocation` or `superInvocation`, the arguments of the | 894 * If [kind] is `thisInvocation` or `superInvocation`, the arguments of the |
| 845 * invocation. Otherwise empty. | 895 * invocation. Otherwise empty. |
| 846 */ | 896 */ |
| 897 @Id(3) | |
| 847 List<UnlinkedConst> get arguments; | 898 List<UnlinkedConst> get arguments; |
| 848 | 899 |
| 849 /** | 900 /** |
| 850 * If [kind] is `field`, the expression of the field initializer. | 901 * If [kind] is `field`, the expression of the field initializer. |
| 851 * Otherwise `null`. | 902 * Otherwise `null`. |
| 852 */ | 903 */ |
| 904 @Id(1) | |
| 853 UnlinkedConst get expression; | 905 UnlinkedConst get expression; |
| 854 | 906 |
| 855 /** | 907 /** |
| 856 * The kind of the constructor initializer (field, redirect, super). | 908 * The kind of the constructor initializer (field, redirect, super). |
| 857 */ | 909 */ |
| 910 @Id(2) | |
| 858 UnlinkedConstructorInitializerKind get kind; | 911 UnlinkedConstructorInitializerKind get kind; |
| 859 | 912 |
| 860 /** | 913 /** |
| 861 * If [kind] is `field`, the name of the field declared in the class. If | 914 * If [kind] is `field`, the name of the field declared in the class. If |
| 862 * [kind] is `thisInvocation`, the name of the constructor, declared in this | 915 * [kind] is `thisInvocation`, the name of the constructor, declared in this |
| 863 * class, to redirect to. If [kind] is `superInvocation`, the name of the | 916 * class, to redirect to. If [kind] is `superInvocation`, the name of the |
| 864 * constructor, declared in the superclass, to invoke. | 917 * constructor, declared in the superclass, to invoke. |
| 865 */ | 918 */ |
| 919 @Id(0) | |
| 866 String get name; | 920 String get name; |
| 867 } | 921 } |
| 868 | 922 |
| 869 /** | 923 /** |
| 870 * Enum used to indicate the kind of an constructor initializer. | 924 * Enum used to indicate the kind of an constructor initializer. |
| 871 */ | 925 */ |
| 872 enum UnlinkedConstructorInitializerKind { | 926 enum UnlinkedConstructorInitializerKind { |
| 873 /** | 927 /** |
| 874 * Initialization of a field. | 928 * Initialization of a field. |
| 875 */ | 929 */ |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 886 superInvocation | 940 superInvocation |
| 887 } | 941 } |
| 888 | 942 |
| 889 /** | 943 /** |
| 890 * Unlinked summary information about a documentation comment. | 944 * Unlinked summary information about a documentation comment. |
| 891 */ | 945 */ |
| 892 abstract class UnlinkedDocumentationComment extends base.SummaryClass { | 946 abstract class UnlinkedDocumentationComment extends base.SummaryClass { |
| 893 /** | 947 /** |
| 894 * Length of the documentation comment (prior to replacing '\r\n' with '\n'). | 948 * Length of the documentation comment (prior to replacing '\r\n' with '\n'). |
| 895 */ | 949 */ |
| 950 @Id(0) | |
| 896 int get length; | 951 int get length; |
| 897 | 952 |
| 898 /** | 953 /** |
| 899 * Offset of the beginning of the documentation comment relative to the | 954 * Offset of the beginning of the documentation comment relative to the |
| 900 * beginning of the file. | 955 * beginning of the file. |
| 901 */ | 956 */ |
| 957 @Id(2) | |
| 902 int get offset; | 958 int get offset; |
| 903 | 959 |
| 904 /** | 960 /** |
| 905 * Text of the documentation comment, with '\r\n' replaced by '\n'. | 961 * Text of the documentation comment, with '\r\n' replaced by '\n'. |
| 906 * | 962 * |
| 907 * References appearing within the doc comment in square brackets are not | 963 * References appearing within the doc comment in square brackets are not |
| 908 * specially encoded. | 964 * specially encoded. |
| 909 */ | 965 */ |
| 966 @Id(1) | |
| 910 String get text; | 967 String get text; |
| 911 } | 968 } |
| 912 | 969 |
| 913 /** | 970 /** |
| 914 * Unlinked summary information about an enum declaration. | 971 * Unlinked summary information about an enum declaration. |
| 915 */ | 972 */ |
| 916 abstract class UnlinkedEnum extends base.SummaryClass { | 973 abstract class UnlinkedEnum extends base.SummaryClass { |
| 917 /** | 974 /** |
| 918 * Annotations for this enum. | 975 * Annotations for this enum. |
| 919 */ | 976 */ |
| 977 @Id(4) | |
| 920 List<UnlinkedConst> get annotations; | 978 List<UnlinkedConst> get annotations; |
| 921 | 979 |
| 922 /** | 980 /** |
| 923 * Documentation comment for the enum, or `null` if there is no documentation | 981 * Documentation comment for the enum, or `null` if there is no documentation |
| 924 * comment. | 982 * comment. |
| 925 */ | 983 */ |
| 926 @informative | 984 @informative |
| 985 @Id(3) | |
| 927 UnlinkedDocumentationComment get documentationComment; | 986 UnlinkedDocumentationComment get documentationComment; |
| 928 | 987 |
| 929 /** | 988 /** |
| 930 * Name of the enum type. | 989 * Name of the enum type. |
| 931 */ | 990 */ |
| 991 @Id(0) | |
| 932 String get name; | 992 String get name; |
| 933 | 993 |
| 934 /** | 994 /** |
| 935 * Offset of the enum name relative to the beginning of the file. | 995 * Offset of the enum name relative to the beginning of the file. |
| 936 */ | 996 */ |
| 937 @informative | 997 @informative |
| 998 @Id(1) | |
| 938 int get nameOffset; | 999 int get nameOffset; |
| 939 | 1000 |
| 940 /** | 1001 /** |
| 941 * Values listed in the enum declaration, in declaration order. | 1002 * Values listed in the enum declaration, in declaration order. |
| 942 */ | 1003 */ |
| 1004 @Id(2) | |
| 943 List<UnlinkedEnumValue> get values; | 1005 List<UnlinkedEnumValue> get values; |
| 944 } | 1006 } |
| 945 | 1007 |
| 946 /** | 1008 /** |
| 947 * Unlinked summary information about a single enumerated value in an enum | 1009 * Unlinked summary information about a single enumerated value in an enum |
| 948 * declaration. | 1010 * declaration. |
| 949 */ | 1011 */ |
| 950 abstract class UnlinkedEnumValue extends base.SummaryClass { | 1012 abstract class UnlinkedEnumValue extends base.SummaryClass { |
| 951 /** | 1013 /** |
| 952 * Documentation comment for the enum value, or `null` if there is no | 1014 * Documentation comment for the enum value, or `null` if there is no |
| 953 * documentation comment. | 1015 * documentation comment. |
| 954 */ | 1016 */ |
| 955 @informative | 1017 @informative |
| 1018 @Id(2) | |
| 956 UnlinkedDocumentationComment get documentationComment; | 1019 UnlinkedDocumentationComment get documentationComment; |
| 957 | 1020 |
| 958 /** | 1021 /** |
| 959 * Name of the enumerated value. | 1022 * Name of the enumerated value. |
| 960 */ | 1023 */ |
| 1024 @Id(0) | |
| 961 String get name; | 1025 String get name; |
| 962 | 1026 |
| 963 /** | 1027 /** |
| 964 * Offset of the enum value name relative to the beginning of the file. | 1028 * Offset of the enum value name relative to the beginning of the file. |
| 965 */ | 1029 */ |
| 966 @informative | 1030 @informative |
| 1031 @Id(1) | |
| 967 int get nameOffset; | 1032 int get nameOffset; |
| 968 } | 1033 } |
| 969 | 1034 |
| 970 /** | 1035 /** |
| 971 * Unlinked summary information about a function, method, getter, or setter | 1036 * Unlinked summary information about a function, method, getter, or setter |
| 972 * declaration. | 1037 * declaration. |
| 973 */ | 1038 */ |
| 974 abstract class UnlinkedExecutable extends base.SummaryClass { | 1039 abstract class UnlinkedExecutable extends base.SummaryClass { |
| 975 /** | 1040 /** |
| 976 * Annotations for this executable. | 1041 * Annotations for this executable. |
| 977 */ | 1042 */ |
| 1043 @Id(6) | |
| 978 List<UnlinkedConst> get annotations; | 1044 List<UnlinkedConst> get annotations; |
| 979 | 1045 |
| 980 /** | 1046 /** |
| 981 * If a constant [UnlinkedExecutableKind.constructor], the constructor | 1047 * If a constant [UnlinkedExecutableKind.constructor], the constructor |
| 982 * initializers. Otherwise empty. | 1048 * initializers. Otherwise empty. |
| 983 */ | 1049 */ |
| 1050 @Id(14) | |
| 984 List<UnlinkedConstructorInitializer> get constantInitializers; | 1051 List<UnlinkedConstructorInitializer> get constantInitializers; |
| 985 | 1052 |
| 986 /** | 1053 /** |
| 987 * Documentation comment for the executable, or `null` if there is no | 1054 * Documentation comment for the executable, or `null` if there is no |
| 988 * documentation comment. | 1055 * documentation comment. |
| 989 */ | 1056 */ |
| 990 @informative | 1057 @informative |
| 1058 @Id(7) | |
| 991 UnlinkedDocumentationComment get documentationComment; | 1059 UnlinkedDocumentationComment get documentationComment; |
| 992 | 1060 |
| 993 /** | 1061 /** |
| 994 * If this executable's return type is inferable, nonzero slot id | 1062 * If this executable's return type is inferable, nonzero slot id |
| 995 * identifying which entry in [LinkedUnit.types] contains the inferred | 1063 * identifying which entry in [LinkedUnit.types] contains the inferred |
| 996 * return type. If there is no matching entry in [LinkedUnit.types], then | 1064 * return type. If there is no matching entry in [LinkedUnit.types], then |
| 997 * no return type was inferred for this variable, so its static type is | 1065 * no return type was inferred for this variable, so its static type is |
| 998 * `dynamic`. | 1066 * `dynamic`. |
| 999 */ | 1067 */ |
| 1068 @Id(5) | |
| 1000 int get inferredReturnTypeSlot; | 1069 int get inferredReturnTypeSlot; |
| 1001 | 1070 |
| 1002 /** | 1071 /** |
| 1003 * Indicates whether the executable is declared using the `abstract` keyword. | 1072 * Indicates whether the executable is declared using the `abstract` keyword. |
| 1004 */ | 1073 */ |
| 1074 @Id(10) | |
| 1005 bool get isAbstract; | 1075 bool get isAbstract; |
| 1006 | 1076 |
| 1007 /** | 1077 /** |
| 1008 * Indicates whether the executable is declared using the `const` keyword. | 1078 * Indicates whether the executable is declared using the `const` keyword. |
| 1009 */ | 1079 */ |
| 1080 @Id(12) | |
| 1010 bool get isConst; | 1081 bool get isConst; |
| 1011 | 1082 |
| 1012 /** | 1083 /** |
| 1013 * Indicates whether the executable is declared using the `external` keyword. | 1084 * Indicates whether the executable is declared using the `external` keyword. |
| 1014 */ | 1085 */ |
| 1086 @Id(11) | |
| 1015 bool get isExternal; | 1087 bool get isExternal; |
| 1016 | 1088 |
| 1017 /** | 1089 /** |
| 1018 * Indicates whether the executable is declared using the `factory` keyword. | 1090 * Indicates whether the executable is declared using the `factory` keyword. |
| 1019 */ | 1091 */ |
| 1092 @Id(8) | |
| 1020 bool get isFactory; | 1093 bool get isFactory; |
| 1021 | 1094 |
| 1022 /** | 1095 /** |
| 1023 * Indicates whether the executable is a redirected constructor. | 1096 * Indicates whether the executable is a redirected constructor. |
| 1024 */ | 1097 */ |
| 1098 @Id(13) | |
| 1025 bool get isRedirectedConstructor; | 1099 bool get isRedirectedConstructor; |
| 1026 | 1100 |
| 1027 /** | 1101 /** |
| 1028 * Indicates whether the executable is declared using the `static` keyword. | 1102 * Indicates whether the executable is declared using the `static` keyword. |
| 1029 * | 1103 * |
| 1030 * Note that for top level executables, this flag is false, since they are | 1104 * Note that for top level executables, this flag is false, since they are |
| 1031 * not declared using the `static` keyword (even though they are considered | 1105 * not declared using the `static` keyword (even though they are considered |
| 1032 * static for semantic purposes). | 1106 * static for semantic purposes). |
| 1033 */ | 1107 */ |
| 1108 @Id(9) | |
| 1034 bool get isStatic; | 1109 bool get isStatic; |
| 1035 | 1110 |
| 1036 /** | 1111 /** |
| 1037 * The kind of the executable (function/method, getter, setter, or | 1112 * The kind of the executable (function/method, getter, setter, or |
| 1038 * constructor). | 1113 * constructor). |
| 1039 */ | 1114 */ |
| 1115 @Id(4) | |
| 1040 UnlinkedExecutableKind get kind; | 1116 UnlinkedExecutableKind get kind; |
| 1041 | 1117 |
| 1042 /** | 1118 /** |
| 1043 * Name of the executable. For setters, this includes the trailing "=". For | 1119 * Name of the executable. For setters, this includes the trailing "=". For |
| 1044 * named constructors, this excludes the class name and excludes the ".". | 1120 * named constructors, this excludes the class name and excludes the ".". |
| 1045 * For unnamed constructors, this is the empty string. | 1121 * For unnamed constructors, this is the empty string. |
| 1046 */ | 1122 */ |
| 1123 @Id(1) | |
| 1047 String get name; | 1124 String get name; |
| 1048 | 1125 |
| 1049 /** | 1126 /** |
| 1050 * Offset of the executable name relative to the beginning of the file. For | 1127 * Offset of the executable name relative to the beginning of the file. For |
| 1051 * named constructors, this excludes the class name and excludes the ".". | 1128 * named constructors, this excludes the class name and excludes the ".". |
| 1052 * For unnamed constructors, this is the offset of the class name (i.e. the | 1129 * For unnamed constructors, this is the offset of the class name (i.e. the |
| 1053 * offset of the second "C" in "class C { C(); }"). | 1130 * offset of the second "C" in "class C { C(); }"). |
| 1054 */ | 1131 */ |
| 1055 @informative | 1132 @informative |
| 1133 @Id(0) | |
| 1056 int get nameOffset; | 1134 int get nameOffset; |
| 1057 | 1135 |
| 1058 /** | 1136 /** |
| 1059 * Parameters of the executable, if any. Note that getters have no | 1137 * Parameters of the executable, if any. Note that getters have no |
| 1060 * parameters (hence this will be the empty list), and setters have a single | 1138 * parameters (hence this will be the empty list), and setters have a single |
| 1061 * parameter. | 1139 * parameter. |
| 1062 */ | 1140 */ |
| 1141 @Id(2) | |
| 1063 List<UnlinkedParam> get parameters; | 1142 List<UnlinkedParam> get parameters; |
| 1064 | 1143 |
| 1065 /** | 1144 /** |
| 1066 * If [isRedirectedConstructor] and [isFactory] are both `true`, the | 1145 * If [isRedirectedConstructor] and [isFactory] are both `true`, the |
| 1067 * constructor to which this constructor redirects; otherwise empty. | 1146 * constructor to which this constructor redirects; otherwise empty. |
| 1068 */ | 1147 */ |
| 1148 @Id(15) | |
| 1069 EntityRef get redirectedConstructor; | 1149 EntityRef get redirectedConstructor; |
| 1070 | 1150 |
| 1071 /** | 1151 /** |
| 1072 * If [isRedirectedConstructor] is `true` and [isFactory] is `false`, the | 1152 * If [isRedirectedConstructor] is `true` and [isFactory] is `false`, the |
| 1073 * name of the constructor that this constructor redirects to; otherwise | 1153 * name of the constructor that this constructor redirects to; otherwise |
| 1074 * empty. | 1154 * empty. |
| 1075 */ | 1155 */ |
| 1156 @Id(17) | |
| 1076 String get redirectedConstructorName; | 1157 String get redirectedConstructorName; |
| 1077 | 1158 |
| 1078 /** | 1159 /** |
| 1079 * Declared return type of the executable. Absent if the executable is a | 1160 * Declared return type of the executable. Absent if the executable is a |
| 1080 * constructor or the return type is implicit. | 1161 * constructor or the return type is implicit. |
| 1081 */ | 1162 */ |
| 1163 @Id(3) | |
| 1082 EntityRef get returnType; | 1164 EntityRef get returnType; |
| 1083 | 1165 |
| 1084 /** | 1166 /** |
| 1085 * Type parameters of the executable, if any. Empty if support for generic | 1167 * Type parameters of the executable, if any. Empty if support for generic |
| 1086 * method syntax is disabled. | 1168 * method syntax is disabled. |
| 1087 */ | 1169 */ |
| 1170 @Id(16) | |
| 1088 List<UnlinkedTypeParam> get typeParameters; | 1171 List<UnlinkedTypeParam> get typeParameters; |
| 1089 } | 1172 } |
| 1090 | 1173 |
| 1091 /** | 1174 /** |
| 1092 * Enum used to indicate the kind of an executable. | 1175 * Enum used to indicate the kind of an executable. |
| 1093 */ | 1176 */ |
| 1094 enum UnlinkedExecutableKind { | 1177 enum UnlinkedExecutableKind { |
| 1095 /** | 1178 /** |
| 1096 * Executable is a function or method. | 1179 * Executable is a function or method. |
| 1097 */ | 1180 */ |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 1114 } | 1197 } |
| 1115 | 1198 |
| 1116 /** | 1199 /** |
| 1117 * Unlinked summary information about an export declaration (stored outside | 1200 * Unlinked summary information about an export declaration (stored outside |
| 1118 * [UnlinkedPublicNamespace]). | 1201 * [UnlinkedPublicNamespace]). |
| 1119 */ | 1202 */ |
| 1120 abstract class UnlinkedExportNonPublic extends base.SummaryClass { | 1203 abstract class UnlinkedExportNonPublic extends base.SummaryClass { |
| 1121 /** | 1204 /** |
| 1122 * Annotations for this export directive. | 1205 * Annotations for this export directive. |
| 1123 */ | 1206 */ |
| 1207 @Id(3) | |
| 1124 List<UnlinkedConst> get annotations; | 1208 List<UnlinkedConst> get annotations; |
| 1125 | 1209 |
| 1126 /** | 1210 /** |
| 1127 * Offset of the "export" keyword. | 1211 * Offset of the "export" keyword. |
| 1128 */ | 1212 */ |
| 1129 @informative | 1213 @informative |
| 1214 @Id(0) | |
| 1130 int get offset; | 1215 int get offset; |
| 1131 | 1216 |
| 1132 /** | 1217 /** |
| 1133 * End of the URI string (including quotes) relative to the beginning of the | 1218 * End of the URI string (including quotes) relative to the beginning of the |
| 1134 * file. | 1219 * file. |
| 1135 */ | 1220 */ |
| 1136 @informative | 1221 @informative |
| 1222 @Id(1) | |
| 1137 int get uriEnd; | 1223 int get uriEnd; |
| 1138 | 1224 |
| 1139 /** | 1225 /** |
| 1140 * Offset of the URI string (including quotes) relative to the beginning of | 1226 * Offset of the URI string (including quotes) relative to the beginning of |
| 1141 * the file. | 1227 * the file. |
| 1142 */ | 1228 */ |
| 1143 @informative | 1229 @informative |
| 1230 @Id(2) | |
| 1144 int get uriOffset; | 1231 int get uriOffset; |
| 1145 } | 1232 } |
| 1146 | 1233 |
| 1147 /** | 1234 /** |
| 1148 * Unlinked summary information about an export declaration (stored inside | 1235 * Unlinked summary information about an export declaration (stored inside |
| 1149 * [UnlinkedPublicNamespace]). | 1236 * [UnlinkedPublicNamespace]). |
| 1150 */ | 1237 */ |
| 1151 abstract class UnlinkedExportPublic extends base.SummaryClass { | 1238 abstract class UnlinkedExportPublic extends base.SummaryClass { |
| 1152 /** | 1239 /** |
| 1153 * Combinators contained in this import declaration. | 1240 * Combinators contained in this import declaration. |
| 1154 */ | 1241 */ |
| 1242 @Id(1) | |
| 1155 List<UnlinkedCombinator> get combinators; | 1243 List<UnlinkedCombinator> get combinators; |
| 1156 | 1244 |
| 1157 /** | 1245 /** |
| 1158 * URI used in the source code to reference the exported library. | 1246 * URI used in the source code to reference the exported library. |
| 1159 */ | 1247 */ |
| 1248 @Id(0) | |
| 1160 String get uri; | 1249 String get uri; |
| 1161 } | 1250 } |
| 1162 | 1251 |
| 1163 /** | 1252 /** |
| 1164 * Unlinked summary information about an import declaration. | 1253 * Unlinked summary information about an import declaration. |
| 1165 */ | 1254 */ |
| 1166 abstract class UnlinkedImport extends base.SummaryClass { | 1255 abstract class UnlinkedImport extends base.SummaryClass { |
| 1167 /** | 1256 /** |
| 1168 * Annotations for this import declaration. | 1257 * Annotations for this import declaration. |
| 1169 */ | 1258 */ |
| 1259 @Id(8) | |
| 1170 List<UnlinkedConst> get annotations; | 1260 List<UnlinkedConst> get annotations; |
| 1171 | 1261 |
| 1172 /** | 1262 /** |
| 1173 * Combinators contained in this import declaration. | 1263 * Combinators contained in this import declaration. |
| 1174 */ | 1264 */ |
| 1265 @Id(4) | |
| 1175 List<UnlinkedCombinator> get combinators; | 1266 List<UnlinkedCombinator> get combinators; |
| 1176 | 1267 |
| 1177 /** | 1268 /** |
| 1178 * Indicates whether the import declaration uses the `deferred` keyword. | 1269 * Indicates whether the import declaration uses the `deferred` keyword. |
| 1179 */ | 1270 */ |
| 1271 @Id(9) | |
| 1180 bool get isDeferred; | 1272 bool get isDeferred; |
| 1181 | 1273 |
| 1182 /** | 1274 /** |
| 1183 * Indicates whether the import declaration is implicit. | 1275 * Indicates whether the import declaration is implicit. |
| 1184 */ | 1276 */ |
| 1277 @Id(5) | |
| 1185 bool get isImplicit; | 1278 bool get isImplicit; |
| 1186 | 1279 |
| 1187 /** | 1280 /** |
| 1188 * If [isImplicit] is false, offset of the "import" keyword. If [isImplicit] | 1281 * If [isImplicit] is false, offset of the "import" keyword. If [isImplicit] |
| 1189 * is true, zero. | 1282 * is true, zero. |
| 1190 */ | 1283 */ |
| 1191 @informative | 1284 @informative |
| 1285 @Id(0) | |
| 1192 int get offset; | 1286 int get offset; |
| 1193 | 1287 |
| 1194 /** | 1288 /** |
| 1195 * Offset of the prefix name relative to the beginning of the file, or zero | 1289 * Offset of the prefix name relative to the beginning of the file, or zero |
| 1196 * if there is no prefix. | 1290 * if there is no prefix. |
| 1197 */ | 1291 */ |
| 1198 @informative | 1292 @informative |
| 1293 @Id(6) | |
| 1199 int get prefixOffset; | 1294 int get prefixOffset; |
| 1200 | 1295 |
| 1201 /** | 1296 /** |
| 1202 * Index into [UnlinkedUnit.references] of the prefix declared by this | 1297 * Index into [UnlinkedUnit.references] of the prefix declared by this |
| 1203 * import declaration, or zero if this import declaration declares no prefix. | 1298 * import declaration, or zero if this import declaration declares no prefix. |
| 1204 * | 1299 * |
| 1205 * Note that multiple imports can declare the same prefix. | 1300 * Note that multiple imports can declare the same prefix. |
| 1206 */ | 1301 */ |
| 1302 @Id(7) | |
| 1207 int get prefixReference; | 1303 int get prefixReference; |
| 1208 | 1304 |
| 1209 /** | 1305 /** |
| 1210 * URI used in the source code to reference the imported library. | 1306 * URI used in the source code to reference the imported library. |
| 1211 */ | 1307 */ |
| 1308 @Id(1) | |
| 1212 String get uri; | 1309 String get uri; |
| 1213 | 1310 |
| 1214 /** | 1311 /** |
| 1215 * End of the URI string (including quotes) relative to the beginning of the | 1312 * End of the URI string (including quotes) relative to the beginning of the |
| 1216 * file. If [isImplicit] is true, zero. | 1313 * file. If [isImplicit] is true, zero. |
| 1217 */ | 1314 */ |
| 1218 @informative | 1315 @informative |
| 1316 @Id(2) | |
| 1219 int get uriEnd; | 1317 int get uriEnd; |
| 1220 | 1318 |
| 1221 /** | 1319 /** |
| 1222 * Offset of the URI string (including quotes) relative to the beginning of | 1320 * Offset of the URI string (including quotes) relative to the beginning of |
| 1223 * the file. If [isImplicit] is true, zero. | 1321 * the file. If [isImplicit] is true, zero. |
| 1224 */ | 1322 */ |
| 1225 @informative | 1323 @informative |
| 1324 @Id(3) | |
| 1226 int get uriOffset; | 1325 int get uriOffset; |
| 1227 } | 1326 } |
| 1228 | 1327 |
| 1229 /** | 1328 /** |
| 1230 * Unlinked summary information about a function parameter. | 1329 * Unlinked summary information about a function parameter. |
| 1231 */ | 1330 */ |
| 1232 abstract class UnlinkedParam extends base.SummaryClass { | 1331 abstract class UnlinkedParam extends base.SummaryClass { |
| 1233 /** | 1332 /** |
| 1234 * Annotations for this parameter. | 1333 * Annotations for this parameter. |
| 1235 */ | 1334 */ |
| 1335 @Id(9) | |
| 1236 List<UnlinkedConst> get annotations; | 1336 List<UnlinkedConst> get annotations; |
| 1237 | 1337 |
| 1238 /** | 1338 /** |
| 1239 * If the parameter has a default value, the constant expression in the | 1339 * If the parameter has a default value, the constant expression in the |
| 1240 * default value. Note that the presence of this expression does not mean | 1340 * default value. Note that the presence of this expression does not mean |
| 1241 * that it is a valid, check [UnlinkedConst.isInvalid]. | 1341 * that it is a valid, check [UnlinkedConst.isInvalid]. |
| 1242 */ | 1342 */ |
| 1343 @Id(7) | |
| 1243 UnlinkedConst get defaultValue; | 1344 UnlinkedConst get defaultValue; |
| 1244 | 1345 |
| 1245 /** | 1346 /** |
| 1246 * If this parameter's type is inferable, nonzero slot id identifying which | 1347 * If this parameter's type is inferable, nonzero slot id identifying which |
| 1247 * entry in [LinkedLibrary.types] contains the inferred type. If there is no | 1348 * entry in [LinkedLibrary.types] contains the inferred type. If there is no |
| 1248 * matching entry in [LinkedLibrary.types], then no type was inferred for | 1349 * matching entry in [LinkedLibrary.types], then no type was inferred for |
| 1249 * this variable, so its static type is `dynamic`. | 1350 * this variable, so its static type is `dynamic`. |
| 1250 * | 1351 * |
| 1251 * Note that although strong mode considers initializing formals to be | 1352 * Note that although strong mode considers initializing formals to be |
| 1252 * inferable, they are not marked as such in the summary; if their type is | 1353 * inferable, they are not marked as such in the summary; if their type is |
| 1253 * not specified, they always inherit the static type of the corresponding | 1354 * not specified, they always inherit the static type of the corresponding |
| 1254 * field. | 1355 * field. |
| 1255 */ | 1356 */ |
| 1357 @Id(2) | |
| 1256 int get inferredTypeSlot; | 1358 int get inferredTypeSlot; |
| 1257 | 1359 |
| 1258 /** | 1360 /** |
| 1259 * Indicates whether this is a function-typed parameter. | 1361 * Indicates whether this is a function-typed parameter. |
| 1260 */ | 1362 */ |
| 1363 @Id(5) | |
| 1261 bool get isFunctionTyped; | 1364 bool get isFunctionTyped; |
| 1262 | 1365 |
| 1263 /** | 1366 /** |
| 1264 * Indicates whether this is an initializing formal parameter (i.e. it is | 1367 * Indicates whether this is an initializing formal parameter (i.e. it is |
| 1265 * declared using `this.` syntax). | 1368 * declared using `this.` syntax). |
| 1266 */ | 1369 */ |
| 1370 @Id(6) | |
| 1267 bool get isInitializingFormal; | 1371 bool get isInitializingFormal; |
| 1268 | 1372 |
| 1269 /** | 1373 /** |
| 1270 * Kind of the parameter. | 1374 * Kind of the parameter. |
| 1271 */ | 1375 */ |
| 1376 @Id(4) | |
| 1272 UnlinkedParamKind get kind; | 1377 UnlinkedParamKind get kind; |
| 1273 | 1378 |
| 1274 /** | 1379 /** |
| 1275 * Name of the parameter. | 1380 * Name of the parameter. |
| 1276 */ | 1381 */ |
| 1382 @Id(0) | |
| 1277 String get name; | 1383 String get name; |
| 1278 | 1384 |
| 1279 /** | 1385 /** |
| 1280 * Offset of the parameter name relative to the beginning of the file. | 1386 * Offset of the parameter name relative to the beginning of the file. |
| 1281 */ | 1387 */ |
| 1282 @informative | 1388 @informative |
| 1389 @Id(1) | |
| 1283 int get nameOffset; | 1390 int get nameOffset; |
| 1284 | 1391 |
| 1285 /** | 1392 /** |
| 1286 * If [isFunctionTyped] is `true`, the parameters of the function type. | 1393 * If [isFunctionTyped] is `true`, the parameters of the function type. |
| 1287 */ | 1394 */ |
| 1395 @Id(8) | |
| 1288 List<UnlinkedParam> get parameters; | 1396 List<UnlinkedParam> get parameters; |
| 1289 | 1397 |
| 1290 /** | 1398 /** |
| 1291 * If [isFunctionTyped] is `true`, the declared return type. If | 1399 * If [isFunctionTyped] is `true`, the declared return type. If |
| 1292 * [isFunctionTyped] is `false`, the declared type. Absent if the type is | 1400 * [isFunctionTyped] is `false`, the declared type. Absent if the type is |
| 1293 * implicit. | 1401 * implicit. |
| 1294 */ | 1402 */ |
| 1403 @Id(3) | |
| 1295 EntityRef get type; | 1404 EntityRef get type; |
| 1296 } | 1405 } |
| 1297 | 1406 |
| 1298 /** | 1407 /** |
| 1299 * Enum used to indicate the kind of a parameter. | 1408 * Enum used to indicate the kind of a parameter. |
| 1300 */ | 1409 */ |
| 1301 enum UnlinkedParamKind { | 1410 enum UnlinkedParamKind { |
| 1302 /** | 1411 /** |
| 1303 * Parameter is required. | 1412 * Parameter is required. |
| 1304 */ | 1413 */ |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 1315 named | 1424 named |
| 1316 } | 1425 } |
| 1317 | 1426 |
| 1318 /** | 1427 /** |
| 1319 * Unlinked summary information about a part declaration. | 1428 * Unlinked summary information about a part declaration. |
| 1320 */ | 1429 */ |
| 1321 abstract class UnlinkedPart extends base.SummaryClass { | 1430 abstract class UnlinkedPart extends base.SummaryClass { |
| 1322 /** | 1431 /** |
| 1323 * Annotations for this part declaration. | 1432 * Annotations for this part declaration. |
| 1324 */ | 1433 */ |
| 1434 @Id(2) | |
| 1325 List<UnlinkedConst> get annotations; | 1435 List<UnlinkedConst> get annotations; |
| 1326 | 1436 |
| 1327 /** | 1437 /** |
| 1328 * End of the URI string (including quotes) relative to the beginning of the | 1438 * End of the URI string (including quotes) relative to the beginning of the |
| 1329 * file. | 1439 * file. |
| 1330 */ | 1440 */ |
| 1331 @informative | 1441 @informative |
| 1442 @Id(0) | |
| 1332 int get uriEnd; | 1443 int get uriEnd; |
| 1333 | 1444 |
| 1334 /** | 1445 /** |
| 1335 * Offset of the URI string (including quotes) relative to the beginning of | 1446 * Offset of the URI string (including quotes) relative to the beginning of |
| 1336 * the file. | 1447 * the file. |
| 1337 */ | 1448 */ |
| 1338 @informative | 1449 @informative |
| 1450 @Id(1) | |
| 1339 int get uriOffset; | 1451 int get uriOffset; |
| 1340 } | 1452 } |
| 1341 | 1453 |
| 1342 /** | 1454 /** |
| 1343 * Unlinked summary information about a specific name contributed by a | 1455 * Unlinked summary information about a specific name contributed by a |
| 1344 * compilation unit to a library's public namespace. | 1456 * compilation unit to a library's public namespace. |
| 1345 * | 1457 * |
| 1346 * TODO(paulberry): some of this information is redundant with information | 1458 * TODO(paulberry): some of this information is redundant with information |
| 1347 * elsewhere in the summary. Consider reducing the redundancy to reduce | 1459 * elsewhere in the summary. Consider reducing the redundancy to reduce |
| 1348 * summary size. | 1460 * summary size. |
| 1349 */ | 1461 */ |
| 1350 abstract class UnlinkedPublicName extends base.SummaryClass { | 1462 abstract class UnlinkedPublicName extends base.SummaryClass { |
| 1351 /** | 1463 /** |
| 1352 * The kind of object referred to by the name. | 1464 * The kind of object referred to by the name. |
| 1353 */ | 1465 */ |
| 1466 @Id(1) | |
| 1354 ReferenceKind get kind; | 1467 ReferenceKind get kind; |
| 1355 | 1468 |
| 1356 /** | 1469 /** |
| 1357 * If this [UnlinkedPublicName] is a class, the list of members which can be | 1470 * If this [UnlinkedPublicName] is a class, the list of members which can be |
| 1358 * referenced from constants or factory redirects - static constant fields, | 1471 * referenced from constants or factory redirects - static constant fields, |
| 1359 * static methods, and constructors. Otherwise empty. | 1472 * static methods, and constructors. Otherwise empty. |
| 1360 * | 1473 * |
| 1361 * Unnamed constructors are not included since they do not constitute a | 1474 * Unnamed constructors are not included since they do not constitute a |
| 1362 * separate name added to any namespace. | 1475 * separate name added to any namespace. |
| 1363 */ | 1476 */ |
| 1477 @Id(2) | |
| 1364 List<UnlinkedPublicName> get members; | 1478 List<UnlinkedPublicName> get members; |
| 1365 | 1479 |
| 1366 /** | 1480 /** |
| 1367 * The name itself. | 1481 * The name itself. |
| 1368 */ | 1482 */ |
| 1483 @Id(0) | |
| 1369 String get name; | 1484 String get name; |
| 1370 | 1485 |
| 1371 /** | 1486 /** |
| 1372 * If the entity being referred to is generic, the number of type parameters | 1487 * If the entity being referred to is generic, the number of type parameters |
| 1373 * it accepts. Otherwise zero. | 1488 * it accepts. Otherwise zero. |
| 1374 */ | 1489 */ |
| 1490 @Id(3) | |
| 1375 int get numTypeParameters; | 1491 int get numTypeParameters; |
| 1376 } | 1492 } |
| 1377 | 1493 |
| 1378 /** | 1494 /** |
| 1379 * Unlinked summary information about what a compilation unit contributes to a | 1495 * Unlinked summary information about what a compilation unit contributes to a |
| 1380 * library's public namespace. This is the subset of [UnlinkedUnit] that is | 1496 * library's public namespace. This is the subset of [UnlinkedUnit] that is |
| 1381 * required from dependent libraries in order to perform prelinking. | 1497 * required from dependent libraries in order to perform prelinking. |
| 1382 */ | 1498 */ |
| 1383 @topLevel | 1499 @topLevel |
| 1384 abstract class UnlinkedPublicNamespace extends base.SummaryClass { | 1500 abstract class UnlinkedPublicNamespace extends base.SummaryClass { |
| 1385 factory UnlinkedPublicNamespace.fromBuffer(List<int> buffer) => | 1501 factory UnlinkedPublicNamespace.fromBuffer(List<int> buffer) => |
| 1386 generated.readUnlinkedPublicNamespace(buffer); | 1502 generated.readUnlinkedPublicNamespace(buffer); |
| 1387 | 1503 |
| 1388 /** | 1504 /** |
| 1389 * Export declarations in the compilation unit. | 1505 * Export declarations in the compilation unit. |
| 1390 */ | 1506 */ |
| 1507 @Id(2) | |
| 1391 List<UnlinkedExportPublic> get exports; | 1508 List<UnlinkedExportPublic> get exports; |
| 1392 | 1509 |
| 1393 /** | 1510 /** |
| 1394 * Public names defined in the compilation unit. | 1511 * Public names defined in the compilation unit. |
| 1395 * | 1512 * |
| 1396 * TODO(paulberry): consider sorting these names to reduce unnecessary | 1513 * TODO(paulberry): consider sorting these names to reduce unnecessary |
| 1397 * relinking. | 1514 * relinking. |
| 1398 */ | 1515 */ |
| 1516 @Id(0) | |
| 1399 List<UnlinkedPublicName> get names; | 1517 List<UnlinkedPublicName> get names; |
| 1400 | 1518 |
| 1401 /** | 1519 /** |
| 1402 * URIs referenced by part declarations in the compilation unit. | 1520 * URIs referenced by part declarations in the compilation unit. |
| 1403 */ | 1521 */ |
| 1522 @Id(1) | |
| 1404 List<String> get parts; | 1523 List<String> get parts; |
| 1405 } | 1524 } |
| 1406 | 1525 |
| 1407 /** | 1526 /** |
| 1408 * Unlinked summary information about a name referred to in one library that | 1527 * Unlinked summary information about a name referred to in one library that |
| 1409 * might be defined in another. | 1528 * might be defined in another. |
| 1410 */ | 1529 */ |
| 1411 abstract class UnlinkedReference extends base.SummaryClass { | 1530 abstract class UnlinkedReference extends base.SummaryClass { |
| 1412 /** | 1531 /** |
| 1413 * Name of the entity being referred to. For the pseudo-type `dynamic`, the | 1532 * Name of the entity being referred to. For the pseudo-type `dynamic`, the |
| 1414 * string is "dynamic". For the pseudo-type `void`, the string is "void". | 1533 * string is "dynamic". For the pseudo-type `void`, the string is "void". |
| 1415 */ | 1534 */ |
| 1535 @Id(0) | |
| 1416 String get name; | 1536 String get name; |
| 1417 | 1537 |
| 1418 /** | 1538 /** |
| 1419 * Prefix used to refer to the entity, or zero if no prefix is used. This is | 1539 * Prefix used to refer to the entity, or zero if no prefix is used. This is |
| 1420 * an index into [UnlinkedUnit.references]. | 1540 * an index into [UnlinkedUnit.references]. |
| 1421 * | 1541 * |
| 1422 * Prefix references must always point backward; that is, for all i, if | 1542 * Prefix references must always point backward; that is, for all i, if |
| 1423 * UnlinkedUnit.references[i].prefixReference != 0, then | 1543 * UnlinkedUnit.references[i].prefixReference != 0, then |
| 1424 * UnlinkedUnit.references[i].prefixReference < i. | 1544 * UnlinkedUnit.references[i].prefixReference < i. |
| 1425 */ | 1545 */ |
| 1546 @Id(1) | |
| 1426 int get prefixReference; | 1547 int get prefixReference; |
| 1427 } | 1548 } |
| 1428 | 1549 |
| 1429 /** | 1550 /** |
| 1430 * Unlinked summary information about a typedef declaration. | 1551 * Unlinked summary information about a typedef declaration. |
| 1431 */ | 1552 */ |
| 1432 abstract class UnlinkedTypedef extends base.SummaryClass { | 1553 abstract class UnlinkedTypedef extends base.SummaryClass { |
| 1433 /** | 1554 /** |
| 1434 * Annotations for this typedef. | 1555 * Annotations for this typedef. |
| 1435 */ | 1556 */ |
| 1557 @Id(4) | |
| 1436 List<UnlinkedConst> get annotations; | 1558 List<UnlinkedConst> get annotations; |
| 1437 | 1559 |
| 1438 /** | 1560 /** |
| 1439 * Documentation comment for the typedef, or `null` if there is no | 1561 * Documentation comment for the typedef, or `null` if there is no |
| 1440 * documentation comment. | 1562 * documentation comment. |
| 1441 */ | 1563 */ |
| 1442 @informative | 1564 @informative |
| 1565 @Id(6) | |
| 1443 UnlinkedDocumentationComment get documentationComment; | 1566 UnlinkedDocumentationComment get documentationComment; |
| 1444 | 1567 |
| 1445 /** | 1568 /** |
| 1446 * Name of the typedef. | 1569 * Name of the typedef. |
| 1447 */ | 1570 */ |
| 1571 @Id(0) | |
| 1448 String get name; | 1572 String get name; |
| 1449 | 1573 |
| 1450 /** | 1574 /** |
| 1451 * Offset of the typedef name relative to the beginning of the file. | 1575 * Offset of the typedef name relative to the beginning of the file. |
| 1452 */ | 1576 */ |
| 1453 @informative | 1577 @informative |
| 1578 @Id(1) | |
| 1454 int get nameOffset; | 1579 int get nameOffset; |
| 1455 | 1580 |
| 1456 /** | 1581 /** |
| 1457 * Parameters of the executable, if any. | 1582 * Parameters of the executable, if any. |
| 1458 */ | 1583 */ |
| 1584 @Id(3) | |
| 1459 List<UnlinkedParam> get parameters; | 1585 List<UnlinkedParam> get parameters; |
| 1460 | 1586 |
| 1461 /** | 1587 /** |
| 1462 * Return type of the typedef. | 1588 * Return type of the typedef. |
| 1463 */ | 1589 */ |
| 1590 @Id(2) | |
| 1464 EntityRef get returnType; | 1591 EntityRef get returnType; |
| 1465 | 1592 |
| 1466 /** | 1593 /** |
| 1467 * Type parameters of the typedef, if any. | 1594 * Type parameters of the typedef, if any. |
| 1468 */ | 1595 */ |
| 1596 @Id(5) | |
| 1469 List<UnlinkedTypeParam> get typeParameters; | 1597 List<UnlinkedTypeParam> get typeParameters; |
| 1470 } | 1598 } |
| 1471 | 1599 |
| 1472 /** | 1600 /** |
| 1473 * Unlinked summary information about a type parameter declaration. | 1601 * Unlinked summary information about a type parameter declaration. |
| 1474 */ | 1602 */ |
| 1475 abstract class UnlinkedTypeParam extends base.SummaryClass { | 1603 abstract class UnlinkedTypeParam extends base.SummaryClass { |
| 1476 /** | 1604 /** |
| 1477 * Annotations for this type parameter. | 1605 * Annotations for this type parameter. |
| 1478 */ | 1606 */ |
| 1607 @Id(3) | |
| 1479 List<UnlinkedConst> get annotations; | 1608 List<UnlinkedConst> get annotations; |
| 1480 | 1609 |
| 1481 /** | 1610 /** |
| 1482 * Bound of the type parameter, if a bound is explicitly declared. Otherwise | 1611 * Bound of the type parameter, if a bound is explicitly declared. Otherwise |
| 1483 * null. | 1612 * null. |
| 1484 */ | 1613 */ |
| 1614 @Id(2) | |
| 1485 EntityRef get bound; | 1615 EntityRef get bound; |
| 1486 | 1616 |
| 1487 /** | 1617 /** |
| 1488 * Name of the type parameter. | 1618 * Name of the type parameter. |
| 1489 */ | 1619 */ |
| 1620 @Id(0) | |
| 1490 String get name; | 1621 String get name; |
| 1491 | 1622 |
| 1492 /** | 1623 /** |
| 1493 * Offset of the type parameter name relative to the beginning of the file. | 1624 * Offset of the type parameter name relative to the beginning of the file. |
| 1494 */ | 1625 */ |
| 1495 @informative | 1626 @informative |
| 1627 @Id(1) | |
| 1496 int get nameOffset; | 1628 int get nameOffset; |
| 1497 } | 1629 } |
| 1498 | 1630 |
| 1499 /** | 1631 /** |
| 1500 * Unlinked summary information about a compilation unit ("part file"). | 1632 * Unlinked summary information about a compilation unit ("part file"). |
| 1501 */ | 1633 */ |
| 1502 @topLevel | 1634 @topLevel |
| 1503 abstract class UnlinkedUnit extends base.SummaryClass { | 1635 abstract class UnlinkedUnit extends base.SummaryClass { |
| 1504 factory UnlinkedUnit.fromBuffer(List<int> buffer) => | 1636 factory UnlinkedUnit.fromBuffer(List<int> buffer) => |
| 1505 generated.readUnlinkedUnit(buffer); | 1637 generated.readUnlinkedUnit(buffer); |
| 1506 | 1638 |
| 1507 /** | 1639 /** |
| 1508 * Classes declared in the compilation unit. | 1640 * Classes declared in the compilation unit. |
| 1509 */ | 1641 */ |
| 1642 @Id(2) | |
| 1510 List<UnlinkedClass> get classes; | 1643 List<UnlinkedClass> get classes; |
| 1511 | 1644 |
| 1512 /** | 1645 /** |
| 1513 * Enums declared in the compilation unit. | 1646 * Enums declared in the compilation unit. |
| 1514 */ | 1647 */ |
| 1648 @Id(12) | |
| 1515 List<UnlinkedEnum> get enums; | 1649 List<UnlinkedEnum> get enums; |
| 1516 | 1650 |
| 1517 /** | 1651 /** |
| 1518 * Top level executable objects (functions, getters, and setters) declared in | 1652 * Top level executable objects (functions, getters, and setters) declared in |
| 1519 * the compilation unit. | 1653 * the compilation unit. |
| 1520 */ | 1654 */ |
| 1655 @Id(4) | |
| 1521 List<UnlinkedExecutable> get executables; | 1656 List<UnlinkedExecutable> get executables; |
| 1522 | 1657 |
| 1523 /** | 1658 /** |
| 1524 * Export declarations in the compilation unit. | 1659 * Export declarations in the compilation unit. |
| 1525 */ | 1660 */ |
| 1661 @Id(13) | |
| 1526 List<UnlinkedExportNonPublic> get exports; | 1662 List<UnlinkedExportNonPublic> get exports; |
| 1527 | 1663 |
| 1528 /** | 1664 /** |
| 1529 * Import declarations in the compilation unit. | 1665 * Import declarations in the compilation unit. |
| 1530 */ | 1666 */ |
| 1667 @Id(5) | |
| 1531 List<UnlinkedImport> get imports; | 1668 List<UnlinkedImport> get imports; |
| 1532 | 1669 |
| 1533 /** | 1670 /** |
| 1534 * Annotations for the library declaration, or the empty list if there is no | 1671 * Annotations for the library declaration, or the empty list if there is no |
| 1535 * library declaration. | 1672 * library declaration. |
| 1536 */ | 1673 */ |
| 1674 @Id(14) | |
| 1537 List<UnlinkedConst> get libraryAnnotations; | 1675 List<UnlinkedConst> get libraryAnnotations; |
| 1538 | 1676 |
| 1539 /** | 1677 /** |
| 1540 * Documentation comment for the library, or `null` if there is no | 1678 * Documentation comment for the library, or `null` if there is no |
| 1541 * documentation comment. | 1679 * documentation comment. |
| 1542 */ | 1680 */ |
| 1543 @informative | 1681 @informative |
| 1682 @Id(9) | |
| 1544 UnlinkedDocumentationComment get libraryDocumentationComment; | 1683 UnlinkedDocumentationComment get libraryDocumentationComment; |
| 1545 | 1684 |
| 1546 /** | 1685 /** |
| 1547 * Name of the library (from a "library" declaration, if present). | 1686 * Name of the library (from a "library" declaration, if present). |
| 1548 */ | 1687 */ |
| 1688 @Id(6) | |
| 1549 String get libraryName; | 1689 String get libraryName; |
| 1550 | 1690 |
| 1551 /** | 1691 /** |
| 1552 * Length of the library name as it appears in the source code (or 0 if the | 1692 * Length of the library name as it appears in the source code (or 0 if the |
| 1553 * library has no name). | 1693 * library has no name). |
| 1554 */ | 1694 */ |
| 1555 @informative | 1695 @informative |
| 1696 @Id(7) | |
| 1556 int get libraryNameLength; | 1697 int get libraryNameLength; |
| 1557 | 1698 |
| 1558 /** | 1699 /** |
| 1559 * Offset of the library name relative to the beginning of the file (or 0 if | 1700 * Offset of the library name relative to the beginning of the file (or 0 if |
| 1560 * the library has no name). | 1701 * the library has no name). |
| 1561 */ | 1702 */ |
| 1562 @informative | 1703 @informative |
| 1704 @Id(8) | |
| 1563 int get libraryNameOffset; | 1705 int get libraryNameOffset; |
| 1564 | 1706 |
| 1565 /** | 1707 /** |
| 1566 * Part declarations in the compilation unit. | 1708 * Part declarations in the compilation unit. |
| 1567 */ | 1709 */ |
| 1710 @Id(11) | |
| 1568 List<UnlinkedPart> get parts; | 1711 List<UnlinkedPart> get parts; |
| 1569 | 1712 |
| 1570 /** | 1713 /** |
| 1571 * Unlinked public namespace of this compilation unit. | 1714 * Unlinked public namespace of this compilation unit. |
| 1572 */ | 1715 */ |
| 1716 @Id(0) | |
| 1573 UnlinkedPublicNamespace get publicNamespace; | 1717 UnlinkedPublicNamespace get publicNamespace; |
| 1574 | 1718 |
| 1575 /** | 1719 /** |
| 1576 * Top level and prefixed names referred to by this compilation unit. The | 1720 * Top level and prefixed names referred to by this compilation unit. The |
| 1577 * zeroth element of this array is always populated and is used to represent | 1721 * zeroth element of this array is always populated and is used to represent |
| 1578 * the absence of a reference in places where a reference is optional (for | 1722 * the absence of a reference in places where a reference is optional (for |
| 1579 * example [UnlinkedReference.prefixReference or | 1723 * example [UnlinkedReference.prefixReference or |
| 1580 * UnlinkedImport.prefixReference]). | 1724 * UnlinkedImport.prefixReference]). |
| 1581 */ | 1725 */ |
| 1726 @Id(1) | |
| 1582 List<UnlinkedReference> get references; | 1727 List<UnlinkedReference> get references; |
| 1583 | 1728 |
| 1584 /** | 1729 /** |
| 1585 * Typedefs declared in the compilation unit. | 1730 * Typedefs declared in the compilation unit. |
| 1586 */ | 1731 */ |
| 1732 @Id(10) | |
| 1587 List<UnlinkedTypedef> get typedefs; | 1733 List<UnlinkedTypedef> get typedefs; |
| 1588 | 1734 |
| 1589 /** | 1735 /** |
| 1590 * Top level variables declared in the compilation unit. | 1736 * Top level variables declared in the compilation unit. |
| 1591 */ | 1737 */ |
| 1738 @Id(3) | |
| 1592 List<UnlinkedVariable> get variables; | 1739 List<UnlinkedVariable> get variables; |
| 1593 } | 1740 } |
| 1594 | 1741 |
| 1595 /** | 1742 /** |
| 1596 * Unlinked summary information about a top level variable, local variable, or | 1743 * Unlinked summary information about a top level variable, local variable, or |
| 1597 * a field. | 1744 * a field. |
| 1598 */ | 1745 */ |
| 1599 abstract class UnlinkedVariable extends base.SummaryClass { | 1746 abstract class UnlinkedVariable extends base.SummaryClass { |
| 1600 /** | 1747 /** |
| 1601 * Annotations for this variable. | 1748 * Annotations for this variable. |
| 1602 */ | 1749 */ |
| 1750 @Id(8) | |
| 1603 List<UnlinkedConst> get annotations; | 1751 List<UnlinkedConst> get annotations; |
| 1604 | 1752 |
| 1605 /** | 1753 /** |
| 1606 * If [isConst] is true, and the variable has an initializer, the constant | 1754 * If [isConst] is true, and the variable has an initializer, the constant |
| 1607 * expression in the initializer. Note that the presence of this expression | 1755 * expression in the initializer. Note that the presence of this expression |
| 1608 * does not mean that it is a valid, check [UnlinkedConst.isInvalid]. | 1756 * does not mean that it is a valid, check [UnlinkedConst.isInvalid]. |
| 1609 */ | 1757 */ |
| 1758 @Id(5) | |
| 1610 UnlinkedConst get constExpr; | 1759 UnlinkedConst get constExpr; |
| 1611 | 1760 |
| 1612 /** | 1761 /** |
| 1613 * Documentation comment for the variable, or `null` if there is no | 1762 * Documentation comment for the variable, or `null` if there is no |
| 1614 * documentation comment. | 1763 * documentation comment. |
| 1615 */ | 1764 */ |
| 1616 @informative | 1765 @informative |
| 1766 @Id(10) | |
| 1617 UnlinkedDocumentationComment get documentationComment; | 1767 UnlinkedDocumentationComment get documentationComment; |
| 1618 | 1768 |
| 1619 /** | 1769 /** |
| 1620 * If this variable is inferable, nonzero slot id identifying which entry in | 1770 * If this variable is inferable, nonzero slot id identifying which entry in |
| 1621 * [LinkedLibrary.types] contains the inferred type for this variable. If | 1771 * [LinkedLibrary.types] contains the inferred type for this variable. If |
| 1622 * there is no matching entry in [LinkedLibrary.types], then no type was | 1772 * there is no matching entry in [LinkedLibrary.types], then no type was |
| 1623 * inferred for this variable, so its static type is `dynamic`. | 1773 * inferred for this variable, so its static type is `dynamic`. |
| 1624 */ | 1774 */ |
| 1775 @Id(9) | |
| 1625 int get inferredTypeSlot; | 1776 int get inferredTypeSlot; |
| 1626 | 1777 |
| 1627 /** | 1778 /** |
| 1628 * Indicates whether the variable is declared using the `const` keyword. | 1779 * Indicates whether the variable is declared using the `const` keyword. |
| 1629 */ | 1780 */ |
| 1781 @Id(6) | |
| 1630 bool get isConst; | 1782 bool get isConst; |
| 1631 | 1783 |
| 1632 /** | 1784 /** |
| 1633 * Indicates whether the variable is declared using the `final` keyword. | 1785 * Indicates whether the variable is declared using the `final` keyword. |
| 1634 */ | 1786 */ |
| 1787 @Id(7) | |
| 1635 bool get isFinal; | 1788 bool get isFinal; |
| 1636 | 1789 |
| 1637 /** | 1790 /** |
| 1638 * Indicates whether the variable is declared using the `static` keyword. | 1791 * Indicates whether the variable is declared using the `static` keyword. |
| 1639 * | 1792 * |
| 1640 * Note that for top level variables, this flag is false, since they are not | 1793 * Note that for top level variables, this flag is false, since they are not |
| 1641 * declared using the `static` keyword (even though they are considered | 1794 * declared using the `static` keyword (even though they are considered |
| 1642 * static for semantic purposes). | 1795 * static for semantic purposes). |
| 1643 */ | 1796 */ |
| 1797 @Id(4) | |
| 1644 bool get isStatic; | 1798 bool get isStatic; |
| 1645 | 1799 |
| 1646 /** | 1800 /** |
| 1647 * Name of the variable. | 1801 * Name of the variable. |
| 1648 */ | 1802 */ |
| 1803 @Id(0) | |
| 1649 String get name; | 1804 String get name; |
| 1650 | 1805 |
| 1651 /** | 1806 /** |
| 1652 * Offset of the variable name relative to the beginning of the file. | 1807 * Offset of the variable name relative to the beginning of the file. |
| 1653 */ | 1808 */ |
| 1654 @informative | 1809 @informative |
| 1810 @Id(1) | |
| 1655 int get nameOffset; | 1811 int get nameOffset; |
| 1656 | 1812 |
| 1657 /** | 1813 /** |
| 1658 * If this variable is propagable, nonzero slot id identifying which entry in | 1814 * If this variable is propagable, nonzero slot id identifying which entry in |
| 1659 * [LinkedLibrary.types] contains the propagated type for this variable. If | 1815 * [LinkedLibrary.types] contains the propagated type for this variable. If |
| 1660 * there is no matching entry in [LinkedLibrary.types], then this variable's | 1816 * there is no matching entry in [LinkedLibrary.types], then this variable's |
| 1661 * propagated type is the same as its declared type. | 1817 * propagated type is the same as its declared type. |
| 1662 * | 1818 * |
| 1663 * Non-propagable variables have a [propagatedTypeSlot] of zero. | 1819 * Non-propagable variables have a [propagatedTypeSlot] of zero. |
| 1664 */ | 1820 */ |
| 1821 @Id(2) | |
| 1665 int get propagatedTypeSlot; | 1822 int get propagatedTypeSlot; |
| 1666 | 1823 |
| 1667 /** | 1824 /** |
| 1668 * Declared type of the variable. Absent if the type is implicit. | 1825 * Declared type of the variable. Absent if the type is implicit. |
| 1669 */ | 1826 */ |
| 1827 @Id(3) | |
| 1670 EntityRef get type; | 1828 EntityRef get type; |
| 1671 } | 1829 } |
| OLD | NEW |