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

Side by Side Diff: pkg/analyzer/tool/summary/idl.dart

Issue 1528113002: Merge the prefix and references tables. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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/test/src/summary/summary_test.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 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 class PrelinkedLibrary { 80 class PrelinkedLibrary {
81 /** 81 /**
82 * The pre-linked summary of all the compilation units constituting the 82 * The pre-linked summary of all the compilation units constituting the
83 * library. The summary of the defining compilation unit is listed first, 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` 84 * followed by the summary of each part, in the order of the `part`
85 * declarations in the defining compilation unit. 85 * declarations in the defining compilation unit.
86 */ 86 */
87 List<PrelinkedUnit> units; 87 List<PrelinkedUnit> units;
88 88
89 /** 89 /**
90 * The unlinked library summary.
91 */
92 UnlinkedLibrary unlinked;
93
94 /**
95 * The libraries that this library depends on (either via an explicit import 90 * The libraries that this library depends on (either via an explicit import
96 * statement or via the implicit dependencies on `dart:core` and 91 * statement or via the implicit dependencies on `dart:core` and
97 * `dart:async`). The first element of this array is a pseudo-dependency 92 * `dart:async`). The first element of this array is a pseudo-dependency
98 * representing the library itself (it is also used for "dynamic"). 93 * representing the library itself (it is also used for "dynamic").
99 * 94 *
100 * TODO(paulberry): consider removing this entirely and just using 95 * TODO(paulberry): consider removing this entirely and just using
101 * [UnlinkedLibrary.imports]. 96 * [UnlinkedLibrary.imports].
102 */ 97 */
103 List<PrelinkedDependency> dependencies; 98 List<PrelinkedDependency> dependencies;
104 99
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 * The entity is a typedef. 146 * The entity is a typedef.
152 */ 147 */
153 typedef, 148 typedef,
154 149
155 /** 150 /**
156 * The entity is a variable or executable. 151 * The entity is a variable or executable.
157 */ 152 */
158 other, 153 other,
159 154
160 /** 155 /**
156 * The entity is a prefix.
157 */
158 prefix,
159
160 /**
161 * The entity being referred to does not exist. 161 * The entity being referred to does not exist.
162 */ 162 */
163 unresolved 163 unresolved
164 } 164 }
165 165
166 /** 166 /**
167 * Pre-linked summary of a compilation unit. 167 * Pre-linked summary of a compilation unit.
168 */ 168 */
169 class PrelinkedUnit { 169 class PrelinkedUnit {
170 /** 170 /**
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 String uri; 403 String uri;
404 404
405 /** 405 /**
406 * If [isImplicit] is false, offset of the "import" keyword. If [isImplicit] 406 * If [isImplicit] is false, offset of the "import" keyword. If [isImplicit]
407 * is true, zero. 407 * is true, zero.
408 */ 408 */
409 @informative 409 @informative
410 int offset; 410 int offset;
411 411
412 /** 412 /**
413 * Index into [UnlinkedLibrary.prefixes] of the prefix declared by this 413 * Index into [UnlinkedUnit.references] of the prefix declared by this
414 * import declaration, or zero if this import declaration declares no prefix. 414 * import declaration, or zero if this import declaration declares no prefix.
415 * 415 *
416 * Note that multiple imports can declare the same prefix. 416 * Note that multiple imports can declare the same prefix.
417 */ 417 */
418 int prefix; 418 int prefixReference;
419 419
420 /** 420 /**
421 * Combinators contained in this import declaration. 421 * Combinators contained in this import declaration.
422 */ 422 */
423 List<UnlinkedCombinator> combinators; 423 List<UnlinkedCombinator> combinators;
424 424
425 /** 425 /**
426 * Indicates whether the import declaration uses the `deferred` keyword. 426 * Indicates whether the import declaration uses the `deferred` keyword.
427 */ 427 */
428 bool isDeferred; 428 bool isDeferred;
429 429
430 /** 430 /**
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.
438 */
439 class UnlinkedLibrary {
440 /**
441 * Prefixes introduced by import declarations. The first element in this
442 * array is a pseudo-prefix used by references made with no prefix.
443 */
444 List<UnlinkedPrefix> prefixes;
445 }
446
447 /**
448 * Unlinked summary information about a function parameter. 437 * Unlinked summary information about a function parameter.
449 */ 438 */
450 class UnlinkedParam { 439 class UnlinkedParam {
451 /** 440 /**
452 * Name of the parameter. 441 * Name of the parameter.
453 */ 442 */
454 String name; 443 String name;
455 444
456 /** 445 /**
457 * If [isFunctionTyped] is `true`, the declared return type. If 446 * If [isFunctionTyped] is `true`, the declared return type. If
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 /** 502 /**
514 * Unlinked summary information about a part declaration. 503 * Unlinked summary information about a part declaration.
515 */ 504 */
516 class UnlinkedPart { 505 class UnlinkedPart {
517 /** 506 /**
518 * String used in the compilation unit to refer to the part file. 507 * String used in the compilation unit to refer to the part file.
519 */ 508 */
520 String uri; 509 String uri;
521 } 510 }
522 511
523 class UnlinkedPrefix {
524 /**
525 * The name of the prefix, or the empty string in the case of the
526 * pseudo-prefix which represents "no prefix".
527 */
528 String name;
529 }
530
531 /** 512 /**
532 * Unlinked summary information about a name referred to in one library that 513 * Unlinked summary information about a name referred to in one library that
533 * might be defined in another. 514 * might be defined in another.
534 */ 515 */
535 class UnlinkedReference { 516 class UnlinkedReference {
536 /** 517 /**
537 * Name of the entity being referred to. The empty string refers to the 518 * Name of the entity being referred to. The empty string refers to the
538 * pseudo-type `dynamic`. 519 * pseudo-type `dynamic`.
539 */ 520 */
540 String name; 521 String name;
541 522
542 /** 523 /**
543 * Prefix used to refer to the entity. This is an index into 524 * Prefix used to refer to the entity, or zero if no prefix is used. This is
544 * [UnlinkedLibrary.prefixes]. 525 * an index into [UnlinkedUnit.references].
545 */ 526 */
546 int prefix; 527 int prefixReference;
547 } 528 }
548 529
549 /** 530 /**
550 * Unlinked summary information about a typedef declaration. 531 * Unlinked summary information about a typedef declaration.
551 */ 532 */
552 class UnlinkedTypedef { 533 class UnlinkedTypedef {
553 /** 534 /**
554 * Name of the typedef. 535 * Name of the typedef.
555 */ 536 */
556 String name; 537 String name;
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 /** 703 /**
723 * Indicates whether the variable is declared using the `const` keyword. 704 * Indicates whether the variable is declared using the `const` keyword.
724 */ 705 */
725 bool isConst; 706 bool isConst;
726 707
727 /** 708 /**
728 * Indicates whether this variable lacks an explicit type declaration. 709 * Indicates whether this variable lacks an explicit type declaration.
729 */ 710 */
730 bool hasImplicitType; 711 bool hasImplicitType;
731 } 712 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/src/summary/summary_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698