OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * This file is an "idl" style description of the summary format. It is not | 6 * This file is an "idl" style description of the summary format. It is not |
7 * executed directly; instead it is parsed and transformed into code that | 7 * executed directly; instead it is parsed and transformed into code that |
8 * implements the summary format. | 8 * implements the summary format. |
9 * | 9 * |
10 * The code generation process introduces the following non-typical semantics: | 10 * The code generation process introduces the following non-typical semantics: |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 */ | 72 */ |
73 String uri; | 73 String uri; |
74 } | 74 } |
75 | 75 |
76 /** | 76 /** |
77 * Pre-linked summary of a library. | 77 * Pre-linked summary of a library. |
78 */ | 78 */ |
79 @topLevel | 79 @topLevel |
80 class PrelinkedLibrary { | 80 class PrelinkedLibrary { |
81 /** | 81 /** |
| 82 * The pre-linked summary of all the compilation units constituting the |
| 83 * library. The summary of the defining compilation unit is listed first, |
| 84 * followed by the summary of each part, in the order of the `part` |
| 85 * declarations in the defining compilation unit. |
| 86 */ |
| 87 List<PrelinkedUnit> units; |
| 88 |
| 89 /** |
82 * The unlinked library summary. | 90 * The unlinked library summary. |
83 */ | 91 */ |
84 UnlinkedLibrary unlinked; | 92 UnlinkedLibrary unlinked; |
85 | 93 |
86 /** | 94 /** |
87 * The libraries that this library depends on (either via an explicit import | 95 * The libraries that this library depends on (either via an explicit import |
88 * statement or via the implicit dependencies on `dart:core` and | 96 * statement or via the implicit dependencies on `dart:core` and |
89 * `dart:async`). The first element of this array is a pseudo-dependency | 97 * `dart:async`). The first element of this array is a pseudo-dependency |
90 * representing the library itself (it is also used for "dynamic"). | 98 * representing the library itself (it is also used for "dynamic"). |
91 * | 99 * |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 */ | 163 */ |
156 other, | 164 other, |
157 | 165 |
158 /** | 166 /** |
159 * The entity being referred to does not exist. | 167 * The entity being referred to does not exist. |
160 */ | 168 */ |
161 unresolved | 169 unresolved |
162 } | 170 } |
163 | 171 |
164 /** | 172 /** |
| 173 * Pre-linked summary of a compilation unit. |
| 174 */ |
| 175 class PrelinkedUnit { |
| 176 /** |
| 177 * The unlinked summary of the compilation unit |
| 178 */ |
| 179 UnlinkedUnit unlinked; |
| 180 } |
| 181 |
| 182 /** |
165 * Unlinked summary information about a class declaration. | 183 * Unlinked summary information about a class declaration. |
166 */ | 184 */ |
167 class UnlinkedClass { | 185 class UnlinkedClass { |
168 /** | 186 /** |
169 * Name of the class. | 187 * Name of the class. |
170 */ | 188 */ |
171 String name; | 189 String name; |
172 | 190 |
173 /** | 191 /** |
174 * Index into [UnlinkedLibrary.units] indicating which compilation unit the | |
175 * class is declared in. | |
176 */ | |
177 @informative | |
178 int unit; | |
179 | |
180 /** | |
181 * Type parameters of the class, if any. | 192 * Type parameters of the class, if any. |
182 */ | 193 */ |
183 List<UnlinkedTypeParam> typeParameters; | 194 List<UnlinkedTypeParam> typeParameters; |
184 | 195 |
185 /** | 196 /** |
186 * Supertype of the class, or `null` if either (a) the class doesn't | 197 * Supertype of the class, or `null` if either (a) the class doesn't |
187 * explicitly declare a supertype (and hence has supertype `Object`), or (b) | 198 * explicitly declare a supertype (and hence has supertype `Object`), or (b) |
188 * the class *is* `Object` (and hence has no supertype). | 199 * the class *is* `Object` (and hence has no supertype). |
189 */ | 200 */ |
190 UnlinkedTypeRef supertype; | 201 UnlinkedTypeRef supertype; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 class UnlinkedEnum { | 264 class UnlinkedEnum { |
254 /** | 265 /** |
255 * Name of the enum type. | 266 * Name of the enum type. |
256 */ | 267 */ |
257 String name; | 268 String name; |
258 | 269 |
259 /** | 270 /** |
260 * Values listed in the enum declaration, in declaration order. | 271 * Values listed in the enum declaration, in declaration order. |
261 */ | 272 */ |
262 List<UnlinkedEnumValue> values; | 273 List<UnlinkedEnumValue> values; |
263 | |
264 /** | |
265 * Index into [UnlinkedLibrary.units] indicating which compilation unit the | |
266 * enum is declared in. | |
267 */ | |
268 @informative | |
269 int unit; | |
270 } | 274 } |
271 | 275 |
272 /** | 276 /** |
273 * Unlinked summary information about a single enumerated value in an enum | 277 * Unlinked summary information about a single enumerated value in an enum |
274 * declaration. | 278 * declaration. |
275 */ | 279 */ |
276 class UnlinkedEnumValue { | 280 class UnlinkedEnumValue { |
277 /** | 281 /** |
278 * Name of the enumerated value. | 282 * Name of the enumerated value. |
279 */ | 283 */ |
280 String name; | 284 String name; |
281 } | 285 } |
282 | 286 |
283 /** | 287 /** |
284 * Unlinked summary information about a function, method, getter, or setter | 288 * Unlinked summary information about a function, method, getter, or setter |
285 * declaration. | 289 * declaration. |
286 */ | 290 */ |
287 class UnlinkedExecutable { | 291 class UnlinkedExecutable { |
288 /** | 292 /** |
289 * Name of the executable. For setters, this includes the trailing "=". For | 293 * Name of the executable. For setters, this includes the trailing "=". For |
290 * named constructors, this excludes the class name and excludes the ".". | 294 * named constructors, this excludes the class name and excludes the ".". |
291 * For unnamed constructors, this is the empty string. | 295 * For unnamed constructors, this is the empty string. |
292 */ | 296 */ |
293 String name; | 297 String name; |
294 | 298 |
295 /** | 299 /** |
296 * Index into [UnlinkedLibrary.units] indicating which compilation unit the | |
297 * executable is declared in. Zero for executables which are nested inside | |
298 * another declaration (i.e. local functions and method declarations). | |
299 */ | |
300 @informative | |
301 int unit; | |
302 | |
303 /** | |
304 * Type parameters of the executable, if any. Empty if support for generic | 300 * Type parameters of the executable, if any. Empty if support for generic |
305 * method syntax is disabled. | 301 * method syntax is disabled. |
306 */ | 302 */ |
307 List<UnlinkedTypeParam> typeParameters; | 303 List<UnlinkedTypeParam> typeParameters; |
308 | 304 |
309 /** | 305 /** |
310 * Declared return type of the executable. Absent if the return type is | 306 * Declared return type of the executable. Absent if the return type is |
311 * `void`. Note that when strong mode is enabled, the actual return type may | 307 * `void`. Note that when strong mode is enabled, the actual return type may |
312 * be different due to type inference. | 308 * be different due to type inference. |
313 */ | 309 */ |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 /** | 436 /** |
441 * Unlinked summary of an entire library. | 437 * Unlinked summary of an entire library. |
442 */ | 438 */ |
443 class UnlinkedLibrary { | 439 class UnlinkedLibrary { |
444 /** | 440 /** |
445 * Top level and prefixed names referred to by this library. | 441 * Top level and prefixed names referred to by this library. |
446 */ | 442 */ |
447 List<UnlinkedReference> references; | 443 List<UnlinkedReference> references; |
448 | 444 |
449 /** | 445 /** |
450 * Information about the units constituting this library. The first unit | |
451 * listed is always the defining compilation unit. The remaining units are | |
452 * listed in the order of their corresponding `part` declarations. | |
453 */ | |
454 List<UnlinkedUnit> units; | |
455 | |
456 /** | |
457 * Name of the library (from a "library" declaration, if present). | |
458 */ | |
459 String name; | |
460 | |
461 /** | |
462 * Classes declared in the library. | |
463 */ | |
464 List<UnlinkedClass> classes; | |
465 | |
466 /** | |
467 * Enums declared in the library. | |
468 */ | |
469 List<UnlinkedEnum> enums; | |
470 | |
471 /** | |
472 * Top level executable objects (functions, getters, and setters) declared in | |
473 * the library. | |
474 */ | |
475 List<UnlinkedExecutable> executables; | |
476 | |
477 /** | |
478 * Export declarations in the library. | |
479 */ | |
480 List<UnlinkedExport> exports; | |
481 | |
482 /** | |
483 * Import declarations in the library. | |
484 */ | |
485 List<UnlinkedImport> imports; | |
486 | |
487 /** | |
488 * Typedefs declared in the library. | |
489 */ | |
490 List<UnlinkedTypedef> typedefs; | |
491 | |
492 /** | |
493 * Top level variables declared in the library. | |
494 */ | |
495 List<UnlinkedVariable> variables; | |
496 | |
497 /** | |
498 * Prefixes introduced by import declarations. The first element in this | 446 * Prefixes introduced by import declarations. The first element in this |
499 * array is a pseudo-prefix used by references made with no prefix. | 447 * array is a pseudo-prefix used by references made with no prefix. |
500 */ | 448 */ |
501 List<UnlinkedPrefix> prefixes; | 449 List<UnlinkedPrefix> prefixes; |
502 } | 450 } |
503 | 451 |
504 /** | 452 /** |
505 * Unlinked summary information about a function parameter. | 453 * Unlinked summary information about a function parameter. |
506 */ | 454 */ |
507 class UnlinkedParam { | 455 class UnlinkedParam { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 * Parameter is positional optional (enclosed in `[]`) | 508 * Parameter is positional optional (enclosed in `[]`) |
561 */ | 509 */ |
562 positional, | 510 positional, |
563 | 511 |
564 /** | 512 /** |
565 * Parameter is named optional (enclosed in `{}`) | 513 * Parameter is named optional (enclosed in `{}`) |
566 */ | 514 */ |
567 named | 515 named |
568 } | 516 } |
569 | 517 |
| 518 /** |
| 519 * Unlinked summary information about a part declaration. |
| 520 */ |
| 521 class UnlinkedPart { |
| 522 /** |
| 523 * String used in the compilation unit to refer to the part file. |
| 524 */ |
| 525 String uri; |
| 526 } |
| 527 |
570 class UnlinkedPrefix { | 528 class UnlinkedPrefix { |
571 /** | 529 /** |
572 * The name of the prefix, or the empty string in the case of the | 530 * The name of the prefix, or the empty string in the case of the |
573 * pseudo-prefix which represents "no prefix". | 531 * pseudo-prefix which represents "no prefix". |
574 */ | 532 */ |
575 String name; | 533 String name; |
576 } | 534 } |
577 | 535 |
578 /** | 536 /** |
579 * Unlinked summary information about a name referred to in one library that | 537 * Unlinked summary information about a name referred to in one library that |
(...skipping 16 matching lines...) Expand all Loading... |
596 /** | 554 /** |
597 * Unlinked summary information about a typedef declaration. | 555 * Unlinked summary information about a typedef declaration. |
598 */ | 556 */ |
599 class UnlinkedTypedef { | 557 class UnlinkedTypedef { |
600 /** | 558 /** |
601 * Name of the typedef. | 559 * Name of the typedef. |
602 */ | 560 */ |
603 String name; | 561 String name; |
604 | 562 |
605 /** | 563 /** |
606 * Index into [UnlinkedLibrary.units] indicating which compilation unit the | |
607 * typedef is declared in. | |
608 */ | |
609 @informative | |
610 int unit; | |
611 | |
612 /** | |
613 * Type parameters of the typedef, if any. | 564 * Type parameters of the typedef, if any. |
614 */ | 565 */ |
615 List<UnlinkedTypeParam> typeParameters; | 566 List<UnlinkedTypeParam> typeParameters; |
616 | 567 |
617 /** | 568 /** |
618 * Return type of the typedef. Absent if the return type is `void`. | 569 * Return type of the typedef. Absent if the return type is `void`. |
619 */ | 570 */ |
620 UnlinkedTypeRef returnType; | 571 UnlinkedTypeRef returnType; |
621 | 572 |
622 /** | 573 /** |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 | 638 |
688 /** | 639 /** |
689 * Unlinked summary information about a compilation unit ("part file"). Note | 640 * Unlinked summary information about a compilation unit ("part file"). Note |
690 * that since a declaration can be moved from one part file to another without | 641 * that since a declaration can be moved from one part file to another without |
691 * changing semantics, the declarations themselves aren't stored here; they are | 642 * changing semantics, the declarations themselves aren't stored here; they are |
692 * stored in [UnlinkedLibrary] and they refer to [UnlinkedUnit]s via an index | 643 * stored in [UnlinkedLibrary] and they refer to [UnlinkedUnit]s via an index |
693 * into [UnlinkedLibrary.units]. | 644 * into [UnlinkedLibrary.units]. |
694 */ | 645 */ |
695 class UnlinkedUnit { | 646 class UnlinkedUnit { |
696 /** | 647 /** |
697 * String used in the defining compilation unit to reference the part file. | 648 * Name of the library (from a "library" declaration, if present). |
698 * Empty for the defining compilation unit itself. | |
699 */ | 649 */ |
700 String uri; | 650 String libraryName; |
| 651 |
| 652 /** |
| 653 * Classes declared in the compilation unit. |
| 654 */ |
| 655 List<UnlinkedClass> classes; |
| 656 |
| 657 /** |
| 658 * Enums declared in the compilation unit. |
| 659 */ |
| 660 List<UnlinkedEnum> enums; |
| 661 |
| 662 /** |
| 663 * Top level executable objects (functions, getters, and setters) declared in |
| 664 * the compilation unit. |
| 665 */ |
| 666 List<UnlinkedExecutable> executables; |
| 667 |
| 668 /** |
| 669 * Export declarations in the compilation unit. |
| 670 */ |
| 671 List<UnlinkedExport> exports; |
| 672 |
| 673 /** |
| 674 * Import declarations in the compilation unit. |
| 675 */ |
| 676 List<UnlinkedImport> imports; |
| 677 |
| 678 /** |
| 679 * Part declarations in the compilation unit. |
| 680 */ |
| 681 List<UnlinkedPart> parts; |
| 682 |
| 683 /** |
| 684 * Typedefs declared in the compilation unit. |
| 685 */ |
| 686 List<UnlinkedTypedef> typedefs; |
| 687 |
| 688 /** |
| 689 * Top level variables declared in the compilation unit. |
| 690 */ |
| 691 List<UnlinkedVariable> variables; |
701 } | 692 } |
702 | 693 |
703 /** | 694 /** |
704 * Unlinked summary information about a top level variable, local variable, or | 695 * Unlinked summary information about a top level variable, local variable, or |
705 * a field. | 696 * a field. |
706 */ | 697 */ |
707 class UnlinkedVariable { | 698 class UnlinkedVariable { |
708 /** | 699 /** |
709 * Name of the variable. | 700 * Name of the variable. |
710 */ | 701 */ |
711 String name; | 702 String name; |
712 | 703 |
713 /** | 704 /** |
714 * Index into [UnlinkedLibrary.units] indicating which compilation unit the | |
715 * variable is declared in. Zero for variables which are nested inside | |
716 * another declaration (i.e. local variables and fields). | |
717 */ | |
718 @informative | |
719 int unit; | |
720 | |
721 /** | |
722 * Declared type of the variable. Note that when strong mode is enabled, the | 705 * Declared type of the variable. Note that when strong mode is enabled, the |
723 * actual type of the variable may be different due to type inference. | 706 * actual type of the variable may be different due to type inference. |
724 */ | 707 */ |
725 UnlinkedTypeRef type; | 708 UnlinkedTypeRef type; |
726 | 709 |
727 /** | 710 /** |
728 * Indicates whether the variable is declared using the `static` keyword. | 711 * Indicates whether the variable is declared using the `static` keyword. |
729 * | 712 * |
730 * Note that for top level variables, this flag is false, since they are not | 713 * Note that for top level variables, this flag is false, since they are not |
731 * declared using the `static` keyword (even though they are considered | 714 * declared using the `static` keyword (even though they are considered |
732 * static for semantic purposes). | 715 * static for semantic purposes). |
733 */ | 716 */ |
734 bool isStatic; | 717 bool isStatic; |
735 | 718 |
736 /** | 719 /** |
737 * Indicates whether the variable is declared using the `final` keyword. | 720 * Indicates whether the variable is declared using the `final` keyword. |
738 */ | 721 */ |
739 bool isFinal; | 722 bool isFinal; |
740 | 723 |
741 /** | 724 /** |
742 * Indicates whether the variable is declared using the `const` keyword. | 725 * Indicates whether the variable is declared using the `const` keyword. |
743 */ | 726 */ |
744 bool isConst; | 727 bool isConst; |
745 | 728 |
746 /** | 729 /** |
747 * Indicates whether this variable lacks an explicit type declaration. | 730 * Indicates whether this variable lacks an explicit type declaration. |
748 */ | 731 */ |
749 bool hasImplicitType; | 732 bool hasImplicitType; |
750 } | 733 } |
OLD | NEW |