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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 List<int> importDependencies; | 97 List<int> importDependencies; |
98 | 98 |
99 /** | 99 /** |
100 * For each reference in [UnlinkedLibrary.references], information about how | 100 * For each reference in [UnlinkedLibrary.references], information about how |
101 * that reference is resolved. | 101 * that reference is resolved. |
102 */ | 102 */ |
103 List<PrelinkedReference> references; | 103 List<PrelinkedReference> references; |
104 } | 104 } |
105 | 105 |
106 /** | 106 /** |
| 107 * Information about the resolution of an [UnlinkedReference]. |
| 108 */ |
| 109 class PrelinkedReference { |
| 110 /** |
| 111 * Index into [UnlinkedLibrary.dependencies] indicating which imported library |
| 112 * declares the entity being referred to. |
| 113 */ |
| 114 int dependency; |
| 115 |
| 116 /** |
| 117 * The kind of the entity being referred to. |
| 118 */ |
| 119 PrelinkedReferenceKind kind; |
| 120 } |
| 121 |
| 122 /** |
107 * Enum used to indicate the kind of entity referred to by a | 123 * Enum used to indicate the kind of entity referred to by a |
108 * [PrelinkedReference]. | 124 * [PrelinkedReference]. |
109 */ | 125 */ |
110 enum PrelinkedReferenceKind { | 126 enum PrelinkedReferenceKind { |
111 /** | 127 /** |
112 * The entity is a class or enum. | 128 * The entity is a class or enum. |
113 */ | 129 */ |
114 classOrEnum, | 130 classOrEnum, |
115 | 131 |
116 /** | 132 /** |
117 * The entity is a typedef. | 133 * The entity is a typedef. |
118 */ | 134 */ |
119 typedef, | 135 typedef, |
120 | 136 |
121 /** | 137 /** |
122 * The entity is a variable or executable. | 138 * The entity is a variable or executable. |
123 */ | 139 */ |
124 other, | 140 other, |
125 | 141 |
126 /** | 142 /** |
127 * The entity being referred to does not exist. | 143 * The entity being referred to does not exist. |
128 */ | 144 */ |
129 unresolved | 145 unresolved |
130 } | 146 } |
131 | 147 |
132 /** | 148 /** |
133 * Information about the resolution of an [UnlinkedReference]. | |
134 */ | |
135 class PrelinkedReference { | |
136 /** | |
137 * Index into [UnlinkedLibrary.dependencies] indicating which imported library | |
138 * declares the entity being referred to. | |
139 */ | |
140 int dependency; | |
141 | |
142 /** | |
143 * The kind of the entity being referred to. | |
144 */ | |
145 PrelinkedReferenceKind kind; | |
146 } | |
147 | |
148 /** | |
149 * Unlinked summary information about a class declaration. | 149 * Unlinked summary information about a class declaration. |
150 */ | 150 */ |
151 class UnlinkedClass { | 151 class UnlinkedClass { |
152 /** | 152 /** |
153 * Name of the class. | 153 * Name of the class. |
154 */ | 154 */ |
155 String name; | 155 String name; |
156 | 156 |
157 /** | 157 /** |
158 * Index into [UnlinkedLibrary.units] indicating which compilation unit the | 158 * Index into [UnlinkedLibrary.units] indicating which compilation unit the |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 } | 205 } |
206 | 206 |
207 /** | 207 /** |
208 * Unlinked summary information about a `show` or `hide` combinator in an | 208 * Unlinked summary information about a `show` or `hide` combinator in an |
209 * import or export declaration. | 209 * import or export declaration. |
210 */ | 210 */ |
211 class UnlinkedCombinator { | 211 class UnlinkedCombinator { |
212 /** | 212 /** |
213 * List of names which are shown. Empty if this is a `hide` combinator. | 213 * List of names which are shown. Empty if this is a `hide` combinator. |
214 */ | 214 */ |
215 List<String> shows; | 215 List<UnlinkedCombinatorName> shows; |
216 | 216 |
217 /** | 217 /** |
218 * List of names which are hidden. Empty if this is a `show` combinator. | 218 * List of names which are hidden. Empty if this is a `show` combinator. |
219 */ | 219 */ |
220 List<String> hides; | 220 List<UnlinkedCombinatorName> hides; |
221 } | 221 } |
222 | 222 |
223 /** | 223 /** |
| 224 * Unlinked summary information about a single name in a `show` or `hide` |
| 225 * combinator. |
| 226 */ |
| 227 class UnlinkedCombinatorName { |
| 228 /** |
| 229 * The name itself. |
| 230 */ |
| 231 String name; |
| 232 } |
| 233 |
| 234 /** |
224 * Unlinked summary information about an enum declaration. | 235 * Unlinked summary information about an enum declaration. |
225 */ | 236 */ |
226 class UnlinkedEnum { | 237 class UnlinkedEnum { |
227 /** | 238 /** |
228 * Name of the enum type. | 239 * Name of the enum type. |
229 */ | 240 */ |
230 String name; | 241 String name; |
231 | 242 |
232 /** | 243 /** |
233 * Values listed in the enum declaration, in declaration order. | 244 * Values listed in the enum declaration, in declaration order. |
(...skipping 13 matching lines...) Expand all Loading... |
247 * declaration. | 258 * declaration. |
248 */ | 259 */ |
249 class UnlinkedEnumValue { | 260 class UnlinkedEnumValue { |
250 /** | 261 /** |
251 * Name of the enumerated value. | 262 * Name of the enumerated value. |
252 */ | 263 */ |
253 String name; | 264 String name; |
254 } | 265 } |
255 | 266 |
256 /** | 267 /** |
257 * Enum used to indicate the kind of an executable. | |
258 */ | |
259 enum UnlinkedExecutableKind { | |
260 /** | |
261 * Executable is a function or method. | |
262 */ | |
263 functionOrMethod, | |
264 | |
265 /** | |
266 * Executable is a getter. | |
267 */ | |
268 getter, | |
269 | |
270 /** | |
271 * Executable is a setter. | |
272 */ | |
273 setter, | |
274 | |
275 /** | |
276 * Executable is a constructor. | |
277 */ | |
278 constructor | |
279 } | |
280 | |
281 /** | |
282 * Unlinked summary information about a function, method, getter, or setter | 268 * Unlinked summary information about a function, method, getter, or setter |
283 * declaration. | 269 * declaration. |
284 */ | 270 */ |
285 class UnlinkedExecutable { | 271 class UnlinkedExecutable { |
286 /** | 272 /** |
287 * Name of the executable. For setters, this includes the trailing "=". For | 273 * Name of the executable. For setters, this includes the trailing "=". For |
288 * named constructors, this excludes the class name and excludes the ".". | 274 * named constructors, this excludes the class name and excludes the ".". |
289 * For unnamed constructors, this is the empty string. | 275 * For unnamed constructors, this is the empty string. |
290 */ | 276 */ |
291 String name; | 277 String name; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 */ | 329 */ |
344 bool isConst; | 330 bool isConst; |
345 | 331 |
346 /** | 332 /** |
347 * Indicates whether the executable is declared using the `factory` keyword. | 333 * Indicates whether the executable is declared using the `factory` keyword. |
348 */ | 334 */ |
349 bool isFactory; | 335 bool isFactory; |
350 } | 336 } |
351 | 337 |
352 /** | 338 /** |
| 339 * Enum used to indicate the kind of an executable. |
| 340 */ |
| 341 enum UnlinkedExecutableKind { |
| 342 /** |
| 343 * Executable is a function or method. |
| 344 */ |
| 345 functionOrMethod, |
| 346 |
| 347 /** |
| 348 * Executable is a getter. |
| 349 */ |
| 350 getter, |
| 351 |
| 352 /** |
| 353 * Executable is a setter. |
| 354 */ |
| 355 setter, |
| 356 |
| 357 /** |
| 358 * Executable is a constructor. |
| 359 */ |
| 360 constructor |
| 361 } |
| 362 |
| 363 /** |
353 * Unlinked summary information about an export declaration. | 364 * Unlinked summary information about an export declaration. |
354 */ | 365 */ |
355 class UnlinkedExport { | 366 class UnlinkedExport { |
356 /** | 367 /** |
357 * URI used in the source code to reference the exported library. | 368 * URI used in the source code to reference the exported library. |
358 */ | 369 */ |
359 String uri; | 370 String uri; |
360 | 371 |
361 /** | 372 /** |
362 * Combinators contained in this import declaration. | 373 * Combinators contained in this import declaration. |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 List<UnlinkedVariable> variables; | 472 List<UnlinkedVariable> variables; |
462 | 473 |
463 /** | 474 /** |
464 * Prefixes introduced by import declarations. The first element in this | 475 * Prefixes introduced by import declarations. The first element in this |
465 * array is a pseudo-prefix used by references made with no prefix. | 476 * array is a pseudo-prefix used by references made with no prefix. |
466 */ | 477 */ |
467 List<UnlinkedPrefix> prefixes; | 478 List<UnlinkedPrefix> prefixes; |
468 } | 479 } |
469 | 480 |
470 /** | 481 /** |
471 * Enum used to indicate the kind of a parameter. | |
472 */ | |
473 enum UnlinkedParamKind { | |
474 /** | |
475 * Parameter is required. | |
476 */ | |
477 required, | |
478 | |
479 /** | |
480 * Parameter is positional optional (enclosed in `[]`) | |
481 */ | |
482 positional, | |
483 | |
484 /** | |
485 * Parameter is named optional (enclosed in `{}`) | |
486 */ | |
487 named | |
488 } | |
489 | |
490 /** | |
491 * Unlinked summary information about a function parameter. | 482 * Unlinked summary information about a function parameter. |
492 */ | 483 */ |
493 class UnlinkedParam { | 484 class UnlinkedParam { |
494 /** | 485 /** |
495 * Name of the parameter. | 486 * Name of the parameter. |
496 */ | 487 */ |
497 String name; | 488 String name; |
498 | 489 |
499 /** | 490 /** |
500 * If [isFunctionTyped] is `true`, the declared return type. If | 491 * If [isFunctionTyped] is `true`, the declared return type. If |
(...skipping 19 matching lines...) Expand all Loading... |
520 */ | 511 */ |
521 bool isFunctionTyped; | 512 bool isFunctionTyped; |
522 | 513 |
523 /** | 514 /** |
524 * Indicates whether this is an initializing formal parameter (i.e. it is | 515 * Indicates whether this is an initializing formal parameter (i.e. it is |
525 * declared using `this.` syntax). | 516 * declared using `this.` syntax). |
526 */ | 517 */ |
527 bool isInitializingFormal; | 518 bool isInitializingFormal; |
528 } | 519 } |
529 | 520 |
| 521 /** |
| 522 * Enum used to indicate the kind of a parameter. |
| 523 */ |
| 524 enum UnlinkedParamKind { |
| 525 /** |
| 526 * Parameter is required. |
| 527 */ |
| 528 required, |
| 529 |
| 530 /** |
| 531 * Parameter is positional optional (enclosed in `[]`) |
| 532 */ |
| 533 positional, |
| 534 |
| 535 /** |
| 536 * Parameter is named optional (enclosed in `{}`) |
| 537 */ |
| 538 named |
| 539 } |
| 540 |
530 class UnlinkedPrefix { | 541 class UnlinkedPrefix { |
531 /** | 542 /** |
532 * The name of the prefix, or the empty string in the case of the | 543 * The name of the prefix, or the empty string in the case of the |
533 * pseudo-prefix which represents "no prefix". | 544 * pseudo-prefix which represents "no prefix". |
534 */ | 545 */ |
535 String name; | 546 String name; |
536 } | 547 } |
537 | 548 |
538 /** | 549 /** |
539 * Unlinked summary information about a name referred to in one library that | 550 * Unlinked summary information about a name referred to in one library that |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 /** | 694 /** |
684 * Indicates whether the variable is declared using the `final` keyword. | 695 * Indicates whether the variable is declared using the `final` keyword. |
685 */ | 696 */ |
686 bool isFinal; | 697 bool isFinal; |
687 | 698 |
688 /** | 699 /** |
689 * Indicates whether the variable is declared using the `const` keyword. | 700 * Indicates whether the variable is declared using the `const` keyword. |
690 */ | 701 */ |
691 bool isConst; | 702 bool isConst; |
692 } | 703 } |
OLD | NEW |