| 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: |
| 11 * - Fields of type List have a default value of the empty list. | 11 * - Fields of type List are never null, and have a default value of the empty |
| 12 * - Fields of type int have a default value of zero. | 12 * list. |
| 13 * - Fields of type String have a defauld value of ''. | 13 * - Fields of type int are never null, and have a default value of zero. |
| 14 * - Fields of type String are never null, and have a default value of ''. |
| 14 * | 15 * |
| 15 * Terminology used in this document: | 16 * Terminology used in this document: |
| 16 * - "Unlinked" refers to information that can be determined from reading the | 17 * - "Unlinked" refers to information that can be determined from reading the |
| 17 * .dart file for the library itself (including all parts) and no other | 18 * .dart file for the library itself (including all parts) and no other |
| 18 * files. | 19 * files. |
| 19 * - "Prelinked" refers to information that can be determined from reading the | 20 * - "Prelinked" refers to information that can be determined from reading the |
| 20 * unlinked information for the library itself and the unlinked information | 21 * unlinked information for the library itself and the unlinked information |
| 21 * for all direct imports (plus the transitive closure of exports reachable | 22 * for all direct imports (plus the transitive closure of exports reachable |
| 22 * from those direct imports). | 23 * from those direct imports). |
| 23 * - "Linked" refers to information that can be determined only from reading | 24 * - "Linked" refers to information that can be determined only from reading |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 * that reference is resolved. | 110 * that reference is resolved. |
| 110 */ | 111 */ |
| 111 List<PrelinkedReference> references; | 112 List<PrelinkedReference> references; |
| 112 } | 113 } |
| 113 | 114 |
| 114 /** | 115 /** |
| 115 * Information about the resolution of an [UnlinkedReference]. | 116 * Information about the resolution of an [UnlinkedReference]. |
| 116 */ | 117 */ |
| 117 class PrelinkedReference { | 118 class PrelinkedReference { |
| 118 /** | 119 /** |
| 119 * Index into [LibraryElement.dependencies] indicating which imported library | 120 * Index into [UnlinkedLibrary.dependencies] indicating which imported library |
| 120 * declares the entity being referred to. | 121 * declares the entity being referred to. |
| 121 */ | 122 */ |
| 122 int dependency; | 123 int dependency; |
| 123 | 124 |
| 124 @Flag('CLASS', 0, 'Indicates that the thing being referred to is a class') | 125 @Flag('CLASS', 0, |
| 126 'Indicates that the thing being referred to is a class or enum') |
| 125 @Flag('TYPEDEF', 1, 'Indicates that the thing being referred to is a typedef') | 127 @Flag('TYPEDEF', 1, 'Indicates that the thing being referred to is a typedef') |
| 126 @Flag('OTHER', 2, | 128 @Flag('OTHER', 2, |
| 127 'Indicates that the thing being referred to is a variable or executable') | 129 'Indicates that the thing being referred to is a variable or executable') |
| 128 @Flag('UNRESOLVED', 3, | 130 @Flag('UNRESOLVED', 3, |
| 129 'Indicates that the thing being referred to was not found') | 131 'Indicates that the thing being referred to was not found') |
| 130 int flags; | 132 int flags; |
| 131 } | 133 } |
| 132 | 134 |
| 133 /** | 135 /** |
| 134 * Unlinked summary information about a class declaration. | 136 * Unlinked summary information about a class declaration. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 145 */ | 147 */ |
| 146 @informative | 148 @informative |
| 147 int unit; | 149 int unit; |
| 148 | 150 |
| 149 /** | 151 /** |
| 150 * Type parameters of the class, if any. | 152 * Type parameters of the class, if any. |
| 151 */ | 153 */ |
| 152 List<UnlinkedTypeParam> typeParameters; | 154 List<UnlinkedTypeParam> typeParameters; |
| 153 | 155 |
| 154 /** | 156 /** |
| 155 * Supertype of the class, or `null` if the class doesn't explicitly declare | 157 * Supertype of the class, or `null` if either (a) the class doesn't |
| 156 * a supertype. | 158 * explicitly declare a supertype (and hence has supertype `Object`), or (b) |
| 159 * the class *is* `Object` (and hence has no supertype). |
| 157 */ | 160 */ |
| 158 UnlinkedTypeRef supertype; | 161 UnlinkedTypeRef supertype; |
| 159 | 162 |
| 160 /** | 163 /** |
| 161 * Mixins appering in a `with` clause, if any. | 164 * Mixins appering in a `with` clause, if any. |
| 162 */ | 165 */ |
| 163 List<UnlinkedTypeRef> mixins; | 166 List<UnlinkedTypeRef> mixins; |
| 164 | 167 |
| 165 /** | 168 /** |
| 166 * Interfaces appearing in an `implements` clause, if any. | 169 * Interfaces appearing in an `implements` clause, if any. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 /** | 206 /** |
| 204 * Unlinked summary information about an enum declaration. | 207 * Unlinked summary information about an enum declaration. |
| 205 */ | 208 */ |
| 206 class UnlinkedEnum { | 209 class UnlinkedEnum { |
| 207 /** | 210 /** |
| 208 * Name of the enum type. | 211 * Name of the enum type. |
| 209 */ | 212 */ |
| 210 String name; | 213 String name; |
| 211 | 214 |
| 212 /** | 215 /** |
| 213 * Values listed in the enum declaration. | 216 * Values listed in the enum declaration, in declaration order. |
| 214 */ | 217 */ |
| 215 List<UnlinkedEnumValue> values; | 218 List<UnlinkedEnumValue> values; |
| 216 | 219 |
| 217 /** | 220 /** |
| 218 * Index into [UnlinkedLibrary.units] indicating which compilation unit the | 221 * Index into [UnlinkedLibrary.units] indicating which compilation unit the |
| 219 * enum is declared in. | 222 * enum is declared in. |
| 220 */ | 223 */ |
| 221 @informative | 224 @informative |
| 222 int unit; | 225 int unit; |
| 223 } | 226 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 | 264 |
| 262 /** | 265 /** |
| 263 * Declared return type of the executable. Absent if the return type is | 266 * Declared return type of the executable. Absent if the return type is |
| 264 * `void`. Note that when strong mode is enabled, the actual return type may | 267 * `void`. Note that when strong mode is enabled, the actual return type may |
| 265 * be different due to type inference. | 268 * be different due to type inference. |
| 266 */ | 269 */ |
| 267 UnlinkedTypeRef returnType; | 270 UnlinkedTypeRef returnType; |
| 268 | 271 |
| 269 /** | 272 /** |
| 270 * Parameters of the executable, if any. Note that getters have no | 273 * Parameters of the executable, if any. Note that getters have no |
| 271 * parameters, and setters have a single parameter. | 274 * parameters (hence this will be the empty list), and setters have a single |
| 275 * parameter. |
| 272 */ | 276 */ |
| 273 List<UnlinkedParam> parameters; | 277 List<UnlinkedParam> parameters; |
| 274 | 278 |
| 275 @Flag('FUNCTION', 0, | 279 @Flag('FUNCTION', 0, |
| 276 'Indicates that the declaration is for a function or method') | 280 'Indicates that the declaration is for a function or method') |
| 277 @Flag('GETTER', 1, 'Indicates that the declaration is for a getter') | 281 @Flag('GETTER', 1, 'Indicates that the declaration is for a getter') |
| 278 @Flag('SETTER', 2, 'Indicates that the declaration is for a setter') | 282 @Flag('SETTER', 2, 'Indicates that the declaration is for a setter') |
| 279 @Flag('CONSTRUCTOR', 3, 'Indicates that the declaration is for a constructor') | 283 @Flag('CONSTRUCTOR', 3, 'Indicates that the declaration is for a constructor') |
| 280 @Flag('ABSTRACT', 4, 'Set if the declaration lacks a function body') | 284 @Flag('ABSTRACT', 4, 'Set if the declaration lacks a function body') |
| 281 @Flag('STATIC', 8, 'Set if the declaration includes the `static` keyword') | 285 @Flag('STATIC', 8, 'Set if the declaration includes the `static` keyword') |
| 282 @Flag('CONST', 16, | 286 @Flag('CONST', 16, |
| 283 'Set if the declaration includes the `const` keyword (constructors only)') | 287 'Set if the declaration includes the `const` keyword (constructors only)') |
| 284 @Flag('FACTORY', 32, | 288 @Flag('FACTORY', 32, |
| 285 'Set if the declaration includes the `factory` keyword (constructors only)
') | 289 'Set if the declaration includes the `factory` keyword (constructors only)
') |
| 286 int flags; | 290 int flags; |
| 287 } | 291 } |
| 288 | 292 |
| 289 /** | 293 /** |
| 290 * Unlinked summary information about an export declaration. | 294 * Unlinked summary information about an export declaration. |
| 291 */ | 295 */ |
| 292 class UnlinkedExport { | 296 class UnlinkedExport { |
| 293 /** | 297 /** |
| 294 * Relative URI used to reference the exported library. | 298 * URI used in the source code to reference the exported library. |
| 295 */ | 299 */ |
| 296 String uri; | 300 String uri; |
| 297 | 301 |
| 298 /** | 302 /** |
| 299 * Combinators contained in this import declaration. | 303 * Combinators contained in this import declaration. |
| 300 */ | 304 */ |
| 301 List<UnlinkedCombinator> combinators; | 305 List<UnlinkedCombinator> combinators; |
| 302 } | 306 } |
| 303 | 307 |
| 304 /** | 308 /** |
| 305 * Unlinked summary information about an import declaration. | 309 * Unlinked summary information about an import declaration. |
| 306 */ | 310 */ |
| 307 class UnlinkedImport { | 311 class UnlinkedImport { |
| 308 /** | 312 /** |
| 309 * Relative URI used to reference the imported library. | 313 * URI used in the source code to reference the imported library. |
| 310 */ | 314 */ |
| 311 String uri; | 315 String uri; |
| 312 | 316 |
| 313 /** | 317 /** |
| 314 * Offset of the "import" keyword. Zero for implicit imports. | 318 * Offset of the "import" keyword. Zero for implicit imports. |
| 315 * | 319 * |
| 316 * Note that explicit imports may also have an offset of zero. To | 320 * Note that explicit imports may also have an offset of zero. To |
| 317 * distinguish explicit from implicit imports, look for the presence of the | 321 * distinguish explicit from implicit imports, look for the presence of the |
| 318 * [IMPLICIT] flag. | 322 * [IMPLICIT] flag. |
| 319 */ | 323 */ |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 * Declared type of the variable. Note that when strong mode is enabled, the | 580 * Declared type of the variable. Note that when strong mode is enabled, the |
| 577 * actual type of the variable may be different due to type inference. | 581 * actual type of the variable may be different due to type inference. |
| 578 */ | 582 */ |
| 579 UnlinkedTypeRef type; | 583 UnlinkedTypeRef type; |
| 580 | 584 |
| 581 @Flag('STATIC', 1, 'Set if the declaration includes the `static` keyword') | 585 @Flag('STATIC', 1, 'Set if the declaration includes the `static` keyword') |
| 582 @Flag('FINAL', 2, 'Set if the declaration includes the `final` keyword') | 586 @Flag('FINAL', 2, 'Set if the declaration includes the `final` keyword') |
| 583 @Flag('CONST', 4, 'Set if the declaration includes the `const` keyword') | 587 @Flag('CONST', 4, 'Set if the declaration includes the `const` keyword') |
| 584 int flags; | 588 int flags; |
| 585 } | 589 } |
| OLD | NEW |