Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Side by Side Diff: pkg/analyzer/lib/src/summary/idl.dart

Issue 1681733002: Sort members in idl.dart. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/src/summary/format.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 * encoded summary. 69 * encoded summary.
70 */ 70 */
71 const topLevel = null; 71 const topLevel = null;
72 72
73 /** 73 /**
74 * 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
75 * level executable, or executable within a class. 75 * level executable, or executable within a class.
76 */ 76 */
77 abstract class EntityRef extends base.SummaryClass { 77 abstract class EntityRef extends base.SummaryClass {
78 /** 78 /**
79 * If this [EntityRef] is contained within [LinkedUnit.types], slot id (which 79 * If this is a reference to a function type implicitly defined by a
80 * is unique within the compilation unit) identifying the target of type 80 * function-typed parameter, a list of zero-based indices indicating the path
81 * propagation or type inference with which this [EntityRef] is associated. 81 * from the entity referred to by [reference] to the appropriate type
82 * parameter. Otherwise the empty list.
82 * 83 *
83 * Otherwise zero. 84 * If there are N indices in this list, then the entity being referred to is
85 * the function type implicitly defined by a function-typed parameter of a
86 * function-typed parameter, to N levels of nesting. The first index in the
87 * list refers to the outermost level of nesting; for example if [reference]
88 * refers to the entity defined by:
89 *
90 * void f(x, void g(y, z, int h(String w))) { ... }
91 *
92 * Then to refer to the function type implicitly defined by parameter `h`
93 * (which is parameter 2 of parameter 1 of `f`), then
94 * [implicitFunctionTypeIndices] should be [1, 2].
95 *
96 * Note that if the entity being referred to is a generic method inside a
97 * generic class, then the type arguments in [typeArguments] are applied
98 * first to the class and then to the method.
84 */ 99 */
85 int get slot; 100 List<int> get implicitFunctionTypeIndices;
86
87 /**
88 * Index into [UnlinkedUnit.references] for the entity being referred to, or
89 * zero if this is a reference to a type parameter.
90 */
91 int get reference;
92 101
93 /** 102 /**
94 * If this is a reference to a type parameter, one-based index into the list 103 * If this is a reference to a type parameter, one-based index into the list
95 * of [UnlinkedTypeParam]s currently in effect. Indexing is done using De 104 * of [UnlinkedTypeParam]s currently in effect. Indexing is done using De
96 * Bruijn index conventions; that is, innermost parameters come first, and 105 * Bruijn index conventions; that is, innermost parameters come first, and
97 * if a class or method has multiple parameters, they are indexed from right 106 * if a class or method has multiple parameters, they are indexed from right
98 * to left. So for instance, if the enclosing declaration is 107 * to left. So for instance, if the enclosing declaration is
99 * 108 *
100 * class C<T,U> { 109 * class C<T,U> {
101 * m<V,W> { 110 * m<V,W> {
102 * ... 111 * ...
103 * } 112 * }
104 * } 113 * }
105 * 114 *
106 * Then [paramReference] values of 1, 2, 3, and 4 represent W, V, U, and T, 115 * Then [paramReference] values of 1, 2, 3, and 4 represent W, V, U, and T,
107 * respectively. 116 * respectively.
108 * 117 *
109 * If the type being referred to is not a type parameter, [paramReference] is 118 * If the type being referred to is not a type parameter, [paramReference] is
110 * zero. 119 * zero.
111 */ 120 */
112 int get paramReference; 121 int get paramReference;
113 122
114 /** 123 /**
115 * If this is a reference to a function type implicitly defined by a 124 * Index into [UnlinkedUnit.references] for the entity being referred to, or
116 * function-typed parameter, a list of zero-based indices indicating the path 125 * zero if this is a reference to a type parameter.
117 * from the entity referred to by [reference] to the appropriate type 126 */
118 * parameter. Otherwise the empty list. 127 int get reference;
128
129 /**
130 * If this [EntityRef] is contained within [LinkedUnit.types], slot id (which
131 * is unique within the compilation unit) identifying the target of type
132 * propagation or type inference with which this [EntityRef] is associated.
119 * 133 *
120 * If there are N indices in this list, then the entity being referred to is 134 * Otherwise zero.
121 * the function type implicitly defined by a function-typed parameter of a
122 * function-typed parameter, to N levels of nesting. The first index in the
123 * list refers to the outermost level of nesting; for example if [reference]
124 * refers to the entity defined by:
125 *
126 * void f(x, void g(y, z, int h(String w))) { ... }
127 *
128 * Then to refer to the function type implicitly defined by parameter `h`
129 * (which is parameter 2 of parameter 1 of `f`), then
130 * [implicitFunctionTypeIndices] should be [1, 2].
131 *
132 * Note that if the entity being referred to is a generic method inside a
133 * generic class, then the type arguments in [typeArguments] are applied
134 * first to the class and then to the method.
135 */ 135 */
136 List<int> get implicitFunctionTypeIndices; 136 int get slot;
137 137
138 /** 138 /**
139 * 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
140 * type arguments used to instantiate it. Trailing type arguments of type 140 * type arguments used to instantiate it. Trailing type arguments of type
141 * `dynamic` are omitted. 141 * `dynamic` are omitted.
142 */ 142 */
143 List<EntityRef> get typeArguments; 143 List<EntityRef> get typeArguments;
144 } 144 }
145 145
146 /** 146 /**
147 * Information about a dependency that exists between one library and another 147 * Information about a dependency that exists between one library and another
148 * due to an "import" declaration. 148 * due to an "import" declaration.
149 */ 149 */
150 abstract class LinkedDependency extends base.SummaryClass { 150 abstract class LinkedDependency extends base.SummaryClass {
151 /** 151 /**
152 * URI for the compilation units listed in the library's `part` declarations.
153 * These URIs are relative to the importing library.
154 */
155 List<String> get parts;
156
157 /**
152 * The relative URI of the dependent library. This URI is relative to the 158 * The relative URI of the dependent library. This URI is relative to the
153 * importing library, even if there are intervening `export` declarations. 159 * importing library, even if there are intervening `export` declarations.
154 * So, for example, if `a.dart` imports `b/c.dart` and `b/c.dart` exports 160 * So, for example, if `a.dart` imports `b/c.dart` and `b/c.dart` exports
155 * `d/e.dart`, the URI listed for `a.dart`'s dependency on `e.dart` will be 161 * `d/e.dart`, the URI listed for `a.dart`'s dependency on `e.dart` will be
156 * `b/d/e.dart`. 162 * `b/d/e.dart`.
157 */ 163 */
158 String get uri; 164 String get uri;
159
160 /**
161 * URI for the compilation units listed in the library's `part` declarations.
162 * These URIs are relative to the importing library.
163 */
164 List<String> get parts;
165 } 165 }
166 166
167 /** 167 /**
168 * 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
169 * is not in the public namespace. 169 * is not in the public namespace.
170 */ 170 */
171 abstract class LinkedExportName extends base.SummaryClass { 171 abstract class LinkedExportName extends base.SummaryClass {
172 /** 172 /**
173 * Index into [LinkedLibrary.dependencies] for the library in which the
174 * entity is defined.
175 */
176 int get dependency;
177
178 /**
179 * The kind of the entity being referred to.
180 */
181 ReferenceKind get kind;
182
183 /**
173 * Name of the exported entity. For an exported setter, this name includes 184 * Name of the exported entity. For an exported setter, this name includes
174 * the trailing '='. 185 * the trailing '='.
175 */ 186 */
176 String get name; 187 String get name;
177 188
178 /** 189 /**
179 * Index into [LinkedLibrary.dependencies] for the library in which the
180 * entity is defined.
181 */
182 int get dependency;
183
184 /**
185 * Integer index indicating which unit in the exported library contains the 190 * Integer index indicating which unit in the exported library contains the
186 * definition of the entity. As with indices into [LinkedLibrary.units], 191 * definition of the entity. As with indices into [LinkedLibrary.units],
187 * zero represents the defining compilation unit, and nonzero values 192 * zero represents the defining compilation unit, and nonzero values
188 * represent parts in the order of the corresponding `part` declarations. 193 * represent parts in the order of the corresponding `part` declarations.
189 */ 194 */
190 int get unit; 195 int get unit;
191
192 /**
193 * The kind of the entity being referred to.
194 */
195 ReferenceKind get kind;
196 } 196 }
197 197
198 /** 198 /**
199 * Linked summary of a library. 199 * Linked summary of a library.
200 */ 200 */
201 @topLevel 201 @topLevel
202 abstract class LinkedLibrary extends base.SummaryClass { 202 abstract class LinkedLibrary extends base.SummaryClass {
203 factory LinkedLibrary.fromBuffer(List<int> buffer) => 203 factory LinkedLibrary.fromBuffer(List<int> buffer) =>
204 generated.readLinkedLibrary(buffer); 204 generated.readLinkedLibrary(buffer);
205 205
206 /** 206 /**
207 * The linked summary of all the compilation units constituting the
208 * library. The summary of the defining compilation unit is listed first,
209 * followed by the summary of each part, in the order of the `part`
210 * declarations in the defining compilation unit.
211 */
212 List<LinkedUnit> get units;
213
214 /**
215 * The libraries that this library depends on (either via an explicit import 207 * The libraries that this library depends on (either via an explicit import
216 * statement or via the implicit dependencies on `dart:core` and 208 * statement or via the implicit dependencies on `dart:core` and
217 * `dart:async`). The first element of this array is a pseudo-dependency 209 * `dart:async`). The first element of this array is a pseudo-dependency
218 * representing the library itself (it is also used for `dynamic` and 210 * representing the library itself (it is also used for `dynamic` and
219 * `void`). This is followed by elements representing "prelinked" 211 * `void`). This is followed by elements representing "prelinked"
220 * dependencies (direct imports and the transitive closure of exports). 212 * dependencies (direct imports and the transitive closure of exports).
221 * After the prelinked dependencies are elements representing "linked" 213 * After the prelinked dependencies are elements representing "linked"
222 * dependencies. 214 * dependencies.
223 * 215 *
224 * A library is only included as a "linked" dependency if it is a true 216 * A library is only included as a "linked" dependency if it is a true
225 * dependency (e.g. a propagated or inferred type or constant value 217 * dependency (e.g. a propagated or inferred type or constant value
226 * implicitly refers to an element declared in the library) or 218 * implicitly refers to an element declared in the library) or
227 * anti-dependency (e.g. the result of type propagation or type inference 219 * anti-dependency (e.g. the result of type propagation or type inference
228 * depends on the lack of a certain declaration in the library). 220 * depends on the lack of a certain declaration in the library).
229 */ 221 */
230 List<LinkedDependency> get dependencies; 222 List<LinkedDependency> get dependencies;
231 223
232 /** 224 /**
233 * For each import in [UnlinkedUnit.imports], an index into [dependencies]
234 * of the library being imported.
235 */
236 List<int> get importDependencies;
237
238 /**
239 * 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
240 * 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
241 * brought into the namespace via `export` directives). 227 * brought into the namespace via `export` directives).
242 * 228 *
243 * Sorted by name. 229 * Sorted by name.
244 */ 230 */
245 List<LinkedExportName> get exportNames; 231 List<LinkedExportName> get exportNames;
246 232
247 /** 233 /**
234 * For each import in [UnlinkedUnit.imports], an index into [dependencies]
235 * of the library being imported.
236 */
237 List<int> get importDependencies;
238
239 /**
248 * The number of elements in [dependencies] which are not "linked" 240 * The number of elements in [dependencies] which are not "linked"
249 * dependencies (that is, the number of libraries in the direct imports plus 241 * dependencies (that is, the number of libraries in the direct imports plus
250 * the transitive closure of exports, plus the library itself). 242 * the transitive closure of exports, plus the library itself).
251 */ 243 */
252 int get numPrelinkedDependencies; 244 int get numPrelinkedDependencies;
245
246 /**
247 * The linked summary of all the compilation units constituting the
248 * library. The summary of the defining compilation unit is listed first,
249 * followed by the summary of each part, in the order of the `part`
250 * declarations in the defining compilation unit.
251 */
252 List<LinkedUnit> get units;
253 } 253 }
254 254
255 /** 255 /**
256 * Information about the resolution of an [UnlinkedReference]. 256 * Information about the resolution of an [UnlinkedReference].
257 */ 257 */
258 abstract class LinkedReference extends base.SummaryClass { 258 abstract class LinkedReference extends base.SummaryClass {
259 /** 259 /**
260 * If this [LinkedReference] doesn't have an associated [UnlinkedReference],
261 * and the entity being referred to is contained within another entity, index
262 * of the containing entity. This behaves similarly to
263 * [UnlinkedReference.prefixReference], however it is only used for class
264 * members, not for prefixed imports.
265 *
266 * Containing references must always point backward; that is, for all i, if
267 * LinkedUnit.references[i].containingReference != 0, then
268 * LinkedUnit.references[i].containingReference < i.
269 */
270 int get containingReference;
271
272 /**
260 * Index into [LinkedLibrary.dependencies] indicating which imported library 273 * Index into [LinkedLibrary.dependencies] indicating which imported library
261 * declares the entity being referred to. 274 * declares the entity being referred to.
262 * 275 *
263 * Zero if this entity is contained within another entity (e.g. a class 276 * Zero if this entity is contained within another entity (e.g. a class
264 * member), or if [kind] is [ReferenceKind.prefix]. 277 * member), or if [kind] is [ReferenceKind.prefix].
265 */ 278 */
266 int get dependency; 279 int get dependency;
267 280
268 /** 281 /**
269 * The kind of the entity being referred to. For the pseudo-types `dynamic` 282 * The kind of the entity being referred to. For the pseudo-types `dynamic`
270 * and `void`, the kind is [ReferenceKind.classOrEnum]. 283 * and `void`, the kind is [ReferenceKind.classOrEnum].
271 */ 284 */
272 ReferenceKind get kind; 285 ReferenceKind get kind;
273 286
274 /** 287 /**
275 * Integer index indicating which unit in the imported library contains the 288 * If this [LinkedReference] doesn't have an associated [UnlinkedReference],
276 * definition of the entity. As with indices into [LinkedLibrary.units], 289 * name of the entity being referred to. For the pseudo-type `dynamic`, the
277 * zero represents the defining compilation unit, and nonzero values 290 * string is "dynamic". For the pseudo-type `void`, the string is "void".
278 * represent parts in the order of the corresponding `part` declarations.
279 *
280 * Zero if this entity is contained within another entity (e.g. a class
281 * member).
282 */ 291 */
283 int get unit; 292 String get name;
284 293
285 /** 294 /**
286 * If the entity being referred to is generic, the number of type parameters 295 * If the entity being referred to is generic, the number of type parameters
287 * it accepts. Otherwise zero. 296 * it accepts. Otherwise zero.
288 */ 297 */
289 int get numTypeParameters; 298 int get numTypeParameters;
290 299
291 /** 300 /**
292 * If this [LinkedReference] doesn't have an associated [UnlinkedReference], 301 * Integer index indicating which unit in the imported library contains the
293 * name of the entity being referred to. For the pseudo-type `dynamic`, the 302 * definition of the entity. As with indices into [LinkedLibrary.units],
294 * string is "dynamic". For the pseudo-type `void`, the string is "void". 303 * zero represents the defining compilation unit, and nonzero values
304 * represent parts in the order of the corresponding `part` declarations.
305 *
306 * Zero if this entity is contained within another entity (e.g. a class
307 * member).
295 */ 308 */
296 String get name; 309 int get unit;
297
298 /**
299 * If this [LinkedReference] doesn't have an associated [UnlinkedReference],
300 * and the entity being referred to is contained within another entity, index
301 * of the containing entity. This behaves similarly to
302 * [UnlinkedReference.prefixReference], however it is only used for class
303 * members, not for prefixed imports.
304 *
305 * Containing references must always point backward; that is, for all i, if
306 * LinkedUnit.references[i].containingReference != 0, then
307 * LinkedUnit.references[i].containingReference < i.
308 */
309 int get containingReference;
310 } 310 }
311 311
312 /** 312 /**
313 * Linked summary of a compilation unit. 313 * Linked summary of a compilation unit.
314 */ 314 */
315 abstract class LinkedUnit extends base.SummaryClass { 315 abstract class LinkedUnit extends base.SummaryClass {
316 /** 316 /**
317 * Information about the resolution of references within the compilation 317 * Information about the resolution of references within the compilation
318 * unit. Each element of [UnlinkedUnit.references] has a corresponding 318 * unit. Each element of [UnlinkedUnit.references] has a corresponding
319 * 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
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 390
391 /** 391 /**
392 * Information about SDK. 392 * Information about SDK.
393 */ 393 */
394 @topLevel 394 @topLevel
395 abstract class SdkBundle extends base.SummaryClass { 395 abstract class SdkBundle extends base.SummaryClass {
396 factory SdkBundle.fromBuffer(List<int> buffer) => 396 factory SdkBundle.fromBuffer(List<int> buffer) =>
397 generated.readSdkBundle(buffer); 397 generated.readSdkBundle(buffer);
398 398
399 /** 399 /**
400 * Linked libraries.
401 */
402 List<LinkedLibrary> get linkedLibraries;
403
404 /**
400 * The list of URIs of items in [linkedLibraries], e.g. `dart:core`. 405 * The list of URIs of items in [linkedLibraries], e.g. `dart:core`.
401 */ 406 */
402 List<String> get linkedLibraryUris; 407 List<String> get linkedLibraryUris;
403 408
404 /** 409 /**
405 * Linked libraries. 410 * Unlinked information for the compilation units constituting the SDK.
406 */ 411 */
407 List<LinkedLibrary> get linkedLibraries; 412 List<UnlinkedUnit> get unlinkedUnits;
408 413
409 /** 414 /**
410 * The list of URIs of items in [unlinkedUnits], e.g. `dart:core/bool.dart`. 415 * The list of URIs of items in [unlinkedUnits], e.g. `dart:core/bool.dart`.
411 */ 416 */
412 List<String> get unlinkedUnitUris; 417 List<String> get unlinkedUnitUris;
413
414 /**
415 * Unlinked information for the compilation units constituting the SDK.
416 */
417 List<UnlinkedUnit> get unlinkedUnits;
418 } 418 }
419 419
420 /** 420 /**
421 * Unlinked summary information about a class declaration. 421 * Unlinked summary information about a class declaration.
422 */ 422 */
423 abstract class UnlinkedClass extends base.SummaryClass { 423 abstract class UnlinkedClass extends base.SummaryClass {
424 /** 424 /**
425 * Name of the class. 425 * Annotations for this class.
426 */ 426 */
427 String get name; 427 List<UnlinkedConst> get annotations;
428
429 /**
430 * Offset of the class name relative to the beginning of the file.
431 */
432 @informative
433 int get nameOffset;
434 428
435 /** 429 /**
436 * Documentation comment for the class, or `null` if there is no 430 * Documentation comment for the class, or `null` if there is no
437 * documentation comment. 431 * documentation comment.
438 */ 432 */
439 @informative 433 @informative
440 UnlinkedDocumentationComment get documentationComment; 434 UnlinkedDocumentationComment get documentationComment;
441 435
442 /** 436 /**
443 * Annotations for this class. 437 * Executable objects (methods, getters, and setters) contained in the class.
444 */ 438 */
445 List<UnlinkedConst> get annotations; 439 List<UnlinkedExecutable> get executables;
446
447 /**
448 * Type parameters of the class, if any.
449 */
450 List<UnlinkedTypeParam> get typeParameters;
451
452 /**
453 * Supertype of the class, or `null` if either (a) the class doesn't
454 * explicitly declare a supertype (and hence has supertype `Object`), or (b)
455 * the class *is* `Object` (and hence has no supertype).
456 */
457 EntityRef get supertype;
458
459 /**
460 * Mixins appearing in a `with` clause, if any.
461 */
462 List<EntityRef> get mixins;
463
464 /**
465 * Interfaces appearing in an `implements` clause, if any.
466 */
467 List<EntityRef> get interfaces;
468 440
469 /** 441 /**
470 * Field declarations contained in the class. 442 * Field declarations contained in the class.
471 */ 443 */
472 List<UnlinkedVariable> get fields; 444 List<UnlinkedVariable> get fields;
473 445
474 /** 446 /**
475 * Executable objects (methods, getters, and setters) contained in the class. 447 * Indicates whether this class is the core "Object" class (and hence has no
448 * supertype)
476 */ 449 */
477 List<UnlinkedExecutable> get executables; 450 bool get hasNoSupertype;
451
452 /**
453 * Interfaces appearing in an `implements` clause, if any.
454 */
455 List<EntityRef> get interfaces;
478 456
479 /** 457 /**
480 * Indicates whether the class is declared with the `abstract` keyword. 458 * Indicates whether the class is declared with the `abstract` keyword.
481 */ 459 */
482 bool get isAbstract; 460 bool get isAbstract;
483 461
484 /** 462 /**
485 * Indicates whether the class is declared using mixin application syntax. 463 * Indicates whether the class is declared using mixin application syntax.
486 */ 464 */
487 bool get isMixinApplication; 465 bool get isMixinApplication;
488 466
489 /** 467 /**
490 * Indicates whether this class is the core "Object" class (and hence has no 468 * Mixins appearing in a `with` clause, if any.
491 * supertype)
492 */ 469 */
493 bool get hasNoSupertype; 470 List<EntityRef> get mixins;
471
472 /**
473 * Name of the class.
474 */
475 String get name;
476
477 /**
478 * Offset of the class name relative to the beginning of the file.
479 */
480 @informative
481 int get nameOffset;
482
483 /**
484 * Supertype of the class, or `null` if either (a) the class doesn't
485 * explicitly declare a supertype (and hence has supertype `Object`), or (b)
486 * the class *is* `Object` (and hence has no supertype).
487 */
488 EntityRef get supertype;
489
490 /**
491 * Type parameters of the class, if any.
492 */
493 List<UnlinkedTypeParam> get typeParameters;
494 } 494 }
495 495
496 /** 496 /**
497 * Unlinked summary information about a `show` or `hide` combinator in an 497 * Unlinked summary information about a `show` or `hide` combinator in an
498 * import or export declaration. 498 * import or export declaration.
499 */ 499 */
500 abstract class UnlinkedCombinator extends base.SummaryClass { 500 abstract class UnlinkedCombinator extends base.SummaryClass {
501 /** 501 /**
502 * List of names which are hidden. Empty if this is a `show` combinator.
503 */
504 List<String> get hides;
505
506 /**
502 * List of names which are shown. Empty if this is a `hide` combinator. 507 * List of names which are shown. Empty if this is a `hide` combinator.
503 */ 508 */
504 List<String> get shows; 509 List<String> get shows;
505
506 /**
507 * List of names which are hidden. Empty if this is a `show` combinator.
508 */
509 List<String> get hides;
510 } 510 }
511 511
512 /** 512 /**
513 * Unlinked summary information about a compile-time constant expression, or a 513 * Unlinked summary information about a compile-time constant expression, or a
514 * potentially constant expression. 514 * potentially constant expression.
515 * 515 *
516 * Constant expressions are represented using a simple stack-based language 516 * Constant expressions are represented using a simple stack-based language
517 * where [operations] is a sequence of operations to execute starting with an 517 * where [operations] is a sequence of operations to execute starting with an
518 * empty stack. Once all operations have been executed, the stack should 518 * empty stack. Once all operations have been executed, the stack should
519 * contain a single value which is the value of the constant. Note that some 519 * contain a single value which is the value of the constant. Note that some
520 * operations consume additional data from the other fields of this class. 520 * operations consume additional data from the other fields of this class.
521 */ 521 */
522 abstract class UnlinkedConst extends base.SummaryClass { 522 abstract class UnlinkedConst extends base.SummaryClass {
523 /** 523 /**
524 * Indicates whether the expression is not a valid potentially constant 524 * Sequence of 64-bit doubles consumed by the operation `pushDouble`.
525 * expression.
526 */ 525 */
527 bool get isInvalid; 526 List<double> get doubles;
528
529 /**
530 * Sequence of operations to execute (starting with an empty stack) to form
531 * the constant value.
532 */
533 List<UnlinkedConstOperation> get operations;
534 527
535 /** 528 /**
536 * Sequence of unsigned 32-bit integers consumed by the operations 529 * Sequence of unsigned 32-bit integers consumed by the operations
537 * `pushArgument`, `pushInt`, `shiftOr`, `concatenate`, `invokeConstructor`, 530 * `pushArgument`, `pushInt`, `shiftOr`, `concatenate`, `invokeConstructor`,
538 * `makeList`, and `makeMap`. 531 * `makeList`, and `makeMap`.
539 */ 532 */
540 List<int> get ints; 533 List<int> get ints;
541 534
542 /** 535 /**
543 * Sequence of 64-bit doubles consumed by the operation `pushDouble`. 536 * Indicates whether the expression is not a valid potentially constant
537 * expression.
544 */ 538 */
545 List<double> get doubles; 539 bool get isInvalid;
546 540
547 /** 541 /**
548 * Sequence of strings consumed by the operations `pushString` and 542 * Sequence of operations to execute (starting with an empty stack) to form
549 * `invokeConstructor`. 543 * the constant value.
550 */ 544 */
551 List<String> get strings; 545 List<UnlinkedConstOperation> get operations;
552 546
553 /** 547 /**
554 * Sequence of language constructs consumed by the operations 548 * Sequence of language constructs consumed by the operations
555 * `pushReference`, `invokeConstructor`, `makeList`, and `makeMap`. Note 549 * `pushReference`, `invokeConstructor`, `makeList`, and `makeMap`. Note
556 * that in the case of `pushReference` (and sometimes `invokeConstructor` the 550 * that in the case of `pushReference` (and sometimes `invokeConstructor` the
557 * actual entity being referred to may be something other than a type. 551 * actual entity being referred to may be something other than a type.
558 */ 552 */
559 List<EntityRef> get references; 553 List<EntityRef> get references;
554
555 /**
556 * Sequence of strings consumed by the operations `pushString` and
557 * `invokeConstructor`.
558 */
559 List<String> get strings;
560 } 560 }
561 561
562 /** 562 /**
563 * Enum representing the various kinds of operations which may be performed to 563 * Enum representing the various kinds of operations which may be performed to
564 * produce a constant value. These options are assumed to execute in the 564 * produce a constant value. These options are assumed to execute in the
565 * context of a stack which is initially empty. 565 * context of a stack which is initially empty.
566 */ 566 */
567 enum UnlinkedConstOperation { 567 enum UnlinkedConstOperation {
568 /** 568 /**
569 * Push the next value from [UnlinkedConst.ints] (a 32-bit unsigned integer) 569 * Push the next value from [UnlinkedConst.ints] (a 32-bit unsigned integer)
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 * back onto the stack. 847 * back onto the stack.
848 */ 848 */
849 length, 849 length,
850 } 850 }
851 851
852 /** 852 /**
853 * Unlinked summary information about a constructor initializer. 853 * Unlinked summary information about a constructor initializer.
854 */ 854 */
855 abstract class UnlinkedConstructorInitializer extends base.SummaryClass { 855 abstract class UnlinkedConstructorInitializer extends base.SummaryClass {
856 /** 856 /**
857 * If [kind] is `thisInvocation` or `superInvocation`, the arguments of the
858 * invocation. Otherwise empty.
859 */
860 List<UnlinkedConst> get arguments;
861
862 /**
863 * If [kind] is `field`, the expression of the field initializer.
864 * Otherwise `null`.
865 */
866 UnlinkedConst get expression;
867
868 /**
857 * The kind of the constructor initializer (field, redirect, super). 869 * The kind of the constructor initializer (field, redirect, super).
858 */ 870 */
859 UnlinkedConstructorInitializerKind get kind; 871 UnlinkedConstructorInitializerKind get kind;
860 872
861 /** 873 /**
862 * If [kind] is `field`, the name of the field declared in the class. If 874 * If [kind] is `field`, the name of the field declared in the class. If
863 * [kind] is `thisInvocation`, the name of the constructor, declared in this 875 * [kind] is `thisInvocation`, the name of the constructor, declared in this
864 * class, to redirect to. If [kind] is `superInvocation`, the name of the 876 * class, to redirect to. If [kind] is `superInvocation`, the name of the
865 * constructor, declared in the superclass, to invoke. 877 * constructor, declared in the superclass, to invoke.
866 */ 878 */
867 String get name; 879 String get name;
868
869 /**
870 * If [kind] is `field`, the expression of the field initializer.
871 * Otherwise `null`.
872 */
873 UnlinkedConst get expression;
874
875 /**
876 * If [kind] is `thisInvocation` or `superInvocation`, the arguments of the
877 * invocation. Otherwise empty.
878 */
879 List<UnlinkedConst> get arguments;
880 } 880 }
881 881
882 /** 882 /**
883 * Enum used to indicate the kind of an constructor initializer. 883 * Enum used to indicate the kind of an constructor initializer.
884 */ 884 */
885 enum UnlinkedConstructorInitializerKind { 885 enum UnlinkedConstructorInitializerKind {
886 /** 886 /**
887 * Initialization of a field. 887 * Initialization of a field.
888 */ 888 */
889 field, 889 field,
890 890
891 /** 891 /**
892 * Invocation of a constructor in the same class. 892 * Invocation of a constructor in the same class.
893 */ 893 */
894 thisInvocation, 894 thisInvocation,
895 895
896 /** 896 /**
897 * Invocation of a superclass' constructor. 897 * Invocation of a superclass' constructor.
898 */ 898 */
899 superInvocation 899 superInvocation
900 } 900 }
901 901
902 /** 902 /**
903 * Unlinked summary information about a documentation comment. 903 * Unlinked summary information about a documentation comment.
904 */ 904 */
905 abstract class UnlinkedDocumentationComment extends base.SummaryClass { 905 abstract class UnlinkedDocumentationComment extends base.SummaryClass {
906 /** 906 /**
907 * Text of the documentation comment, with '\r\n' replaced by '\n'. 907 * Length of the documentation comment (prior to replacing '\r\n' with '\n').
908 *
909 * References appearing within the doc comment in square brackets are not
910 * specially encoded.
911 */ 908 */
912 String get text; 909 int get length;
913 910
914 /** 911 /**
915 * Offset of the beginning of the documentation comment relative to the 912 * Offset of the beginning of the documentation comment relative to the
916 * beginning of the file. 913 * beginning of the file.
917 */ 914 */
918 int get offset; 915 int get offset;
919 916
920 /** 917 /**
921 * Length of the documentation comment (prior to replacing '\r\n' with '\n'). 918 * Text of the documentation comment, with '\r\n' replaced by '\n'.
919 *
920 * References appearing within the doc comment in square brackets are not
921 * specially encoded.
922 */ 922 */
923 int get length; 923 String get text;
924 } 924 }
925 925
926 /** 926 /**
927 * Unlinked summary information about an enum declaration. 927 * Unlinked summary information about an enum declaration.
928 */ 928 */
929 abstract class UnlinkedEnum extends base.SummaryClass { 929 abstract class UnlinkedEnum extends base.SummaryClass {
930 /** 930 /**
931 * Name of the enum type. 931 * Annotations for this enum.
932 */ 932 */
933 String get name; 933 List<UnlinkedConst> get annotations;
934
935 /**
936 * Offset of the enum name relative to the beginning of the file.
937 */
938 @informative
939 int get nameOffset;
940 934
941 /** 935 /**
942 * Documentation comment for the enum, or `null` if there is no documentation 936 * Documentation comment for the enum, or `null` if there is no documentation
943 * comment. 937 * comment.
944 */ 938 */
945 @informative 939 @informative
946 UnlinkedDocumentationComment get documentationComment; 940 UnlinkedDocumentationComment get documentationComment;
947 941
948 /** 942 /**
949 * Annotations for this enum. 943 * Name of the enum type.
950 */ 944 */
951 List<UnlinkedConst> get annotations; 945 String get name;
946
947 /**
948 * Offset of the enum name relative to the beginning of the file.
949 */
950 @informative
951 int get nameOffset;
952 952
953 /** 953 /**
954 * Values listed in the enum declaration, in declaration order. 954 * Values listed in the enum declaration, in declaration order.
955 */ 955 */
956 List<UnlinkedEnumValue> get values; 956 List<UnlinkedEnumValue> get values;
957 } 957 }
958 958
959 /** 959 /**
960 * Unlinked summary information about a single enumerated value in an enum 960 * Unlinked summary information about a single enumerated value in an enum
961 * declaration. 961 * declaration.
962 */ 962 */
963 abstract class UnlinkedEnumValue extends base.SummaryClass { 963 abstract class UnlinkedEnumValue extends base.SummaryClass {
964 /** 964 /**
965 * Documentation comment for the enum value, or `null` if there is no
966 * documentation comment.
967 */
968 @informative
969 UnlinkedDocumentationComment get documentationComment;
970
971 /**
965 * Name of the enumerated value. 972 * Name of the enumerated value.
966 */ 973 */
967 String get name; 974 String get name;
968 975
969 /** 976 /**
970 * Offset of the enum value name relative to the beginning of the file. 977 * Offset of the enum value name relative to the beginning of the file.
971 */ 978 */
972 @informative 979 @informative
973 int get nameOffset; 980 int get nameOffset;
974
975 /**
976 * Documentation comment for the enum value, or `null` if there is no
977 * documentation comment.
978 */
979 @informative
980 UnlinkedDocumentationComment get documentationComment;
981 } 981 }
982 982
983 /** 983 /**
984 * Unlinked summary information about a function, method, getter, or setter 984 * Unlinked summary information about a function, method, getter, or setter
985 * declaration. 985 * declaration.
986 */ 986 */
987 abstract class UnlinkedExecutable extends base.SummaryClass { 987 abstract class UnlinkedExecutable extends base.SummaryClass {
988 /** 988 /**
989 * Name of the executable. For setters, this includes the trailing "=". For 989 * Annotations for this executable.
990 * named constructors, this excludes the class name and excludes the ".".
991 * For unnamed constructors, this is the empty string.
992 */ 990 */
993 String get name; 991 List<UnlinkedConst> get annotations;
994 992
995 /** 993 /**
996 * Offset of the executable name relative to the beginning of the file. For 994 * If a constant [UnlinkedExecutableKind.constructor], the constructor
997 * named constructors, this excludes the class name and excludes the ".". 995 * initializers. Otherwise empty.
998 * For unnamed constructors, this is the offset of the class name (i.e. the
999 * offset of the second "C" in "class C { C(); }").
1000 */ 996 */
1001 @informative 997 List<UnlinkedConstructorInitializer> get constantInitializers;
1002 int get nameOffset;
1003 998
1004 /** 999 /**
1005 * Documentation comment for the executable, or `null` if there is no 1000 * Documentation comment for the executable, or `null` if there is no
1006 * documentation comment. 1001 * documentation comment.
1007 */ 1002 */
1008 @informative 1003 @informative
1009 UnlinkedDocumentationComment get documentationComment; 1004 UnlinkedDocumentationComment get documentationComment;
1010 1005
1011 /** 1006 /**
1012 * Annotations for this executable. 1007 * If this executable's return type is inferable, nonzero slot id
1008 * identifying which entry in [LinkedUnit.types] contains the inferred
1009 * return type. If there is no matching entry in [LinkedUnit.types], then
1010 * no return type was inferred for this variable, so its static type is
1011 * `dynamic`.
1013 */ 1012 */
1014 List<UnlinkedConst> get annotations; 1013 int get inferredReturnTypeSlot;
1015
1016 /**
1017 * Type parameters of the executable, if any. Empty if support for generic
1018 * method syntax is disabled.
1019 */
1020 List<UnlinkedTypeParam> get typeParameters;
1021
1022 /**
1023 * Declared return type of the executable. Absent if the executable is a
1024 * constructor or the return type is implicit.
1025 */
1026 EntityRef get returnType;
1027
1028 /**
1029 * Parameters of the executable, if any. Note that getters have no
1030 * parameters (hence this will be the empty list), and setters have a single
1031 * parameter.
1032 */
1033 List<UnlinkedParam> get parameters;
1034
1035 /**
1036 * The kind of the executable (function/method, getter, setter, or
1037 * constructor).
1038 */
1039 UnlinkedExecutableKind get kind;
1040 1014
1041 /** 1015 /**
1042 * Indicates whether the executable is declared using the `abstract` keyword. 1016 * Indicates whether the executable is declared using the `abstract` keyword.
1043 */ 1017 */
1044 bool get isAbstract; 1018 bool get isAbstract;
1045 1019
1046 /** 1020 /**
1021 * Indicates whether the executable is declared using the `const` keyword.
1022 */
1023 bool get isConst;
1024
1025 /**
1026 * Indicates whether the executable is declared using the `external` keyword.
1027 */
1028 bool get isExternal;
1029
1030 /**
1031 * Indicates whether the executable is declared using the `factory` keyword.
1032 */
1033 bool get isFactory;
1034
1035 /**
1047 * Indicates whether the executable is declared using the `static` keyword. 1036 * Indicates whether the executable is declared using the `static` keyword.
1048 * 1037 *
1049 * Note that for top level executables, this flag is false, since they are 1038 * Note that for top level executables, this flag is false, since they are
1050 * not declared using the `static` keyword (even though they are considered 1039 * not declared using the `static` keyword (even though they are considered
1051 * static for semantic purposes). 1040 * static for semantic purposes).
1052 */ 1041 */
1053 bool get isStatic; 1042 bool get isStatic;
1054 1043
1055 /** 1044 /**
1056 * Indicates whether the executable is declared using the `const` keyword. 1045 * The kind of the executable (function/method, getter, setter, or
1046 * constructor).
1057 */ 1047 */
1058 bool get isConst; 1048 UnlinkedExecutableKind get kind;
1059 1049
1060 /** 1050 /**
1061 * Indicates whether the executable is declared using the `factory` keyword. 1051 * Name of the executable. For setters, this includes the trailing "=". For
1052 * named constructors, this excludes the class name and excludes the ".".
1053 * For unnamed constructors, this is the empty string.
1062 */ 1054 */
1063 bool get isFactory; 1055 String get name;
1064 1056
1065 /** 1057 /**
1066 * Indicates whether the executable is declared using the `external` keyword. 1058 * Offset of the executable name relative to the beginning of the file. For
1059 * named constructors, this excludes the class name and excludes the ".".
1060 * For unnamed constructors, this is the offset of the class name (i.e. the
1061 * offset of the second "C" in "class C { C(); }").
1067 */ 1062 */
1068 bool get isExternal; 1063 @informative
1064 int get nameOffset;
1069 1065
1070 /** 1066 /**
1071 * If this executable's return type is inferable, nonzero slot id 1067 * Parameters of the executable, if any. Note that getters have no
1072 * identifying which entry in [LinkedUnit.types] contains the inferred 1068 * parameters (hence this will be the empty list), and setters have a single
1073 * return type. If there is no matching entry in [LinkedUnit.types], then 1069 * parameter.
1074 * no return type was inferred for this variable, so its static type is
1075 * `dynamic`.
1076 */ 1070 */
1077 int get inferredReturnTypeSlot; 1071 List<UnlinkedParam> get parameters;
1078 1072
1079 /** 1073 /**
1080 * If a constant [UnlinkedExecutableKind.constructor], the constructor 1074 * Declared return type of the executable. Absent if the executable is a
1081 * initializers. Otherwise empty. 1075 * constructor or the return type is implicit.
1082 */ 1076 */
1083 List<UnlinkedConstructorInitializer> get constantInitializers; 1077 EntityRef get returnType;
1078
1079 /**
1080 * Type parameters of the executable, if any. Empty if support for generic
1081 * method syntax is disabled.
1082 */
1083 List<UnlinkedTypeParam> get typeParameters;
1084 } 1084 }
1085 1085
1086 /** 1086 /**
1087 * Enum used to indicate the kind of an executable. 1087 * Enum used to indicate the kind of an executable.
1088 */ 1088 */
1089 enum UnlinkedExecutableKind { 1089 enum UnlinkedExecutableKind {
1090 /** 1090 /**
1091 * Executable is a function or method. 1091 * Executable is a function or method.
1092 */ 1092 */
1093 functionOrMethod, 1093 functionOrMethod,
(...skipping 13 matching lines...) Expand all
1107 */ 1107 */
1108 constructor 1108 constructor
1109 } 1109 }
1110 1110
1111 /** 1111 /**
1112 * Unlinked summary information about an export declaration (stored outside 1112 * Unlinked summary information about an export declaration (stored outside
1113 * [UnlinkedPublicNamespace]). 1113 * [UnlinkedPublicNamespace]).
1114 */ 1114 */
1115 abstract class UnlinkedExportNonPublic extends base.SummaryClass { 1115 abstract class UnlinkedExportNonPublic extends base.SummaryClass {
1116 /** 1116 /**
1117 * Annotations for this export directive.
1118 */
1119 List<UnlinkedConst> get annotations;
1120
1121 /**
1117 * Offset of the "export" keyword. 1122 * Offset of the "export" keyword.
1118 */ 1123 */
1119 @informative 1124 @informative
1120 int get offset; 1125 int get offset;
1121 1126
1122 /** 1127 /**
1123 * Offset of the URI string (including quotes) relative to the beginning of
1124 * the file.
1125 */
1126 @informative
1127 int get uriOffset;
1128
1129 /**
1130 * End of the URI string (including quotes) relative to the beginning of the 1128 * End of the URI string (including quotes) relative to the beginning of the
1131 * file. 1129 * file.
1132 */ 1130 */
1133 @informative 1131 @informative
1134 int get uriEnd; 1132 int get uriEnd;
1135 1133
1136 /** 1134 /**
1137 * Annotations for this export directive. 1135 * Offset of the URI string (including quotes) relative to the beginning of
1136 * the file.
1138 */ 1137 */
1139 List<UnlinkedConst> get annotations; 1138 @informative
1139 int get uriOffset;
1140 } 1140 }
1141 1141
1142 /** 1142 /**
1143 * Unlinked summary information about an export declaration (stored inside 1143 * Unlinked summary information about an export declaration (stored inside
1144 * [UnlinkedPublicNamespace]). 1144 * [UnlinkedPublicNamespace]).
1145 */ 1145 */
1146 abstract class UnlinkedExportPublic extends base.SummaryClass { 1146 abstract class UnlinkedExportPublic extends base.SummaryClass {
1147 /** 1147 /**
1148 * Combinators contained in this import declaration.
1149 */
1150 List<UnlinkedCombinator> get combinators;
1151
1152 /**
1148 * URI used in the source code to reference the exported library. 1153 * URI used in the source code to reference the exported library.
1149 */ 1154 */
1150 String get uri; 1155 String get uri;
1151
1152 /**
1153 * Combinators contained in this import declaration.
1154 */
1155 List<UnlinkedCombinator> get combinators;
1156 } 1156 }
1157 1157
1158 /** 1158 /**
1159 * Unlinked summary information about an import declaration. 1159 * Unlinked summary information about an import declaration.
1160 */ 1160 */
1161 abstract class UnlinkedImport extends base.SummaryClass { 1161 abstract class UnlinkedImport extends base.SummaryClass {
1162 /** 1162 /**
1163 * URI used in the source code to reference the imported library. 1163 * Annotations for this import declaration.
1164 */ 1164 */
1165 String get uri; 1165 List<UnlinkedConst> get annotations;
1166
1167 /**
1168 * Combinators contained in this import declaration.
1169 */
1170 List<UnlinkedCombinator> get combinators;
1171
1172 /**
1173 * Indicates whether the import declaration uses the `deferred` keyword.
1174 */
1175 bool get isDeferred;
1176
1177 /**
1178 * Indicates whether the import declaration is implicit.
1179 */
1180 bool get isImplicit;
1166 1181
1167 /** 1182 /**
1168 * If [isImplicit] is false, offset of the "import" keyword. If [isImplicit] 1183 * If [isImplicit] is false, offset of the "import" keyword. If [isImplicit]
1169 * is true, zero. 1184 * is true, zero.
1170 */ 1185 */
1171 @informative 1186 @informative
1172 int get offset; 1187 int get offset;
1173 1188
1174 /** 1189 /**
1175 * Annotations for this import declaration. 1190 * Offset of the prefix name relative to the beginning of the file, or zero
1191 * if there is no prefix.
1176 */ 1192 */
1177 List<UnlinkedConst> get annotations; 1193 @informative
1194 int get prefixOffset;
1178 1195
1179 /** 1196 /**
1180 * Index into [UnlinkedUnit.references] of the prefix declared by this 1197 * Index into [UnlinkedUnit.references] of the prefix declared by this
1181 * import declaration, or zero if this import declaration declares no prefix. 1198 * import declaration, or zero if this import declaration declares no prefix.
1182 * 1199 *
1183 * Note that multiple imports can declare the same prefix. 1200 * Note that multiple imports can declare the same prefix.
1184 */ 1201 */
1185 int get prefixReference; 1202 int get prefixReference;
1186 1203
1187 /** 1204 /**
1188 * Combinators contained in this import declaration. 1205 * URI used in the source code to reference the imported library.
1189 */ 1206 */
1190 List<UnlinkedCombinator> get combinators; 1207 String get uri;
1191 1208
1192 /** 1209 /**
1193 * Indicates whether the import declaration uses the `deferred` keyword. 1210 * End of the URI string (including quotes) relative to the beginning of the
1211 * file. If [isImplicit] is true, zero.
1194 */ 1212 */
1195 bool get isDeferred; 1213 @informative
1196 1214 int get uriEnd;
1197 /**
1198 * Indicates whether the import declaration is implicit.
1199 */
1200 bool get isImplicit;
1201 1215
1202 /** 1216 /**
1203 * Offset of the URI string (including quotes) relative to the beginning of 1217 * Offset of the URI string (including quotes) relative to the beginning of
1204 * the file. If [isImplicit] is true, zero. 1218 * the file. If [isImplicit] is true, zero.
1205 */ 1219 */
1206 @informative 1220 @informative
1207 int get uriOffset; 1221 int get uriOffset;
1208
1209 /**
1210 * End of the URI string (including quotes) relative to the beginning of the
1211 * file. If [isImplicit] is true, zero.
1212 */
1213 @informative
1214 int get uriEnd;
1215
1216 /**
1217 * Offset of the prefix name relative to the beginning of the file, or zero
1218 * if there is no prefix.
1219 */
1220 @informative
1221 int get prefixOffset;
1222 } 1222 }
1223 1223
1224 /** 1224 /**
1225 * Unlinked summary information about a function parameter. 1225 * Unlinked summary information about a function parameter.
1226 */ 1226 */
1227 abstract class UnlinkedParam extends base.SummaryClass { 1227 abstract class UnlinkedParam extends base.SummaryClass {
1228 /** 1228 /**
1229 * Name of the parameter.
1230 */
1231 String get name;
1232
1233 /**
1234 * Offset of the parameter name relative to the beginning of the file.
1235 */
1236 @informative
1237 int get nameOffset;
1238
1239 /**
1240 * Annotations for this parameter. 1229 * Annotations for this parameter.
1241 */ 1230 */
1242 List<UnlinkedConst> get annotations; 1231 List<UnlinkedConst> get annotations;
1243 1232
1244 /** 1233 /**
1245 * If [isFunctionTyped] is `true`, the declared return type. If 1234 * If the parameter has a default value, the constant expression in the
1246 * [isFunctionTyped] is `false`, the declared type. Absent if the type is 1235 * default value. Note that the presence of this expression does not mean
1247 * implicit. 1236 * that it is a valid, check [UnlinkedConst.isInvalid].
1248 */ 1237 */
1249 EntityRef get type; 1238 UnlinkedConst get defaultValue;
1250 1239
1251 /** 1240 /**
1252 * If [isFunctionTyped] is `true`, the parameters of the function type. 1241 * If this parameter's type is inferable, nonzero slot id identifying which
1242 * entry in [LinkedLibrary.types] contains the inferred type. If there is no
1243 * matching entry in [LinkedLibrary.types], then no type was inferred for
1244 * this variable, so its static type is `dynamic`.
1245 *
1246 * Note that although strong mode considers initializing formals to be
1247 * inferable, they are not marked as such in the summary; if their type is
1248 * not specified, they always inherit the static type of the corresponding
1249 * field.
1253 */ 1250 */
1254 List<UnlinkedParam> get parameters; 1251 int get inferredTypeSlot;
1252
1253 /**
1254 * Indicates whether this is a function-typed parameter.
1255 */
1256 bool get isFunctionTyped;
1257
1258 /**
1259 * Indicates whether this is an initializing formal parameter (i.e. it is
1260 * declared using `this.` syntax).
1261 */
1262 bool get isInitializingFormal;
1255 1263
1256 /** 1264 /**
1257 * Kind of the parameter. 1265 * Kind of the parameter.
1258 */ 1266 */
1259 UnlinkedParamKind get kind; 1267 UnlinkedParamKind get kind;
1260 1268
1261 /** 1269 /**
1262 * Indicates whether this is a function-typed parameter. 1270 * Name of the parameter.
1263 */ 1271 */
1264 bool get isFunctionTyped; 1272 String get name;
1265 1273
1266 /** 1274 /**
1267 * Indicates whether this is an initializing formal parameter (i.e. it is 1275 * Offset of the parameter name relative to the beginning of the file.
1268 * declared using `this.` syntax).
1269 */ 1276 */
1270 bool get isInitializingFormal; 1277 @informative
1278 int get nameOffset;
1271 1279
1272 /** 1280 /**
1273 * If this parameter's type is inferable, nonzero slot id identifying which 1281 * If [isFunctionTyped] is `true`, the parameters of the function type.
1274 * entry in [LinkedLibrary.types] contains the inferred type. If there is no
1275 * matching entry in [LinkedLibrary.types], then no type was inferred for
1276 * this variable, so its static type is `dynamic`.
1277 *
1278 * Note that although strong mode considers initializing formals to be
1279 * inferable, they are not marked as such in the summary; if their type is
1280 * not specified, they always inherit the static type of the corresponding
1281 * field.
1282 */ 1282 */
1283 int get inferredTypeSlot; 1283 List<UnlinkedParam> get parameters;
1284 1284
1285 /** 1285 /**
1286 * If the parameter has a default value, the constant expression in the 1286 * If [isFunctionTyped] is `true`, the declared return type. If
1287 * default value. Note that the presence of this expression does not mean 1287 * [isFunctionTyped] is `false`, the declared type. Absent if the type is
1288 * that it is a valid, check [UnlinkedConst.isInvalid]. 1288 * implicit.
1289 */ 1289 */
1290 UnlinkedConst get defaultValue; 1290 EntityRef get type;
1291 } 1291 }
1292 1292
1293 /** 1293 /**
1294 * Enum used to indicate the kind of a parameter. 1294 * Enum used to indicate the kind of a parameter.
1295 */ 1295 */
1296 enum UnlinkedParamKind { 1296 enum UnlinkedParamKind {
1297 /** 1297 /**
1298 * Parameter is required. 1298 * Parameter is required.
1299 */ 1299 */
1300 required, 1300 required,
1301 1301
1302 /** 1302 /**
1303 * Parameter is positional optional (enclosed in `[]`) 1303 * Parameter is positional optional (enclosed in `[]`)
1304 */ 1304 */
1305 positional, 1305 positional,
1306 1306
1307 /** 1307 /**
1308 * Parameter is named optional (enclosed in `{}`) 1308 * Parameter is named optional (enclosed in `{}`)
1309 */ 1309 */
1310 named 1310 named
1311 } 1311 }
1312 1312
1313 /** 1313 /**
1314 * Unlinked summary information about a part declaration. 1314 * Unlinked summary information about a part declaration.
1315 */ 1315 */
1316 abstract class UnlinkedPart extends base.SummaryClass { 1316 abstract class UnlinkedPart extends base.SummaryClass {
1317 /** 1317 /**
1318 * Offset of the URI string (including quotes) relative to the beginning of 1318 * Annotations for this part declaration.
1319 * the file.
1320 */ 1319 */
1321 @informative 1320 List<UnlinkedConst> get annotations;
1322 int get uriOffset;
1323 1321
1324 /** 1322 /**
1325 * End of the URI string (including quotes) relative to the beginning of the 1323 * End of the URI string (including quotes) relative to the beginning of the
1326 * file. 1324 * file.
1327 */ 1325 */
1328 @informative 1326 @informative
1329 int get uriEnd; 1327 int get uriEnd;
1330 1328
1331 /** 1329 /**
1332 * Annotations for this part declaration. 1330 * Offset of the URI string (including quotes) relative to the beginning of
1331 * the file.
1333 */ 1332 */
1334 List<UnlinkedConst> get annotations; 1333 @informative
1334 int get uriOffset;
1335 } 1335 }
1336 1336
1337 /** 1337 /**
1338 * Unlinked summary information about a specific name contributed by a 1338 * Unlinked summary information about a specific name contributed by a
1339 * compilation unit to a library's public namespace. 1339 * compilation unit to a library's public namespace.
1340 * 1340 *
1341 * TODO(paulberry): some of this information is redundant with information 1341 * TODO(paulberry): some of this information is redundant with information
1342 * elsewhere in the summary. Consider reducing the redundancy to reduce 1342 * elsewhere in the summary. Consider reducing the redundancy to reduce
1343 * summary size. 1343 * summary size.
1344 */ 1344 */
1345 abstract class UnlinkedPublicName extends base.SummaryClass { 1345 abstract class UnlinkedPublicName extends base.SummaryClass {
1346 /** 1346 /**
1347 * The name itself. 1347 * If this [UnlinkedPublicName] is a class, the list of members which can be
1348 * referenced from constants - static constant fields, static methods, and
1349 * constructors. Otherwise empty.
1348 */ 1350 */
1349 String get name; 1351 List<UnlinkedPublicName> get constMembers;
1350 1352
1351 /** 1353 /**
1352 * The kind of object referred to by the name. 1354 * The kind of object referred to by the name.
1353 */ 1355 */
1354 ReferenceKind get kind; 1356 ReferenceKind get kind;
1355 1357
1356 /** 1358 /**
1359 * The name itself.
1360 */
1361 String get name;
1362
1363 /**
1357 * If the entity being referred to is generic, the number of type parameters 1364 * If the entity being referred to is generic, the number of type parameters
1358 * it accepts. Otherwise zero. 1365 * it accepts. Otherwise zero.
1359 */ 1366 */
1360 int get numTypeParameters; 1367 int get numTypeParameters;
1361
1362 /**
1363 * If this [UnlinkedPublicName] is a class, the list of members which can be
1364 * referenced from constants - static constant fields, static methods, and
1365 * constructors. Otherwise empty.
1366 */
1367 List<UnlinkedPublicName> get constMembers;
1368 } 1368 }
1369 1369
1370 /** 1370 /**
1371 * Unlinked summary information about what a compilation unit contributes to a 1371 * Unlinked summary information about what a compilation unit contributes to a
1372 * library's public namespace. This is the subset of [UnlinkedUnit] that is 1372 * library's public namespace. This is the subset of [UnlinkedUnit] that is
1373 * required from dependent libraries in order to perform prelinking. 1373 * required from dependent libraries in order to perform prelinking.
1374 */ 1374 */
1375 @topLevel 1375 @topLevel
1376 abstract class UnlinkedPublicNamespace extends base.SummaryClass { 1376 abstract class UnlinkedPublicNamespace extends base.SummaryClass {
1377 factory UnlinkedPublicNamespace.fromBuffer(List<int> buffer) => 1377 factory UnlinkedPublicNamespace.fromBuffer(List<int> buffer) =>
1378 generated.readUnlinkedPublicNamespace(buffer); 1378 generated.readUnlinkedPublicNamespace(buffer);
1379 1379
1380 /** 1380 /**
1381 * Export declarations in the compilation unit.
1382 */
1383 List<UnlinkedExportPublic> get exports;
1384
1385 /**
1381 * Public names defined in the compilation unit. 1386 * Public names defined in the compilation unit.
1382 * 1387 *
1383 * TODO(paulberry): consider sorting these names to reduce unnecessary 1388 * TODO(paulberry): consider sorting these names to reduce unnecessary
1384 * relinking. 1389 * relinking.
1385 */ 1390 */
1386 List<UnlinkedPublicName> get names; 1391 List<UnlinkedPublicName> get names;
1387 1392
1388 /** 1393 /**
1389 * Export declarations in the compilation unit.
1390 */
1391 List<UnlinkedExportPublic> get exports;
1392
1393 /**
1394 * URIs referenced by part declarations in the compilation unit. 1394 * URIs referenced by part declarations in the compilation unit.
1395 */ 1395 */
1396 List<String> get parts; 1396 List<String> get parts;
1397 } 1397 }
1398 1398
1399 /** 1399 /**
1400 * Unlinked summary information about a name referred to in one library that 1400 * Unlinked summary information about a name referred to in one library that
1401 * might be defined in another. 1401 * might be defined in another.
1402 */ 1402 */
1403 abstract class UnlinkedReference extends base.SummaryClass { 1403 abstract class UnlinkedReference extends base.SummaryClass {
(...skipping 12 matching lines...) Expand all
1416 * UnlinkedUnit.references[i].prefixReference < i. 1416 * UnlinkedUnit.references[i].prefixReference < i.
1417 */ 1417 */
1418 int get prefixReference; 1418 int get prefixReference;
1419 } 1419 }
1420 1420
1421 /** 1421 /**
1422 * Unlinked summary information about a typedef declaration. 1422 * Unlinked summary information about a typedef declaration.
1423 */ 1423 */
1424 abstract class UnlinkedTypedef extends base.SummaryClass { 1424 abstract class UnlinkedTypedef extends base.SummaryClass {
1425 /** 1425 /**
1426 * Name of the typedef. 1426 * Annotations for this typedef.
1427 */ 1427 */
1428 String get name; 1428 List<UnlinkedConst> get annotations;
1429
1430 /**
1431 * Offset of the typedef name relative to the beginning of the file.
1432 */
1433 @informative
1434 int get nameOffset;
1435 1429
1436 /** 1430 /**
1437 * Documentation comment for the typedef, or `null` if there is no 1431 * Documentation comment for the typedef, or `null` if there is no
1438 * documentation comment. 1432 * documentation comment.
1439 */ 1433 */
1440 @informative 1434 @informative
1441 UnlinkedDocumentationComment get documentationComment; 1435 UnlinkedDocumentationComment get documentationComment;
1442 1436
1443 /** 1437 /**
1444 * Annotations for this typedef. 1438 * Name of the typedef.
1445 */ 1439 */
1446 List<UnlinkedConst> get annotations; 1440 String get name;
1447 1441
1448 /** 1442 /**
1449 * Type parameters of the typedef, if any. 1443 * Offset of the typedef name relative to the beginning of the file.
1450 */ 1444 */
1451 List<UnlinkedTypeParam> get typeParameters; 1445 @informative
1446 int get nameOffset;
1447
1448 /**
1449 * Parameters of the executable, if any.
1450 */
1451 List<UnlinkedParam> get parameters;
1452 1452
1453 /** 1453 /**
1454 * Return type of the typedef. 1454 * Return type of the typedef.
1455 */ 1455 */
1456 EntityRef get returnType; 1456 EntityRef get returnType;
1457 1457
1458 /** 1458 /**
1459 * Parameters of the executable, if any. 1459 * Type parameters of the typedef, if any.
1460 */ 1460 */
1461 List<UnlinkedParam> get parameters; 1461 List<UnlinkedTypeParam> get typeParameters;
1462 } 1462 }
1463 1463
1464 /** 1464 /**
1465 * Unlinked summary information about a type parameter declaration. 1465 * Unlinked summary information about a type parameter declaration.
1466 */ 1466 */
1467 abstract class UnlinkedTypeParam extends base.SummaryClass { 1467 abstract class UnlinkedTypeParam extends base.SummaryClass {
1468 /** 1468 /**
1469 * Annotations for this type parameter.
1470 */
1471 List<UnlinkedConst> get annotations;
1472
1473 /**
1474 * Bound of the type parameter, if a bound is explicitly declared. Otherwise
1475 * null.
1476 */
1477 EntityRef get bound;
1478
1479 /**
1469 * Name of the type parameter. 1480 * Name of the type parameter.
1470 */ 1481 */
1471 String get name; 1482 String get name;
1472 1483
1473 /** 1484 /**
1474 * Offset of the type parameter name relative to the beginning of the file. 1485 * Offset of the type parameter name relative to the beginning of the file.
1475 */ 1486 */
1476 @informative 1487 @informative
1477 int get nameOffset; 1488 int get nameOffset;
1478
1479 /**
1480 * Annotations for this type parameter.
1481 */
1482 List<UnlinkedConst> get annotations;
1483
1484 /**
1485 * Bound of the type parameter, if a bound is explicitly declared. Otherwise
1486 * null.
1487 */
1488 EntityRef get bound;
1489 } 1489 }
1490 1490
1491 /** 1491 /**
1492 * Unlinked summary information about a compilation unit ("part file"). 1492 * Unlinked summary information about a compilation unit ("part file").
1493 */ 1493 */
1494 @topLevel 1494 @topLevel
1495 abstract class UnlinkedUnit extends base.SummaryClass { 1495 abstract class UnlinkedUnit extends base.SummaryClass {
1496 factory UnlinkedUnit.fromBuffer(List<int> buffer) => 1496 factory UnlinkedUnit.fromBuffer(List<int> buffer) =>
1497 generated.readUnlinkedUnit(buffer); 1497 generated.readUnlinkedUnit(buffer);
1498 1498
1499 /** 1499 /**
1500 * Name of the library (from a "library" declaration, if present).
1501 */
1502 String get libraryName;
1503
1504 /**
1505 * Offset of the library name relative to the beginning of the file (or 0 if
1506 * the library has no name).
1507 */
1508 @informative
1509 int get libraryNameOffset;
1510
1511 /**
1512 * Length of the library name as it appears in the source code (or 0 if the
1513 * library has no name).
1514 */
1515 @informative
1516 int get libraryNameLength;
1517
1518 /**
1519 * Documentation comment for the library, or `null` if there is no
1520 * documentation comment.
1521 */
1522 @informative
1523 UnlinkedDocumentationComment get libraryDocumentationComment;
1524
1525 /**
1526 * Annotations for the library declaration, or the empty list if there is no
1527 * library declaration.
1528 */
1529 List<UnlinkedConst> get libraryAnnotations;
1530
1531 /**
1532 * Unlinked public namespace of this compilation unit.
1533 */
1534 UnlinkedPublicNamespace get publicNamespace;
1535
1536 /**
1537 * Top level and prefixed names referred to by this compilation unit. The
1538 * zeroth element of this array is always populated and is used to represent
1539 * the absence of a reference in places where a reference is optional (for
1540 * example [UnlinkedReference.prefixReference or
1541 * UnlinkedImport.prefixReference]).
1542 */
1543 List<UnlinkedReference> get references;
1544
1545 /**
1546 * Classes declared in the compilation unit. 1500 * Classes declared in the compilation unit.
1547 */ 1501 */
1548 List<UnlinkedClass> get classes; 1502 List<UnlinkedClass> get classes;
1549 1503
1550 /** 1504 /**
1551 * Enums declared in the compilation unit. 1505 * Enums declared in the compilation unit.
1552 */ 1506 */
1553 List<UnlinkedEnum> get enums; 1507 List<UnlinkedEnum> get enums;
1554 1508
1555 /** 1509 /**
1556 * Top level executable objects (functions, getters, and setters) declared in 1510 * Top level executable objects (functions, getters, and setters) declared in
1557 * the compilation unit. 1511 * the compilation unit.
1558 */ 1512 */
1559 List<UnlinkedExecutable> get executables; 1513 List<UnlinkedExecutable> get executables;
1560 1514
1561 /** 1515 /**
1562 * Export declarations in the compilation unit. 1516 * Export declarations in the compilation unit.
1563 */ 1517 */
1564 List<UnlinkedExportNonPublic> get exports; 1518 List<UnlinkedExportNonPublic> get exports;
1565 1519
1566 /** 1520 /**
1567 * Import declarations in the compilation unit. 1521 * Import declarations in the compilation unit.
1568 */ 1522 */
1569 List<UnlinkedImport> get imports; 1523 List<UnlinkedImport> get imports;
1570 1524
1571 /** 1525 /**
1526 * Annotations for the library declaration, or the empty list if there is no
1527 * library declaration.
1528 */
1529 List<UnlinkedConst> get libraryAnnotations;
1530
1531 /**
1532 * Documentation comment for the library, or `null` if there is no
1533 * documentation comment.
1534 */
1535 @informative
1536 UnlinkedDocumentationComment get libraryDocumentationComment;
1537
1538 /**
1539 * Name of the library (from a "library" declaration, if present).
1540 */
1541 String get libraryName;
1542
1543 /**
1544 * Length of the library name as it appears in the source code (or 0 if the
1545 * library has no name).
1546 */
1547 @informative
1548 int get libraryNameLength;
1549
1550 /**
1551 * Offset of the library name relative to the beginning of the file (or 0 if
1552 * the library has no name).
1553 */
1554 @informative
1555 int get libraryNameOffset;
1556
1557 /**
1572 * Part declarations in the compilation unit. 1558 * Part declarations in the compilation unit.
1573 */ 1559 */
1574 List<UnlinkedPart> get parts; 1560 List<UnlinkedPart> get parts;
1575 1561
1576 /** 1562 /**
1563 * Unlinked public namespace of this compilation unit.
1564 */
1565 UnlinkedPublicNamespace get publicNamespace;
1566
1567 /**
1568 * Top level and prefixed names referred to by this compilation unit. The
1569 * zeroth element of this array is always populated and is used to represent
1570 * the absence of a reference in places where a reference is optional (for
1571 * example [UnlinkedReference.prefixReference or
1572 * UnlinkedImport.prefixReference]).
1573 */
1574 List<UnlinkedReference> get references;
1575
1576 /**
1577 * Typedefs declared in the compilation unit. 1577 * Typedefs declared in the compilation unit.
1578 */ 1578 */
1579 List<UnlinkedTypedef> get typedefs; 1579 List<UnlinkedTypedef> get typedefs;
1580 1580
1581 /** 1581 /**
1582 * Top level variables declared in the compilation unit. 1582 * Top level variables declared in the compilation unit.
1583 */ 1583 */
1584 List<UnlinkedVariable> get variables; 1584 List<UnlinkedVariable> get variables;
1585 } 1585 }
1586 1586
1587 /** 1587 /**
1588 * Unlinked summary information about a top level variable, local variable, or 1588 * Unlinked summary information about a top level variable, local variable, or
1589 * a field. 1589 * a field.
1590 */ 1590 */
1591 abstract class UnlinkedVariable extends base.SummaryClass { 1591 abstract class UnlinkedVariable extends base.SummaryClass {
1592 /** 1592 /**
1593 * Name of the variable. 1593 * Annotations for this variable.
1594 */ 1594 */
1595 String get name; 1595 List<UnlinkedConst> get annotations;
1596 1596
1597 /** 1597 /**
1598 * Offset of the variable name relative to the beginning of the file. 1598 * If [isConst] is true, and the variable has an initializer, the constant
1599 * expression in the initializer. Note that the presence of this expression
1600 * does not mean that it is a valid, check [UnlinkedConst.isInvalid].
1599 */ 1601 */
1600 @informative 1602 UnlinkedConst get constExpr;
1601 int get nameOffset;
1602 1603
1603 /** 1604 /**
1604 * Documentation comment for the variable, or `null` if there is no 1605 * Documentation comment for the variable, or `null` if there is no
1605 * documentation comment. 1606 * documentation comment.
1606 */ 1607 */
1607 @informative 1608 @informative
1608 UnlinkedDocumentationComment get documentationComment; 1609 UnlinkedDocumentationComment get documentationComment;
1609 1610
1610 /** 1611 /**
1611 * Annotations for this variable. 1612 * If this variable is inferable, nonzero slot id identifying which entry in
1613 * [LinkedLibrary.types] contains the inferred type for this variable. If
1614 * there is no matching entry in [LinkedLibrary.types], then no type was
1615 * inferred for this variable, so its static type is `dynamic`.
1612 */ 1616 */
1613 List<UnlinkedConst> get annotations; 1617 int get inferredTypeSlot;
1614 1618
1615 /** 1619 /**
1616 * Declared type of the variable. Absent if the type is implicit. 1620 * Indicates whether the variable is declared using the `const` keyword.
1617 */ 1621 */
1618 EntityRef get type; 1622 bool get isConst;
1619 1623
1620 /** 1624 /**
1621 * If [isConst] is true, and the variable has an initializer, the constant 1625 * Indicates whether the variable is declared using the `final` keyword.
1622 * expression in the initializer. Note that the presence of this expression
1623 * does not mean that it is a valid, check [UnlinkedConst.isInvalid].
1624 */ 1626 */
1625 UnlinkedConst get constExpr; 1627 bool get isFinal;
1626 1628
1627 /** 1629 /**
1628 * Indicates whether the variable is declared using the `static` keyword. 1630 * Indicates whether the variable is declared using the `static` keyword.
1629 * 1631 *
1630 * Note that for top level variables, this flag is false, since they are not 1632 * Note that for top level variables, this flag is false, since they are not
1631 * declared using the `static` keyword (even though they are considered 1633 * declared using the `static` keyword (even though they are considered
1632 * static for semantic purposes). 1634 * static for semantic purposes).
1633 */ 1635 */
1634 bool get isStatic; 1636 bool get isStatic;
1635 1637
1636 /** 1638 /**
1637 * Indicates whether the variable is declared using the `final` keyword. 1639 * Name of the variable.
1638 */ 1640 */
1639 bool get isFinal; 1641 String get name;
1640 1642
1641 /** 1643 /**
1642 * Indicates whether the variable is declared using the `const` keyword. 1644 * Offset of the variable name relative to the beginning of the file.
1643 */ 1645 */
1644 bool get isConst; 1646 @informative
1647 int get nameOffset;
1645 1648
1646 /** 1649 /**
1647 * If this variable is propagable, nonzero slot id identifying which entry in 1650 * If this variable is propagable, nonzero slot id identifying which entry in
1648 * [LinkedLibrary.types] contains the propagated type for this variable. If 1651 * [LinkedLibrary.types] contains the propagated type for this variable. If
1649 * there is no matching entry in [LinkedLibrary.types], then this variable's 1652 * there is no matching entry in [LinkedLibrary.types], then this variable's
1650 * propagated type is the same as its declared type. 1653 * propagated type is the same as its declared type.
1651 * 1654 *
1652 * Non-propagable variables have a [propagatedTypeSlot] of zero. 1655 * Non-propagable variables have a [propagatedTypeSlot] of zero.
1653 */ 1656 */
1654 int get propagatedTypeSlot; 1657 int get propagatedTypeSlot;
1655 1658
1656 /** 1659 /**
1657 * If this variable is inferable, nonzero slot id identifying which entry in 1660 * Declared type of the variable. Absent if the type is implicit.
1658 * [LinkedLibrary.types] contains the inferred type for this variable. If
1659 * there is no matching entry in [LinkedLibrary.types], then no type was
1660 * inferred for this variable, so its static type is `dynamic`.
1661 */ 1661 */
1662 int get inferredTypeSlot; 1662 EntityRef get type;
1663 } 1663 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/format.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698