| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 List<PrelinkedDependency> dependencies; | 103 List<PrelinkedDependency> dependencies; |
| 104 | 104 |
| 105 /** | 105 /** |
| 106 * For each import in [UnlinkedLibrary.imports], an index into [dependencies] | 106 * For each import in [UnlinkedLibrary.imports], an index into [dependencies] |
| 107 * of the library being imported. | 107 * of the library being imported. |
| 108 * | 108 * |
| 109 * TODO(paulberry): if [dependencies] is removed, this can be removed as | 109 * TODO(paulberry): if [dependencies] is removed, this can be removed as |
| 110 * well, since there will effectively be a one-to-one mapping. | 110 * well, since there will effectively be a one-to-one mapping. |
| 111 */ | 111 */ |
| 112 List<int> importDependencies; | 112 List<int> importDependencies; |
| 113 | |
| 114 /** | |
| 115 * For each reference in [UnlinkedLibrary.references], information about how | |
| 116 * that reference is resolved. | |
| 117 */ | |
| 118 List<PrelinkedReference> references; | |
| 119 } | 113 } |
| 120 | 114 |
| 121 /** | 115 /** |
| 122 * Information about the resolution of an [UnlinkedReference]. | 116 * Information about the resolution of an [UnlinkedReference]. |
| 123 */ | 117 */ |
| 124 class PrelinkedReference { | 118 class PrelinkedReference { |
| 125 /** | 119 /** |
| 126 * Index into [UnlinkedLibrary.dependencies] indicating which imported library | 120 * Index into [UnlinkedLibrary.dependencies] indicating which imported library |
| 127 * declares the entity being referred to. | 121 * declares the entity being referred to. |
| 128 */ | 122 */ |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 } | 164 } |
| 171 | 165 |
| 172 /** | 166 /** |
| 173 * Pre-linked summary of a compilation unit. | 167 * Pre-linked summary of a compilation unit. |
| 174 */ | 168 */ |
| 175 class PrelinkedUnit { | 169 class PrelinkedUnit { |
| 176 /** | 170 /** |
| 177 * The unlinked summary of the compilation unit | 171 * The unlinked summary of the compilation unit |
| 178 */ | 172 */ |
| 179 UnlinkedUnit unlinked; | 173 UnlinkedUnit unlinked; |
| 174 |
| 175 /** |
| 176 * For each reference in [UnlinkedUnit.references], information about how |
| 177 * that reference is resolved. |
| 178 */ |
| 179 List<PrelinkedReference> references; |
| 180 } | 180 } |
| 181 | 181 |
| 182 /** | 182 /** |
| 183 * Unlinked summary information about a class declaration. | 183 * Unlinked summary information about a class declaration. |
| 184 */ | 184 */ |
| 185 class UnlinkedClass { | 185 class UnlinkedClass { |
| 186 /** | 186 /** |
| 187 * Name of the class. | 187 * Name of the class. |
| 188 */ | 188 */ |
| 189 String name; | 189 String name; |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 * Indicates whether the import declaration is implicit. | 431 * Indicates whether the import declaration is implicit. |
| 432 */ | 432 */ |
| 433 bool isImplicit; | 433 bool isImplicit; |
| 434 } | 434 } |
| 435 | 435 |
| 436 /** | 436 /** |
| 437 * Unlinked summary of an entire library. | 437 * Unlinked summary of an entire library. |
| 438 */ | 438 */ |
| 439 class UnlinkedLibrary { | 439 class UnlinkedLibrary { |
| 440 /** | 440 /** |
| 441 * Top level and prefixed names referred to by this library. | |
| 442 */ | |
| 443 List<UnlinkedReference> references; | |
| 444 | |
| 445 /** | |
| 446 * Prefixes introduced by import declarations. The first element in this | 441 * Prefixes introduced by import declarations. The first element in this |
| 447 * array is a pseudo-prefix used by references made with no prefix. | 442 * array is a pseudo-prefix used by references made with no prefix. |
| 448 */ | 443 */ |
| 449 List<UnlinkedPrefix> prefixes; | 444 List<UnlinkedPrefix> prefixes; |
| 450 } | 445 } |
| 451 | 446 |
| 452 /** | 447 /** |
| 453 * Unlinked summary information about a function parameter. | 448 * Unlinked summary information about a function parameter. |
| 454 */ | 449 */ |
| 455 class UnlinkedParam { | 450 class UnlinkedParam { |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 * null. | 585 * null. |
| 591 */ | 586 */ |
| 592 UnlinkedTypeRef bound; | 587 UnlinkedTypeRef bound; |
| 593 } | 588 } |
| 594 | 589 |
| 595 /** | 590 /** |
| 596 * Unlinked summary information about a reference to a type. | 591 * Unlinked summary information about a reference to a type. |
| 597 */ | 592 */ |
| 598 class UnlinkedTypeRef { | 593 class UnlinkedTypeRef { |
| 599 /** | 594 /** |
| 600 * Index into [UnlinkedLibrary.references] for the type being referred to, or | 595 * Index into [UnlinkedUnit.references] for the type being referred to, or |
| 601 * zero if this is a reference to a type parameter. | 596 * zero if this is a reference to a type parameter. |
| 602 * | 597 * |
| 603 * Note that since zero is also a valid index into | 598 * Note that since zero is also a valid index into |
| 604 * [UnlinkedLibrary.references], we cannot distinguish between references to | 599 * [UnlinkedUnit.references], we cannot distinguish between references to |
| 605 * type parameters and references to types by checking [reference] against | 600 * type parameters and references to types by checking [reference] against |
| 606 * zero. To distinguish between references to type parameters and references | 601 * zero. To distinguish between references to type parameters and references |
| 607 * to types, check whether [paramReference] is zero. | 602 * to types, check whether [paramReference] is zero. |
| 608 */ | 603 */ |
| 609 int reference; | 604 int reference; |
| 610 | 605 |
| 611 /** | 606 /** |
| 612 * If this is a reference to a type parameter, one-based index into the list | 607 * If this is a reference to a type parameter, one-based index into the list |
| 613 * of [UnlinkedTypeParam]s currently in effect. Indexing is done using De | 608 * of [UnlinkedTypeParam]s currently in effect. Indexing is done using De |
| 614 * Bruijn index conventions; that is, innermost parameters come first, and | 609 * Bruijn index conventions; that is, innermost parameters come first, and |
| (...skipping 15 matching lines...) Expand all Loading... |
| 630 int paramReference; | 625 int paramReference; |
| 631 | 626 |
| 632 /** | 627 /** |
| 633 * If this is an instantiation of a generic type, the type arguments used to | 628 * If this is an instantiation of a generic type, the type arguments used to |
| 634 * instantiate it. Trailing type arguments of type `dynamic` are omitted. | 629 * instantiate it. Trailing type arguments of type `dynamic` are omitted. |
| 635 */ | 630 */ |
| 636 List<UnlinkedTypeRef> typeArguments; | 631 List<UnlinkedTypeRef> typeArguments; |
| 637 } | 632 } |
| 638 | 633 |
| 639 /** | 634 /** |
| 640 * Unlinked summary information about a compilation unit ("part file"). Note | 635 * Unlinked summary information about a compilation unit ("part file"). |
| 641 * that since a declaration can be moved from one part file to another without | |
| 642 * changing semantics, the declarations themselves aren't stored here; they are | |
| 643 * stored in [UnlinkedLibrary] and they refer to [UnlinkedUnit]s via an index | |
| 644 * into [UnlinkedLibrary.units]. | |
| 645 */ | 636 */ |
| 646 class UnlinkedUnit { | 637 class UnlinkedUnit { |
| 647 /** | 638 /** |
| 648 * Name of the library (from a "library" declaration, if present). | 639 * Name of the library (from a "library" declaration, if present). |
| 649 */ | 640 */ |
| 650 String libraryName; | 641 String libraryName; |
| 651 | 642 |
| 652 /** | 643 /** |
| 644 * Top level and prefixed names referred to by this compilation unit. |
| 645 */ |
| 646 List<UnlinkedReference> references; |
| 647 |
| 648 /** |
| 653 * Classes declared in the compilation unit. | 649 * Classes declared in the compilation unit. |
| 654 */ | 650 */ |
| 655 List<UnlinkedClass> classes; | 651 List<UnlinkedClass> classes; |
| 656 | 652 |
| 657 /** | 653 /** |
| 658 * Enums declared in the compilation unit. | 654 * Enums declared in the compilation unit. |
| 659 */ | 655 */ |
| 660 List<UnlinkedEnum> enums; | 656 List<UnlinkedEnum> enums; |
| 661 | 657 |
| 662 /** | 658 /** |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 /** | 720 /** |
| 725 * Indicates whether the variable is declared using the `const` keyword. | 721 * Indicates whether the variable is declared using the `const` keyword. |
| 726 */ | 722 */ |
| 727 bool isConst; | 723 bool isConst; |
| 728 | 724 |
| 729 /** | 725 /** |
| 730 * Indicates whether this variable lacks an explicit type declaration. | 726 * Indicates whether this variable lacks an explicit type declaration. |
| 731 */ | 727 */ |
| 732 bool hasImplicitType; | 728 bool hasImplicitType; |
| 733 } | 729 } |
| OLD | NEW |