| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // |
| 5 // This file has been automatically generated. Please do not edit it manually. |
| 6 // To regenerate the file, use the script "pkg/analyzer/tool/generate_files". |
| 7 |
| 8 library analyzer.src.summary.format; |
| 9 |
| 10 import 'flat_buffers.dart' as fb; |
| 11 import 'idl.dart' as idl; |
| 12 import 'dart:convert' as convert; |
| 13 import 'api_signature.dart' as api_sig; |
| 14 |
| 15 class _IndexNameKindReader extends fb.Reader<idl.IndexNameKind> { |
| 16 const _IndexNameKindReader() : super(); |
| 17 |
| 18 @override |
| 19 int get size => 1; |
| 20 |
| 21 @override |
| 22 idl.IndexNameKind read(fb.BufferContext bc, int offset) { |
| 23 int index = const fb.Uint8Reader().read(bc, offset); |
| 24 return index < idl.IndexNameKind.values.length ? idl.IndexNameKind.values[in
dex] : idl.IndexNameKind.topLevel; |
| 25 } |
| 26 } |
| 27 |
| 28 class _IndexRelationKindReader extends fb.Reader<idl.IndexRelationKind> { |
| 29 const _IndexRelationKindReader() : super(); |
| 30 |
| 31 @override |
| 32 int get size => 1; |
| 33 |
| 34 @override |
| 35 idl.IndexRelationKind read(fb.BufferContext bc, int offset) { |
| 36 int index = const fb.Uint8Reader().read(bc, offset); |
| 37 return index < idl.IndexRelationKind.values.length ? idl.IndexRelationKind.v
alues[index] : idl.IndexRelationKind.IS_ANCESTOR_OF; |
| 38 } |
| 39 } |
| 40 |
| 41 class _IndexSyntheticElementKindReader extends fb.Reader<idl.IndexSyntheticEleme
ntKind> { |
| 42 const _IndexSyntheticElementKindReader() : super(); |
| 43 |
| 44 @override |
| 45 int get size => 1; |
| 46 |
| 47 @override |
| 48 idl.IndexSyntheticElementKind read(fb.BufferContext bc, int offset) { |
| 49 int index = const fb.Uint8Reader().read(bc, offset); |
| 50 return index < idl.IndexSyntheticElementKind.values.length ? idl.IndexSynthe
ticElementKind.values[index] : idl.IndexSyntheticElementKind.notSynthetic; |
| 51 } |
| 52 } |
| 53 |
| 54 class _ReferenceKindReader extends fb.Reader<idl.ReferenceKind> { |
| 55 const _ReferenceKindReader() : super(); |
| 56 |
| 57 @override |
| 58 int get size => 1; |
| 59 |
| 60 @override |
| 61 idl.ReferenceKind read(fb.BufferContext bc, int offset) { |
| 62 int index = const fb.Uint8Reader().read(bc, offset); |
| 63 return index < idl.ReferenceKind.values.length ? idl.ReferenceKind.values[in
dex] : idl.ReferenceKind.classOrEnum; |
| 64 } |
| 65 } |
| 66 |
| 67 class _UnlinkedConstOperationReader extends fb.Reader<idl.UnlinkedConstOperation
> { |
| 68 const _UnlinkedConstOperationReader() : super(); |
| 69 |
| 70 @override |
| 71 int get size => 1; |
| 72 |
| 73 @override |
| 74 idl.UnlinkedConstOperation read(fb.BufferContext bc, int offset) { |
| 75 int index = const fb.Uint8Reader().read(bc, offset); |
| 76 return index < idl.UnlinkedConstOperation.values.length ? idl.UnlinkedConstO
peration.values[index] : idl.UnlinkedConstOperation.pushInt; |
| 77 } |
| 78 } |
| 79 |
| 80 class _UnlinkedConstructorInitializerKindReader extends fb.Reader<idl.UnlinkedCo
nstructorInitializerKind> { |
| 81 const _UnlinkedConstructorInitializerKindReader() : super(); |
| 82 |
| 83 @override |
| 84 int get size => 1; |
| 85 |
| 86 @override |
| 87 idl.UnlinkedConstructorInitializerKind read(fb.BufferContext bc, int offset) { |
| 88 int index = const fb.Uint8Reader().read(bc, offset); |
| 89 return index < idl.UnlinkedConstructorInitializerKind.values.length ? idl.Un
linkedConstructorInitializerKind.values[index] : idl.UnlinkedConstructorInitiali
zerKind.field; |
| 90 } |
| 91 } |
| 92 |
| 93 class _UnlinkedExecutableKindReader extends fb.Reader<idl.UnlinkedExecutableKind
> { |
| 94 const _UnlinkedExecutableKindReader() : super(); |
| 95 |
| 96 @override |
| 97 int get size => 1; |
| 98 |
| 99 @override |
| 100 idl.UnlinkedExecutableKind read(fb.BufferContext bc, int offset) { |
| 101 int index = const fb.Uint8Reader().read(bc, offset); |
| 102 return index < idl.UnlinkedExecutableKind.values.length ? idl.UnlinkedExecut
ableKind.values[index] : idl.UnlinkedExecutableKind.functionOrMethod; |
| 103 } |
| 104 } |
| 105 |
| 106 class _UnlinkedExprAssignOperatorReader extends fb.Reader<idl.UnlinkedExprAssign
Operator> { |
| 107 const _UnlinkedExprAssignOperatorReader() : super(); |
| 108 |
| 109 @override |
| 110 int get size => 1; |
| 111 |
| 112 @override |
| 113 idl.UnlinkedExprAssignOperator read(fb.BufferContext bc, int offset) { |
| 114 int index = const fb.Uint8Reader().read(bc, offset); |
| 115 return index < idl.UnlinkedExprAssignOperator.values.length ? idl.UnlinkedEx
prAssignOperator.values[index] : idl.UnlinkedExprAssignOperator.assign; |
| 116 } |
| 117 } |
| 118 |
| 119 class _UnlinkedParamKindReader extends fb.Reader<idl.UnlinkedParamKind> { |
| 120 const _UnlinkedParamKindReader() : super(); |
| 121 |
| 122 @override |
| 123 int get size => 1; |
| 124 |
| 125 @override |
| 126 idl.UnlinkedParamKind read(fb.BufferContext bc, int offset) { |
| 127 int index = const fb.Uint8Reader().read(bc, offset); |
| 128 return index < idl.UnlinkedParamKind.values.length ? idl.UnlinkedParamKind.v
alues[index] : idl.UnlinkedParamKind.required; |
| 129 } |
| 130 } |
| 131 |
| 132 class CodeRangeBuilder extends Object with _CodeRangeMixin implements idl.CodeRa
nge { |
| 133 int _length; |
| 134 int _offset; |
| 135 |
| 136 @override |
| 137 int get length => _length ??= 0; |
| 138 |
| 139 /** |
| 140 * Length of the element code. |
| 141 */ |
| 142 void set length(int value) { |
| 143 assert(value == null || value >= 0); |
| 144 this._length = value; |
| 145 } |
| 146 |
| 147 @override |
| 148 int get offset => _offset ??= 0; |
| 149 |
| 150 /** |
| 151 * Offset of the element code relative to the beginning of the file. |
| 152 */ |
| 153 void set offset(int value) { |
| 154 assert(value == null || value >= 0); |
| 155 this._offset = value; |
| 156 } |
| 157 |
| 158 CodeRangeBuilder({int length, int offset}) |
| 159 : _length = length, |
| 160 _offset = offset; |
| 161 |
| 162 /** |
| 163 * Flush [informative] data recursively. |
| 164 */ |
| 165 void flushInformative() { |
| 166 } |
| 167 |
| 168 /** |
| 169 * Accumulate non-[informative] data into [signature]. |
| 170 */ |
| 171 void collectApiSignature(api_sig.ApiSignature signature) { |
| 172 signature.addInt(this._offset ?? 0); |
| 173 signature.addInt(this._length ?? 0); |
| 174 } |
| 175 |
| 176 fb.Offset finish(fb.Builder fbBuilder) { |
| 177 fbBuilder.startTable(); |
| 178 if (_length != null && _length != 0) { |
| 179 fbBuilder.addUint32(1, _length); |
| 180 } |
| 181 if (_offset != null && _offset != 0) { |
| 182 fbBuilder.addUint32(0, _offset); |
| 183 } |
| 184 return fbBuilder.endTable(); |
| 185 } |
| 186 } |
| 187 |
| 188 class _CodeRangeReader extends fb.TableReader<_CodeRangeImpl> { |
| 189 const _CodeRangeReader(); |
| 190 |
| 191 @override |
| 192 _CodeRangeImpl createObject(fb.BufferContext bc, int offset) => new _CodeRange
Impl(bc, offset); |
| 193 } |
| 194 |
| 195 class _CodeRangeImpl extends Object with _CodeRangeMixin implements idl.CodeRang
e { |
| 196 final fb.BufferContext _bc; |
| 197 final int _bcOffset; |
| 198 |
| 199 _CodeRangeImpl(this._bc, this._bcOffset); |
| 200 |
| 201 int _length; |
| 202 int _offset; |
| 203 |
| 204 @override |
| 205 int get length { |
| 206 _length ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 1, 0); |
| 207 return _length; |
| 208 } |
| 209 |
| 210 @override |
| 211 int get offset { |
| 212 _offset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 0, 0); |
| 213 return _offset; |
| 214 } |
| 215 } |
| 216 |
| 217 abstract class _CodeRangeMixin implements idl.CodeRange { |
| 218 @override |
| 219 Map<String, Object> toJson() { |
| 220 Map<String, Object> _result = <String, Object>{}; |
| 221 if (length != 0) _result["length"] = length; |
| 222 if (offset != 0) _result["offset"] = offset; |
| 223 return _result; |
| 224 } |
| 225 |
| 226 @override |
| 227 Map<String, Object> toMap() => { |
| 228 "length": length, |
| 229 "offset": offset, |
| 230 }; |
| 231 |
| 232 @override |
| 233 String toString() => convert.JSON.encode(toJson()); |
| 234 } |
| 235 |
| 236 class EntityRefBuilder extends Object with _EntityRefMixin implements idl.Entity
Ref { |
| 237 List<int> _implicitFunctionTypeIndices; |
| 238 int _paramReference; |
| 239 int _reference; |
| 240 int _slot; |
| 241 List<UnlinkedParamBuilder> _syntheticParams; |
| 242 EntityRefBuilder _syntheticReturnType; |
| 243 List<EntityRefBuilder> _typeArguments; |
| 244 |
| 245 @override |
| 246 List<int> get implicitFunctionTypeIndices => _implicitFunctionTypeIndices ??=
<int>[]; |
| 247 |
| 248 /** |
| 249 * If this is a reference to a function type implicitly defined by a |
| 250 * function-typed parameter, a list of zero-based indices indicating the path |
| 251 * from the entity referred to by [reference] to the appropriate type |
| 252 * parameter. Otherwise the empty list. |
| 253 * |
| 254 * If there are N indices in this list, then the entity being referred to is |
| 255 * the function type implicitly defined by a function-typed parameter of a |
| 256 * function-typed parameter, to N levels of nesting. The first index in the |
| 257 * list refers to the outermost level of nesting; for example if [reference] |
| 258 * refers to the entity defined by: |
| 259 * |
| 260 * void f(x, void g(y, z, int h(String w))) { ... } |
| 261 * |
| 262 * Then to refer to the function type implicitly defined by parameter `h` |
| 263 * (which is parameter 2 of parameter 1 of `f`), then |
| 264 * [implicitFunctionTypeIndices] should be [1, 2]. |
| 265 * |
| 266 * Note that if the entity being referred to is a generic method inside a |
| 267 * generic class, then the type arguments in [typeArguments] are applied |
| 268 * first to the class and then to the method. |
| 269 */ |
| 270 void set implicitFunctionTypeIndices(List<int> value) { |
| 271 assert(value == null || value.every((e) => e >= 0)); |
| 272 this._implicitFunctionTypeIndices = value; |
| 273 } |
| 274 |
| 275 @override |
| 276 int get paramReference => _paramReference ??= 0; |
| 277 |
| 278 /** |
| 279 * If this is a reference to a type parameter, one-based index into the list |
| 280 * of [UnlinkedTypeParam]s currently in effect. Indexing is done using De |
| 281 * Bruijn index conventions; that is, innermost parameters come first, and |
| 282 * if a class or method has multiple parameters, they are indexed from right |
| 283 * to left. So for instance, if the enclosing declaration is |
| 284 * |
| 285 * class C<T,U> { |
| 286 * m<V,W> { |
| 287 * ... |
| 288 * } |
| 289 * } |
| 290 * |
| 291 * Then [paramReference] values of 1, 2, 3, and 4 represent W, V, U, and T, |
| 292 * respectively. |
| 293 * |
| 294 * If the type being referred to is not a type parameter, [paramReference] is |
| 295 * zero. |
| 296 */ |
| 297 void set paramReference(int value) { |
| 298 assert(value == null || value >= 0); |
| 299 this._paramReference = value; |
| 300 } |
| 301 |
| 302 @override |
| 303 int get reference => _reference ??= 0; |
| 304 |
| 305 /** |
| 306 * Index into [UnlinkedUnit.references] for the entity being referred to, or |
| 307 * zero if this is a reference to a type parameter. |
| 308 */ |
| 309 void set reference(int value) { |
| 310 assert(value == null || value >= 0); |
| 311 this._reference = value; |
| 312 } |
| 313 |
| 314 @override |
| 315 int get slot => _slot ??= 0; |
| 316 |
| 317 /** |
| 318 * If this [EntityRef] is contained within [LinkedUnit.types], slot id (which |
| 319 * is unique within the compilation unit) identifying the target of type |
| 320 * propagation or type inference with which this [EntityRef] is associated. |
| 321 * |
| 322 * Otherwise zero. |
| 323 */ |
| 324 void set slot(int value) { |
| 325 assert(value == null || value >= 0); |
| 326 this._slot = value; |
| 327 } |
| 328 |
| 329 @override |
| 330 List<UnlinkedParamBuilder> get syntheticParams => _syntheticParams ??= <Unlink
edParamBuilder>[]; |
| 331 |
| 332 /** |
| 333 * If this [EntityRef] is a reference to a function type whose |
| 334 * [FunctionElement] is not in any library (e.g. a function type that was |
| 335 * synthesized by a LUB computation), the function parameters. Otherwise |
| 336 * empty. |
| 337 */ |
| 338 void set syntheticParams(List<UnlinkedParamBuilder> value) { |
| 339 this._syntheticParams = value; |
| 340 } |
| 341 |
| 342 @override |
| 343 EntityRefBuilder get syntheticReturnType => _syntheticReturnType; |
| 344 |
| 345 /** |
| 346 * If this [EntityRef] is a reference to a function type whose |
| 347 * [FunctionElement] is not in any library (e.g. a function type that was |
| 348 * synthesized by a LUB computation), the return type of the function. |
| 349 * Otherwise `null`. |
| 350 */ |
| 351 void set syntheticReturnType(EntityRefBuilder value) { |
| 352 this._syntheticReturnType = value; |
| 353 } |
| 354 |
| 355 @override |
| 356 List<EntityRefBuilder> get typeArguments => _typeArguments ??= <EntityRefBuild
er>[]; |
| 357 |
| 358 /** |
| 359 * If this is an instantiation of a generic type or generic executable, the |
| 360 * type arguments used to instantiate it (if any). |
| 361 */ |
| 362 void set typeArguments(List<EntityRefBuilder> value) { |
| 363 this._typeArguments = value; |
| 364 } |
| 365 |
| 366 EntityRefBuilder({List<int> implicitFunctionTypeIndices, int paramReference, i
nt reference, int slot, List<UnlinkedParamBuilder> syntheticParams, EntityRefBui
lder syntheticReturnType, List<EntityRefBuilder> typeArguments}) |
| 367 : _implicitFunctionTypeIndices = implicitFunctionTypeIndices, |
| 368 _paramReference = paramReference, |
| 369 _reference = reference, |
| 370 _slot = slot, |
| 371 _syntheticParams = syntheticParams, |
| 372 _syntheticReturnType = syntheticReturnType, |
| 373 _typeArguments = typeArguments; |
| 374 |
| 375 /** |
| 376 * Flush [informative] data recursively. |
| 377 */ |
| 378 void flushInformative() { |
| 379 _syntheticParams?.forEach((b) => b.flushInformative()); |
| 380 _syntheticReturnType?.flushInformative(); |
| 381 _typeArguments?.forEach((b) => b.flushInformative()); |
| 382 } |
| 383 |
| 384 /** |
| 385 * Accumulate non-[informative] data into [signature]. |
| 386 */ |
| 387 void collectApiSignature(api_sig.ApiSignature signature) { |
| 388 signature.addInt(this._reference ?? 0); |
| 389 if (this._typeArguments == null) { |
| 390 signature.addInt(0); |
| 391 } else { |
| 392 signature.addInt(this._typeArguments.length); |
| 393 for (var x in this._typeArguments) { |
| 394 x?.collectApiSignature(signature); |
| 395 } |
| 396 } |
| 397 signature.addInt(this._slot ?? 0); |
| 398 signature.addInt(this._paramReference ?? 0); |
| 399 if (this._implicitFunctionTypeIndices == null) { |
| 400 signature.addInt(0); |
| 401 } else { |
| 402 signature.addInt(this._implicitFunctionTypeIndices.length); |
| 403 for (var x in this._implicitFunctionTypeIndices) { |
| 404 signature.addInt(x); |
| 405 } |
| 406 } |
| 407 signature.addBool(this._syntheticReturnType != null); |
| 408 this._syntheticReturnType?.collectApiSignature(signature); |
| 409 if (this._syntheticParams == null) { |
| 410 signature.addInt(0); |
| 411 } else { |
| 412 signature.addInt(this._syntheticParams.length); |
| 413 for (var x in this._syntheticParams) { |
| 414 x?.collectApiSignature(signature); |
| 415 } |
| 416 } |
| 417 } |
| 418 |
| 419 fb.Offset finish(fb.Builder fbBuilder) { |
| 420 fb.Offset offset_implicitFunctionTypeIndices; |
| 421 fb.Offset offset_syntheticParams; |
| 422 fb.Offset offset_syntheticReturnType; |
| 423 fb.Offset offset_typeArguments; |
| 424 if (!(_implicitFunctionTypeIndices == null || _implicitFunctionTypeIndices.i
sEmpty)) { |
| 425 offset_implicitFunctionTypeIndices = fbBuilder.writeListUint32(_implicitFu
nctionTypeIndices); |
| 426 } |
| 427 if (!(_syntheticParams == null || _syntheticParams.isEmpty)) { |
| 428 offset_syntheticParams = fbBuilder.writeList(_syntheticParams.map((b) => b
.finish(fbBuilder)).toList()); |
| 429 } |
| 430 if (_syntheticReturnType != null) { |
| 431 offset_syntheticReturnType = _syntheticReturnType.finish(fbBuilder); |
| 432 } |
| 433 if (!(_typeArguments == null || _typeArguments.isEmpty)) { |
| 434 offset_typeArguments = fbBuilder.writeList(_typeArguments.map((b) => b.fin
ish(fbBuilder)).toList()); |
| 435 } |
| 436 fbBuilder.startTable(); |
| 437 if (offset_implicitFunctionTypeIndices != null) { |
| 438 fbBuilder.addOffset(4, offset_implicitFunctionTypeIndices); |
| 439 } |
| 440 if (_paramReference != null && _paramReference != 0) { |
| 441 fbBuilder.addUint32(3, _paramReference); |
| 442 } |
| 443 if (_reference != null && _reference != 0) { |
| 444 fbBuilder.addUint32(0, _reference); |
| 445 } |
| 446 if (_slot != null && _slot != 0) { |
| 447 fbBuilder.addUint32(2, _slot); |
| 448 } |
| 449 if (offset_syntheticParams != null) { |
| 450 fbBuilder.addOffset(6, offset_syntheticParams); |
| 451 } |
| 452 if (offset_syntheticReturnType != null) { |
| 453 fbBuilder.addOffset(5, offset_syntheticReturnType); |
| 454 } |
| 455 if (offset_typeArguments != null) { |
| 456 fbBuilder.addOffset(1, offset_typeArguments); |
| 457 } |
| 458 return fbBuilder.endTable(); |
| 459 } |
| 460 } |
| 461 |
| 462 class _EntityRefReader extends fb.TableReader<_EntityRefImpl> { |
| 463 const _EntityRefReader(); |
| 464 |
| 465 @override |
| 466 _EntityRefImpl createObject(fb.BufferContext bc, int offset) => new _EntityRef
Impl(bc, offset); |
| 467 } |
| 468 |
| 469 class _EntityRefImpl extends Object with _EntityRefMixin implements idl.EntityRe
f { |
| 470 final fb.BufferContext _bc; |
| 471 final int _bcOffset; |
| 472 |
| 473 _EntityRefImpl(this._bc, this._bcOffset); |
| 474 |
| 475 List<int> _implicitFunctionTypeIndices; |
| 476 int _paramReference; |
| 477 int _reference; |
| 478 int _slot; |
| 479 List<idl.UnlinkedParam> _syntheticParams; |
| 480 idl.EntityRef _syntheticReturnType; |
| 481 List<idl.EntityRef> _typeArguments; |
| 482 |
| 483 @override |
| 484 List<int> get implicitFunctionTypeIndices { |
| 485 _implicitFunctionTypeIndices ??= const fb.Uint32ListReader().vTableGet(_bc,
_bcOffset, 4, const <int>[]); |
| 486 return _implicitFunctionTypeIndices; |
| 487 } |
| 488 |
| 489 @override |
| 490 int get paramReference { |
| 491 _paramReference ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 3, 0); |
| 492 return _paramReference; |
| 493 } |
| 494 |
| 495 @override |
| 496 int get reference { |
| 497 _reference ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 0, 0); |
| 498 return _reference; |
| 499 } |
| 500 |
| 501 @override |
| 502 int get slot { |
| 503 _slot ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 2, 0); |
| 504 return _slot; |
| 505 } |
| 506 |
| 507 @override |
| 508 List<idl.UnlinkedParam> get syntheticParams { |
| 509 _syntheticParams ??= const fb.ListReader<idl.UnlinkedParam>(const _UnlinkedP
aramReader()).vTableGet(_bc, _bcOffset, 6, const <idl.UnlinkedParam>[]); |
| 510 return _syntheticParams; |
| 511 } |
| 512 |
| 513 @override |
| 514 idl.EntityRef get syntheticReturnType { |
| 515 _syntheticReturnType ??= const _EntityRefReader().vTableGet(_bc, _bcOffset,
5, null); |
| 516 return _syntheticReturnType; |
| 517 } |
| 518 |
| 519 @override |
| 520 List<idl.EntityRef> get typeArguments { |
| 521 _typeArguments ??= const fb.ListReader<idl.EntityRef>(const _EntityRefReader
()).vTableGet(_bc, _bcOffset, 1, const <idl.EntityRef>[]); |
| 522 return _typeArguments; |
| 523 } |
| 524 } |
| 525 |
| 526 abstract class _EntityRefMixin implements idl.EntityRef { |
| 527 @override |
| 528 Map<String, Object> toJson() { |
| 529 Map<String, Object> _result = <String, Object>{}; |
| 530 if (implicitFunctionTypeIndices.isNotEmpty) _result["implicitFunctionTypeInd
ices"] = implicitFunctionTypeIndices; |
| 531 if (paramReference != 0) _result["paramReference"] = paramReference; |
| 532 if (reference != 0) _result["reference"] = reference; |
| 533 if (slot != 0) _result["slot"] = slot; |
| 534 if (syntheticParams.isNotEmpty) _result["syntheticParams"] = syntheticParams
.map((_value) => _value.toJson()).toList(); |
| 535 if (syntheticReturnType != null) _result["syntheticReturnType"] = syntheticR
eturnType.toJson(); |
| 536 if (typeArguments.isNotEmpty) _result["typeArguments"] = typeArguments.map((
_value) => _value.toJson()).toList(); |
| 537 return _result; |
| 538 } |
| 539 |
| 540 @override |
| 541 Map<String, Object> toMap() => { |
| 542 "implicitFunctionTypeIndices": implicitFunctionTypeIndices, |
| 543 "paramReference": paramReference, |
| 544 "reference": reference, |
| 545 "slot": slot, |
| 546 "syntheticParams": syntheticParams, |
| 547 "syntheticReturnType": syntheticReturnType, |
| 548 "typeArguments": typeArguments, |
| 549 }; |
| 550 |
| 551 @override |
| 552 String toString() => convert.JSON.encode(toJson()); |
| 553 } |
| 554 |
| 555 class LinkedDependencyBuilder extends Object with _LinkedDependencyMixin impleme
nts idl.LinkedDependency { |
| 556 List<String> _parts; |
| 557 String _uri; |
| 558 |
| 559 @override |
| 560 List<String> get parts => _parts ??= <String>[]; |
| 561 |
| 562 /** |
| 563 * URI for the compilation units listed in the library's `part` declarations. |
| 564 * These URIs are relative to the importing library. |
| 565 */ |
| 566 void set parts(List<String> value) { |
| 567 this._parts = value; |
| 568 } |
| 569 |
| 570 @override |
| 571 String get uri => _uri ??= ''; |
| 572 |
| 573 /** |
| 574 * The relative URI of the dependent library. This URI is relative to the |
| 575 * importing library, even if there are intervening `export` declarations. |
| 576 * So, for example, if `a.dart` imports `b/c.dart` and `b/c.dart` exports |
| 577 * `d/e.dart`, the URI listed for `a.dart`'s dependency on `e.dart` will be |
| 578 * `b/d/e.dart`. |
| 579 */ |
| 580 void set uri(String value) { |
| 581 this._uri = value; |
| 582 } |
| 583 |
| 584 LinkedDependencyBuilder({List<String> parts, String uri}) |
| 585 : _parts = parts, |
| 586 _uri = uri; |
| 587 |
| 588 /** |
| 589 * Flush [informative] data recursively. |
| 590 */ |
| 591 void flushInformative() { |
| 592 } |
| 593 |
| 594 /** |
| 595 * Accumulate non-[informative] data into [signature]. |
| 596 */ |
| 597 void collectApiSignature(api_sig.ApiSignature signature) { |
| 598 signature.addString(this._uri ?? ''); |
| 599 if (this._parts == null) { |
| 600 signature.addInt(0); |
| 601 } else { |
| 602 signature.addInt(this._parts.length); |
| 603 for (var x in this._parts) { |
| 604 signature.addString(x); |
| 605 } |
| 606 } |
| 607 } |
| 608 |
| 609 fb.Offset finish(fb.Builder fbBuilder) { |
| 610 fb.Offset offset_parts; |
| 611 fb.Offset offset_uri; |
| 612 if (!(_parts == null || _parts.isEmpty)) { |
| 613 offset_parts = fbBuilder.writeList(_parts.map((b) => fbBuilder.writeString
(b)).toList()); |
| 614 } |
| 615 if (_uri != null) { |
| 616 offset_uri = fbBuilder.writeString(_uri); |
| 617 } |
| 618 fbBuilder.startTable(); |
| 619 if (offset_parts != null) { |
| 620 fbBuilder.addOffset(1, offset_parts); |
| 621 } |
| 622 if (offset_uri != null) { |
| 623 fbBuilder.addOffset(0, offset_uri); |
| 624 } |
| 625 return fbBuilder.endTable(); |
| 626 } |
| 627 } |
| 628 |
| 629 class _LinkedDependencyReader extends fb.TableReader<_LinkedDependencyImpl> { |
| 630 const _LinkedDependencyReader(); |
| 631 |
| 632 @override |
| 633 _LinkedDependencyImpl createObject(fb.BufferContext bc, int offset) => new _Li
nkedDependencyImpl(bc, offset); |
| 634 } |
| 635 |
| 636 class _LinkedDependencyImpl extends Object with _LinkedDependencyMixin implement
s idl.LinkedDependency { |
| 637 final fb.BufferContext _bc; |
| 638 final int _bcOffset; |
| 639 |
| 640 _LinkedDependencyImpl(this._bc, this._bcOffset); |
| 641 |
| 642 List<String> _parts; |
| 643 String _uri; |
| 644 |
| 645 @override |
| 646 List<String> get parts { |
| 647 _parts ??= const fb.ListReader<String>(const fb.StringReader()).vTableGet(_b
c, _bcOffset, 1, const <String>[]); |
| 648 return _parts; |
| 649 } |
| 650 |
| 651 @override |
| 652 String get uri { |
| 653 _uri ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, ''); |
| 654 return _uri; |
| 655 } |
| 656 } |
| 657 |
| 658 abstract class _LinkedDependencyMixin implements idl.LinkedDependency { |
| 659 @override |
| 660 Map<String, Object> toJson() { |
| 661 Map<String, Object> _result = <String, Object>{}; |
| 662 if (parts.isNotEmpty) _result["parts"] = parts; |
| 663 if (uri != '') _result["uri"] = uri; |
| 664 return _result; |
| 665 } |
| 666 |
| 667 @override |
| 668 Map<String, Object> toMap() => { |
| 669 "parts": parts, |
| 670 "uri": uri, |
| 671 }; |
| 672 |
| 673 @override |
| 674 String toString() => convert.JSON.encode(toJson()); |
| 675 } |
| 676 |
| 677 class LinkedExportNameBuilder extends Object with _LinkedExportNameMixin impleme
nts idl.LinkedExportName { |
| 678 int _dependency; |
| 679 idl.ReferenceKind _kind; |
| 680 String _name; |
| 681 int _unit; |
| 682 |
| 683 @override |
| 684 int get dependency => _dependency ??= 0; |
| 685 |
| 686 /** |
| 687 * Index into [LinkedLibrary.dependencies] for the library in which the |
| 688 * entity is defined. |
| 689 */ |
| 690 void set dependency(int value) { |
| 691 assert(value == null || value >= 0); |
| 692 this._dependency = value; |
| 693 } |
| 694 |
| 695 @override |
| 696 idl.ReferenceKind get kind => _kind ??= idl.ReferenceKind.classOrEnum; |
| 697 |
| 698 /** |
| 699 * The kind of the entity being referred to. |
| 700 */ |
| 701 void set kind(idl.ReferenceKind value) { |
| 702 this._kind = value; |
| 703 } |
| 704 |
| 705 @override |
| 706 String get name => _name ??= ''; |
| 707 |
| 708 /** |
| 709 * Name of the exported entity. For an exported setter, this name includes |
| 710 * the trailing '='. |
| 711 */ |
| 712 void set name(String value) { |
| 713 this._name = value; |
| 714 } |
| 715 |
| 716 @override |
| 717 int get unit => _unit ??= 0; |
| 718 |
| 719 /** |
| 720 * Integer index indicating which unit in the exported library contains the |
| 721 * definition of the entity. As with indices into [LinkedLibrary.units], |
| 722 * zero represents the defining compilation unit, and nonzero values |
| 723 * represent parts in the order of the corresponding `part` declarations. |
| 724 */ |
| 725 void set unit(int value) { |
| 726 assert(value == null || value >= 0); |
| 727 this._unit = value; |
| 728 } |
| 729 |
| 730 LinkedExportNameBuilder({int dependency, idl.ReferenceKind kind, String name,
int unit}) |
| 731 : _dependency = dependency, |
| 732 _kind = kind, |
| 733 _name = name, |
| 734 _unit = unit; |
| 735 |
| 736 /** |
| 737 * Flush [informative] data recursively. |
| 738 */ |
| 739 void flushInformative() { |
| 740 } |
| 741 |
| 742 /** |
| 743 * Accumulate non-[informative] data into [signature]. |
| 744 */ |
| 745 void collectApiSignature(api_sig.ApiSignature signature) { |
| 746 signature.addInt(this._dependency ?? 0); |
| 747 signature.addString(this._name ?? ''); |
| 748 signature.addInt(this._unit ?? 0); |
| 749 signature.addInt(this._kind == null ? 0 : this._kind.index); |
| 750 } |
| 751 |
| 752 fb.Offset finish(fb.Builder fbBuilder) { |
| 753 fb.Offset offset_name; |
| 754 if (_name != null) { |
| 755 offset_name = fbBuilder.writeString(_name); |
| 756 } |
| 757 fbBuilder.startTable(); |
| 758 if (_dependency != null && _dependency != 0) { |
| 759 fbBuilder.addUint32(0, _dependency); |
| 760 } |
| 761 if (_kind != null && _kind != idl.ReferenceKind.classOrEnum) { |
| 762 fbBuilder.addUint8(3, _kind.index); |
| 763 } |
| 764 if (offset_name != null) { |
| 765 fbBuilder.addOffset(1, offset_name); |
| 766 } |
| 767 if (_unit != null && _unit != 0) { |
| 768 fbBuilder.addUint32(2, _unit); |
| 769 } |
| 770 return fbBuilder.endTable(); |
| 771 } |
| 772 } |
| 773 |
| 774 class _LinkedExportNameReader extends fb.TableReader<_LinkedExportNameImpl> { |
| 775 const _LinkedExportNameReader(); |
| 776 |
| 777 @override |
| 778 _LinkedExportNameImpl createObject(fb.BufferContext bc, int offset) => new _Li
nkedExportNameImpl(bc, offset); |
| 779 } |
| 780 |
| 781 class _LinkedExportNameImpl extends Object with _LinkedExportNameMixin implement
s idl.LinkedExportName { |
| 782 final fb.BufferContext _bc; |
| 783 final int _bcOffset; |
| 784 |
| 785 _LinkedExportNameImpl(this._bc, this._bcOffset); |
| 786 |
| 787 int _dependency; |
| 788 idl.ReferenceKind _kind; |
| 789 String _name; |
| 790 int _unit; |
| 791 |
| 792 @override |
| 793 int get dependency { |
| 794 _dependency ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 0, 0); |
| 795 return _dependency; |
| 796 } |
| 797 |
| 798 @override |
| 799 idl.ReferenceKind get kind { |
| 800 _kind ??= const _ReferenceKindReader().vTableGet(_bc, _bcOffset, 3, idl.Refe
renceKind.classOrEnum); |
| 801 return _kind; |
| 802 } |
| 803 |
| 804 @override |
| 805 String get name { |
| 806 _name ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 1, ''); |
| 807 return _name; |
| 808 } |
| 809 |
| 810 @override |
| 811 int get unit { |
| 812 _unit ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 2, 0); |
| 813 return _unit; |
| 814 } |
| 815 } |
| 816 |
| 817 abstract class _LinkedExportNameMixin implements idl.LinkedExportName { |
| 818 @override |
| 819 Map<String, Object> toJson() { |
| 820 Map<String, Object> _result = <String, Object>{}; |
| 821 if (dependency != 0) _result["dependency"] = dependency; |
| 822 if (kind != idl.ReferenceKind.classOrEnum) _result["kind"] = kind.toString()
.split('.')[1]; |
| 823 if (name != '') _result["name"] = name; |
| 824 if (unit != 0) _result["unit"] = unit; |
| 825 return _result; |
| 826 } |
| 827 |
| 828 @override |
| 829 Map<String, Object> toMap() => { |
| 830 "dependency": dependency, |
| 831 "kind": kind, |
| 832 "name": name, |
| 833 "unit": unit, |
| 834 }; |
| 835 |
| 836 @override |
| 837 String toString() => convert.JSON.encode(toJson()); |
| 838 } |
| 839 |
| 840 class LinkedLibraryBuilder extends Object with _LinkedLibraryMixin implements id
l.LinkedLibrary { |
| 841 List<LinkedDependencyBuilder> _dependencies; |
| 842 List<int> _exportDependencies; |
| 843 List<LinkedExportNameBuilder> _exportNames; |
| 844 bool _fallbackMode; |
| 845 List<int> _importDependencies; |
| 846 int _numPrelinkedDependencies; |
| 847 List<LinkedUnitBuilder> _units; |
| 848 |
| 849 @override |
| 850 List<LinkedDependencyBuilder> get dependencies => _dependencies ??= <LinkedDep
endencyBuilder>[]; |
| 851 |
| 852 /** |
| 853 * The libraries that this library depends on (either via an explicit import |
| 854 * statement or via the implicit dependencies on `dart:core` and |
| 855 * `dart:async`). The first element of this array is a pseudo-dependency |
| 856 * representing the library itself (it is also used for `dynamic` and |
| 857 * `void`). This is followed by elements representing "prelinked" |
| 858 * dependencies (direct imports and the transitive closure of exports). |
| 859 * After the prelinked dependencies are elements representing "linked" |
| 860 * dependencies. |
| 861 * |
| 862 * A library is only included as a "linked" dependency if it is a true |
| 863 * dependency (e.g. a propagated or inferred type or constant value |
| 864 * implicitly refers to an element declared in the library) or |
| 865 * anti-dependency (e.g. the result of type propagation or type inference |
| 866 * depends on the lack of a certain declaration in the library). |
| 867 */ |
| 868 void set dependencies(List<LinkedDependencyBuilder> value) { |
| 869 this._dependencies = value; |
| 870 } |
| 871 |
| 872 @override |
| 873 List<int> get exportDependencies => _exportDependencies ??= <int>[]; |
| 874 |
| 875 /** |
| 876 * For each export in [UnlinkedUnit.exports], an index into [dependencies] |
| 877 * of the library being exported. |
| 878 */ |
| 879 void set exportDependencies(List<int> value) { |
| 880 assert(value == null || value.every((e) => e >= 0)); |
| 881 this._exportDependencies = value; |
| 882 } |
| 883 |
| 884 @override |
| 885 List<LinkedExportNameBuilder> get exportNames => _exportNames ??= <LinkedExpor
tNameBuilder>[]; |
| 886 |
| 887 /** |
| 888 * Information about entities in the export namespace of the library that are |
| 889 * not in the public namespace of the library (that is, entities that are |
| 890 * brought into the namespace via `export` directives). |
| 891 * |
| 892 * Sorted by name. |
| 893 */ |
| 894 void set exportNames(List<LinkedExportNameBuilder> value) { |
| 895 this._exportNames = value; |
| 896 } |
| 897 |
| 898 @override |
| 899 bool get fallbackMode => _fallbackMode ??= false; |
| 900 |
| 901 /** |
| 902 * Indicates whether this library was summarized in "fallback mode". If |
| 903 * true, all other fields in the data structure have their default values. |
| 904 */ |
| 905 void set fallbackMode(bool value) { |
| 906 this._fallbackMode = value; |
| 907 } |
| 908 |
| 909 @override |
| 910 List<int> get importDependencies => _importDependencies ??= <int>[]; |
| 911 |
| 912 /** |
| 913 * For each import in [UnlinkedUnit.imports], an index into [dependencies] |
| 914 * of the library being imported. |
| 915 */ |
| 916 void set importDependencies(List<int> value) { |
| 917 assert(value == null || value.every((e) => e >= 0)); |
| 918 this._importDependencies = value; |
| 919 } |
| 920 |
| 921 @override |
| 922 int get numPrelinkedDependencies => _numPrelinkedDependencies ??= 0; |
| 923 |
| 924 /** |
| 925 * The number of elements in [dependencies] which are not "linked" |
| 926 * dependencies (that is, the number of libraries in the direct imports plus |
| 927 * the transitive closure of exports, plus the library itself). |
| 928 */ |
| 929 void set numPrelinkedDependencies(int value) { |
| 930 assert(value == null || value >= 0); |
| 931 this._numPrelinkedDependencies = value; |
| 932 } |
| 933 |
| 934 @override |
| 935 List<LinkedUnitBuilder> get units => _units ??= <LinkedUnitBuilder>[]; |
| 936 |
| 937 /** |
| 938 * The linked summary of all the compilation units constituting the |
| 939 * library. The summary of the defining compilation unit is listed first, |
| 940 * followed by the summary of each part, in the order of the `part` |
| 941 * declarations in the defining compilation unit. |
| 942 */ |
| 943 void set units(List<LinkedUnitBuilder> value) { |
| 944 this._units = value; |
| 945 } |
| 946 |
| 947 LinkedLibraryBuilder({List<LinkedDependencyBuilder> dependencies, List<int> ex
portDependencies, List<LinkedExportNameBuilder> exportNames, bool fallbackMode,
List<int> importDependencies, int numPrelinkedDependencies, List<LinkedUnitBuild
er> units}) |
| 948 : _dependencies = dependencies, |
| 949 _exportDependencies = exportDependencies, |
| 950 _exportNames = exportNames, |
| 951 _fallbackMode = fallbackMode, |
| 952 _importDependencies = importDependencies, |
| 953 _numPrelinkedDependencies = numPrelinkedDependencies, |
| 954 _units = units; |
| 955 |
| 956 /** |
| 957 * Flush [informative] data recursively. |
| 958 */ |
| 959 void flushInformative() { |
| 960 _dependencies?.forEach((b) => b.flushInformative()); |
| 961 _exportNames?.forEach((b) => b.flushInformative()); |
| 962 _units?.forEach((b) => b.flushInformative()); |
| 963 } |
| 964 |
| 965 /** |
| 966 * Accumulate non-[informative] data into [signature]. |
| 967 */ |
| 968 void collectApiSignature(api_sig.ApiSignature signature) { |
| 969 if (this._dependencies == null) { |
| 970 signature.addInt(0); |
| 971 } else { |
| 972 signature.addInt(this._dependencies.length); |
| 973 for (var x in this._dependencies) { |
| 974 x?.collectApiSignature(signature); |
| 975 } |
| 976 } |
| 977 if (this._importDependencies == null) { |
| 978 signature.addInt(0); |
| 979 } else { |
| 980 signature.addInt(this._importDependencies.length); |
| 981 for (var x in this._importDependencies) { |
| 982 signature.addInt(x); |
| 983 } |
| 984 } |
| 985 signature.addInt(this._numPrelinkedDependencies ?? 0); |
| 986 if (this._units == null) { |
| 987 signature.addInt(0); |
| 988 } else { |
| 989 signature.addInt(this._units.length); |
| 990 for (var x in this._units) { |
| 991 x?.collectApiSignature(signature); |
| 992 } |
| 993 } |
| 994 if (this._exportNames == null) { |
| 995 signature.addInt(0); |
| 996 } else { |
| 997 signature.addInt(this._exportNames.length); |
| 998 for (var x in this._exportNames) { |
| 999 x?.collectApiSignature(signature); |
| 1000 } |
| 1001 } |
| 1002 signature.addBool(this._fallbackMode == true); |
| 1003 if (this._exportDependencies == null) { |
| 1004 signature.addInt(0); |
| 1005 } else { |
| 1006 signature.addInt(this._exportDependencies.length); |
| 1007 for (var x in this._exportDependencies) { |
| 1008 signature.addInt(x); |
| 1009 } |
| 1010 } |
| 1011 } |
| 1012 |
| 1013 List<int> toBuffer() { |
| 1014 fb.Builder fbBuilder = new fb.Builder(); |
| 1015 return fbBuilder.finish(finish(fbBuilder), "LLib"); |
| 1016 } |
| 1017 |
| 1018 fb.Offset finish(fb.Builder fbBuilder) { |
| 1019 fb.Offset offset_dependencies; |
| 1020 fb.Offset offset_exportDependencies; |
| 1021 fb.Offset offset_exportNames; |
| 1022 fb.Offset offset_importDependencies; |
| 1023 fb.Offset offset_units; |
| 1024 if (!(_dependencies == null || _dependencies.isEmpty)) { |
| 1025 offset_dependencies = fbBuilder.writeList(_dependencies.map((b) => b.finis
h(fbBuilder)).toList()); |
| 1026 } |
| 1027 if (!(_exportDependencies == null || _exportDependencies.isEmpty)) { |
| 1028 offset_exportDependencies = fbBuilder.writeListUint32(_exportDependencies)
; |
| 1029 } |
| 1030 if (!(_exportNames == null || _exportNames.isEmpty)) { |
| 1031 offset_exportNames = fbBuilder.writeList(_exportNames.map((b) => b.finish(
fbBuilder)).toList()); |
| 1032 } |
| 1033 if (!(_importDependencies == null || _importDependencies.isEmpty)) { |
| 1034 offset_importDependencies = fbBuilder.writeListUint32(_importDependencies)
; |
| 1035 } |
| 1036 if (!(_units == null || _units.isEmpty)) { |
| 1037 offset_units = fbBuilder.writeList(_units.map((b) => b.finish(fbBuilder)).
toList()); |
| 1038 } |
| 1039 fbBuilder.startTable(); |
| 1040 if (offset_dependencies != null) { |
| 1041 fbBuilder.addOffset(0, offset_dependencies); |
| 1042 } |
| 1043 if (offset_exportDependencies != null) { |
| 1044 fbBuilder.addOffset(6, offset_exportDependencies); |
| 1045 } |
| 1046 if (offset_exportNames != null) { |
| 1047 fbBuilder.addOffset(4, offset_exportNames); |
| 1048 } |
| 1049 if (_fallbackMode == true) { |
| 1050 fbBuilder.addBool(5, true); |
| 1051 } |
| 1052 if (offset_importDependencies != null) { |
| 1053 fbBuilder.addOffset(1, offset_importDependencies); |
| 1054 } |
| 1055 if (_numPrelinkedDependencies != null && _numPrelinkedDependencies != 0) { |
| 1056 fbBuilder.addUint32(2, _numPrelinkedDependencies); |
| 1057 } |
| 1058 if (offset_units != null) { |
| 1059 fbBuilder.addOffset(3, offset_units); |
| 1060 } |
| 1061 return fbBuilder.endTable(); |
| 1062 } |
| 1063 } |
| 1064 |
| 1065 idl.LinkedLibrary readLinkedLibrary(List<int> buffer) { |
| 1066 fb.BufferContext rootRef = new fb.BufferContext.fromBytes(buffer); |
| 1067 return const _LinkedLibraryReader().read(rootRef, 0); |
| 1068 } |
| 1069 |
| 1070 class _LinkedLibraryReader extends fb.TableReader<_LinkedLibraryImpl> { |
| 1071 const _LinkedLibraryReader(); |
| 1072 |
| 1073 @override |
| 1074 _LinkedLibraryImpl createObject(fb.BufferContext bc, int offset) => new _Linke
dLibraryImpl(bc, offset); |
| 1075 } |
| 1076 |
| 1077 class _LinkedLibraryImpl extends Object with _LinkedLibraryMixin implements idl.
LinkedLibrary { |
| 1078 final fb.BufferContext _bc; |
| 1079 final int _bcOffset; |
| 1080 |
| 1081 _LinkedLibraryImpl(this._bc, this._bcOffset); |
| 1082 |
| 1083 List<idl.LinkedDependency> _dependencies; |
| 1084 List<int> _exportDependencies; |
| 1085 List<idl.LinkedExportName> _exportNames; |
| 1086 bool _fallbackMode; |
| 1087 List<int> _importDependencies; |
| 1088 int _numPrelinkedDependencies; |
| 1089 List<idl.LinkedUnit> _units; |
| 1090 |
| 1091 @override |
| 1092 List<idl.LinkedDependency> get dependencies { |
| 1093 _dependencies ??= const fb.ListReader<idl.LinkedDependency>(const _LinkedDep
endencyReader()).vTableGet(_bc, _bcOffset, 0, const <idl.LinkedDependency>[]); |
| 1094 return _dependencies; |
| 1095 } |
| 1096 |
| 1097 @override |
| 1098 List<int> get exportDependencies { |
| 1099 _exportDependencies ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset
, 6, const <int>[]); |
| 1100 return _exportDependencies; |
| 1101 } |
| 1102 |
| 1103 @override |
| 1104 List<idl.LinkedExportName> get exportNames { |
| 1105 _exportNames ??= const fb.ListReader<idl.LinkedExportName>(const _LinkedExpo
rtNameReader()).vTableGet(_bc, _bcOffset, 4, const <idl.LinkedExportName>[]); |
| 1106 return _exportNames; |
| 1107 } |
| 1108 |
| 1109 @override |
| 1110 bool get fallbackMode { |
| 1111 _fallbackMode ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 5, false); |
| 1112 return _fallbackMode; |
| 1113 } |
| 1114 |
| 1115 @override |
| 1116 List<int> get importDependencies { |
| 1117 _importDependencies ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset
, 1, const <int>[]); |
| 1118 return _importDependencies; |
| 1119 } |
| 1120 |
| 1121 @override |
| 1122 int get numPrelinkedDependencies { |
| 1123 _numPrelinkedDependencies ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffs
et, 2, 0); |
| 1124 return _numPrelinkedDependencies; |
| 1125 } |
| 1126 |
| 1127 @override |
| 1128 List<idl.LinkedUnit> get units { |
| 1129 _units ??= const fb.ListReader<idl.LinkedUnit>(const _LinkedUnitReader()).vT
ableGet(_bc, _bcOffset, 3, const <idl.LinkedUnit>[]); |
| 1130 return _units; |
| 1131 } |
| 1132 } |
| 1133 |
| 1134 abstract class _LinkedLibraryMixin implements idl.LinkedLibrary { |
| 1135 @override |
| 1136 Map<String, Object> toJson() { |
| 1137 Map<String, Object> _result = <String, Object>{}; |
| 1138 if (dependencies.isNotEmpty) _result["dependencies"] = dependencies.map((_va
lue) => _value.toJson()).toList(); |
| 1139 if (exportDependencies.isNotEmpty) _result["exportDependencies"] = exportDep
endencies; |
| 1140 if (exportNames.isNotEmpty) _result["exportNames"] = exportNames.map((_value
) => _value.toJson()).toList(); |
| 1141 if (fallbackMode != false) _result["fallbackMode"] = fallbackMode; |
| 1142 if (importDependencies.isNotEmpty) _result["importDependencies"] = importDep
endencies; |
| 1143 if (numPrelinkedDependencies != 0) _result["numPrelinkedDependencies"] = num
PrelinkedDependencies; |
| 1144 if (units.isNotEmpty) _result["units"] = units.map((_value) => _value.toJson
()).toList(); |
| 1145 return _result; |
| 1146 } |
| 1147 |
| 1148 @override |
| 1149 Map<String, Object> toMap() => { |
| 1150 "dependencies": dependencies, |
| 1151 "exportDependencies": exportDependencies, |
| 1152 "exportNames": exportNames, |
| 1153 "fallbackMode": fallbackMode, |
| 1154 "importDependencies": importDependencies, |
| 1155 "numPrelinkedDependencies": numPrelinkedDependencies, |
| 1156 "units": units, |
| 1157 }; |
| 1158 |
| 1159 @override |
| 1160 String toString() => convert.JSON.encode(toJson()); |
| 1161 } |
| 1162 |
| 1163 class LinkedReferenceBuilder extends Object with _LinkedReferenceMixin implement
s idl.LinkedReference { |
| 1164 int _containingReference; |
| 1165 int _dependency; |
| 1166 idl.ReferenceKind _kind; |
| 1167 int _localIndex; |
| 1168 String _name; |
| 1169 int _numTypeParameters; |
| 1170 int _unit; |
| 1171 |
| 1172 @override |
| 1173 int get containingReference => _containingReference ??= 0; |
| 1174 |
| 1175 /** |
| 1176 * If this [LinkedReference] doesn't have an associated [UnlinkedReference], |
| 1177 * and the entity being referred to is contained within another entity, index |
| 1178 * of the containing entity. This behaves similarly to |
| 1179 * [UnlinkedReference.prefixReference], however it is only used for class |
| 1180 * members, not for prefixed imports. |
| 1181 * |
| 1182 * Containing references must always point backward; that is, for all i, if |
| 1183 * LinkedUnit.references[i].containingReference != 0, then |
| 1184 * LinkedUnit.references[i].containingReference < i. |
| 1185 */ |
| 1186 void set containingReference(int value) { |
| 1187 assert(value == null || value >= 0); |
| 1188 this._containingReference = value; |
| 1189 } |
| 1190 |
| 1191 @override |
| 1192 int get dependency => _dependency ??= 0; |
| 1193 |
| 1194 /** |
| 1195 * Index into [LinkedLibrary.dependencies] indicating which imported library |
| 1196 * declares the entity being referred to. |
| 1197 * |
| 1198 * Zero if this entity is contained within another entity (e.g. a class |
| 1199 * member), or if [kind] is [ReferenceKind.prefix]. |
| 1200 */ |
| 1201 void set dependency(int value) { |
| 1202 assert(value == null || value >= 0); |
| 1203 this._dependency = value; |
| 1204 } |
| 1205 |
| 1206 @override |
| 1207 idl.ReferenceKind get kind => _kind ??= idl.ReferenceKind.classOrEnum; |
| 1208 |
| 1209 /** |
| 1210 * The kind of the entity being referred to. For the pseudo-types `dynamic` |
| 1211 * and `void`, the kind is [ReferenceKind.classOrEnum]. |
| 1212 */ |
| 1213 void set kind(idl.ReferenceKind value) { |
| 1214 this._kind = value; |
| 1215 } |
| 1216 |
| 1217 @override |
| 1218 int get localIndex => _localIndex ??= 0; |
| 1219 |
| 1220 /** |
| 1221 * If [kind] is [ReferenceKind.function] (that is, the entity being referred |
| 1222 * to is a local function), the index of the function within |
| 1223 * [UnlinkedExecutable.localFunctions]. If [kind] is |
| 1224 * [ReferenceKind.variable], the index of the variable within |
| 1225 * [UnlinkedExecutable.localVariables]. Otherwise zero. |
| 1226 */ |
| 1227 void set localIndex(int value) { |
| 1228 assert(value == null || value >= 0); |
| 1229 this._localIndex = value; |
| 1230 } |
| 1231 |
| 1232 @override |
| 1233 String get name => _name ??= ''; |
| 1234 |
| 1235 /** |
| 1236 * If this [LinkedReference] doesn't have an associated [UnlinkedReference], |
| 1237 * name of the entity being referred to. For the pseudo-type `dynamic`, the |
| 1238 * string is "dynamic". For the pseudo-type `void`, the string is "void". |
| 1239 */ |
| 1240 void set name(String value) { |
| 1241 this._name = value; |
| 1242 } |
| 1243 |
| 1244 @override |
| 1245 int get numTypeParameters => _numTypeParameters ??= 0; |
| 1246 |
| 1247 /** |
| 1248 * If the entity being referred to is generic, the number of type parameters |
| 1249 * it declares (does not include type parameters of enclosing entities). |
| 1250 * Otherwise zero. |
| 1251 */ |
| 1252 void set numTypeParameters(int value) { |
| 1253 assert(value == null || value >= 0); |
| 1254 this._numTypeParameters = value; |
| 1255 } |
| 1256 |
| 1257 @override |
| 1258 int get unit => _unit ??= 0; |
| 1259 |
| 1260 /** |
| 1261 * Integer index indicating which unit in the imported library contains the |
| 1262 * definition of the entity. As with indices into [LinkedLibrary.units], |
| 1263 * zero represents the defining compilation unit, and nonzero values |
| 1264 * represent parts in the order of the corresponding `part` declarations. |
| 1265 * |
| 1266 * Zero if this entity is contained within another entity (e.g. a class |
| 1267 * member). |
| 1268 */ |
| 1269 void set unit(int value) { |
| 1270 assert(value == null || value >= 0); |
| 1271 this._unit = value; |
| 1272 } |
| 1273 |
| 1274 LinkedReferenceBuilder({int containingReference, int dependency, idl.Reference
Kind kind, int localIndex, String name, int numTypeParameters, int unit}) |
| 1275 : _containingReference = containingReference, |
| 1276 _dependency = dependency, |
| 1277 _kind = kind, |
| 1278 _localIndex = localIndex, |
| 1279 _name = name, |
| 1280 _numTypeParameters = numTypeParameters, |
| 1281 _unit = unit; |
| 1282 |
| 1283 /** |
| 1284 * Flush [informative] data recursively. |
| 1285 */ |
| 1286 void flushInformative() { |
| 1287 } |
| 1288 |
| 1289 /** |
| 1290 * Accumulate non-[informative] data into [signature]. |
| 1291 */ |
| 1292 void collectApiSignature(api_sig.ApiSignature signature) { |
| 1293 signature.addInt(this._unit ?? 0); |
| 1294 signature.addInt(this._dependency ?? 0); |
| 1295 signature.addInt(this._kind == null ? 0 : this._kind.index); |
| 1296 signature.addString(this._name ?? ''); |
| 1297 signature.addInt(this._numTypeParameters ?? 0); |
| 1298 signature.addInt(this._containingReference ?? 0); |
| 1299 signature.addInt(this._localIndex ?? 0); |
| 1300 } |
| 1301 |
| 1302 fb.Offset finish(fb.Builder fbBuilder) { |
| 1303 fb.Offset offset_name; |
| 1304 if (_name != null) { |
| 1305 offset_name = fbBuilder.writeString(_name); |
| 1306 } |
| 1307 fbBuilder.startTable(); |
| 1308 if (_containingReference != null && _containingReference != 0) { |
| 1309 fbBuilder.addUint32(5, _containingReference); |
| 1310 } |
| 1311 if (_dependency != null && _dependency != 0) { |
| 1312 fbBuilder.addUint32(1, _dependency); |
| 1313 } |
| 1314 if (_kind != null && _kind != idl.ReferenceKind.classOrEnum) { |
| 1315 fbBuilder.addUint8(2, _kind.index); |
| 1316 } |
| 1317 if (_localIndex != null && _localIndex != 0) { |
| 1318 fbBuilder.addUint32(6, _localIndex); |
| 1319 } |
| 1320 if (offset_name != null) { |
| 1321 fbBuilder.addOffset(3, offset_name); |
| 1322 } |
| 1323 if (_numTypeParameters != null && _numTypeParameters != 0) { |
| 1324 fbBuilder.addUint32(4, _numTypeParameters); |
| 1325 } |
| 1326 if (_unit != null && _unit != 0) { |
| 1327 fbBuilder.addUint32(0, _unit); |
| 1328 } |
| 1329 return fbBuilder.endTable(); |
| 1330 } |
| 1331 } |
| 1332 |
| 1333 class _LinkedReferenceReader extends fb.TableReader<_LinkedReferenceImpl> { |
| 1334 const _LinkedReferenceReader(); |
| 1335 |
| 1336 @override |
| 1337 _LinkedReferenceImpl createObject(fb.BufferContext bc, int offset) => new _Lin
kedReferenceImpl(bc, offset); |
| 1338 } |
| 1339 |
| 1340 class _LinkedReferenceImpl extends Object with _LinkedReferenceMixin implements
idl.LinkedReference { |
| 1341 final fb.BufferContext _bc; |
| 1342 final int _bcOffset; |
| 1343 |
| 1344 _LinkedReferenceImpl(this._bc, this._bcOffset); |
| 1345 |
| 1346 int _containingReference; |
| 1347 int _dependency; |
| 1348 idl.ReferenceKind _kind; |
| 1349 int _localIndex; |
| 1350 String _name; |
| 1351 int _numTypeParameters; |
| 1352 int _unit; |
| 1353 |
| 1354 @override |
| 1355 int get containingReference { |
| 1356 _containingReference ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 5
, 0); |
| 1357 return _containingReference; |
| 1358 } |
| 1359 |
| 1360 @override |
| 1361 int get dependency { |
| 1362 _dependency ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 1, 0); |
| 1363 return _dependency; |
| 1364 } |
| 1365 |
| 1366 @override |
| 1367 idl.ReferenceKind get kind { |
| 1368 _kind ??= const _ReferenceKindReader().vTableGet(_bc, _bcOffset, 2, idl.Refe
renceKind.classOrEnum); |
| 1369 return _kind; |
| 1370 } |
| 1371 |
| 1372 @override |
| 1373 int get localIndex { |
| 1374 _localIndex ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 6, 0); |
| 1375 return _localIndex; |
| 1376 } |
| 1377 |
| 1378 @override |
| 1379 String get name { |
| 1380 _name ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 3, ''); |
| 1381 return _name; |
| 1382 } |
| 1383 |
| 1384 @override |
| 1385 int get numTypeParameters { |
| 1386 _numTypeParameters ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 4,
0); |
| 1387 return _numTypeParameters; |
| 1388 } |
| 1389 |
| 1390 @override |
| 1391 int get unit { |
| 1392 _unit ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 0, 0); |
| 1393 return _unit; |
| 1394 } |
| 1395 } |
| 1396 |
| 1397 abstract class _LinkedReferenceMixin implements idl.LinkedReference { |
| 1398 @override |
| 1399 Map<String, Object> toJson() { |
| 1400 Map<String, Object> _result = <String, Object>{}; |
| 1401 if (containingReference != 0) _result["containingReference"] = containingRef
erence; |
| 1402 if (dependency != 0) _result["dependency"] = dependency; |
| 1403 if (kind != idl.ReferenceKind.classOrEnum) _result["kind"] = kind.toString()
.split('.')[1]; |
| 1404 if (localIndex != 0) _result["localIndex"] = localIndex; |
| 1405 if (name != '') _result["name"] = name; |
| 1406 if (numTypeParameters != 0) _result["numTypeParameters"] = numTypeParameters
; |
| 1407 if (unit != 0) _result["unit"] = unit; |
| 1408 return _result; |
| 1409 } |
| 1410 |
| 1411 @override |
| 1412 Map<String, Object> toMap() => { |
| 1413 "containingReference": containingReference, |
| 1414 "dependency": dependency, |
| 1415 "kind": kind, |
| 1416 "localIndex": localIndex, |
| 1417 "name": name, |
| 1418 "numTypeParameters": numTypeParameters, |
| 1419 "unit": unit, |
| 1420 }; |
| 1421 |
| 1422 @override |
| 1423 String toString() => convert.JSON.encode(toJson()); |
| 1424 } |
| 1425 |
| 1426 class LinkedUnitBuilder extends Object with _LinkedUnitMixin implements idl.Link
edUnit { |
| 1427 List<int> _constCycles; |
| 1428 List<int> _parametersInheritingCovariant; |
| 1429 List<LinkedReferenceBuilder> _references; |
| 1430 List<EntityRefBuilder> _types; |
| 1431 |
| 1432 @override |
| 1433 List<int> get constCycles => _constCycles ??= <int>[]; |
| 1434 |
| 1435 /** |
| 1436 * List of slot ids (referring to [UnlinkedExecutable.constCycleSlot]) |
| 1437 * corresponding to const constructors that are part of cycles. |
| 1438 */ |
| 1439 void set constCycles(List<int> value) { |
| 1440 assert(value == null || value.every((e) => e >= 0)); |
| 1441 this._constCycles = value; |
| 1442 } |
| 1443 |
| 1444 @override |
| 1445 List<int> get parametersInheritingCovariant => _parametersInheritingCovariant
??= <int>[]; |
| 1446 |
| 1447 /** |
| 1448 * List of slot ids (referring to [UnlinkedParam.inheritsCovariantSlot]) |
| 1449 * corresponding to parameters that inherit `@covariant` behavior from a base |
| 1450 * class. |
| 1451 */ |
| 1452 void set parametersInheritingCovariant(List<int> value) { |
| 1453 assert(value == null || value.every((e) => e >= 0)); |
| 1454 this._parametersInheritingCovariant = value; |
| 1455 } |
| 1456 |
| 1457 @override |
| 1458 List<LinkedReferenceBuilder> get references => _references ??= <LinkedReferenc
eBuilder>[]; |
| 1459 |
| 1460 /** |
| 1461 * Information about the resolution of references within the compilation |
| 1462 * unit. Each element of [UnlinkedUnit.references] has a corresponding |
| 1463 * element in this list (at the same index). If this list has additional |
| 1464 * elements beyond the number of elements in [UnlinkedUnit.references], those |
| 1465 * additional elements are references that are only referred to implicitly |
| 1466 * (e.g. elements involved in inferred or propagated types). |
| 1467 */ |
| 1468 void set references(List<LinkedReferenceBuilder> value) { |
| 1469 this._references = value; |
| 1470 } |
| 1471 |
| 1472 @override |
| 1473 List<EntityRefBuilder> get types => _types ??= <EntityRefBuilder>[]; |
| 1474 |
| 1475 /** |
| 1476 * List associating slot ids found inside the unlinked summary for the |
| 1477 * compilation unit with propagated and inferred types. |
| 1478 */ |
| 1479 void set types(List<EntityRefBuilder> value) { |
| 1480 this._types = value; |
| 1481 } |
| 1482 |
| 1483 LinkedUnitBuilder({List<int> constCycles, List<int> parametersInheritingCovari
ant, List<LinkedReferenceBuilder> references, List<EntityRefBuilder> types}) |
| 1484 : _constCycles = constCycles, |
| 1485 _parametersInheritingCovariant = parametersInheritingCovariant, |
| 1486 _references = references, |
| 1487 _types = types; |
| 1488 |
| 1489 /** |
| 1490 * Flush [informative] data recursively. |
| 1491 */ |
| 1492 void flushInformative() { |
| 1493 _references?.forEach((b) => b.flushInformative()); |
| 1494 _types?.forEach((b) => b.flushInformative()); |
| 1495 } |
| 1496 |
| 1497 /** |
| 1498 * Accumulate non-[informative] data into [signature]. |
| 1499 */ |
| 1500 void collectApiSignature(api_sig.ApiSignature signature) { |
| 1501 if (this._references == null) { |
| 1502 signature.addInt(0); |
| 1503 } else { |
| 1504 signature.addInt(this._references.length); |
| 1505 for (var x in this._references) { |
| 1506 x?.collectApiSignature(signature); |
| 1507 } |
| 1508 } |
| 1509 if (this._types == null) { |
| 1510 signature.addInt(0); |
| 1511 } else { |
| 1512 signature.addInt(this._types.length); |
| 1513 for (var x in this._types) { |
| 1514 x?.collectApiSignature(signature); |
| 1515 } |
| 1516 } |
| 1517 if (this._constCycles == null) { |
| 1518 signature.addInt(0); |
| 1519 } else { |
| 1520 signature.addInt(this._constCycles.length); |
| 1521 for (var x in this._constCycles) { |
| 1522 signature.addInt(x); |
| 1523 } |
| 1524 } |
| 1525 if (this._parametersInheritingCovariant == null) { |
| 1526 signature.addInt(0); |
| 1527 } else { |
| 1528 signature.addInt(this._parametersInheritingCovariant.length); |
| 1529 for (var x in this._parametersInheritingCovariant) { |
| 1530 signature.addInt(x); |
| 1531 } |
| 1532 } |
| 1533 } |
| 1534 |
| 1535 fb.Offset finish(fb.Builder fbBuilder) { |
| 1536 fb.Offset offset_constCycles; |
| 1537 fb.Offset offset_parametersInheritingCovariant; |
| 1538 fb.Offset offset_references; |
| 1539 fb.Offset offset_types; |
| 1540 if (!(_constCycles == null || _constCycles.isEmpty)) { |
| 1541 offset_constCycles = fbBuilder.writeListUint32(_constCycles); |
| 1542 } |
| 1543 if (!(_parametersInheritingCovariant == null || _parametersInheritingCovaria
nt.isEmpty)) { |
| 1544 offset_parametersInheritingCovariant = fbBuilder.writeListUint32(_paramete
rsInheritingCovariant); |
| 1545 } |
| 1546 if (!(_references == null || _references.isEmpty)) { |
| 1547 offset_references = fbBuilder.writeList(_references.map((b) => b.finish(fb
Builder)).toList()); |
| 1548 } |
| 1549 if (!(_types == null || _types.isEmpty)) { |
| 1550 offset_types = fbBuilder.writeList(_types.map((b) => b.finish(fbBuilder)).
toList()); |
| 1551 } |
| 1552 fbBuilder.startTable(); |
| 1553 if (offset_constCycles != null) { |
| 1554 fbBuilder.addOffset(2, offset_constCycles); |
| 1555 } |
| 1556 if (offset_parametersInheritingCovariant != null) { |
| 1557 fbBuilder.addOffset(3, offset_parametersInheritingCovariant); |
| 1558 } |
| 1559 if (offset_references != null) { |
| 1560 fbBuilder.addOffset(0, offset_references); |
| 1561 } |
| 1562 if (offset_types != null) { |
| 1563 fbBuilder.addOffset(1, offset_types); |
| 1564 } |
| 1565 return fbBuilder.endTable(); |
| 1566 } |
| 1567 } |
| 1568 |
| 1569 class _LinkedUnitReader extends fb.TableReader<_LinkedUnitImpl> { |
| 1570 const _LinkedUnitReader(); |
| 1571 |
| 1572 @override |
| 1573 _LinkedUnitImpl createObject(fb.BufferContext bc, int offset) => new _LinkedUn
itImpl(bc, offset); |
| 1574 } |
| 1575 |
| 1576 class _LinkedUnitImpl extends Object with _LinkedUnitMixin implements idl.Linked
Unit { |
| 1577 final fb.BufferContext _bc; |
| 1578 final int _bcOffset; |
| 1579 |
| 1580 _LinkedUnitImpl(this._bc, this._bcOffset); |
| 1581 |
| 1582 List<int> _constCycles; |
| 1583 List<int> _parametersInheritingCovariant; |
| 1584 List<idl.LinkedReference> _references; |
| 1585 List<idl.EntityRef> _types; |
| 1586 |
| 1587 @override |
| 1588 List<int> get constCycles { |
| 1589 _constCycles ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 2, co
nst <int>[]); |
| 1590 return _constCycles; |
| 1591 } |
| 1592 |
| 1593 @override |
| 1594 List<int> get parametersInheritingCovariant { |
| 1595 _parametersInheritingCovariant ??= const fb.Uint32ListReader().vTableGet(_bc
, _bcOffset, 3, const <int>[]); |
| 1596 return _parametersInheritingCovariant; |
| 1597 } |
| 1598 |
| 1599 @override |
| 1600 List<idl.LinkedReference> get references { |
| 1601 _references ??= const fb.ListReader<idl.LinkedReference>(const _LinkedRefere
nceReader()).vTableGet(_bc, _bcOffset, 0, const <idl.LinkedReference>[]); |
| 1602 return _references; |
| 1603 } |
| 1604 |
| 1605 @override |
| 1606 List<idl.EntityRef> get types { |
| 1607 _types ??= const fb.ListReader<idl.EntityRef>(const _EntityRefReader()).vTab
leGet(_bc, _bcOffset, 1, const <idl.EntityRef>[]); |
| 1608 return _types; |
| 1609 } |
| 1610 } |
| 1611 |
| 1612 abstract class _LinkedUnitMixin implements idl.LinkedUnit { |
| 1613 @override |
| 1614 Map<String, Object> toJson() { |
| 1615 Map<String, Object> _result = <String, Object>{}; |
| 1616 if (constCycles.isNotEmpty) _result["constCycles"] = constCycles; |
| 1617 if (parametersInheritingCovariant.isNotEmpty) _result["parametersInheritingC
ovariant"] = parametersInheritingCovariant; |
| 1618 if (references.isNotEmpty) _result["references"] = references.map((_value) =
> _value.toJson()).toList(); |
| 1619 if (types.isNotEmpty) _result["types"] = types.map((_value) => _value.toJson
()).toList(); |
| 1620 return _result; |
| 1621 } |
| 1622 |
| 1623 @override |
| 1624 Map<String, Object> toMap() => { |
| 1625 "constCycles": constCycles, |
| 1626 "parametersInheritingCovariant": parametersInheritingCovariant, |
| 1627 "references": references, |
| 1628 "types": types, |
| 1629 }; |
| 1630 |
| 1631 @override |
| 1632 String toString() => convert.JSON.encode(toJson()); |
| 1633 } |
| 1634 |
| 1635 class PackageBundleBuilder extends Object with _PackageBundleMixin implements id
l.PackageBundle { |
| 1636 String _apiSignature; |
| 1637 List<PackageDependencyInfoBuilder> _dependencies; |
| 1638 List<LinkedLibraryBuilder> _linkedLibraries; |
| 1639 List<String> _linkedLibraryUris; |
| 1640 int _majorVersion; |
| 1641 int _minorVersion; |
| 1642 List<String> _unlinkedUnitHashes; |
| 1643 List<UnlinkedUnitBuilder> _unlinkedUnits; |
| 1644 List<String> _unlinkedUnitUris; |
| 1645 |
| 1646 @override |
| 1647 String get apiSignature => _apiSignature ??= ''; |
| 1648 |
| 1649 /** |
| 1650 * MD5 hash of the non-informative fields of the [PackageBundle] (not |
| 1651 * including this one). This can be used to identify when the API of a |
| 1652 * package may have changed. |
| 1653 */ |
| 1654 void set apiSignature(String value) { |
| 1655 this._apiSignature = value; |
| 1656 } |
| 1657 |
| 1658 @override |
| 1659 List<PackageDependencyInfoBuilder> get dependencies => _dependencies ??= <Pack
ageDependencyInfoBuilder>[]; |
| 1660 |
| 1661 /** |
| 1662 * Information about the packages this package depends on, if known. |
| 1663 */ |
| 1664 void set dependencies(List<PackageDependencyInfoBuilder> value) { |
| 1665 this._dependencies = value; |
| 1666 } |
| 1667 |
| 1668 @override |
| 1669 List<LinkedLibraryBuilder> get linkedLibraries => _linkedLibraries ??= <Linked
LibraryBuilder>[]; |
| 1670 |
| 1671 /** |
| 1672 * Linked libraries. |
| 1673 */ |
| 1674 void set linkedLibraries(List<LinkedLibraryBuilder> value) { |
| 1675 this._linkedLibraries = value; |
| 1676 } |
| 1677 |
| 1678 @override |
| 1679 List<String> get linkedLibraryUris => _linkedLibraryUris ??= <String>[]; |
| 1680 |
| 1681 /** |
| 1682 * The list of URIs of items in [linkedLibraries], e.g. `dart:core` or |
| 1683 * `package:foo/bar.dart`. |
| 1684 */ |
| 1685 void set linkedLibraryUris(List<String> value) { |
| 1686 this._linkedLibraryUris = value; |
| 1687 } |
| 1688 |
| 1689 @override |
| 1690 int get majorVersion => _majorVersion ??= 0; |
| 1691 |
| 1692 /** |
| 1693 * Major version of the summary format. See |
| 1694 * [PackageBundleAssembler.currentMajorVersion]. |
| 1695 */ |
| 1696 void set majorVersion(int value) { |
| 1697 assert(value == null || value >= 0); |
| 1698 this._majorVersion = value; |
| 1699 } |
| 1700 |
| 1701 @override |
| 1702 int get minorVersion => _minorVersion ??= 0; |
| 1703 |
| 1704 /** |
| 1705 * Minor version of the summary format. See |
| 1706 * [PackageBundleAssembler.currentMinorVersion]. |
| 1707 */ |
| 1708 void set minorVersion(int value) { |
| 1709 assert(value == null || value >= 0); |
| 1710 this._minorVersion = value; |
| 1711 } |
| 1712 |
| 1713 @override |
| 1714 List<String> get unlinkedUnitHashes => _unlinkedUnitHashes ??= <String>[]; |
| 1715 |
| 1716 /** |
| 1717 * List of MD5 hashes of the files listed in [unlinkedUnitUris]. Each hash |
| 1718 * is encoded as a hexadecimal string using lower case letters. |
| 1719 */ |
| 1720 void set unlinkedUnitHashes(List<String> value) { |
| 1721 this._unlinkedUnitHashes = value; |
| 1722 } |
| 1723 |
| 1724 @override |
| 1725 List<UnlinkedUnitBuilder> get unlinkedUnits => _unlinkedUnits ??= <UnlinkedUni
tBuilder>[]; |
| 1726 |
| 1727 /** |
| 1728 * Unlinked information for the compilation units constituting the package. |
| 1729 */ |
| 1730 void set unlinkedUnits(List<UnlinkedUnitBuilder> value) { |
| 1731 this._unlinkedUnits = value; |
| 1732 } |
| 1733 |
| 1734 @override |
| 1735 List<String> get unlinkedUnitUris => _unlinkedUnitUris ??= <String>[]; |
| 1736 |
| 1737 /** |
| 1738 * The list of URIs of items in [unlinkedUnits], e.g. `dart:core/bool.dart`. |
| 1739 */ |
| 1740 void set unlinkedUnitUris(List<String> value) { |
| 1741 this._unlinkedUnitUris = value; |
| 1742 } |
| 1743 |
| 1744 PackageBundleBuilder({String apiSignature, List<PackageDependencyInfoBuilder>
dependencies, List<LinkedLibraryBuilder> linkedLibraries, List<String> linkedLib
raryUris, int majorVersion, int minorVersion, List<String> unlinkedUnitHashes, L
ist<UnlinkedUnitBuilder> unlinkedUnits, List<String> unlinkedUnitUris}) |
| 1745 : _apiSignature = apiSignature, |
| 1746 _dependencies = dependencies, |
| 1747 _linkedLibraries = linkedLibraries, |
| 1748 _linkedLibraryUris = linkedLibraryUris, |
| 1749 _majorVersion = majorVersion, |
| 1750 _minorVersion = minorVersion, |
| 1751 _unlinkedUnitHashes = unlinkedUnitHashes, |
| 1752 _unlinkedUnits = unlinkedUnits, |
| 1753 _unlinkedUnitUris = unlinkedUnitUris; |
| 1754 |
| 1755 /** |
| 1756 * Flush [informative] data recursively. |
| 1757 */ |
| 1758 void flushInformative() { |
| 1759 _dependencies = null; |
| 1760 _linkedLibraries?.forEach((b) => b.flushInformative()); |
| 1761 _unlinkedUnitHashes = null; |
| 1762 _unlinkedUnits?.forEach((b) => b.flushInformative()); |
| 1763 } |
| 1764 |
| 1765 /** |
| 1766 * Accumulate non-[informative] data into [signature]. |
| 1767 */ |
| 1768 void collectApiSignature(api_sig.ApiSignature signature) { |
| 1769 if (this._linkedLibraries == null) { |
| 1770 signature.addInt(0); |
| 1771 } else { |
| 1772 signature.addInt(this._linkedLibraries.length); |
| 1773 for (var x in this._linkedLibraries) { |
| 1774 x?.collectApiSignature(signature); |
| 1775 } |
| 1776 } |
| 1777 if (this._linkedLibraryUris == null) { |
| 1778 signature.addInt(0); |
| 1779 } else { |
| 1780 signature.addInt(this._linkedLibraryUris.length); |
| 1781 for (var x in this._linkedLibraryUris) { |
| 1782 signature.addString(x); |
| 1783 } |
| 1784 } |
| 1785 if (this._unlinkedUnits == null) { |
| 1786 signature.addInt(0); |
| 1787 } else { |
| 1788 signature.addInt(this._unlinkedUnits.length); |
| 1789 for (var x in this._unlinkedUnits) { |
| 1790 x?.collectApiSignature(signature); |
| 1791 } |
| 1792 } |
| 1793 if (this._unlinkedUnitUris == null) { |
| 1794 signature.addInt(0); |
| 1795 } else { |
| 1796 signature.addInt(this._unlinkedUnitUris.length); |
| 1797 for (var x in this._unlinkedUnitUris) { |
| 1798 signature.addString(x); |
| 1799 } |
| 1800 } |
| 1801 signature.addInt(this._majorVersion ?? 0); |
| 1802 signature.addInt(this._minorVersion ?? 0); |
| 1803 signature.addString(this._apiSignature ?? ''); |
| 1804 } |
| 1805 |
| 1806 List<int> toBuffer() { |
| 1807 fb.Builder fbBuilder = new fb.Builder(); |
| 1808 return fbBuilder.finish(finish(fbBuilder), "PBdl"); |
| 1809 } |
| 1810 |
| 1811 fb.Offset finish(fb.Builder fbBuilder) { |
| 1812 fb.Offset offset_apiSignature; |
| 1813 fb.Offset offset_dependencies; |
| 1814 fb.Offset offset_linkedLibraries; |
| 1815 fb.Offset offset_linkedLibraryUris; |
| 1816 fb.Offset offset_unlinkedUnitHashes; |
| 1817 fb.Offset offset_unlinkedUnits; |
| 1818 fb.Offset offset_unlinkedUnitUris; |
| 1819 if (_apiSignature != null) { |
| 1820 offset_apiSignature = fbBuilder.writeString(_apiSignature); |
| 1821 } |
| 1822 if (!(_dependencies == null || _dependencies.isEmpty)) { |
| 1823 offset_dependencies = fbBuilder.writeList(_dependencies.map((b) => b.finis
h(fbBuilder)).toList()); |
| 1824 } |
| 1825 if (!(_linkedLibraries == null || _linkedLibraries.isEmpty)) { |
| 1826 offset_linkedLibraries = fbBuilder.writeList(_linkedLibraries.map((b) => b
.finish(fbBuilder)).toList()); |
| 1827 } |
| 1828 if (!(_linkedLibraryUris == null || _linkedLibraryUris.isEmpty)) { |
| 1829 offset_linkedLibraryUris = fbBuilder.writeList(_linkedLibraryUris.map((b)
=> fbBuilder.writeString(b)).toList()); |
| 1830 } |
| 1831 if (!(_unlinkedUnitHashes == null || _unlinkedUnitHashes.isEmpty)) { |
| 1832 offset_unlinkedUnitHashes = fbBuilder.writeList(_unlinkedUnitHashes.map((b
) => fbBuilder.writeString(b)).toList()); |
| 1833 } |
| 1834 if (!(_unlinkedUnits == null || _unlinkedUnits.isEmpty)) { |
| 1835 offset_unlinkedUnits = fbBuilder.writeList(_unlinkedUnits.map((b) => b.fin
ish(fbBuilder)).toList()); |
| 1836 } |
| 1837 if (!(_unlinkedUnitUris == null || _unlinkedUnitUris.isEmpty)) { |
| 1838 offset_unlinkedUnitUris = fbBuilder.writeList(_unlinkedUnitUris.map((b) =>
fbBuilder.writeString(b)).toList()); |
| 1839 } |
| 1840 fbBuilder.startTable(); |
| 1841 if (offset_apiSignature != null) { |
| 1842 fbBuilder.addOffset(7, offset_apiSignature); |
| 1843 } |
| 1844 if (offset_dependencies != null) { |
| 1845 fbBuilder.addOffset(8, offset_dependencies); |
| 1846 } |
| 1847 if (offset_linkedLibraries != null) { |
| 1848 fbBuilder.addOffset(0, offset_linkedLibraries); |
| 1849 } |
| 1850 if (offset_linkedLibraryUris != null) { |
| 1851 fbBuilder.addOffset(1, offset_linkedLibraryUris); |
| 1852 } |
| 1853 if (_majorVersion != null && _majorVersion != 0) { |
| 1854 fbBuilder.addUint32(5, _majorVersion); |
| 1855 } |
| 1856 if (_minorVersion != null && _minorVersion != 0) { |
| 1857 fbBuilder.addUint32(6, _minorVersion); |
| 1858 } |
| 1859 if (offset_unlinkedUnitHashes != null) { |
| 1860 fbBuilder.addOffset(4, offset_unlinkedUnitHashes); |
| 1861 } |
| 1862 if (offset_unlinkedUnits != null) { |
| 1863 fbBuilder.addOffset(2, offset_unlinkedUnits); |
| 1864 } |
| 1865 if (offset_unlinkedUnitUris != null) { |
| 1866 fbBuilder.addOffset(3, offset_unlinkedUnitUris); |
| 1867 } |
| 1868 return fbBuilder.endTable(); |
| 1869 } |
| 1870 } |
| 1871 |
| 1872 idl.PackageBundle readPackageBundle(List<int> buffer) { |
| 1873 fb.BufferContext rootRef = new fb.BufferContext.fromBytes(buffer); |
| 1874 return const _PackageBundleReader().read(rootRef, 0); |
| 1875 } |
| 1876 |
| 1877 class _PackageBundleReader extends fb.TableReader<_PackageBundleImpl> { |
| 1878 const _PackageBundleReader(); |
| 1879 |
| 1880 @override |
| 1881 _PackageBundleImpl createObject(fb.BufferContext bc, int offset) => new _Packa
geBundleImpl(bc, offset); |
| 1882 } |
| 1883 |
| 1884 class _PackageBundleImpl extends Object with _PackageBundleMixin implements idl.
PackageBundle { |
| 1885 final fb.BufferContext _bc; |
| 1886 final int _bcOffset; |
| 1887 |
| 1888 _PackageBundleImpl(this._bc, this._bcOffset); |
| 1889 |
| 1890 String _apiSignature; |
| 1891 List<idl.PackageDependencyInfo> _dependencies; |
| 1892 List<idl.LinkedLibrary> _linkedLibraries; |
| 1893 List<String> _linkedLibraryUris; |
| 1894 int _majorVersion; |
| 1895 int _minorVersion; |
| 1896 List<String> _unlinkedUnitHashes; |
| 1897 List<idl.UnlinkedUnit> _unlinkedUnits; |
| 1898 List<String> _unlinkedUnitUris; |
| 1899 |
| 1900 @override |
| 1901 String get apiSignature { |
| 1902 _apiSignature ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 7, ''); |
| 1903 return _apiSignature; |
| 1904 } |
| 1905 |
| 1906 @override |
| 1907 List<idl.PackageDependencyInfo> get dependencies { |
| 1908 _dependencies ??= const fb.ListReader<idl.PackageDependencyInfo>(const _Pack
ageDependencyInfoReader()).vTableGet(_bc, _bcOffset, 8, const <idl.PackageDepend
encyInfo>[]); |
| 1909 return _dependencies; |
| 1910 } |
| 1911 |
| 1912 @override |
| 1913 List<idl.LinkedLibrary> get linkedLibraries { |
| 1914 _linkedLibraries ??= const fb.ListReader<idl.LinkedLibrary>(const _LinkedLib
raryReader()).vTableGet(_bc, _bcOffset, 0, const <idl.LinkedLibrary>[]); |
| 1915 return _linkedLibraries; |
| 1916 } |
| 1917 |
| 1918 @override |
| 1919 List<String> get linkedLibraryUris { |
| 1920 _linkedLibraryUris ??= const fb.ListReader<String>(const fb.StringReader()).
vTableGet(_bc, _bcOffset, 1, const <String>[]); |
| 1921 return _linkedLibraryUris; |
| 1922 } |
| 1923 |
| 1924 @override |
| 1925 int get majorVersion { |
| 1926 _majorVersion ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 5, 0); |
| 1927 return _majorVersion; |
| 1928 } |
| 1929 |
| 1930 @override |
| 1931 int get minorVersion { |
| 1932 _minorVersion ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 6, 0); |
| 1933 return _minorVersion; |
| 1934 } |
| 1935 |
| 1936 @override |
| 1937 List<String> get unlinkedUnitHashes { |
| 1938 _unlinkedUnitHashes ??= const fb.ListReader<String>(const fb.StringReader())
.vTableGet(_bc, _bcOffset, 4, const <String>[]); |
| 1939 return _unlinkedUnitHashes; |
| 1940 } |
| 1941 |
| 1942 @override |
| 1943 List<idl.UnlinkedUnit> get unlinkedUnits { |
| 1944 _unlinkedUnits ??= const fb.ListReader<idl.UnlinkedUnit>(const _UnlinkedUnit
Reader()).vTableGet(_bc, _bcOffset, 2, const <idl.UnlinkedUnit>[]); |
| 1945 return _unlinkedUnits; |
| 1946 } |
| 1947 |
| 1948 @override |
| 1949 List<String> get unlinkedUnitUris { |
| 1950 _unlinkedUnitUris ??= const fb.ListReader<String>(const fb.StringReader()).v
TableGet(_bc, _bcOffset, 3, const <String>[]); |
| 1951 return _unlinkedUnitUris; |
| 1952 } |
| 1953 } |
| 1954 |
| 1955 abstract class _PackageBundleMixin implements idl.PackageBundle { |
| 1956 @override |
| 1957 Map<String, Object> toJson() { |
| 1958 Map<String, Object> _result = <String, Object>{}; |
| 1959 if (apiSignature != '') _result["apiSignature"] = apiSignature; |
| 1960 if (dependencies.isNotEmpty) _result["dependencies"] = dependencies.map((_va
lue) => _value.toJson()).toList(); |
| 1961 if (linkedLibraries.isNotEmpty) _result["linkedLibraries"] = linkedLibraries
.map((_value) => _value.toJson()).toList(); |
| 1962 if (linkedLibraryUris.isNotEmpty) _result["linkedLibraryUris"] = linkedLibra
ryUris; |
| 1963 if (majorVersion != 0) _result["majorVersion"] = majorVersion; |
| 1964 if (minorVersion != 0) _result["minorVersion"] = minorVersion; |
| 1965 if (unlinkedUnitHashes.isNotEmpty) _result["unlinkedUnitHashes"] = unlinkedU
nitHashes; |
| 1966 if (unlinkedUnits.isNotEmpty) _result["unlinkedUnits"] = unlinkedUnits.map((
_value) => _value.toJson()).toList(); |
| 1967 if (unlinkedUnitUris.isNotEmpty) _result["unlinkedUnitUris"] = unlinkedUnitU
ris; |
| 1968 return _result; |
| 1969 } |
| 1970 |
| 1971 @override |
| 1972 Map<String, Object> toMap() => { |
| 1973 "apiSignature": apiSignature, |
| 1974 "dependencies": dependencies, |
| 1975 "linkedLibraries": linkedLibraries, |
| 1976 "linkedLibraryUris": linkedLibraryUris, |
| 1977 "majorVersion": majorVersion, |
| 1978 "minorVersion": minorVersion, |
| 1979 "unlinkedUnitHashes": unlinkedUnitHashes, |
| 1980 "unlinkedUnits": unlinkedUnits, |
| 1981 "unlinkedUnitUris": unlinkedUnitUris, |
| 1982 }; |
| 1983 |
| 1984 @override |
| 1985 String toString() => convert.JSON.encode(toJson()); |
| 1986 } |
| 1987 |
| 1988 class PackageDependencyInfoBuilder extends Object with _PackageDependencyInfoMix
in implements idl.PackageDependencyInfo { |
| 1989 String _apiSignature; |
| 1990 List<String> _includedPackageNames; |
| 1991 bool _includesDartUris; |
| 1992 bool _includesFileUris; |
| 1993 String _summaryPath; |
| 1994 |
| 1995 @override |
| 1996 String get apiSignature => _apiSignature ??= ''; |
| 1997 |
| 1998 /** |
| 1999 * API signature of this dependency. |
| 2000 */ |
| 2001 void set apiSignature(String value) { |
| 2002 this._apiSignature = value; |
| 2003 } |
| 2004 |
| 2005 @override |
| 2006 List<String> get includedPackageNames => _includedPackageNames ??= <String>[]; |
| 2007 |
| 2008 /** |
| 2009 * If this dependency summarizes any files whose URI takes the form |
| 2010 * "package:<package_name>/...", a list of all such package names, sorted |
| 2011 * lexicographically. Otherwise empty. |
| 2012 */ |
| 2013 void set includedPackageNames(List<String> value) { |
| 2014 this._includedPackageNames = value; |
| 2015 } |
| 2016 |
| 2017 @override |
| 2018 bool get includesDartUris => _includesDartUris ??= false; |
| 2019 |
| 2020 /** |
| 2021 * Indicates whether this dependency summarizes any files whose URI takes the |
| 2022 * form "dart:...". |
| 2023 */ |
| 2024 void set includesDartUris(bool value) { |
| 2025 this._includesDartUris = value; |
| 2026 } |
| 2027 |
| 2028 @override |
| 2029 bool get includesFileUris => _includesFileUris ??= false; |
| 2030 |
| 2031 /** |
| 2032 * Indicates whether this dependency summarizes any files whose URI takes the |
| 2033 * form "file:...". |
| 2034 */ |
| 2035 void set includesFileUris(bool value) { |
| 2036 this._includesFileUris = value; |
| 2037 } |
| 2038 |
| 2039 @override |
| 2040 String get summaryPath => _summaryPath ??= ''; |
| 2041 |
| 2042 /** |
| 2043 * Relative path to the summary file for this dependency. This is intended as |
| 2044 * a hint to help the analysis server locate summaries of dependencies. We |
| 2045 * don't specify precisely what this path is relative to, but we expect it to |
| 2046 * be relative to a directory the analysis server can find (e.g. for projects |
| 2047 * built using Bazel, it would be relative to the "bazel-bin" directory). |
| 2048 * |
| 2049 * Absent if the path is not known. |
| 2050 */ |
| 2051 void set summaryPath(String value) { |
| 2052 this._summaryPath = value; |
| 2053 } |
| 2054 |
| 2055 PackageDependencyInfoBuilder({String apiSignature, List<String> includedPackag
eNames, bool includesDartUris, bool includesFileUris, String summaryPath}) |
| 2056 : _apiSignature = apiSignature, |
| 2057 _includedPackageNames = includedPackageNames, |
| 2058 _includesDartUris = includesDartUris, |
| 2059 _includesFileUris = includesFileUris, |
| 2060 _summaryPath = summaryPath; |
| 2061 |
| 2062 /** |
| 2063 * Flush [informative] data recursively. |
| 2064 */ |
| 2065 void flushInformative() { |
| 2066 } |
| 2067 |
| 2068 /** |
| 2069 * Accumulate non-[informative] data into [signature]. |
| 2070 */ |
| 2071 void collectApiSignature(api_sig.ApiSignature signature) { |
| 2072 signature.addString(this._apiSignature ?? ''); |
| 2073 signature.addString(this._summaryPath ?? ''); |
| 2074 if (this._includedPackageNames == null) { |
| 2075 signature.addInt(0); |
| 2076 } else { |
| 2077 signature.addInt(this._includedPackageNames.length); |
| 2078 for (var x in this._includedPackageNames) { |
| 2079 signature.addString(x); |
| 2080 } |
| 2081 } |
| 2082 signature.addBool(this._includesFileUris == true); |
| 2083 signature.addBool(this._includesDartUris == true); |
| 2084 } |
| 2085 |
| 2086 fb.Offset finish(fb.Builder fbBuilder) { |
| 2087 fb.Offset offset_apiSignature; |
| 2088 fb.Offset offset_includedPackageNames; |
| 2089 fb.Offset offset_summaryPath; |
| 2090 if (_apiSignature != null) { |
| 2091 offset_apiSignature = fbBuilder.writeString(_apiSignature); |
| 2092 } |
| 2093 if (!(_includedPackageNames == null || _includedPackageNames.isEmpty)) { |
| 2094 offset_includedPackageNames = fbBuilder.writeList(_includedPackageNames.ma
p((b) => fbBuilder.writeString(b)).toList()); |
| 2095 } |
| 2096 if (_summaryPath != null) { |
| 2097 offset_summaryPath = fbBuilder.writeString(_summaryPath); |
| 2098 } |
| 2099 fbBuilder.startTable(); |
| 2100 if (offset_apiSignature != null) { |
| 2101 fbBuilder.addOffset(0, offset_apiSignature); |
| 2102 } |
| 2103 if (offset_includedPackageNames != null) { |
| 2104 fbBuilder.addOffset(2, offset_includedPackageNames); |
| 2105 } |
| 2106 if (_includesDartUris == true) { |
| 2107 fbBuilder.addBool(4, true); |
| 2108 } |
| 2109 if (_includesFileUris == true) { |
| 2110 fbBuilder.addBool(3, true); |
| 2111 } |
| 2112 if (offset_summaryPath != null) { |
| 2113 fbBuilder.addOffset(1, offset_summaryPath); |
| 2114 } |
| 2115 return fbBuilder.endTable(); |
| 2116 } |
| 2117 } |
| 2118 |
| 2119 class _PackageDependencyInfoReader extends fb.TableReader<_PackageDependencyInfo
Impl> { |
| 2120 const _PackageDependencyInfoReader(); |
| 2121 |
| 2122 @override |
| 2123 _PackageDependencyInfoImpl createObject(fb.BufferContext bc, int offset) => ne
w _PackageDependencyInfoImpl(bc, offset); |
| 2124 } |
| 2125 |
| 2126 class _PackageDependencyInfoImpl extends Object with _PackageDependencyInfoMixin
implements idl.PackageDependencyInfo { |
| 2127 final fb.BufferContext _bc; |
| 2128 final int _bcOffset; |
| 2129 |
| 2130 _PackageDependencyInfoImpl(this._bc, this._bcOffset); |
| 2131 |
| 2132 String _apiSignature; |
| 2133 List<String> _includedPackageNames; |
| 2134 bool _includesDartUris; |
| 2135 bool _includesFileUris; |
| 2136 String _summaryPath; |
| 2137 |
| 2138 @override |
| 2139 String get apiSignature { |
| 2140 _apiSignature ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, ''); |
| 2141 return _apiSignature; |
| 2142 } |
| 2143 |
| 2144 @override |
| 2145 List<String> get includedPackageNames { |
| 2146 _includedPackageNames ??= const fb.ListReader<String>(const fb.StringReader(
)).vTableGet(_bc, _bcOffset, 2, const <String>[]); |
| 2147 return _includedPackageNames; |
| 2148 } |
| 2149 |
| 2150 @override |
| 2151 bool get includesDartUris { |
| 2152 _includesDartUris ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 4, fal
se); |
| 2153 return _includesDartUris; |
| 2154 } |
| 2155 |
| 2156 @override |
| 2157 bool get includesFileUris { |
| 2158 _includesFileUris ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 3, fal
se); |
| 2159 return _includesFileUris; |
| 2160 } |
| 2161 |
| 2162 @override |
| 2163 String get summaryPath { |
| 2164 _summaryPath ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 1, ''); |
| 2165 return _summaryPath; |
| 2166 } |
| 2167 } |
| 2168 |
| 2169 abstract class _PackageDependencyInfoMixin implements idl.PackageDependencyInfo
{ |
| 2170 @override |
| 2171 Map<String, Object> toJson() { |
| 2172 Map<String, Object> _result = <String, Object>{}; |
| 2173 if (apiSignature != '') _result["apiSignature"] = apiSignature; |
| 2174 if (includedPackageNames.isNotEmpty) _result["includedPackageNames"] = inclu
dedPackageNames; |
| 2175 if (includesDartUris != false) _result["includesDartUris"] = includesDartUri
s; |
| 2176 if (includesFileUris != false) _result["includesFileUris"] = includesFileUri
s; |
| 2177 if (summaryPath != '') _result["summaryPath"] = summaryPath; |
| 2178 return _result; |
| 2179 } |
| 2180 |
| 2181 @override |
| 2182 Map<String, Object> toMap() => { |
| 2183 "apiSignature": apiSignature, |
| 2184 "includedPackageNames": includedPackageNames, |
| 2185 "includesDartUris": includesDartUris, |
| 2186 "includesFileUris": includesFileUris, |
| 2187 "summaryPath": summaryPath, |
| 2188 }; |
| 2189 |
| 2190 @override |
| 2191 String toString() => convert.JSON.encode(toJson()); |
| 2192 } |
| 2193 |
| 2194 class PackageIndexBuilder extends Object with _PackageIndexMixin implements idl.
PackageIndex { |
| 2195 List<idl.IndexSyntheticElementKind> _elementKinds; |
| 2196 List<int> _elementNameClassMemberIds; |
| 2197 List<int> _elementNameParameterIds; |
| 2198 List<int> _elementNameUnitMemberIds; |
| 2199 List<int> _elementUnits; |
| 2200 List<String> _strings; |
| 2201 List<int> _unitLibraryUris; |
| 2202 List<UnitIndexBuilder> _units; |
| 2203 List<int> _unitUnitUris; |
| 2204 |
| 2205 @override |
| 2206 List<idl.IndexSyntheticElementKind> get elementKinds => _elementKinds ??= <idl
.IndexSyntheticElementKind>[]; |
| 2207 |
| 2208 /** |
| 2209 * Each item of this list corresponds to a unique referenced element. It is |
| 2210 * the kind of the synthetic element. |
| 2211 */ |
| 2212 void set elementKinds(List<idl.IndexSyntheticElementKind> value) { |
| 2213 this._elementKinds = value; |
| 2214 } |
| 2215 |
| 2216 @override |
| 2217 List<int> get elementNameClassMemberIds => _elementNameClassMemberIds ??= <int
>[]; |
| 2218 |
| 2219 /** |
| 2220 * Each item of this list corresponds to a unique referenced element. It is |
| 2221 * the identifier of the class member element name, or `null` if the element i
s |
| 2222 * a top-level element. The list is sorted in ascending order, so that the |
| 2223 * client can quickly check whether an element is referenced in this |
| 2224 * [PackageIndex]. |
| 2225 */ |
| 2226 void set elementNameClassMemberIds(List<int> value) { |
| 2227 assert(value == null || value.every((e) => e >= 0)); |
| 2228 this._elementNameClassMemberIds = value; |
| 2229 } |
| 2230 |
| 2231 @override |
| 2232 List<int> get elementNameParameterIds => _elementNameParameterIds ??= <int>[]; |
| 2233 |
| 2234 /** |
| 2235 * Each item of this list corresponds to a unique referenced element. It is |
| 2236 * the identifier of the named parameter name, or `null` if the element is not |
| 2237 * a named parameter. The list is sorted in ascending order, so that the |
| 2238 * client can quickly check whether an element is referenced in this |
| 2239 * [PackageIndex]. |
| 2240 */ |
| 2241 void set elementNameParameterIds(List<int> value) { |
| 2242 assert(value == null || value.every((e) => e >= 0)); |
| 2243 this._elementNameParameterIds = value; |
| 2244 } |
| 2245 |
| 2246 @override |
| 2247 List<int> get elementNameUnitMemberIds => _elementNameUnitMemberIds ??= <int>[
]; |
| 2248 |
| 2249 /** |
| 2250 * Each item of this list corresponds to a unique referenced element. It is |
| 2251 * the identifier of the top-level element name, or `null` if the element is |
| 2252 * the unit. The list is sorted in ascending order, so that the client can |
| 2253 * quickly check whether an element is referenced in this [PackageIndex]. |
| 2254 */ |
| 2255 void set elementNameUnitMemberIds(List<int> value) { |
| 2256 assert(value == null || value.every((e) => e >= 0)); |
| 2257 this._elementNameUnitMemberIds = value; |
| 2258 } |
| 2259 |
| 2260 @override |
| 2261 List<int> get elementUnits => _elementUnits ??= <int>[]; |
| 2262 |
| 2263 /** |
| 2264 * Each item of this list corresponds to a unique referenced element. It is |
| 2265 * the index into [unitLibraryUris] and [unitUnitUris] for the library |
| 2266 * specific unit where the element is declared. |
| 2267 */ |
| 2268 void set elementUnits(List<int> value) { |
| 2269 assert(value == null || value.every((e) => e >= 0)); |
| 2270 this._elementUnits = value; |
| 2271 } |
| 2272 |
| 2273 @override |
| 2274 List<String> get strings => _strings ??= <String>[]; |
| 2275 |
| 2276 /** |
| 2277 * List of unique element strings used in this [PackageIndex]. The list is |
| 2278 * sorted in ascending order, so that the client can quickly check the |
| 2279 * presence of a string in this [PackageIndex]. |
| 2280 */ |
| 2281 void set strings(List<String> value) { |
| 2282 this._strings = value; |
| 2283 } |
| 2284 |
| 2285 @override |
| 2286 List<int> get unitLibraryUris => _unitLibraryUris ??= <int>[]; |
| 2287 |
| 2288 /** |
| 2289 * Each item of this list corresponds to the library URI of a unique library |
| 2290 * specific unit referenced in the [PackageIndex]. It is an index into |
| 2291 * [strings] list. |
| 2292 */ |
| 2293 void set unitLibraryUris(List<int> value) { |
| 2294 assert(value == null || value.every((e) => e >= 0)); |
| 2295 this._unitLibraryUris = value; |
| 2296 } |
| 2297 |
| 2298 @override |
| 2299 List<UnitIndexBuilder> get units => _units ??= <UnitIndexBuilder>[]; |
| 2300 |
| 2301 /** |
| 2302 * List of indexes of each unit in this [PackageIndex]. |
| 2303 */ |
| 2304 void set units(List<UnitIndexBuilder> value) { |
| 2305 this._units = value; |
| 2306 } |
| 2307 |
| 2308 @override |
| 2309 List<int> get unitUnitUris => _unitUnitUris ??= <int>[]; |
| 2310 |
| 2311 /** |
| 2312 * Each item of this list corresponds to the unit URI of a unique library |
| 2313 * specific unit referenced in the [PackageIndex]. It is an index into |
| 2314 * [strings] list. |
| 2315 */ |
| 2316 void set unitUnitUris(List<int> value) { |
| 2317 assert(value == null || value.every((e) => e >= 0)); |
| 2318 this._unitUnitUris = value; |
| 2319 } |
| 2320 |
| 2321 PackageIndexBuilder({List<idl.IndexSyntheticElementKind> elementKinds, List<in
t> elementNameClassMemberIds, List<int> elementNameParameterIds, List<int> eleme
ntNameUnitMemberIds, List<int> elementUnits, List<String> strings, List<int> uni
tLibraryUris, List<UnitIndexBuilder> units, List<int> unitUnitUris}) |
| 2322 : _elementKinds = elementKinds, |
| 2323 _elementNameClassMemberIds = elementNameClassMemberIds, |
| 2324 _elementNameParameterIds = elementNameParameterIds, |
| 2325 _elementNameUnitMemberIds = elementNameUnitMemberIds, |
| 2326 _elementUnits = elementUnits, |
| 2327 _strings = strings, |
| 2328 _unitLibraryUris = unitLibraryUris, |
| 2329 _units = units, |
| 2330 _unitUnitUris = unitUnitUris; |
| 2331 |
| 2332 /** |
| 2333 * Flush [informative] data recursively. |
| 2334 */ |
| 2335 void flushInformative() { |
| 2336 _units?.forEach((b) => b.flushInformative()); |
| 2337 } |
| 2338 |
| 2339 /** |
| 2340 * Accumulate non-[informative] data into [signature]. |
| 2341 */ |
| 2342 void collectApiSignature(api_sig.ApiSignature signature) { |
| 2343 if (this._elementUnits == null) { |
| 2344 signature.addInt(0); |
| 2345 } else { |
| 2346 signature.addInt(this._elementUnits.length); |
| 2347 for (var x in this._elementUnits) { |
| 2348 signature.addInt(x); |
| 2349 } |
| 2350 } |
| 2351 if (this._elementNameUnitMemberIds == null) { |
| 2352 signature.addInt(0); |
| 2353 } else { |
| 2354 signature.addInt(this._elementNameUnitMemberIds.length); |
| 2355 for (var x in this._elementNameUnitMemberIds) { |
| 2356 signature.addInt(x); |
| 2357 } |
| 2358 } |
| 2359 if (this._unitLibraryUris == null) { |
| 2360 signature.addInt(0); |
| 2361 } else { |
| 2362 signature.addInt(this._unitLibraryUris.length); |
| 2363 for (var x in this._unitLibraryUris) { |
| 2364 signature.addInt(x); |
| 2365 } |
| 2366 } |
| 2367 if (this._unitUnitUris == null) { |
| 2368 signature.addInt(0); |
| 2369 } else { |
| 2370 signature.addInt(this._unitUnitUris.length); |
| 2371 for (var x in this._unitUnitUris) { |
| 2372 signature.addInt(x); |
| 2373 } |
| 2374 } |
| 2375 if (this._units == null) { |
| 2376 signature.addInt(0); |
| 2377 } else { |
| 2378 signature.addInt(this._units.length); |
| 2379 for (var x in this._units) { |
| 2380 x?.collectApiSignature(signature); |
| 2381 } |
| 2382 } |
| 2383 if (this._elementKinds == null) { |
| 2384 signature.addInt(0); |
| 2385 } else { |
| 2386 signature.addInt(this._elementKinds.length); |
| 2387 for (var x in this._elementKinds) { |
| 2388 signature.addInt(x.index); |
| 2389 } |
| 2390 } |
| 2391 if (this._strings == null) { |
| 2392 signature.addInt(0); |
| 2393 } else { |
| 2394 signature.addInt(this._strings.length); |
| 2395 for (var x in this._strings) { |
| 2396 signature.addString(x); |
| 2397 } |
| 2398 } |
| 2399 if (this._elementNameClassMemberIds == null) { |
| 2400 signature.addInt(0); |
| 2401 } else { |
| 2402 signature.addInt(this._elementNameClassMemberIds.length); |
| 2403 for (var x in this._elementNameClassMemberIds) { |
| 2404 signature.addInt(x); |
| 2405 } |
| 2406 } |
| 2407 if (this._elementNameParameterIds == null) { |
| 2408 signature.addInt(0); |
| 2409 } else { |
| 2410 signature.addInt(this._elementNameParameterIds.length); |
| 2411 for (var x in this._elementNameParameterIds) { |
| 2412 signature.addInt(x); |
| 2413 } |
| 2414 } |
| 2415 } |
| 2416 |
| 2417 List<int> toBuffer() { |
| 2418 fb.Builder fbBuilder = new fb.Builder(); |
| 2419 return fbBuilder.finish(finish(fbBuilder), "Indx"); |
| 2420 } |
| 2421 |
| 2422 fb.Offset finish(fb.Builder fbBuilder) { |
| 2423 fb.Offset offset_elementKinds; |
| 2424 fb.Offset offset_elementNameClassMemberIds; |
| 2425 fb.Offset offset_elementNameParameterIds; |
| 2426 fb.Offset offset_elementNameUnitMemberIds; |
| 2427 fb.Offset offset_elementUnits; |
| 2428 fb.Offset offset_strings; |
| 2429 fb.Offset offset_unitLibraryUris; |
| 2430 fb.Offset offset_units; |
| 2431 fb.Offset offset_unitUnitUris; |
| 2432 if (!(_elementKinds == null || _elementKinds.isEmpty)) { |
| 2433 offset_elementKinds = fbBuilder.writeListUint8(_elementKinds.map((b) => b.
index).toList()); |
| 2434 } |
| 2435 if (!(_elementNameClassMemberIds == null || _elementNameClassMemberIds.isEmp
ty)) { |
| 2436 offset_elementNameClassMemberIds = fbBuilder.writeListUint32(_elementNameC
lassMemberIds); |
| 2437 } |
| 2438 if (!(_elementNameParameterIds == null || _elementNameParameterIds.isEmpty))
{ |
| 2439 offset_elementNameParameterIds = fbBuilder.writeListUint32(_elementNamePar
ameterIds); |
| 2440 } |
| 2441 if (!(_elementNameUnitMemberIds == null || _elementNameUnitMemberIds.isEmpty
)) { |
| 2442 offset_elementNameUnitMemberIds = fbBuilder.writeListUint32(_elementNameUn
itMemberIds); |
| 2443 } |
| 2444 if (!(_elementUnits == null || _elementUnits.isEmpty)) { |
| 2445 offset_elementUnits = fbBuilder.writeListUint32(_elementUnits); |
| 2446 } |
| 2447 if (!(_strings == null || _strings.isEmpty)) { |
| 2448 offset_strings = fbBuilder.writeList(_strings.map((b) => fbBuilder.writeSt
ring(b)).toList()); |
| 2449 } |
| 2450 if (!(_unitLibraryUris == null || _unitLibraryUris.isEmpty)) { |
| 2451 offset_unitLibraryUris = fbBuilder.writeListUint32(_unitLibraryUris); |
| 2452 } |
| 2453 if (!(_units == null || _units.isEmpty)) { |
| 2454 offset_units = fbBuilder.writeList(_units.map((b) => b.finish(fbBuilder)).
toList()); |
| 2455 } |
| 2456 if (!(_unitUnitUris == null || _unitUnitUris.isEmpty)) { |
| 2457 offset_unitUnitUris = fbBuilder.writeListUint32(_unitUnitUris); |
| 2458 } |
| 2459 fbBuilder.startTable(); |
| 2460 if (offset_elementKinds != null) { |
| 2461 fbBuilder.addOffset(5, offset_elementKinds); |
| 2462 } |
| 2463 if (offset_elementNameClassMemberIds != null) { |
| 2464 fbBuilder.addOffset(7, offset_elementNameClassMemberIds); |
| 2465 } |
| 2466 if (offset_elementNameParameterIds != null) { |
| 2467 fbBuilder.addOffset(8, offset_elementNameParameterIds); |
| 2468 } |
| 2469 if (offset_elementNameUnitMemberIds != null) { |
| 2470 fbBuilder.addOffset(1, offset_elementNameUnitMemberIds); |
| 2471 } |
| 2472 if (offset_elementUnits != null) { |
| 2473 fbBuilder.addOffset(0, offset_elementUnits); |
| 2474 } |
| 2475 if (offset_strings != null) { |
| 2476 fbBuilder.addOffset(6, offset_strings); |
| 2477 } |
| 2478 if (offset_unitLibraryUris != null) { |
| 2479 fbBuilder.addOffset(2, offset_unitLibraryUris); |
| 2480 } |
| 2481 if (offset_units != null) { |
| 2482 fbBuilder.addOffset(4, offset_units); |
| 2483 } |
| 2484 if (offset_unitUnitUris != null) { |
| 2485 fbBuilder.addOffset(3, offset_unitUnitUris); |
| 2486 } |
| 2487 return fbBuilder.endTable(); |
| 2488 } |
| 2489 } |
| 2490 |
| 2491 idl.PackageIndex readPackageIndex(List<int> buffer) { |
| 2492 fb.BufferContext rootRef = new fb.BufferContext.fromBytes(buffer); |
| 2493 return const _PackageIndexReader().read(rootRef, 0); |
| 2494 } |
| 2495 |
| 2496 class _PackageIndexReader extends fb.TableReader<_PackageIndexImpl> { |
| 2497 const _PackageIndexReader(); |
| 2498 |
| 2499 @override |
| 2500 _PackageIndexImpl createObject(fb.BufferContext bc, int offset) => new _Packag
eIndexImpl(bc, offset); |
| 2501 } |
| 2502 |
| 2503 class _PackageIndexImpl extends Object with _PackageIndexMixin implements idl.Pa
ckageIndex { |
| 2504 final fb.BufferContext _bc; |
| 2505 final int _bcOffset; |
| 2506 |
| 2507 _PackageIndexImpl(this._bc, this._bcOffset); |
| 2508 |
| 2509 List<idl.IndexSyntheticElementKind> _elementKinds; |
| 2510 List<int> _elementNameClassMemberIds; |
| 2511 List<int> _elementNameParameterIds; |
| 2512 List<int> _elementNameUnitMemberIds; |
| 2513 List<int> _elementUnits; |
| 2514 List<String> _strings; |
| 2515 List<int> _unitLibraryUris; |
| 2516 List<idl.UnitIndex> _units; |
| 2517 List<int> _unitUnitUris; |
| 2518 |
| 2519 @override |
| 2520 List<idl.IndexSyntheticElementKind> get elementKinds { |
| 2521 _elementKinds ??= const fb.ListReader<idl.IndexSyntheticElementKind>(const _
IndexSyntheticElementKindReader()).vTableGet(_bc, _bcOffset, 5, const <idl.Index
SyntheticElementKind>[]); |
| 2522 return _elementKinds; |
| 2523 } |
| 2524 |
| 2525 @override |
| 2526 List<int> get elementNameClassMemberIds { |
| 2527 _elementNameClassMemberIds ??= const fb.Uint32ListReader().vTableGet(_bc, _b
cOffset, 7, const <int>[]); |
| 2528 return _elementNameClassMemberIds; |
| 2529 } |
| 2530 |
| 2531 @override |
| 2532 List<int> get elementNameParameterIds { |
| 2533 _elementNameParameterIds ??= const fb.Uint32ListReader().vTableGet(_bc, _bcO
ffset, 8, const <int>[]); |
| 2534 return _elementNameParameterIds; |
| 2535 } |
| 2536 |
| 2537 @override |
| 2538 List<int> get elementNameUnitMemberIds { |
| 2539 _elementNameUnitMemberIds ??= const fb.Uint32ListReader().vTableGet(_bc, _bc
Offset, 1, const <int>[]); |
| 2540 return _elementNameUnitMemberIds; |
| 2541 } |
| 2542 |
| 2543 @override |
| 2544 List<int> get elementUnits { |
| 2545 _elementUnits ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 0, c
onst <int>[]); |
| 2546 return _elementUnits; |
| 2547 } |
| 2548 |
| 2549 @override |
| 2550 List<String> get strings { |
| 2551 _strings ??= const fb.ListReader<String>(const fb.StringReader()).vTableGet(
_bc, _bcOffset, 6, const <String>[]); |
| 2552 return _strings; |
| 2553 } |
| 2554 |
| 2555 @override |
| 2556 List<int> get unitLibraryUris { |
| 2557 _unitLibraryUris ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 2
, const <int>[]); |
| 2558 return _unitLibraryUris; |
| 2559 } |
| 2560 |
| 2561 @override |
| 2562 List<idl.UnitIndex> get units { |
| 2563 _units ??= const fb.ListReader<idl.UnitIndex>(const _UnitIndexReader()).vTab
leGet(_bc, _bcOffset, 4, const <idl.UnitIndex>[]); |
| 2564 return _units; |
| 2565 } |
| 2566 |
| 2567 @override |
| 2568 List<int> get unitUnitUris { |
| 2569 _unitUnitUris ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 3, c
onst <int>[]); |
| 2570 return _unitUnitUris; |
| 2571 } |
| 2572 } |
| 2573 |
| 2574 abstract class _PackageIndexMixin implements idl.PackageIndex { |
| 2575 @override |
| 2576 Map<String, Object> toJson() { |
| 2577 Map<String, Object> _result = <String, Object>{}; |
| 2578 if (elementKinds.isNotEmpty) _result["elementKinds"] = elementKinds.map((_va
lue) => _value.toString().split('.')[1]).toList(); |
| 2579 if (elementNameClassMemberIds.isNotEmpty) _result["elementNameClassMemberIds
"] = elementNameClassMemberIds; |
| 2580 if (elementNameParameterIds.isNotEmpty) _result["elementNameParameterIds"] =
elementNameParameterIds; |
| 2581 if (elementNameUnitMemberIds.isNotEmpty) _result["elementNameUnitMemberIds"]
= elementNameUnitMemberIds; |
| 2582 if (elementUnits.isNotEmpty) _result["elementUnits"] = elementUnits; |
| 2583 if (strings.isNotEmpty) _result["strings"] = strings; |
| 2584 if (unitLibraryUris.isNotEmpty) _result["unitLibraryUris"] = unitLibraryUris
; |
| 2585 if (units.isNotEmpty) _result["units"] = units.map((_value) => _value.toJson
()).toList(); |
| 2586 if (unitUnitUris.isNotEmpty) _result["unitUnitUris"] = unitUnitUris; |
| 2587 return _result; |
| 2588 } |
| 2589 |
| 2590 @override |
| 2591 Map<String, Object> toMap() => { |
| 2592 "elementKinds": elementKinds, |
| 2593 "elementNameClassMemberIds": elementNameClassMemberIds, |
| 2594 "elementNameParameterIds": elementNameParameterIds, |
| 2595 "elementNameUnitMemberIds": elementNameUnitMemberIds, |
| 2596 "elementUnits": elementUnits, |
| 2597 "strings": strings, |
| 2598 "unitLibraryUris": unitLibraryUris, |
| 2599 "units": units, |
| 2600 "unitUnitUris": unitUnitUris, |
| 2601 }; |
| 2602 |
| 2603 @override |
| 2604 String toString() => convert.JSON.encode(toJson()); |
| 2605 } |
| 2606 |
| 2607 class UnitIndexBuilder extends Object with _UnitIndexMixin implements idl.UnitIn
dex { |
| 2608 List<idl.IndexNameKind> _definedNameKinds; |
| 2609 List<int> _definedNameOffsets; |
| 2610 List<int> _definedNames; |
| 2611 int _unit; |
| 2612 List<bool> _usedElementIsQualifiedFlags; |
| 2613 List<idl.IndexRelationKind> _usedElementKinds; |
| 2614 List<int> _usedElementLengths; |
| 2615 List<int> _usedElementOffsets; |
| 2616 List<int> _usedElements; |
| 2617 List<bool> _usedNameIsQualifiedFlags; |
| 2618 List<idl.IndexRelationKind> _usedNameKinds; |
| 2619 List<int> _usedNameOffsets; |
| 2620 List<int> _usedNames; |
| 2621 |
| 2622 @override |
| 2623 List<idl.IndexNameKind> get definedNameKinds => _definedNameKinds ??= <idl.Ind
exNameKind>[]; |
| 2624 |
| 2625 /** |
| 2626 * Each item of this list is the kind of an element defined in this unit. |
| 2627 */ |
| 2628 void set definedNameKinds(List<idl.IndexNameKind> value) { |
| 2629 this._definedNameKinds = value; |
| 2630 } |
| 2631 |
| 2632 @override |
| 2633 List<int> get definedNameOffsets => _definedNameOffsets ??= <int>[]; |
| 2634 |
| 2635 /** |
| 2636 * Each item of this list is the name offset of an element defined in this |
| 2637 * unit relative to the beginning of the file. |
| 2638 */ |
| 2639 void set definedNameOffsets(List<int> value) { |
| 2640 assert(value == null || value.every((e) => e >= 0)); |
| 2641 this._definedNameOffsets = value; |
| 2642 } |
| 2643 |
| 2644 @override |
| 2645 List<int> get definedNames => _definedNames ??= <int>[]; |
| 2646 |
| 2647 /** |
| 2648 * Each item of this list corresponds to an element defined in this unit. It |
| 2649 * is an index into [PackageIndex.strings] list. The list is sorted in |
| 2650 * ascending order, so that the client can quickly find name definitions in |
| 2651 * this [UnitIndex]. |
| 2652 */ |
| 2653 void set definedNames(List<int> value) { |
| 2654 assert(value == null || value.every((e) => e >= 0)); |
| 2655 this._definedNames = value; |
| 2656 } |
| 2657 |
| 2658 @override |
| 2659 int get unit => _unit ??= 0; |
| 2660 |
| 2661 /** |
| 2662 * Index into [PackageIndex.unitLibraryUris] and [PackageIndex.unitUnitUris] |
| 2663 * for the library specific unit that corresponds to this [UnitIndex]. |
| 2664 */ |
| 2665 void set unit(int value) { |
| 2666 assert(value == null || value >= 0); |
| 2667 this._unit = value; |
| 2668 } |
| 2669 |
| 2670 @override |
| 2671 List<bool> get usedElementIsQualifiedFlags => _usedElementIsQualifiedFlags ??=
<bool>[]; |
| 2672 |
| 2673 /** |
| 2674 * Each item of this list is the `true` if the corresponding element usage |
| 2675 * is qualified with some prefix. |
| 2676 */ |
| 2677 void set usedElementIsQualifiedFlags(List<bool> value) { |
| 2678 this._usedElementIsQualifiedFlags = value; |
| 2679 } |
| 2680 |
| 2681 @override |
| 2682 List<idl.IndexRelationKind> get usedElementKinds => _usedElementKinds ??= <idl
.IndexRelationKind>[]; |
| 2683 |
| 2684 /** |
| 2685 * Each item of this list is the kind of the element usage. |
| 2686 */ |
| 2687 void set usedElementKinds(List<idl.IndexRelationKind> value) { |
| 2688 this._usedElementKinds = value; |
| 2689 } |
| 2690 |
| 2691 @override |
| 2692 List<int> get usedElementLengths => _usedElementLengths ??= <int>[]; |
| 2693 |
| 2694 /** |
| 2695 * Each item of this list is the length of the element usage. |
| 2696 */ |
| 2697 void set usedElementLengths(List<int> value) { |
| 2698 assert(value == null || value.every((e) => e >= 0)); |
| 2699 this._usedElementLengths = value; |
| 2700 } |
| 2701 |
| 2702 @override |
| 2703 List<int> get usedElementOffsets => _usedElementOffsets ??= <int>[]; |
| 2704 |
| 2705 /** |
| 2706 * Each item of this list is the offset of the element usage relative to the |
| 2707 * beginning of the file. |
| 2708 */ |
| 2709 void set usedElementOffsets(List<int> value) { |
| 2710 assert(value == null || value.every((e) => e >= 0)); |
| 2711 this._usedElementOffsets = value; |
| 2712 } |
| 2713 |
| 2714 @override |
| 2715 List<int> get usedElements => _usedElements ??= <int>[]; |
| 2716 |
| 2717 /** |
| 2718 * Each item of this list is the index into [PackageIndex.elementUnits] and |
| 2719 * [PackageIndex.elementOffsets]. The list is sorted in ascending order, so |
| 2720 * that the client can quickly find element references in this [UnitIndex]. |
| 2721 */ |
| 2722 void set usedElements(List<int> value) { |
| 2723 assert(value == null || value.every((e) => e >= 0)); |
| 2724 this._usedElements = value; |
| 2725 } |
| 2726 |
| 2727 @override |
| 2728 List<bool> get usedNameIsQualifiedFlags => _usedNameIsQualifiedFlags ??= <bool
>[]; |
| 2729 |
| 2730 /** |
| 2731 * Each item of this list is the `true` if the corresponding name usage |
| 2732 * is qualified with some prefix. |
| 2733 */ |
| 2734 void set usedNameIsQualifiedFlags(List<bool> value) { |
| 2735 this._usedNameIsQualifiedFlags = value; |
| 2736 } |
| 2737 |
| 2738 @override |
| 2739 List<idl.IndexRelationKind> get usedNameKinds => _usedNameKinds ??= <idl.Index
RelationKind>[]; |
| 2740 |
| 2741 /** |
| 2742 * Each item of this list is the kind of the name usage. |
| 2743 */ |
| 2744 void set usedNameKinds(List<idl.IndexRelationKind> value) { |
| 2745 this._usedNameKinds = value; |
| 2746 } |
| 2747 |
| 2748 @override |
| 2749 List<int> get usedNameOffsets => _usedNameOffsets ??= <int>[]; |
| 2750 |
| 2751 /** |
| 2752 * Each item of this list is the offset of the name usage relative to the |
| 2753 * beginning of the file. |
| 2754 */ |
| 2755 void set usedNameOffsets(List<int> value) { |
| 2756 assert(value == null || value.every((e) => e >= 0)); |
| 2757 this._usedNameOffsets = value; |
| 2758 } |
| 2759 |
| 2760 @override |
| 2761 List<int> get usedNames => _usedNames ??= <int>[]; |
| 2762 |
| 2763 /** |
| 2764 * Each item of this list is the index into [PackageIndex.strings] for a |
| 2765 * used name. The list is sorted in ascending order, so that the client can |
| 2766 * quickly find name uses in this [UnitIndex]. |
| 2767 */ |
| 2768 void set usedNames(List<int> value) { |
| 2769 assert(value == null || value.every((e) => e >= 0)); |
| 2770 this._usedNames = value; |
| 2771 } |
| 2772 |
| 2773 UnitIndexBuilder({List<idl.IndexNameKind> definedNameKinds, List<int> definedN
ameOffsets, List<int> definedNames, int unit, List<bool> usedElementIsQualifiedF
lags, List<idl.IndexRelationKind> usedElementKinds, List<int> usedElementLengths
, List<int> usedElementOffsets, List<int> usedElements, List<bool> usedNameIsQua
lifiedFlags, List<idl.IndexRelationKind> usedNameKinds, List<int> usedNameOffset
s, List<int> usedNames}) |
| 2774 : _definedNameKinds = definedNameKinds, |
| 2775 _definedNameOffsets = definedNameOffsets, |
| 2776 _definedNames = definedNames, |
| 2777 _unit = unit, |
| 2778 _usedElementIsQualifiedFlags = usedElementIsQualifiedFlags, |
| 2779 _usedElementKinds = usedElementKinds, |
| 2780 _usedElementLengths = usedElementLengths, |
| 2781 _usedElementOffsets = usedElementOffsets, |
| 2782 _usedElements = usedElements, |
| 2783 _usedNameIsQualifiedFlags = usedNameIsQualifiedFlags, |
| 2784 _usedNameKinds = usedNameKinds, |
| 2785 _usedNameOffsets = usedNameOffsets, |
| 2786 _usedNames = usedNames; |
| 2787 |
| 2788 /** |
| 2789 * Flush [informative] data recursively. |
| 2790 */ |
| 2791 void flushInformative() { |
| 2792 } |
| 2793 |
| 2794 /** |
| 2795 * Accumulate non-[informative] data into [signature]. |
| 2796 */ |
| 2797 void collectApiSignature(api_sig.ApiSignature signature) { |
| 2798 signature.addInt(this._unit ?? 0); |
| 2799 if (this._usedElementLengths == null) { |
| 2800 signature.addInt(0); |
| 2801 } else { |
| 2802 signature.addInt(this._usedElementLengths.length); |
| 2803 for (var x in this._usedElementLengths) { |
| 2804 signature.addInt(x); |
| 2805 } |
| 2806 } |
| 2807 if (this._usedElementOffsets == null) { |
| 2808 signature.addInt(0); |
| 2809 } else { |
| 2810 signature.addInt(this._usedElementOffsets.length); |
| 2811 for (var x in this._usedElementOffsets) { |
| 2812 signature.addInt(x); |
| 2813 } |
| 2814 } |
| 2815 if (this._usedElements == null) { |
| 2816 signature.addInt(0); |
| 2817 } else { |
| 2818 signature.addInt(this._usedElements.length); |
| 2819 for (var x in this._usedElements) { |
| 2820 signature.addInt(x); |
| 2821 } |
| 2822 } |
| 2823 if (this._usedElementKinds == null) { |
| 2824 signature.addInt(0); |
| 2825 } else { |
| 2826 signature.addInt(this._usedElementKinds.length); |
| 2827 for (var x in this._usedElementKinds) { |
| 2828 signature.addInt(x.index); |
| 2829 } |
| 2830 } |
| 2831 if (this._definedNames == null) { |
| 2832 signature.addInt(0); |
| 2833 } else { |
| 2834 signature.addInt(this._definedNames.length); |
| 2835 for (var x in this._definedNames) { |
| 2836 signature.addInt(x); |
| 2837 } |
| 2838 } |
| 2839 if (this._definedNameKinds == null) { |
| 2840 signature.addInt(0); |
| 2841 } else { |
| 2842 signature.addInt(this._definedNameKinds.length); |
| 2843 for (var x in this._definedNameKinds) { |
| 2844 signature.addInt(x.index); |
| 2845 } |
| 2846 } |
| 2847 if (this._definedNameOffsets == null) { |
| 2848 signature.addInt(0); |
| 2849 } else { |
| 2850 signature.addInt(this._definedNameOffsets.length); |
| 2851 for (var x in this._definedNameOffsets) { |
| 2852 signature.addInt(x); |
| 2853 } |
| 2854 } |
| 2855 if (this._usedNames == null) { |
| 2856 signature.addInt(0); |
| 2857 } else { |
| 2858 signature.addInt(this._usedNames.length); |
| 2859 for (var x in this._usedNames) { |
| 2860 signature.addInt(x); |
| 2861 } |
| 2862 } |
| 2863 if (this._usedNameOffsets == null) { |
| 2864 signature.addInt(0); |
| 2865 } else { |
| 2866 signature.addInt(this._usedNameOffsets.length); |
| 2867 for (var x in this._usedNameOffsets) { |
| 2868 signature.addInt(x); |
| 2869 } |
| 2870 } |
| 2871 if (this._usedNameKinds == null) { |
| 2872 signature.addInt(0); |
| 2873 } else { |
| 2874 signature.addInt(this._usedNameKinds.length); |
| 2875 for (var x in this._usedNameKinds) { |
| 2876 signature.addInt(x.index); |
| 2877 } |
| 2878 } |
| 2879 if (this._usedElementIsQualifiedFlags == null) { |
| 2880 signature.addInt(0); |
| 2881 } else { |
| 2882 signature.addInt(this._usedElementIsQualifiedFlags.length); |
| 2883 for (var x in this._usedElementIsQualifiedFlags) { |
| 2884 signature.addBool(x); |
| 2885 } |
| 2886 } |
| 2887 if (this._usedNameIsQualifiedFlags == null) { |
| 2888 signature.addInt(0); |
| 2889 } else { |
| 2890 signature.addInt(this._usedNameIsQualifiedFlags.length); |
| 2891 for (var x in this._usedNameIsQualifiedFlags) { |
| 2892 signature.addBool(x); |
| 2893 } |
| 2894 } |
| 2895 } |
| 2896 |
| 2897 fb.Offset finish(fb.Builder fbBuilder) { |
| 2898 fb.Offset offset_definedNameKinds; |
| 2899 fb.Offset offset_definedNameOffsets; |
| 2900 fb.Offset offset_definedNames; |
| 2901 fb.Offset offset_usedElementIsQualifiedFlags; |
| 2902 fb.Offset offset_usedElementKinds; |
| 2903 fb.Offset offset_usedElementLengths; |
| 2904 fb.Offset offset_usedElementOffsets; |
| 2905 fb.Offset offset_usedElements; |
| 2906 fb.Offset offset_usedNameIsQualifiedFlags; |
| 2907 fb.Offset offset_usedNameKinds; |
| 2908 fb.Offset offset_usedNameOffsets; |
| 2909 fb.Offset offset_usedNames; |
| 2910 if (!(_definedNameKinds == null || _definedNameKinds.isEmpty)) { |
| 2911 offset_definedNameKinds = fbBuilder.writeListUint8(_definedNameKinds.map((
b) => b.index).toList()); |
| 2912 } |
| 2913 if (!(_definedNameOffsets == null || _definedNameOffsets.isEmpty)) { |
| 2914 offset_definedNameOffsets = fbBuilder.writeListUint32(_definedNameOffsets)
; |
| 2915 } |
| 2916 if (!(_definedNames == null || _definedNames.isEmpty)) { |
| 2917 offset_definedNames = fbBuilder.writeListUint32(_definedNames); |
| 2918 } |
| 2919 if (!(_usedElementIsQualifiedFlags == null || _usedElementIsQualifiedFlags.i
sEmpty)) { |
| 2920 offset_usedElementIsQualifiedFlags = fbBuilder.writeListBool(_usedElementI
sQualifiedFlags); |
| 2921 } |
| 2922 if (!(_usedElementKinds == null || _usedElementKinds.isEmpty)) { |
| 2923 offset_usedElementKinds = fbBuilder.writeListUint8(_usedElementKinds.map((
b) => b.index).toList()); |
| 2924 } |
| 2925 if (!(_usedElementLengths == null || _usedElementLengths.isEmpty)) { |
| 2926 offset_usedElementLengths = fbBuilder.writeListUint32(_usedElementLengths)
; |
| 2927 } |
| 2928 if (!(_usedElementOffsets == null || _usedElementOffsets.isEmpty)) { |
| 2929 offset_usedElementOffsets = fbBuilder.writeListUint32(_usedElementOffsets)
; |
| 2930 } |
| 2931 if (!(_usedElements == null || _usedElements.isEmpty)) { |
| 2932 offset_usedElements = fbBuilder.writeListUint32(_usedElements); |
| 2933 } |
| 2934 if (!(_usedNameIsQualifiedFlags == null || _usedNameIsQualifiedFlags.isEmpty
)) { |
| 2935 offset_usedNameIsQualifiedFlags = fbBuilder.writeListBool(_usedNameIsQuali
fiedFlags); |
| 2936 } |
| 2937 if (!(_usedNameKinds == null || _usedNameKinds.isEmpty)) { |
| 2938 offset_usedNameKinds = fbBuilder.writeListUint8(_usedNameKinds.map((b) =>
b.index).toList()); |
| 2939 } |
| 2940 if (!(_usedNameOffsets == null || _usedNameOffsets.isEmpty)) { |
| 2941 offset_usedNameOffsets = fbBuilder.writeListUint32(_usedNameOffsets); |
| 2942 } |
| 2943 if (!(_usedNames == null || _usedNames.isEmpty)) { |
| 2944 offset_usedNames = fbBuilder.writeListUint32(_usedNames); |
| 2945 } |
| 2946 fbBuilder.startTable(); |
| 2947 if (offset_definedNameKinds != null) { |
| 2948 fbBuilder.addOffset(6, offset_definedNameKinds); |
| 2949 } |
| 2950 if (offset_definedNameOffsets != null) { |
| 2951 fbBuilder.addOffset(7, offset_definedNameOffsets); |
| 2952 } |
| 2953 if (offset_definedNames != null) { |
| 2954 fbBuilder.addOffset(5, offset_definedNames); |
| 2955 } |
| 2956 if (_unit != null && _unit != 0) { |
| 2957 fbBuilder.addUint32(0, _unit); |
| 2958 } |
| 2959 if (offset_usedElementIsQualifiedFlags != null) { |
| 2960 fbBuilder.addOffset(11, offset_usedElementIsQualifiedFlags); |
| 2961 } |
| 2962 if (offset_usedElementKinds != null) { |
| 2963 fbBuilder.addOffset(4, offset_usedElementKinds); |
| 2964 } |
| 2965 if (offset_usedElementLengths != null) { |
| 2966 fbBuilder.addOffset(1, offset_usedElementLengths); |
| 2967 } |
| 2968 if (offset_usedElementOffsets != null) { |
| 2969 fbBuilder.addOffset(2, offset_usedElementOffsets); |
| 2970 } |
| 2971 if (offset_usedElements != null) { |
| 2972 fbBuilder.addOffset(3, offset_usedElements); |
| 2973 } |
| 2974 if (offset_usedNameIsQualifiedFlags != null) { |
| 2975 fbBuilder.addOffset(12, offset_usedNameIsQualifiedFlags); |
| 2976 } |
| 2977 if (offset_usedNameKinds != null) { |
| 2978 fbBuilder.addOffset(10, offset_usedNameKinds); |
| 2979 } |
| 2980 if (offset_usedNameOffsets != null) { |
| 2981 fbBuilder.addOffset(9, offset_usedNameOffsets); |
| 2982 } |
| 2983 if (offset_usedNames != null) { |
| 2984 fbBuilder.addOffset(8, offset_usedNames); |
| 2985 } |
| 2986 return fbBuilder.endTable(); |
| 2987 } |
| 2988 } |
| 2989 |
| 2990 class _UnitIndexReader extends fb.TableReader<_UnitIndexImpl> { |
| 2991 const _UnitIndexReader(); |
| 2992 |
| 2993 @override |
| 2994 _UnitIndexImpl createObject(fb.BufferContext bc, int offset) => new _UnitIndex
Impl(bc, offset); |
| 2995 } |
| 2996 |
| 2997 class _UnitIndexImpl extends Object with _UnitIndexMixin implements idl.UnitInde
x { |
| 2998 final fb.BufferContext _bc; |
| 2999 final int _bcOffset; |
| 3000 |
| 3001 _UnitIndexImpl(this._bc, this._bcOffset); |
| 3002 |
| 3003 List<idl.IndexNameKind> _definedNameKinds; |
| 3004 List<int> _definedNameOffsets; |
| 3005 List<int> _definedNames; |
| 3006 int _unit; |
| 3007 List<bool> _usedElementIsQualifiedFlags; |
| 3008 List<idl.IndexRelationKind> _usedElementKinds; |
| 3009 List<int> _usedElementLengths; |
| 3010 List<int> _usedElementOffsets; |
| 3011 List<int> _usedElements; |
| 3012 List<bool> _usedNameIsQualifiedFlags; |
| 3013 List<idl.IndexRelationKind> _usedNameKinds; |
| 3014 List<int> _usedNameOffsets; |
| 3015 List<int> _usedNames; |
| 3016 |
| 3017 @override |
| 3018 List<idl.IndexNameKind> get definedNameKinds { |
| 3019 _definedNameKinds ??= const fb.ListReader<idl.IndexNameKind>(const _IndexNam
eKindReader()).vTableGet(_bc, _bcOffset, 6, const <idl.IndexNameKind>[]); |
| 3020 return _definedNameKinds; |
| 3021 } |
| 3022 |
| 3023 @override |
| 3024 List<int> get definedNameOffsets { |
| 3025 _definedNameOffsets ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset
, 7, const <int>[]); |
| 3026 return _definedNameOffsets; |
| 3027 } |
| 3028 |
| 3029 @override |
| 3030 List<int> get definedNames { |
| 3031 _definedNames ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 5, c
onst <int>[]); |
| 3032 return _definedNames; |
| 3033 } |
| 3034 |
| 3035 @override |
| 3036 int get unit { |
| 3037 _unit ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 0, 0); |
| 3038 return _unit; |
| 3039 } |
| 3040 |
| 3041 @override |
| 3042 List<bool> get usedElementIsQualifiedFlags { |
| 3043 _usedElementIsQualifiedFlags ??= const fb.BoolListReader().vTableGet(_bc, _b
cOffset, 11, const <bool>[]); |
| 3044 return _usedElementIsQualifiedFlags; |
| 3045 } |
| 3046 |
| 3047 @override |
| 3048 List<idl.IndexRelationKind> get usedElementKinds { |
| 3049 _usedElementKinds ??= const fb.ListReader<idl.IndexRelationKind>(const _Inde
xRelationKindReader()).vTableGet(_bc, _bcOffset, 4, const <idl.IndexRelationKind
>[]); |
| 3050 return _usedElementKinds; |
| 3051 } |
| 3052 |
| 3053 @override |
| 3054 List<int> get usedElementLengths { |
| 3055 _usedElementLengths ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset
, 1, const <int>[]); |
| 3056 return _usedElementLengths; |
| 3057 } |
| 3058 |
| 3059 @override |
| 3060 List<int> get usedElementOffsets { |
| 3061 _usedElementOffsets ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset
, 2, const <int>[]); |
| 3062 return _usedElementOffsets; |
| 3063 } |
| 3064 |
| 3065 @override |
| 3066 List<int> get usedElements { |
| 3067 _usedElements ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 3, c
onst <int>[]); |
| 3068 return _usedElements; |
| 3069 } |
| 3070 |
| 3071 @override |
| 3072 List<bool> get usedNameIsQualifiedFlags { |
| 3073 _usedNameIsQualifiedFlags ??= const fb.BoolListReader().vTableGet(_bc, _bcOf
fset, 12, const <bool>[]); |
| 3074 return _usedNameIsQualifiedFlags; |
| 3075 } |
| 3076 |
| 3077 @override |
| 3078 List<idl.IndexRelationKind> get usedNameKinds { |
| 3079 _usedNameKinds ??= const fb.ListReader<idl.IndexRelationKind>(const _IndexRe
lationKindReader()).vTableGet(_bc, _bcOffset, 10, const <idl.IndexRelationKind>[
]); |
| 3080 return _usedNameKinds; |
| 3081 } |
| 3082 |
| 3083 @override |
| 3084 List<int> get usedNameOffsets { |
| 3085 _usedNameOffsets ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 9
, const <int>[]); |
| 3086 return _usedNameOffsets; |
| 3087 } |
| 3088 |
| 3089 @override |
| 3090 List<int> get usedNames { |
| 3091 _usedNames ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 8, cons
t <int>[]); |
| 3092 return _usedNames; |
| 3093 } |
| 3094 } |
| 3095 |
| 3096 abstract class _UnitIndexMixin implements idl.UnitIndex { |
| 3097 @override |
| 3098 Map<String, Object> toJson() { |
| 3099 Map<String, Object> _result = <String, Object>{}; |
| 3100 if (definedNameKinds.isNotEmpty) _result["definedNameKinds"] = definedNameKi
nds.map((_value) => _value.toString().split('.')[1]).toList(); |
| 3101 if (definedNameOffsets.isNotEmpty) _result["definedNameOffsets"] = definedNa
meOffsets; |
| 3102 if (definedNames.isNotEmpty) _result["definedNames"] = definedNames; |
| 3103 if (unit != 0) _result["unit"] = unit; |
| 3104 if (usedElementIsQualifiedFlags.isNotEmpty) _result["usedElementIsQualifiedF
lags"] = usedElementIsQualifiedFlags; |
| 3105 if (usedElementKinds.isNotEmpty) _result["usedElementKinds"] = usedElementKi
nds.map((_value) => _value.toString().split('.')[1]).toList(); |
| 3106 if (usedElementLengths.isNotEmpty) _result["usedElementLengths"] = usedEleme
ntLengths; |
| 3107 if (usedElementOffsets.isNotEmpty) _result["usedElementOffsets"] = usedEleme
ntOffsets; |
| 3108 if (usedElements.isNotEmpty) _result["usedElements"] = usedElements; |
| 3109 if (usedNameIsQualifiedFlags.isNotEmpty) _result["usedNameIsQualifiedFlags"]
= usedNameIsQualifiedFlags; |
| 3110 if (usedNameKinds.isNotEmpty) _result["usedNameKinds"] = usedNameKinds.map((
_value) => _value.toString().split('.')[1]).toList(); |
| 3111 if (usedNameOffsets.isNotEmpty) _result["usedNameOffsets"] = usedNameOffsets
; |
| 3112 if (usedNames.isNotEmpty) _result["usedNames"] = usedNames; |
| 3113 return _result; |
| 3114 } |
| 3115 |
| 3116 @override |
| 3117 Map<String, Object> toMap() => { |
| 3118 "definedNameKinds": definedNameKinds, |
| 3119 "definedNameOffsets": definedNameOffsets, |
| 3120 "definedNames": definedNames, |
| 3121 "unit": unit, |
| 3122 "usedElementIsQualifiedFlags": usedElementIsQualifiedFlags, |
| 3123 "usedElementKinds": usedElementKinds, |
| 3124 "usedElementLengths": usedElementLengths, |
| 3125 "usedElementOffsets": usedElementOffsets, |
| 3126 "usedElements": usedElements, |
| 3127 "usedNameIsQualifiedFlags": usedNameIsQualifiedFlags, |
| 3128 "usedNameKinds": usedNameKinds, |
| 3129 "usedNameOffsets": usedNameOffsets, |
| 3130 "usedNames": usedNames, |
| 3131 }; |
| 3132 |
| 3133 @override |
| 3134 String toString() => convert.JSON.encode(toJson()); |
| 3135 } |
| 3136 |
| 3137 class UnlinkedClassBuilder extends Object with _UnlinkedClassMixin implements id
l.UnlinkedClass { |
| 3138 List<UnlinkedConstBuilder> _annotations; |
| 3139 CodeRangeBuilder _codeRange; |
| 3140 UnlinkedDocumentationCommentBuilder _documentationComment; |
| 3141 List<UnlinkedExecutableBuilder> _executables; |
| 3142 List<UnlinkedVariableBuilder> _fields; |
| 3143 bool _hasNoSupertype; |
| 3144 List<EntityRefBuilder> _interfaces; |
| 3145 bool _isAbstract; |
| 3146 bool _isMixinApplication; |
| 3147 List<EntityRefBuilder> _mixins; |
| 3148 String _name; |
| 3149 int _nameOffset; |
| 3150 EntityRefBuilder _supertype; |
| 3151 List<UnlinkedTypeParamBuilder> _typeParameters; |
| 3152 |
| 3153 @override |
| 3154 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; |
| 3155 |
| 3156 /** |
| 3157 * Annotations for this class. |
| 3158 */ |
| 3159 void set annotations(List<UnlinkedConstBuilder> value) { |
| 3160 this._annotations = value; |
| 3161 } |
| 3162 |
| 3163 @override |
| 3164 CodeRangeBuilder get codeRange => _codeRange; |
| 3165 |
| 3166 /** |
| 3167 * Code range of the class. |
| 3168 */ |
| 3169 void set codeRange(CodeRangeBuilder value) { |
| 3170 this._codeRange = value; |
| 3171 } |
| 3172 |
| 3173 @override |
| 3174 UnlinkedDocumentationCommentBuilder get documentationComment => _documentation
Comment; |
| 3175 |
| 3176 /** |
| 3177 * Documentation comment for the class, or `null` if there is no |
| 3178 * documentation comment. |
| 3179 */ |
| 3180 void set documentationComment(UnlinkedDocumentationCommentBuilder value) { |
| 3181 this._documentationComment = value; |
| 3182 } |
| 3183 |
| 3184 @override |
| 3185 List<UnlinkedExecutableBuilder> get executables => _executables ??= <UnlinkedE
xecutableBuilder>[]; |
| 3186 |
| 3187 /** |
| 3188 * Executable objects (methods, getters, and setters) contained in the class. |
| 3189 */ |
| 3190 void set executables(List<UnlinkedExecutableBuilder> value) { |
| 3191 this._executables = value; |
| 3192 } |
| 3193 |
| 3194 @override |
| 3195 List<UnlinkedVariableBuilder> get fields => _fields ??= <UnlinkedVariableBuild
er>[]; |
| 3196 |
| 3197 /** |
| 3198 * Field declarations contained in the class. |
| 3199 */ |
| 3200 void set fields(List<UnlinkedVariableBuilder> value) { |
| 3201 this._fields = value; |
| 3202 } |
| 3203 |
| 3204 @override |
| 3205 bool get hasNoSupertype => _hasNoSupertype ??= false; |
| 3206 |
| 3207 /** |
| 3208 * Indicates whether this class is the core "Object" class (and hence has no |
| 3209 * supertype) |
| 3210 */ |
| 3211 void set hasNoSupertype(bool value) { |
| 3212 this._hasNoSupertype = value; |
| 3213 } |
| 3214 |
| 3215 @override |
| 3216 List<EntityRefBuilder> get interfaces => _interfaces ??= <EntityRefBuilder>[]; |
| 3217 |
| 3218 /** |
| 3219 * Interfaces appearing in an `implements` clause, if any. |
| 3220 */ |
| 3221 void set interfaces(List<EntityRefBuilder> value) { |
| 3222 this._interfaces = value; |
| 3223 } |
| 3224 |
| 3225 @override |
| 3226 bool get isAbstract => _isAbstract ??= false; |
| 3227 |
| 3228 /** |
| 3229 * Indicates whether the class is declared with the `abstract` keyword. |
| 3230 */ |
| 3231 void set isAbstract(bool value) { |
| 3232 this._isAbstract = value; |
| 3233 } |
| 3234 |
| 3235 @override |
| 3236 bool get isMixinApplication => _isMixinApplication ??= false; |
| 3237 |
| 3238 /** |
| 3239 * Indicates whether the class is declared using mixin application syntax. |
| 3240 */ |
| 3241 void set isMixinApplication(bool value) { |
| 3242 this._isMixinApplication = value; |
| 3243 } |
| 3244 |
| 3245 @override |
| 3246 List<EntityRefBuilder> get mixins => _mixins ??= <EntityRefBuilder>[]; |
| 3247 |
| 3248 /** |
| 3249 * Mixins appearing in a `with` clause, if any. |
| 3250 */ |
| 3251 void set mixins(List<EntityRefBuilder> value) { |
| 3252 this._mixins = value; |
| 3253 } |
| 3254 |
| 3255 @override |
| 3256 String get name => _name ??= ''; |
| 3257 |
| 3258 /** |
| 3259 * Name of the class. |
| 3260 */ |
| 3261 void set name(String value) { |
| 3262 this._name = value; |
| 3263 } |
| 3264 |
| 3265 @override |
| 3266 int get nameOffset => _nameOffset ??= 0; |
| 3267 |
| 3268 /** |
| 3269 * Offset of the class name relative to the beginning of the file. |
| 3270 */ |
| 3271 void set nameOffset(int value) { |
| 3272 assert(value == null || value >= 0); |
| 3273 this._nameOffset = value; |
| 3274 } |
| 3275 |
| 3276 @override |
| 3277 EntityRefBuilder get supertype => _supertype; |
| 3278 |
| 3279 /** |
| 3280 * Supertype of the class, or `null` if either (a) the class doesn't |
| 3281 * explicitly declare a supertype (and hence has supertype `Object`), or (b) |
| 3282 * the class *is* `Object` (and hence has no supertype). |
| 3283 */ |
| 3284 void set supertype(EntityRefBuilder value) { |
| 3285 this._supertype = value; |
| 3286 } |
| 3287 |
| 3288 @override |
| 3289 List<UnlinkedTypeParamBuilder> get typeParameters => _typeParameters ??= <Unli
nkedTypeParamBuilder>[]; |
| 3290 |
| 3291 /** |
| 3292 * Type parameters of the class, if any. |
| 3293 */ |
| 3294 void set typeParameters(List<UnlinkedTypeParamBuilder> value) { |
| 3295 this._typeParameters = value; |
| 3296 } |
| 3297 |
| 3298 UnlinkedClassBuilder({List<UnlinkedConstBuilder> annotations, CodeRangeBuilder
codeRange, UnlinkedDocumentationCommentBuilder documentationComment, List<Unlin
kedExecutableBuilder> executables, List<UnlinkedVariableBuilder> fields, bool ha
sNoSupertype, List<EntityRefBuilder> interfaces, bool isAbstract, bool isMixinAp
plication, List<EntityRefBuilder> mixins, String name, int nameOffset, EntityRef
Builder supertype, List<UnlinkedTypeParamBuilder> typeParameters}) |
| 3299 : _annotations = annotations, |
| 3300 _codeRange = codeRange, |
| 3301 _documentationComment = documentationComment, |
| 3302 _executables = executables, |
| 3303 _fields = fields, |
| 3304 _hasNoSupertype = hasNoSupertype, |
| 3305 _interfaces = interfaces, |
| 3306 _isAbstract = isAbstract, |
| 3307 _isMixinApplication = isMixinApplication, |
| 3308 _mixins = mixins, |
| 3309 _name = name, |
| 3310 _nameOffset = nameOffset, |
| 3311 _supertype = supertype, |
| 3312 _typeParameters = typeParameters; |
| 3313 |
| 3314 /** |
| 3315 * Flush [informative] data recursively. |
| 3316 */ |
| 3317 void flushInformative() { |
| 3318 _annotations?.forEach((b) => b.flushInformative()); |
| 3319 _codeRange = null; |
| 3320 _documentationComment = null; |
| 3321 _executables?.forEach((b) => b.flushInformative()); |
| 3322 _fields?.forEach((b) => b.flushInformative()); |
| 3323 _interfaces?.forEach((b) => b.flushInformative()); |
| 3324 _mixins?.forEach((b) => b.flushInformative()); |
| 3325 _nameOffset = null; |
| 3326 _supertype?.flushInformative(); |
| 3327 _typeParameters?.forEach((b) => b.flushInformative()); |
| 3328 } |
| 3329 |
| 3330 /** |
| 3331 * Accumulate non-[informative] data into [signature]. |
| 3332 */ |
| 3333 void collectApiSignature(api_sig.ApiSignature signature) { |
| 3334 signature.addString(this._name ?? ''); |
| 3335 if (this._executables == null) { |
| 3336 signature.addInt(0); |
| 3337 } else { |
| 3338 signature.addInt(this._executables.length); |
| 3339 for (var x in this._executables) { |
| 3340 x?.collectApiSignature(signature); |
| 3341 } |
| 3342 } |
| 3343 signature.addBool(this._supertype != null); |
| 3344 this._supertype?.collectApiSignature(signature); |
| 3345 if (this._fields == null) { |
| 3346 signature.addInt(0); |
| 3347 } else { |
| 3348 signature.addInt(this._fields.length); |
| 3349 for (var x in this._fields) { |
| 3350 x?.collectApiSignature(signature); |
| 3351 } |
| 3352 } |
| 3353 if (this._annotations == null) { |
| 3354 signature.addInt(0); |
| 3355 } else { |
| 3356 signature.addInt(this._annotations.length); |
| 3357 for (var x in this._annotations) { |
| 3358 x?.collectApiSignature(signature); |
| 3359 } |
| 3360 } |
| 3361 if (this._interfaces == null) { |
| 3362 signature.addInt(0); |
| 3363 } else { |
| 3364 signature.addInt(this._interfaces.length); |
| 3365 for (var x in this._interfaces) { |
| 3366 x?.collectApiSignature(signature); |
| 3367 } |
| 3368 } |
| 3369 signature.addBool(this._isAbstract == true); |
| 3370 if (this._typeParameters == null) { |
| 3371 signature.addInt(0); |
| 3372 } else { |
| 3373 signature.addInt(this._typeParameters.length); |
| 3374 for (var x in this._typeParameters) { |
| 3375 x?.collectApiSignature(signature); |
| 3376 } |
| 3377 } |
| 3378 if (this._mixins == null) { |
| 3379 signature.addInt(0); |
| 3380 } else { |
| 3381 signature.addInt(this._mixins.length); |
| 3382 for (var x in this._mixins) { |
| 3383 x?.collectApiSignature(signature); |
| 3384 } |
| 3385 } |
| 3386 signature.addBool(this._isMixinApplication == true); |
| 3387 signature.addBool(this._hasNoSupertype == true); |
| 3388 } |
| 3389 |
| 3390 fb.Offset finish(fb.Builder fbBuilder) { |
| 3391 fb.Offset offset_annotations; |
| 3392 fb.Offset offset_codeRange; |
| 3393 fb.Offset offset_documentationComment; |
| 3394 fb.Offset offset_executables; |
| 3395 fb.Offset offset_fields; |
| 3396 fb.Offset offset_interfaces; |
| 3397 fb.Offset offset_mixins; |
| 3398 fb.Offset offset_name; |
| 3399 fb.Offset offset_supertype; |
| 3400 fb.Offset offset_typeParameters; |
| 3401 if (!(_annotations == null || _annotations.isEmpty)) { |
| 3402 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); |
| 3403 } |
| 3404 if (_codeRange != null) { |
| 3405 offset_codeRange = _codeRange.finish(fbBuilder); |
| 3406 } |
| 3407 if (_documentationComment != null) { |
| 3408 offset_documentationComment = _documentationComment.finish(fbBuilder); |
| 3409 } |
| 3410 if (!(_executables == null || _executables.isEmpty)) { |
| 3411 offset_executables = fbBuilder.writeList(_executables.map((b) => b.finish(
fbBuilder)).toList()); |
| 3412 } |
| 3413 if (!(_fields == null || _fields.isEmpty)) { |
| 3414 offset_fields = fbBuilder.writeList(_fields.map((b) => b.finish(fbBuilder)
).toList()); |
| 3415 } |
| 3416 if (!(_interfaces == null || _interfaces.isEmpty)) { |
| 3417 offset_interfaces = fbBuilder.writeList(_interfaces.map((b) => b.finish(fb
Builder)).toList()); |
| 3418 } |
| 3419 if (!(_mixins == null || _mixins.isEmpty)) { |
| 3420 offset_mixins = fbBuilder.writeList(_mixins.map((b) => b.finish(fbBuilder)
).toList()); |
| 3421 } |
| 3422 if (_name != null) { |
| 3423 offset_name = fbBuilder.writeString(_name); |
| 3424 } |
| 3425 if (_supertype != null) { |
| 3426 offset_supertype = _supertype.finish(fbBuilder); |
| 3427 } |
| 3428 if (!(_typeParameters == null || _typeParameters.isEmpty)) { |
| 3429 offset_typeParameters = fbBuilder.writeList(_typeParameters.map((b) => b.f
inish(fbBuilder)).toList()); |
| 3430 } |
| 3431 fbBuilder.startTable(); |
| 3432 if (offset_annotations != null) { |
| 3433 fbBuilder.addOffset(5, offset_annotations); |
| 3434 } |
| 3435 if (offset_codeRange != null) { |
| 3436 fbBuilder.addOffset(13, offset_codeRange); |
| 3437 } |
| 3438 if (offset_documentationComment != null) { |
| 3439 fbBuilder.addOffset(6, offset_documentationComment); |
| 3440 } |
| 3441 if (offset_executables != null) { |
| 3442 fbBuilder.addOffset(2, offset_executables); |
| 3443 } |
| 3444 if (offset_fields != null) { |
| 3445 fbBuilder.addOffset(4, offset_fields); |
| 3446 } |
| 3447 if (_hasNoSupertype == true) { |
| 3448 fbBuilder.addBool(12, true); |
| 3449 } |
| 3450 if (offset_interfaces != null) { |
| 3451 fbBuilder.addOffset(7, offset_interfaces); |
| 3452 } |
| 3453 if (_isAbstract == true) { |
| 3454 fbBuilder.addBool(8, true); |
| 3455 } |
| 3456 if (_isMixinApplication == true) { |
| 3457 fbBuilder.addBool(11, true); |
| 3458 } |
| 3459 if (offset_mixins != null) { |
| 3460 fbBuilder.addOffset(10, offset_mixins); |
| 3461 } |
| 3462 if (offset_name != null) { |
| 3463 fbBuilder.addOffset(0, offset_name); |
| 3464 } |
| 3465 if (_nameOffset != null && _nameOffset != 0) { |
| 3466 fbBuilder.addUint32(1, _nameOffset); |
| 3467 } |
| 3468 if (offset_supertype != null) { |
| 3469 fbBuilder.addOffset(3, offset_supertype); |
| 3470 } |
| 3471 if (offset_typeParameters != null) { |
| 3472 fbBuilder.addOffset(9, offset_typeParameters); |
| 3473 } |
| 3474 return fbBuilder.endTable(); |
| 3475 } |
| 3476 } |
| 3477 |
| 3478 class _UnlinkedClassReader extends fb.TableReader<_UnlinkedClassImpl> { |
| 3479 const _UnlinkedClassReader(); |
| 3480 |
| 3481 @override |
| 3482 _UnlinkedClassImpl createObject(fb.BufferContext bc, int offset) => new _Unlin
kedClassImpl(bc, offset); |
| 3483 } |
| 3484 |
| 3485 class _UnlinkedClassImpl extends Object with _UnlinkedClassMixin implements idl.
UnlinkedClass { |
| 3486 final fb.BufferContext _bc; |
| 3487 final int _bcOffset; |
| 3488 |
| 3489 _UnlinkedClassImpl(this._bc, this._bcOffset); |
| 3490 |
| 3491 List<idl.UnlinkedConst> _annotations; |
| 3492 idl.CodeRange _codeRange; |
| 3493 idl.UnlinkedDocumentationComment _documentationComment; |
| 3494 List<idl.UnlinkedExecutable> _executables; |
| 3495 List<idl.UnlinkedVariable> _fields; |
| 3496 bool _hasNoSupertype; |
| 3497 List<idl.EntityRef> _interfaces; |
| 3498 bool _isAbstract; |
| 3499 bool _isMixinApplication; |
| 3500 List<idl.EntityRef> _mixins; |
| 3501 String _name; |
| 3502 int _nameOffset; |
| 3503 idl.EntityRef _supertype; |
| 3504 List<idl.UnlinkedTypeParam> _typeParameters; |
| 3505 |
| 3506 @override |
| 3507 List<idl.UnlinkedConst> get annotations { |
| 3508 _annotations ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConst
Reader()).vTableGet(_bc, _bcOffset, 5, const <idl.UnlinkedConst>[]); |
| 3509 return _annotations; |
| 3510 } |
| 3511 |
| 3512 @override |
| 3513 idl.CodeRange get codeRange { |
| 3514 _codeRange ??= const _CodeRangeReader().vTableGet(_bc, _bcOffset, 13, null); |
| 3515 return _codeRange; |
| 3516 } |
| 3517 |
| 3518 @override |
| 3519 idl.UnlinkedDocumentationComment get documentationComment { |
| 3520 _documentationComment ??= const _UnlinkedDocumentationCommentReader().vTable
Get(_bc, _bcOffset, 6, null); |
| 3521 return _documentationComment; |
| 3522 } |
| 3523 |
| 3524 @override |
| 3525 List<idl.UnlinkedExecutable> get executables { |
| 3526 _executables ??= const fb.ListReader<idl.UnlinkedExecutable>(const _Unlinked
ExecutableReader()).vTableGet(_bc, _bcOffset, 2, const <idl.UnlinkedExecutable>[
]); |
| 3527 return _executables; |
| 3528 } |
| 3529 |
| 3530 @override |
| 3531 List<idl.UnlinkedVariable> get fields { |
| 3532 _fields ??= const fb.ListReader<idl.UnlinkedVariable>(const _UnlinkedVariabl
eReader()).vTableGet(_bc, _bcOffset, 4, const <idl.UnlinkedVariable>[]); |
| 3533 return _fields; |
| 3534 } |
| 3535 |
| 3536 @override |
| 3537 bool get hasNoSupertype { |
| 3538 _hasNoSupertype ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 12, fals
e); |
| 3539 return _hasNoSupertype; |
| 3540 } |
| 3541 |
| 3542 @override |
| 3543 List<idl.EntityRef> get interfaces { |
| 3544 _interfaces ??= const fb.ListReader<idl.EntityRef>(const _EntityRefReader())
.vTableGet(_bc, _bcOffset, 7, const <idl.EntityRef>[]); |
| 3545 return _interfaces; |
| 3546 } |
| 3547 |
| 3548 @override |
| 3549 bool get isAbstract { |
| 3550 _isAbstract ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 8, false); |
| 3551 return _isAbstract; |
| 3552 } |
| 3553 |
| 3554 @override |
| 3555 bool get isMixinApplication { |
| 3556 _isMixinApplication ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 11,
false); |
| 3557 return _isMixinApplication; |
| 3558 } |
| 3559 |
| 3560 @override |
| 3561 List<idl.EntityRef> get mixins { |
| 3562 _mixins ??= const fb.ListReader<idl.EntityRef>(const _EntityRefReader()).vTa
bleGet(_bc, _bcOffset, 10, const <idl.EntityRef>[]); |
| 3563 return _mixins; |
| 3564 } |
| 3565 |
| 3566 @override |
| 3567 String get name { |
| 3568 _name ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, ''); |
| 3569 return _name; |
| 3570 } |
| 3571 |
| 3572 @override |
| 3573 int get nameOffset { |
| 3574 _nameOffset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 1, 0); |
| 3575 return _nameOffset; |
| 3576 } |
| 3577 |
| 3578 @override |
| 3579 idl.EntityRef get supertype { |
| 3580 _supertype ??= const _EntityRefReader().vTableGet(_bc, _bcOffset, 3, null); |
| 3581 return _supertype; |
| 3582 } |
| 3583 |
| 3584 @override |
| 3585 List<idl.UnlinkedTypeParam> get typeParameters { |
| 3586 _typeParameters ??= const fb.ListReader<idl.UnlinkedTypeParam>(const _Unlink
edTypeParamReader()).vTableGet(_bc, _bcOffset, 9, const <idl.UnlinkedTypeParam>[
]); |
| 3587 return _typeParameters; |
| 3588 } |
| 3589 } |
| 3590 |
| 3591 abstract class _UnlinkedClassMixin implements idl.UnlinkedClass { |
| 3592 @override |
| 3593 Map<String, Object> toJson() { |
| 3594 Map<String, Object> _result = <String, Object>{}; |
| 3595 if (annotations.isNotEmpty) _result["annotations"] = annotations.map((_value
) => _value.toJson()).toList(); |
| 3596 if (codeRange != null) _result["codeRange"] = codeRange.toJson(); |
| 3597 if (documentationComment != null) _result["documentationComment"] = document
ationComment.toJson(); |
| 3598 if (executables.isNotEmpty) _result["executables"] = executables.map((_value
) => _value.toJson()).toList(); |
| 3599 if (fields.isNotEmpty) _result["fields"] = fields.map((_value) => _value.toJ
son()).toList(); |
| 3600 if (hasNoSupertype != false) _result["hasNoSupertype"] = hasNoSupertype; |
| 3601 if (interfaces.isNotEmpty) _result["interfaces"] = interfaces.map((_value) =
> _value.toJson()).toList(); |
| 3602 if (isAbstract != false) _result["isAbstract"] = isAbstract; |
| 3603 if (isMixinApplication != false) _result["isMixinApplication"] = isMixinAppl
ication; |
| 3604 if (mixins.isNotEmpty) _result["mixins"] = mixins.map((_value) => _value.toJ
son()).toList(); |
| 3605 if (name != '') _result["name"] = name; |
| 3606 if (nameOffset != 0) _result["nameOffset"] = nameOffset; |
| 3607 if (supertype != null) _result["supertype"] = supertype.toJson(); |
| 3608 if (typeParameters.isNotEmpty) _result["typeParameters"] = typeParameters.ma
p((_value) => _value.toJson()).toList(); |
| 3609 return _result; |
| 3610 } |
| 3611 |
| 3612 @override |
| 3613 Map<String, Object> toMap() => { |
| 3614 "annotations": annotations, |
| 3615 "codeRange": codeRange, |
| 3616 "documentationComment": documentationComment, |
| 3617 "executables": executables, |
| 3618 "fields": fields, |
| 3619 "hasNoSupertype": hasNoSupertype, |
| 3620 "interfaces": interfaces, |
| 3621 "isAbstract": isAbstract, |
| 3622 "isMixinApplication": isMixinApplication, |
| 3623 "mixins": mixins, |
| 3624 "name": name, |
| 3625 "nameOffset": nameOffset, |
| 3626 "supertype": supertype, |
| 3627 "typeParameters": typeParameters, |
| 3628 }; |
| 3629 |
| 3630 @override |
| 3631 String toString() => convert.JSON.encode(toJson()); |
| 3632 } |
| 3633 |
| 3634 class UnlinkedCombinatorBuilder extends Object with _UnlinkedCombinatorMixin imp
lements idl.UnlinkedCombinator { |
| 3635 int _end; |
| 3636 List<String> _hides; |
| 3637 int _offset; |
| 3638 List<String> _shows; |
| 3639 |
| 3640 @override |
| 3641 int get end => _end ??= 0; |
| 3642 |
| 3643 /** |
| 3644 * If this is a `show` combinator, offset of the end of the list of shown |
| 3645 * names. Otherwise zero. |
| 3646 */ |
| 3647 void set end(int value) { |
| 3648 assert(value == null || value >= 0); |
| 3649 this._end = value; |
| 3650 } |
| 3651 |
| 3652 @override |
| 3653 List<String> get hides => _hides ??= <String>[]; |
| 3654 |
| 3655 /** |
| 3656 * List of names which are hidden. Empty if this is a `show` combinator. |
| 3657 */ |
| 3658 void set hides(List<String> value) { |
| 3659 this._hides = value; |
| 3660 } |
| 3661 |
| 3662 @override |
| 3663 int get offset => _offset ??= 0; |
| 3664 |
| 3665 /** |
| 3666 * If this is a `show` combinator, offset of the `show` keyword. Otherwise |
| 3667 * zero. |
| 3668 */ |
| 3669 void set offset(int value) { |
| 3670 assert(value == null || value >= 0); |
| 3671 this._offset = value; |
| 3672 } |
| 3673 |
| 3674 @override |
| 3675 List<String> get shows => _shows ??= <String>[]; |
| 3676 |
| 3677 /** |
| 3678 * List of names which are shown. Empty if this is a `hide` combinator. |
| 3679 */ |
| 3680 void set shows(List<String> value) { |
| 3681 this._shows = value; |
| 3682 } |
| 3683 |
| 3684 UnlinkedCombinatorBuilder({int end, List<String> hides, int offset, List<Strin
g> shows}) |
| 3685 : _end = end, |
| 3686 _hides = hides, |
| 3687 _offset = offset, |
| 3688 _shows = shows; |
| 3689 |
| 3690 /** |
| 3691 * Flush [informative] data recursively. |
| 3692 */ |
| 3693 void flushInformative() { |
| 3694 _end = null; |
| 3695 _offset = null; |
| 3696 } |
| 3697 |
| 3698 /** |
| 3699 * Accumulate non-[informative] data into [signature]. |
| 3700 */ |
| 3701 void collectApiSignature(api_sig.ApiSignature signature) { |
| 3702 if (this._shows == null) { |
| 3703 signature.addInt(0); |
| 3704 } else { |
| 3705 signature.addInt(this._shows.length); |
| 3706 for (var x in this._shows) { |
| 3707 signature.addString(x); |
| 3708 } |
| 3709 } |
| 3710 if (this._hides == null) { |
| 3711 signature.addInt(0); |
| 3712 } else { |
| 3713 signature.addInt(this._hides.length); |
| 3714 for (var x in this._hides) { |
| 3715 signature.addString(x); |
| 3716 } |
| 3717 } |
| 3718 } |
| 3719 |
| 3720 fb.Offset finish(fb.Builder fbBuilder) { |
| 3721 fb.Offset offset_hides; |
| 3722 fb.Offset offset_shows; |
| 3723 if (!(_hides == null || _hides.isEmpty)) { |
| 3724 offset_hides = fbBuilder.writeList(_hides.map((b) => fbBuilder.writeString
(b)).toList()); |
| 3725 } |
| 3726 if (!(_shows == null || _shows.isEmpty)) { |
| 3727 offset_shows = fbBuilder.writeList(_shows.map((b) => fbBuilder.writeString
(b)).toList()); |
| 3728 } |
| 3729 fbBuilder.startTable(); |
| 3730 if (_end != null && _end != 0) { |
| 3731 fbBuilder.addUint32(3, _end); |
| 3732 } |
| 3733 if (offset_hides != null) { |
| 3734 fbBuilder.addOffset(1, offset_hides); |
| 3735 } |
| 3736 if (_offset != null && _offset != 0) { |
| 3737 fbBuilder.addUint32(2, _offset); |
| 3738 } |
| 3739 if (offset_shows != null) { |
| 3740 fbBuilder.addOffset(0, offset_shows); |
| 3741 } |
| 3742 return fbBuilder.endTable(); |
| 3743 } |
| 3744 } |
| 3745 |
| 3746 class _UnlinkedCombinatorReader extends fb.TableReader<_UnlinkedCombinatorImpl>
{ |
| 3747 const _UnlinkedCombinatorReader(); |
| 3748 |
| 3749 @override |
| 3750 _UnlinkedCombinatorImpl createObject(fb.BufferContext bc, int offset) => new _
UnlinkedCombinatorImpl(bc, offset); |
| 3751 } |
| 3752 |
| 3753 class _UnlinkedCombinatorImpl extends Object with _UnlinkedCombinatorMixin imple
ments idl.UnlinkedCombinator { |
| 3754 final fb.BufferContext _bc; |
| 3755 final int _bcOffset; |
| 3756 |
| 3757 _UnlinkedCombinatorImpl(this._bc, this._bcOffset); |
| 3758 |
| 3759 int _end; |
| 3760 List<String> _hides; |
| 3761 int _offset; |
| 3762 List<String> _shows; |
| 3763 |
| 3764 @override |
| 3765 int get end { |
| 3766 _end ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 3, 0); |
| 3767 return _end; |
| 3768 } |
| 3769 |
| 3770 @override |
| 3771 List<String> get hides { |
| 3772 _hides ??= const fb.ListReader<String>(const fb.StringReader()).vTableGet(_b
c, _bcOffset, 1, const <String>[]); |
| 3773 return _hides; |
| 3774 } |
| 3775 |
| 3776 @override |
| 3777 int get offset { |
| 3778 _offset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 2, 0); |
| 3779 return _offset; |
| 3780 } |
| 3781 |
| 3782 @override |
| 3783 List<String> get shows { |
| 3784 _shows ??= const fb.ListReader<String>(const fb.StringReader()).vTableGet(_b
c, _bcOffset, 0, const <String>[]); |
| 3785 return _shows; |
| 3786 } |
| 3787 } |
| 3788 |
| 3789 abstract class _UnlinkedCombinatorMixin implements idl.UnlinkedCombinator { |
| 3790 @override |
| 3791 Map<String, Object> toJson() { |
| 3792 Map<String, Object> _result = <String, Object>{}; |
| 3793 if (end != 0) _result["end"] = end; |
| 3794 if (hides.isNotEmpty) _result["hides"] = hides; |
| 3795 if (offset != 0) _result["offset"] = offset; |
| 3796 if (shows.isNotEmpty) _result["shows"] = shows; |
| 3797 return _result; |
| 3798 } |
| 3799 |
| 3800 @override |
| 3801 Map<String, Object> toMap() => { |
| 3802 "end": end, |
| 3803 "hides": hides, |
| 3804 "offset": offset, |
| 3805 "shows": shows, |
| 3806 }; |
| 3807 |
| 3808 @override |
| 3809 String toString() => convert.JSON.encode(toJson()); |
| 3810 } |
| 3811 |
| 3812 class UnlinkedConfigurationBuilder extends Object with _UnlinkedConfigurationMix
in implements idl.UnlinkedConfiguration { |
| 3813 String _name; |
| 3814 String _uri; |
| 3815 String _value; |
| 3816 |
| 3817 @override |
| 3818 String get name => _name ??= ''; |
| 3819 |
| 3820 /** |
| 3821 * The name of the declared variable whose value is being used in the |
| 3822 * condition. |
| 3823 */ |
| 3824 void set name(String value) { |
| 3825 this._name = value; |
| 3826 } |
| 3827 |
| 3828 @override |
| 3829 String get uri => _uri ??= ''; |
| 3830 |
| 3831 /** |
| 3832 * The URI of the implementation library to be used if the condition is true. |
| 3833 */ |
| 3834 void set uri(String value) { |
| 3835 this._uri = value; |
| 3836 } |
| 3837 |
| 3838 @override |
| 3839 String get value => _value ??= ''; |
| 3840 |
| 3841 /** |
| 3842 * The value to which the value of the declared variable will be compared, |
| 3843 * or `true` if the condition does not include an equality test. |
| 3844 */ |
| 3845 void set value(String value) { |
| 3846 this._value = value; |
| 3847 } |
| 3848 |
| 3849 UnlinkedConfigurationBuilder({String name, String uri, String value}) |
| 3850 : _name = name, |
| 3851 _uri = uri, |
| 3852 _value = value; |
| 3853 |
| 3854 /** |
| 3855 * Flush [informative] data recursively. |
| 3856 */ |
| 3857 void flushInformative() { |
| 3858 } |
| 3859 |
| 3860 /** |
| 3861 * Accumulate non-[informative] data into [signature]. |
| 3862 */ |
| 3863 void collectApiSignature(api_sig.ApiSignature signature) { |
| 3864 signature.addString(this._name ?? ''); |
| 3865 signature.addString(this._value ?? ''); |
| 3866 signature.addString(this._uri ?? ''); |
| 3867 } |
| 3868 |
| 3869 fb.Offset finish(fb.Builder fbBuilder) { |
| 3870 fb.Offset offset_name; |
| 3871 fb.Offset offset_uri; |
| 3872 fb.Offset offset_value; |
| 3873 if (_name != null) { |
| 3874 offset_name = fbBuilder.writeString(_name); |
| 3875 } |
| 3876 if (_uri != null) { |
| 3877 offset_uri = fbBuilder.writeString(_uri); |
| 3878 } |
| 3879 if (_value != null) { |
| 3880 offset_value = fbBuilder.writeString(_value); |
| 3881 } |
| 3882 fbBuilder.startTable(); |
| 3883 if (offset_name != null) { |
| 3884 fbBuilder.addOffset(0, offset_name); |
| 3885 } |
| 3886 if (offset_uri != null) { |
| 3887 fbBuilder.addOffset(2, offset_uri); |
| 3888 } |
| 3889 if (offset_value != null) { |
| 3890 fbBuilder.addOffset(1, offset_value); |
| 3891 } |
| 3892 return fbBuilder.endTable(); |
| 3893 } |
| 3894 } |
| 3895 |
| 3896 class _UnlinkedConfigurationReader extends fb.TableReader<_UnlinkedConfiguration
Impl> { |
| 3897 const _UnlinkedConfigurationReader(); |
| 3898 |
| 3899 @override |
| 3900 _UnlinkedConfigurationImpl createObject(fb.BufferContext bc, int offset) => ne
w _UnlinkedConfigurationImpl(bc, offset); |
| 3901 } |
| 3902 |
| 3903 class _UnlinkedConfigurationImpl extends Object with _UnlinkedConfigurationMixin
implements idl.UnlinkedConfiguration { |
| 3904 final fb.BufferContext _bc; |
| 3905 final int _bcOffset; |
| 3906 |
| 3907 _UnlinkedConfigurationImpl(this._bc, this._bcOffset); |
| 3908 |
| 3909 String _name; |
| 3910 String _uri; |
| 3911 String _value; |
| 3912 |
| 3913 @override |
| 3914 String get name { |
| 3915 _name ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, ''); |
| 3916 return _name; |
| 3917 } |
| 3918 |
| 3919 @override |
| 3920 String get uri { |
| 3921 _uri ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 2, ''); |
| 3922 return _uri; |
| 3923 } |
| 3924 |
| 3925 @override |
| 3926 String get value { |
| 3927 _value ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 1, ''); |
| 3928 return _value; |
| 3929 } |
| 3930 } |
| 3931 |
| 3932 abstract class _UnlinkedConfigurationMixin implements idl.UnlinkedConfiguration
{ |
| 3933 @override |
| 3934 Map<String, Object> toJson() { |
| 3935 Map<String, Object> _result = <String, Object>{}; |
| 3936 if (name != '') _result["name"] = name; |
| 3937 if (uri != '') _result["uri"] = uri; |
| 3938 if (value != '') _result["value"] = value; |
| 3939 return _result; |
| 3940 } |
| 3941 |
| 3942 @override |
| 3943 Map<String, Object> toMap() => { |
| 3944 "name": name, |
| 3945 "uri": uri, |
| 3946 "value": value, |
| 3947 }; |
| 3948 |
| 3949 @override |
| 3950 String toString() => convert.JSON.encode(toJson()); |
| 3951 } |
| 3952 |
| 3953 class UnlinkedConstBuilder extends Object with _UnlinkedConstMixin implements id
l.UnlinkedConst { |
| 3954 List<idl.UnlinkedExprAssignOperator> _assignmentOperators; |
| 3955 List<double> _doubles; |
| 3956 List<int> _ints; |
| 3957 bool _isValidConst; |
| 3958 List<idl.UnlinkedConstOperation> _operations; |
| 3959 List<EntityRefBuilder> _references; |
| 3960 List<String> _strings; |
| 3961 |
| 3962 @override |
| 3963 List<idl.UnlinkedExprAssignOperator> get assignmentOperators => _assignmentOpe
rators ??= <idl.UnlinkedExprAssignOperator>[]; |
| 3964 |
| 3965 /** |
| 3966 * Sequence of operators used by assignment operations. |
| 3967 */ |
| 3968 void set assignmentOperators(List<idl.UnlinkedExprAssignOperator> value) { |
| 3969 this._assignmentOperators = value; |
| 3970 } |
| 3971 |
| 3972 @override |
| 3973 List<double> get doubles => _doubles ??= <double>[]; |
| 3974 |
| 3975 /** |
| 3976 * Sequence of 64-bit doubles consumed by the operation `pushDouble`. |
| 3977 */ |
| 3978 void set doubles(List<double> value) { |
| 3979 this._doubles = value; |
| 3980 } |
| 3981 |
| 3982 @override |
| 3983 List<int> get ints => _ints ??= <int>[]; |
| 3984 |
| 3985 /** |
| 3986 * Sequence of unsigned 32-bit integers consumed by the operations |
| 3987 * `pushArgument`, `pushInt`, `shiftOr`, `concatenate`, `invokeConstructor`, |
| 3988 * `makeList`, and `makeMap`. |
| 3989 */ |
| 3990 void set ints(List<int> value) { |
| 3991 assert(value == null || value.every((e) => e >= 0)); |
| 3992 this._ints = value; |
| 3993 } |
| 3994 |
| 3995 @override |
| 3996 bool get isValidConst => _isValidConst ??= false; |
| 3997 |
| 3998 /** |
| 3999 * Indicates whether the expression is a valid potentially constant |
| 4000 * expression. |
| 4001 */ |
| 4002 void set isValidConst(bool value) { |
| 4003 this._isValidConst = value; |
| 4004 } |
| 4005 |
| 4006 @override |
| 4007 List<idl.UnlinkedConstOperation> get operations => _operations ??= <idl.Unlink
edConstOperation>[]; |
| 4008 |
| 4009 /** |
| 4010 * Sequence of operations to execute (starting with an empty stack) to form |
| 4011 * the constant value. |
| 4012 */ |
| 4013 void set operations(List<idl.UnlinkedConstOperation> value) { |
| 4014 this._operations = value; |
| 4015 } |
| 4016 |
| 4017 @override |
| 4018 List<EntityRefBuilder> get references => _references ??= <EntityRefBuilder>[]; |
| 4019 |
| 4020 /** |
| 4021 * Sequence of language constructs consumed by the operations |
| 4022 * `pushReference`, `invokeConstructor`, `makeList`, and `makeMap`. Note |
| 4023 * that in the case of `pushReference` (and sometimes `invokeConstructor` the |
| 4024 * actual entity being referred to may be something other than a type. |
| 4025 */ |
| 4026 void set references(List<EntityRefBuilder> value) { |
| 4027 this._references = value; |
| 4028 } |
| 4029 |
| 4030 @override |
| 4031 List<String> get strings => _strings ??= <String>[]; |
| 4032 |
| 4033 /** |
| 4034 * Sequence of strings consumed by the operations `pushString` and |
| 4035 * `invokeConstructor`. |
| 4036 */ |
| 4037 void set strings(List<String> value) { |
| 4038 this._strings = value; |
| 4039 } |
| 4040 |
| 4041 UnlinkedConstBuilder({List<idl.UnlinkedExprAssignOperator> assignmentOperators
, List<double> doubles, List<int> ints, bool isValidConst, List<idl.UnlinkedCons
tOperation> operations, List<EntityRefBuilder> references, List<String> strings}
) |
| 4042 : _assignmentOperators = assignmentOperators, |
| 4043 _doubles = doubles, |
| 4044 _ints = ints, |
| 4045 _isValidConst = isValidConst, |
| 4046 _operations = operations, |
| 4047 _references = references, |
| 4048 _strings = strings; |
| 4049 |
| 4050 /** |
| 4051 * Flush [informative] data recursively. |
| 4052 */ |
| 4053 void flushInformative() { |
| 4054 _references?.forEach((b) => b.flushInformative()); |
| 4055 } |
| 4056 |
| 4057 /** |
| 4058 * Accumulate non-[informative] data into [signature]. |
| 4059 */ |
| 4060 void collectApiSignature(api_sig.ApiSignature signature) { |
| 4061 if (this._operations == null) { |
| 4062 signature.addInt(0); |
| 4063 } else { |
| 4064 signature.addInt(this._operations.length); |
| 4065 for (var x in this._operations) { |
| 4066 signature.addInt(x.index); |
| 4067 } |
| 4068 } |
| 4069 if (this._ints == null) { |
| 4070 signature.addInt(0); |
| 4071 } else { |
| 4072 signature.addInt(this._ints.length); |
| 4073 for (var x in this._ints) { |
| 4074 signature.addInt(x); |
| 4075 } |
| 4076 } |
| 4077 if (this._references == null) { |
| 4078 signature.addInt(0); |
| 4079 } else { |
| 4080 signature.addInt(this._references.length); |
| 4081 for (var x in this._references) { |
| 4082 x?.collectApiSignature(signature); |
| 4083 } |
| 4084 } |
| 4085 if (this._strings == null) { |
| 4086 signature.addInt(0); |
| 4087 } else { |
| 4088 signature.addInt(this._strings.length); |
| 4089 for (var x in this._strings) { |
| 4090 signature.addString(x); |
| 4091 } |
| 4092 } |
| 4093 if (this._doubles == null) { |
| 4094 signature.addInt(0); |
| 4095 } else { |
| 4096 signature.addInt(this._doubles.length); |
| 4097 for (var x in this._doubles) { |
| 4098 signature.addDouble(x); |
| 4099 } |
| 4100 } |
| 4101 signature.addBool(this._isValidConst == true); |
| 4102 if (this._assignmentOperators == null) { |
| 4103 signature.addInt(0); |
| 4104 } else { |
| 4105 signature.addInt(this._assignmentOperators.length); |
| 4106 for (var x in this._assignmentOperators) { |
| 4107 signature.addInt(x.index); |
| 4108 } |
| 4109 } |
| 4110 } |
| 4111 |
| 4112 fb.Offset finish(fb.Builder fbBuilder) { |
| 4113 fb.Offset offset_assignmentOperators; |
| 4114 fb.Offset offset_doubles; |
| 4115 fb.Offset offset_ints; |
| 4116 fb.Offset offset_operations; |
| 4117 fb.Offset offset_references; |
| 4118 fb.Offset offset_strings; |
| 4119 if (!(_assignmentOperators == null || _assignmentOperators.isEmpty)) { |
| 4120 offset_assignmentOperators = fbBuilder.writeListUint8(_assignmentOperators
.map((b) => b.index).toList()); |
| 4121 } |
| 4122 if (!(_doubles == null || _doubles.isEmpty)) { |
| 4123 offset_doubles = fbBuilder.writeListFloat64(_doubles); |
| 4124 } |
| 4125 if (!(_ints == null || _ints.isEmpty)) { |
| 4126 offset_ints = fbBuilder.writeListUint32(_ints); |
| 4127 } |
| 4128 if (!(_operations == null || _operations.isEmpty)) { |
| 4129 offset_operations = fbBuilder.writeListUint8(_operations.map((b) => b.inde
x).toList()); |
| 4130 } |
| 4131 if (!(_references == null || _references.isEmpty)) { |
| 4132 offset_references = fbBuilder.writeList(_references.map((b) => b.finish(fb
Builder)).toList()); |
| 4133 } |
| 4134 if (!(_strings == null || _strings.isEmpty)) { |
| 4135 offset_strings = fbBuilder.writeList(_strings.map((b) => fbBuilder.writeSt
ring(b)).toList()); |
| 4136 } |
| 4137 fbBuilder.startTable(); |
| 4138 if (offset_assignmentOperators != null) { |
| 4139 fbBuilder.addOffset(6, offset_assignmentOperators); |
| 4140 } |
| 4141 if (offset_doubles != null) { |
| 4142 fbBuilder.addOffset(4, offset_doubles); |
| 4143 } |
| 4144 if (offset_ints != null) { |
| 4145 fbBuilder.addOffset(1, offset_ints); |
| 4146 } |
| 4147 if (_isValidConst == true) { |
| 4148 fbBuilder.addBool(5, true); |
| 4149 } |
| 4150 if (offset_operations != null) { |
| 4151 fbBuilder.addOffset(0, offset_operations); |
| 4152 } |
| 4153 if (offset_references != null) { |
| 4154 fbBuilder.addOffset(2, offset_references); |
| 4155 } |
| 4156 if (offset_strings != null) { |
| 4157 fbBuilder.addOffset(3, offset_strings); |
| 4158 } |
| 4159 return fbBuilder.endTable(); |
| 4160 } |
| 4161 } |
| 4162 |
| 4163 class _UnlinkedConstReader extends fb.TableReader<_UnlinkedConstImpl> { |
| 4164 const _UnlinkedConstReader(); |
| 4165 |
| 4166 @override |
| 4167 _UnlinkedConstImpl createObject(fb.BufferContext bc, int offset) => new _Unlin
kedConstImpl(bc, offset); |
| 4168 } |
| 4169 |
| 4170 class _UnlinkedConstImpl extends Object with _UnlinkedConstMixin implements idl.
UnlinkedConst { |
| 4171 final fb.BufferContext _bc; |
| 4172 final int _bcOffset; |
| 4173 |
| 4174 _UnlinkedConstImpl(this._bc, this._bcOffset); |
| 4175 |
| 4176 List<idl.UnlinkedExprAssignOperator> _assignmentOperators; |
| 4177 List<double> _doubles; |
| 4178 List<int> _ints; |
| 4179 bool _isValidConst; |
| 4180 List<idl.UnlinkedConstOperation> _operations; |
| 4181 List<idl.EntityRef> _references; |
| 4182 List<String> _strings; |
| 4183 |
| 4184 @override |
| 4185 List<idl.UnlinkedExprAssignOperator> get assignmentOperators { |
| 4186 _assignmentOperators ??= const fb.ListReader<idl.UnlinkedExprAssignOperator>
(const _UnlinkedExprAssignOperatorReader()).vTableGet(_bc, _bcOffset, 6, const <
idl.UnlinkedExprAssignOperator>[]); |
| 4187 return _assignmentOperators; |
| 4188 } |
| 4189 |
| 4190 @override |
| 4191 List<double> get doubles { |
| 4192 _doubles ??= const fb.Float64ListReader().vTableGet(_bc, _bcOffset, 4, const
<double>[]); |
| 4193 return _doubles; |
| 4194 } |
| 4195 |
| 4196 @override |
| 4197 List<int> get ints { |
| 4198 _ints ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 1, const <in
t>[]); |
| 4199 return _ints; |
| 4200 } |
| 4201 |
| 4202 @override |
| 4203 bool get isValidConst { |
| 4204 _isValidConst ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 5, false); |
| 4205 return _isValidConst; |
| 4206 } |
| 4207 |
| 4208 @override |
| 4209 List<idl.UnlinkedConstOperation> get operations { |
| 4210 _operations ??= const fb.ListReader<idl.UnlinkedConstOperation>(const _Unlin
kedConstOperationReader()).vTableGet(_bc, _bcOffset, 0, const <idl.UnlinkedConst
Operation>[]); |
| 4211 return _operations; |
| 4212 } |
| 4213 |
| 4214 @override |
| 4215 List<idl.EntityRef> get references { |
| 4216 _references ??= const fb.ListReader<idl.EntityRef>(const _EntityRefReader())
.vTableGet(_bc, _bcOffset, 2, const <idl.EntityRef>[]); |
| 4217 return _references; |
| 4218 } |
| 4219 |
| 4220 @override |
| 4221 List<String> get strings { |
| 4222 _strings ??= const fb.ListReader<String>(const fb.StringReader()).vTableGet(
_bc, _bcOffset, 3, const <String>[]); |
| 4223 return _strings; |
| 4224 } |
| 4225 } |
| 4226 |
| 4227 abstract class _UnlinkedConstMixin implements idl.UnlinkedConst { |
| 4228 @override |
| 4229 Map<String, Object> toJson() { |
| 4230 Map<String, Object> _result = <String, Object>{}; |
| 4231 if (assignmentOperators.isNotEmpty) _result["assignmentOperators"] = assignm
entOperators.map((_value) => _value.toString().split('.')[1]).toList(); |
| 4232 if (doubles.isNotEmpty) _result["doubles"] = doubles.map((_value) => _value.
isFinite ? _value : _value.toString()).toList(); |
| 4233 if (ints.isNotEmpty) _result["ints"] = ints; |
| 4234 if (isValidConst != false) _result["isValidConst"] = isValidConst; |
| 4235 if (operations.isNotEmpty) _result["operations"] = operations.map((_value) =
> _value.toString().split('.')[1]).toList(); |
| 4236 if (references.isNotEmpty) _result["references"] = references.map((_value) =
> _value.toJson()).toList(); |
| 4237 if (strings.isNotEmpty) _result["strings"] = strings; |
| 4238 return _result; |
| 4239 } |
| 4240 |
| 4241 @override |
| 4242 Map<String, Object> toMap() => { |
| 4243 "assignmentOperators": assignmentOperators, |
| 4244 "doubles": doubles, |
| 4245 "ints": ints, |
| 4246 "isValidConst": isValidConst, |
| 4247 "operations": operations, |
| 4248 "references": references, |
| 4249 "strings": strings, |
| 4250 }; |
| 4251 |
| 4252 @override |
| 4253 String toString() => convert.JSON.encode(toJson()); |
| 4254 } |
| 4255 |
| 4256 class UnlinkedConstructorInitializerBuilder extends Object with _UnlinkedConstru
ctorInitializerMixin implements idl.UnlinkedConstructorInitializer { |
| 4257 List<String> _argumentNames; |
| 4258 List<UnlinkedConstBuilder> _arguments; |
| 4259 UnlinkedConstBuilder _expression; |
| 4260 idl.UnlinkedConstructorInitializerKind _kind; |
| 4261 String _name; |
| 4262 |
| 4263 @override |
| 4264 List<String> get argumentNames => _argumentNames ??= <String>[]; |
| 4265 |
| 4266 /** |
| 4267 * If there are `m` [arguments] and `n` [argumentNames], then each argument |
| 4268 * from [arguments] with index `i` such that `n + i - m >= 0`, should be used |
| 4269 * with the name at `n + i - m`. |
| 4270 */ |
| 4271 void set argumentNames(List<String> value) { |
| 4272 this._argumentNames = value; |
| 4273 } |
| 4274 |
| 4275 @override |
| 4276 List<UnlinkedConstBuilder> get arguments => _arguments ??= <UnlinkedConstBuild
er>[]; |
| 4277 |
| 4278 /** |
| 4279 * If [kind] is `thisInvocation` or `superInvocation`, the arguments of the |
| 4280 * invocation. Otherwise empty. |
| 4281 */ |
| 4282 void set arguments(List<UnlinkedConstBuilder> value) { |
| 4283 this._arguments = value; |
| 4284 } |
| 4285 |
| 4286 @override |
| 4287 UnlinkedConstBuilder get expression => _expression; |
| 4288 |
| 4289 /** |
| 4290 * If [kind] is `field`, the expression of the field initializer. |
| 4291 * Otherwise `null`. |
| 4292 */ |
| 4293 void set expression(UnlinkedConstBuilder value) { |
| 4294 this._expression = value; |
| 4295 } |
| 4296 |
| 4297 @override |
| 4298 idl.UnlinkedConstructorInitializerKind get kind => _kind ??= idl.UnlinkedConst
ructorInitializerKind.field; |
| 4299 |
| 4300 /** |
| 4301 * The kind of the constructor initializer (field, redirect, super). |
| 4302 */ |
| 4303 void set kind(idl.UnlinkedConstructorInitializerKind value) { |
| 4304 this._kind = value; |
| 4305 } |
| 4306 |
| 4307 @override |
| 4308 String get name => _name ??= ''; |
| 4309 |
| 4310 /** |
| 4311 * If [kind] is `field`, the name of the field declared in the class. If |
| 4312 * [kind] is `thisInvocation`, the name of the constructor, declared in this |
| 4313 * class, to redirect to. If [kind] is `superInvocation`, the name of the |
| 4314 * constructor, declared in the superclass, to invoke. |
| 4315 */ |
| 4316 void set name(String value) { |
| 4317 this._name = value; |
| 4318 } |
| 4319 |
| 4320 UnlinkedConstructorInitializerBuilder({List<String> argumentNames, List<Unlink
edConstBuilder> arguments, UnlinkedConstBuilder expression, idl.UnlinkedConstruc
torInitializerKind kind, String name}) |
| 4321 : _argumentNames = argumentNames, |
| 4322 _arguments = arguments, |
| 4323 _expression = expression, |
| 4324 _kind = kind, |
| 4325 _name = name; |
| 4326 |
| 4327 /** |
| 4328 * Flush [informative] data recursively. |
| 4329 */ |
| 4330 void flushInformative() { |
| 4331 _arguments?.forEach((b) => b.flushInformative()); |
| 4332 _expression?.flushInformative(); |
| 4333 } |
| 4334 |
| 4335 /** |
| 4336 * Accumulate non-[informative] data into [signature]. |
| 4337 */ |
| 4338 void collectApiSignature(api_sig.ApiSignature signature) { |
| 4339 signature.addString(this._name ?? ''); |
| 4340 signature.addBool(this._expression != null); |
| 4341 this._expression?.collectApiSignature(signature); |
| 4342 signature.addInt(this._kind == null ? 0 : this._kind.index); |
| 4343 if (this._arguments == null) { |
| 4344 signature.addInt(0); |
| 4345 } else { |
| 4346 signature.addInt(this._arguments.length); |
| 4347 for (var x in this._arguments) { |
| 4348 x?.collectApiSignature(signature); |
| 4349 } |
| 4350 } |
| 4351 if (this._argumentNames == null) { |
| 4352 signature.addInt(0); |
| 4353 } else { |
| 4354 signature.addInt(this._argumentNames.length); |
| 4355 for (var x in this._argumentNames) { |
| 4356 signature.addString(x); |
| 4357 } |
| 4358 } |
| 4359 } |
| 4360 |
| 4361 fb.Offset finish(fb.Builder fbBuilder) { |
| 4362 fb.Offset offset_argumentNames; |
| 4363 fb.Offset offset_arguments; |
| 4364 fb.Offset offset_expression; |
| 4365 fb.Offset offset_name; |
| 4366 if (!(_argumentNames == null || _argumentNames.isEmpty)) { |
| 4367 offset_argumentNames = fbBuilder.writeList(_argumentNames.map((b) => fbBui
lder.writeString(b)).toList()); |
| 4368 } |
| 4369 if (!(_arguments == null || _arguments.isEmpty)) { |
| 4370 offset_arguments = fbBuilder.writeList(_arguments.map((b) => b.finish(fbBu
ilder)).toList()); |
| 4371 } |
| 4372 if (_expression != null) { |
| 4373 offset_expression = _expression.finish(fbBuilder); |
| 4374 } |
| 4375 if (_name != null) { |
| 4376 offset_name = fbBuilder.writeString(_name); |
| 4377 } |
| 4378 fbBuilder.startTable(); |
| 4379 if (offset_argumentNames != null) { |
| 4380 fbBuilder.addOffset(4, offset_argumentNames); |
| 4381 } |
| 4382 if (offset_arguments != null) { |
| 4383 fbBuilder.addOffset(3, offset_arguments); |
| 4384 } |
| 4385 if (offset_expression != null) { |
| 4386 fbBuilder.addOffset(1, offset_expression); |
| 4387 } |
| 4388 if (_kind != null && _kind != idl.UnlinkedConstructorInitializerKind.field)
{ |
| 4389 fbBuilder.addUint8(2, _kind.index); |
| 4390 } |
| 4391 if (offset_name != null) { |
| 4392 fbBuilder.addOffset(0, offset_name); |
| 4393 } |
| 4394 return fbBuilder.endTable(); |
| 4395 } |
| 4396 } |
| 4397 |
| 4398 class _UnlinkedConstructorInitializerReader extends fb.TableReader<_UnlinkedCons
tructorInitializerImpl> { |
| 4399 const _UnlinkedConstructorInitializerReader(); |
| 4400 |
| 4401 @override |
| 4402 _UnlinkedConstructorInitializerImpl createObject(fb.BufferContext bc, int offs
et) => new _UnlinkedConstructorInitializerImpl(bc, offset); |
| 4403 } |
| 4404 |
| 4405 class _UnlinkedConstructorInitializerImpl extends Object with _UnlinkedConstruct
orInitializerMixin implements idl.UnlinkedConstructorInitializer { |
| 4406 final fb.BufferContext _bc; |
| 4407 final int _bcOffset; |
| 4408 |
| 4409 _UnlinkedConstructorInitializerImpl(this._bc, this._bcOffset); |
| 4410 |
| 4411 List<String> _argumentNames; |
| 4412 List<idl.UnlinkedConst> _arguments; |
| 4413 idl.UnlinkedConst _expression; |
| 4414 idl.UnlinkedConstructorInitializerKind _kind; |
| 4415 String _name; |
| 4416 |
| 4417 @override |
| 4418 List<String> get argumentNames { |
| 4419 _argumentNames ??= const fb.ListReader<String>(const fb.StringReader()).vTab
leGet(_bc, _bcOffset, 4, const <String>[]); |
| 4420 return _argumentNames; |
| 4421 } |
| 4422 |
| 4423 @override |
| 4424 List<idl.UnlinkedConst> get arguments { |
| 4425 _arguments ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConstRe
ader()).vTableGet(_bc, _bcOffset, 3, const <idl.UnlinkedConst>[]); |
| 4426 return _arguments; |
| 4427 } |
| 4428 |
| 4429 @override |
| 4430 idl.UnlinkedConst get expression { |
| 4431 _expression ??= const _UnlinkedConstReader().vTableGet(_bc, _bcOffset, 1, nu
ll); |
| 4432 return _expression; |
| 4433 } |
| 4434 |
| 4435 @override |
| 4436 idl.UnlinkedConstructorInitializerKind get kind { |
| 4437 _kind ??= const _UnlinkedConstructorInitializerKindReader().vTableGet(_bc, _
bcOffset, 2, idl.UnlinkedConstructorInitializerKind.field); |
| 4438 return _kind; |
| 4439 } |
| 4440 |
| 4441 @override |
| 4442 String get name { |
| 4443 _name ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, ''); |
| 4444 return _name; |
| 4445 } |
| 4446 } |
| 4447 |
| 4448 abstract class _UnlinkedConstructorInitializerMixin implements idl.UnlinkedConst
ructorInitializer { |
| 4449 @override |
| 4450 Map<String, Object> toJson() { |
| 4451 Map<String, Object> _result = <String, Object>{}; |
| 4452 if (argumentNames.isNotEmpty) _result["argumentNames"] = argumentNames; |
| 4453 if (arguments.isNotEmpty) _result["arguments"] = arguments.map((_value) => _
value.toJson()).toList(); |
| 4454 if (expression != null) _result["expression"] = expression.toJson(); |
| 4455 if (kind != idl.UnlinkedConstructorInitializerKind.field) _result["kind"] =
kind.toString().split('.')[1]; |
| 4456 if (name != '') _result["name"] = name; |
| 4457 return _result; |
| 4458 } |
| 4459 |
| 4460 @override |
| 4461 Map<String, Object> toMap() => { |
| 4462 "argumentNames": argumentNames, |
| 4463 "arguments": arguments, |
| 4464 "expression": expression, |
| 4465 "kind": kind, |
| 4466 "name": name, |
| 4467 }; |
| 4468 |
| 4469 @override |
| 4470 String toString() => convert.JSON.encode(toJson()); |
| 4471 } |
| 4472 |
| 4473 class UnlinkedDocumentationCommentBuilder extends Object with _UnlinkedDocumenta
tionCommentMixin implements idl.UnlinkedDocumentationComment { |
| 4474 String _text; |
| 4475 |
| 4476 @override |
| 4477 int get length => throw new UnimplementedError('attempt to access deprecated f
ield'); |
| 4478 |
| 4479 @override |
| 4480 int get offset => throw new UnimplementedError('attempt to access deprecated f
ield'); |
| 4481 |
| 4482 @override |
| 4483 String get text => _text ??= ''; |
| 4484 |
| 4485 /** |
| 4486 * Text of the documentation comment, with '\r\n' replaced by '\n'. |
| 4487 * |
| 4488 * References appearing within the doc comment in square brackets are not |
| 4489 * specially encoded. |
| 4490 */ |
| 4491 void set text(String value) { |
| 4492 this._text = value; |
| 4493 } |
| 4494 |
| 4495 UnlinkedDocumentationCommentBuilder({String text}) |
| 4496 : _text = text; |
| 4497 |
| 4498 /** |
| 4499 * Flush [informative] data recursively. |
| 4500 */ |
| 4501 void flushInformative() { |
| 4502 } |
| 4503 |
| 4504 /** |
| 4505 * Accumulate non-[informative] data into [signature]. |
| 4506 */ |
| 4507 void collectApiSignature(api_sig.ApiSignature signature) { |
| 4508 signature.addString(this._text ?? ''); |
| 4509 } |
| 4510 |
| 4511 fb.Offset finish(fb.Builder fbBuilder) { |
| 4512 fb.Offset offset_text; |
| 4513 if (_text != null) { |
| 4514 offset_text = fbBuilder.writeString(_text); |
| 4515 } |
| 4516 fbBuilder.startTable(); |
| 4517 if (offset_text != null) { |
| 4518 fbBuilder.addOffset(1, offset_text); |
| 4519 } |
| 4520 return fbBuilder.endTable(); |
| 4521 } |
| 4522 } |
| 4523 |
| 4524 class _UnlinkedDocumentationCommentReader extends fb.TableReader<_UnlinkedDocume
ntationCommentImpl> { |
| 4525 const _UnlinkedDocumentationCommentReader(); |
| 4526 |
| 4527 @override |
| 4528 _UnlinkedDocumentationCommentImpl createObject(fb.BufferContext bc, int offset
) => new _UnlinkedDocumentationCommentImpl(bc, offset); |
| 4529 } |
| 4530 |
| 4531 class _UnlinkedDocumentationCommentImpl extends Object with _UnlinkedDocumentati
onCommentMixin implements idl.UnlinkedDocumentationComment { |
| 4532 final fb.BufferContext _bc; |
| 4533 final int _bcOffset; |
| 4534 |
| 4535 _UnlinkedDocumentationCommentImpl(this._bc, this._bcOffset); |
| 4536 |
| 4537 String _text; |
| 4538 |
| 4539 @override |
| 4540 int get length => throw new UnimplementedError('attempt to access deprecated f
ield'); |
| 4541 |
| 4542 @override |
| 4543 int get offset => throw new UnimplementedError('attempt to access deprecated f
ield'); |
| 4544 |
| 4545 @override |
| 4546 String get text { |
| 4547 _text ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 1, ''); |
| 4548 return _text; |
| 4549 } |
| 4550 } |
| 4551 |
| 4552 abstract class _UnlinkedDocumentationCommentMixin implements idl.UnlinkedDocumen
tationComment { |
| 4553 @override |
| 4554 Map<String, Object> toJson() { |
| 4555 Map<String, Object> _result = <String, Object>{}; |
| 4556 if (text != '') _result["text"] = text; |
| 4557 return _result; |
| 4558 } |
| 4559 |
| 4560 @override |
| 4561 Map<String, Object> toMap() => { |
| 4562 "text": text, |
| 4563 }; |
| 4564 |
| 4565 @override |
| 4566 String toString() => convert.JSON.encode(toJson()); |
| 4567 } |
| 4568 |
| 4569 class UnlinkedEnumBuilder extends Object with _UnlinkedEnumMixin implements idl.
UnlinkedEnum { |
| 4570 List<UnlinkedConstBuilder> _annotations; |
| 4571 CodeRangeBuilder _codeRange; |
| 4572 UnlinkedDocumentationCommentBuilder _documentationComment; |
| 4573 String _name; |
| 4574 int _nameOffset; |
| 4575 List<UnlinkedEnumValueBuilder> _values; |
| 4576 |
| 4577 @override |
| 4578 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; |
| 4579 |
| 4580 /** |
| 4581 * Annotations for this enum. |
| 4582 */ |
| 4583 void set annotations(List<UnlinkedConstBuilder> value) { |
| 4584 this._annotations = value; |
| 4585 } |
| 4586 |
| 4587 @override |
| 4588 CodeRangeBuilder get codeRange => _codeRange; |
| 4589 |
| 4590 /** |
| 4591 * Code range of the enum. |
| 4592 */ |
| 4593 void set codeRange(CodeRangeBuilder value) { |
| 4594 this._codeRange = value; |
| 4595 } |
| 4596 |
| 4597 @override |
| 4598 UnlinkedDocumentationCommentBuilder get documentationComment => _documentation
Comment; |
| 4599 |
| 4600 /** |
| 4601 * Documentation comment for the enum, or `null` if there is no documentation |
| 4602 * comment. |
| 4603 */ |
| 4604 void set documentationComment(UnlinkedDocumentationCommentBuilder value) { |
| 4605 this._documentationComment = value; |
| 4606 } |
| 4607 |
| 4608 @override |
| 4609 String get name => _name ??= ''; |
| 4610 |
| 4611 /** |
| 4612 * Name of the enum type. |
| 4613 */ |
| 4614 void set name(String value) { |
| 4615 this._name = value; |
| 4616 } |
| 4617 |
| 4618 @override |
| 4619 int get nameOffset => _nameOffset ??= 0; |
| 4620 |
| 4621 /** |
| 4622 * Offset of the enum name relative to the beginning of the file. |
| 4623 */ |
| 4624 void set nameOffset(int value) { |
| 4625 assert(value == null || value >= 0); |
| 4626 this._nameOffset = value; |
| 4627 } |
| 4628 |
| 4629 @override |
| 4630 List<UnlinkedEnumValueBuilder> get values => _values ??= <UnlinkedEnumValueBui
lder>[]; |
| 4631 |
| 4632 /** |
| 4633 * Values listed in the enum declaration, in declaration order. |
| 4634 */ |
| 4635 void set values(List<UnlinkedEnumValueBuilder> value) { |
| 4636 this._values = value; |
| 4637 } |
| 4638 |
| 4639 UnlinkedEnumBuilder({List<UnlinkedConstBuilder> annotations, CodeRangeBuilder
codeRange, UnlinkedDocumentationCommentBuilder documentationComment, String name
, int nameOffset, List<UnlinkedEnumValueBuilder> values}) |
| 4640 : _annotations = annotations, |
| 4641 _codeRange = codeRange, |
| 4642 _documentationComment = documentationComment, |
| 4643 _name = name, |
| 4644 _nameOffset = nameOffset, |
| 4645 _values = values; |
| 4646 |
| 4647 /** |
| 4648 * Flush [informative] data recursively. |
| 4649 */ |
| 4650 void flushInformative() { |
| 4651 _annotations?.forEach((b) => b.flushInformative()); |
| 4652 _codeRange = null; |
| 4653 _documentationComment = null; |
| 4654 _nameOffset = null; |
| 4655 _values?.forEach((b) => b.flushInformative()); |
| 4656 } |
| 4657 |
| 4658 /** |
| 4659 * Accumulate non-[informative] data into [signature]. |
| 4660 */ |
| 4661 void collectApiSignature(api_sig.ApiSignature signature) { |
| 4662 signature.addString(this._name ?? ''); |
| 4663 if (this._values == null) { |
| 4664 signature.addInt(0); |
| 4665 } else { |
| 4666 signature.addInt(this._values.length); |
| 4667 for (var x in this._values) { |
| 4668 x?.collectApiSignature(signature); |
| 4669 } |
| 4670 } |
| 4671 if (this._annotations == null) { |
| 4672 signature.addInt(0); |
| 4673 } else { |
| 4674 signature.addInt(this._annotations.length); |
| 4675 for (var x in this._annotations) { |
| 4676 x?.collectApiSignature(signature); |
| 4677 } |
| 4678 } |
| 4679 } |
| 4680 |
| 4681 fb.Offset finish(fb.Builder fbBuilder) { |
| 4682 fb.Offset offset_annotations; |
| 4683 fb.Offset offset_codeRange; |
| 4684 fb.Offset offset_documentationComment; |
| 4685 fb.Offset offset_name; |
| 4686 fb.Offset offset_values; |
| 4687 if (!(_annotations == null || _annotations.isEmpty)) { |
| 4688 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); |
| 4689 } |
| 4690 if (_codeRange != null) { |
| 4691 offset_codeRange = _codeRange.finish(fbBuilder); |
| 4692 } |
| 4693 if (_documentationComment != null) { |
| 4694 offset_documentationComment = _documentationComment.finish(fbBuilder); |
| 4695 } |
| 4696 if (_name != null) { |
| 4697 offset_name = fbBuilder.writeString(_name); |
| 4698 } |
| 4699 if (!(_values == null || _values.isEmpty)) { |
| 4700 offset_values = fbBuilder.writeList(_values.map((b) => b.finish(fbBuilder)
).toList()); |
| 4701 } |
| 4702 fbBuilder.startTable(); |
| 4703 if (offset_annotations != null) { |
| 4704 fbBuilder.addOffset(4, offset_annotations); |
| 4705 } |
| 4706 if (offset_codeRange != null) { |
| 4707 fbBuilder.addOffset(5, offset_codeRange); |
| 4708 } |
| 4709 if (offset_documentationComment != null) { |
| 4710 fbBuilder.addOffset(3, offset_documentationComment); |
| 4711 } |
| 4712 if (offset_name != null) { |
| 4713 fbBuilder.addOffset(0, offset_name); |
| 4714 } |
| 4715 if (_nameOffset != null && _nameOffset != 0) { |
| 4716 fbBuilder.addUint32(1, _nameOffset); |
| 4717 } |
| 4718 if (offset_values != null) { |
| 4719 fbBuilder.addOffset(2, offset_values); |
| 4720 } |
| 4721 return fbBuilder.endTable(); |
| 4722 } |
| 4723 } |
| 4724 |
| 4725 class _UnlinkedEnumReader extends fb.TableReader<_UnlinkedEnumImpl> { |
| 4726 const _UnlinkedEnumReader(); |
| 4727 |
| 4728 @override |
| 4729 _UnlinkedEnumImpl createObject(fb.BufferContext bc, int offset) => new _Unlink
edEnumImpl(bc, offset); |
| 4730 } |
| 4731 |
| 4732 class _UnlinkedEnumImpl extends Object with _UnlinkedEnumMixin implements idl.Un
linkedEnum { |
| 4733 final fb.BufferContext _bc; |
| 4734 final int _bcOffset; |
| 4735 |
| 4736 _UnlinkedEnumImpl(this._bc, this._bcOffset); |
| 4737 |
| 4738 List<idl.UnlinkedConst> _annotations; |
| 4739 idl.CodeRange _codeRange; |
| 4740 idl.UnlinkedDocumentationComment _documentationComment; |
| 4741 String _name; |
| 4742 int _nameOffset; |
| 4743 List<idl.UnlinkedEnumValue> _values; |
| 4744 |
| 4745 @override |
| 4746 List<idl.UnlinkedConst> get annotations { |
| 4747 _annotations ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConst
Reader()).vTableGet(_bc, _bcOffset, 4, const <idl.UnlinkedConst>[]); |
| 4748 return _annotations; |
| 4749 } |
| 4750 |
| 4751 @override |
| 4752 idl.CodeRange get codeRange { |
| 4753 _codeRange ??= const _CodeRangeReader().vTableGet(_bc, _bcOffset, 5, null); |
| 4754 return _codeRange; |
| 4755 } |
| 4756 |
| 4757 @override |
| 4758 idl.UnlinkedDocumentationComment get documentationComment { |
| 4759 _documentationComment ??= const _UnlinkedDocumentationCommentReader().vTable
Get(_bc, _bcOffset, 3, null); |
| 4760 return _documentationComment; |
| 4761 } |
| 4762 |
| 4763 @override |
| 4764 String get name { |
| 4765 _name ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, ''); |
| 4766 return _name; |
| 4767 } |
| 4768 |
| 4769 @override |
| 4770 int get nameOffset { |
| 4771 _nameOffset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 1, 0); |
| 4772 return _nameOffset; |
| 4773 } |
| 4774 |
| 4775 @override |
| 4776 List<idl.UnlinkedEnumValue> get values { |
| 4777 _values ??= const fb.ListReader<idl.UnlinkedEnumValue>(const _UnlinkedEnumVa
lueReader()).vTableGet(_bc, _bcOffset, 2, const <idl.UnlinkedEnumValue>[]); |
| 4778 return _values; |
| 4779 } |
| 4780 } |
| 4781 |
| 4782 abstract class _UnlinkedEnumMixin implements idl.UnlinkedEnum { |
| 4783 @override |
| 4784 Map<String, Object> toJson() { |
| 4785 Map<String, Object> _result = <String, Object>{}; |
| 4786 if (annotations.isNotEmpty) _result["annotations"] = annotations.map((_value
) => _value.toJson()).toList(); |
| 4787 if (codeRange != null) _result["codeRange"] = codeRange.toJson(); |
| 4788 if (documentationComment != null) _result["documentationComment"] = document
ationComment.toJson(); |
| 4789 if (name != '') _result["name"] = name; |
| 4790 if (nameOffset != 0) _result["nameOffset"] = nameOffset; |
| 4791 if (values.isNotEmpty) _result["values"] = values.map((_value) => _value.toJ
son()).toList(); |
| 4792 return _result; |
| 4793 } |
| 4794 |
| 4795 @override |
| 4796 Map<String, Object> toMap() => { |
| 4797 "annotations": annotations, |
| 4798 "codeRange": codeRange, |
| 4799 "documentationComment": documentationComment, |
| 4800 "name": name, |
| 4801 "nameOffset": nameOffset, |
| 4802 "values": values, |
| 4803 }; |
| 4804 |
| 4805 @override |
| 4806 String toString() => convert.JSON.encode(toJson()); |
| 4807 } |
| 4808 |
| 4809 class UnlinkedEnumValueBuilder extends Object with _UnlinkedEnumValueMixin imple
ments idl.UnlinkedEnumValue { |
| 4810 UnlinkedDocumentationCommentBuilder _documentationComment; |
| 4811 String _name; |
| 4812 int _nameOffset; |
| 4813 |
| 4814 @override |
| 4815 UnlinkedDocumentationCommentBuilder get documentationComment => _documentation
Comment; |
| 4816 |
| 4817 /** |
| 4818 * Documentation comment for the enum value, or `null` if there is no |
| 4819 * documentation comment. |
| 4820 */ |
| 4821 void set documentationComment(UnlinkedDocumentationCommentBuilder value) { |
| 4822 this._documentationComment = value; |
| 4823 } |
| 4824 |
| 4825 @override |
| 4826 String get name => _name ??= ''; |
| 4827 |
| 4828 /** |
| 4829 * Name of the enumerated value. |
| 4830 */ |
| 4831 void set name(String value) { |
| 4832 this._name = value; |
| 4833 } |
| 4834 |
| 4835 @override |
| 4836 int get nameOffset => _nameOffset ??= 0; |
| 4837 |
| 4838 /** |
| 4839 * Offset of the enum value name relative to the beginning of the file. |
| 4840 */ |
| 4841 void set nameOffset(int value) { |
| 4842 assert(value == null || value >= 0); |
| 4843 this._nameOffset = value; |
| 4844 } |
| 4845 |
| 4846 UnlinkedEnumValueBuilder({UnlinkedDocumentationCommentBuilder documentationCom
ment, String name, int nameOffset}) |
| 4847 : _documentationComment = documentationComment, |
| 4848 _name = name, |
| 4849 _nameOffset = nameOffset; |
| 4850 |
| 4851 /** |
| 4852 * Flush [informative] data recursively. |
| 4853 */ |
| 4854 void flushInformative() { |
| 4855 _documentationComment = null; |
| 4856 _nameOffset = null; |
| 4857 } |
| 4858 |
| 4859 /** |
| 4860 * Accumulate non-[informative] data into [signature]. |
| 4861 */ |
| 4862 void collectApiSignature(api_sig.ApiSignature signature) { |
| 4863 signature.addString(this._name ?? ''); |
| 4864 } |
| 4865 |
| 4866 fb.Offset finish(fb.Builder fbBuilder) { |
| 4867 fb.Offset offset_documentationComment; |
| 4868 fb.Offset offset_name; |
| 4869 if (_documentationComment != null) { |
| 4870 offset_documentationComment = _documentationComment.finish(fbBuilder); |
| 4871 } |
| 4872 if (_name != null) { |
| 4873 offset_name = fbBuilder.writeString(_name); |
| 4874 } |
| 4875 fbBuilder.startTable(); |
| 4876 if (offset_documentationComment != null) { |
| 4877 fbBuilder.addOffset(2, offset_documentationComment); |
| 4878 } |
| 4879 if (offset_name != null) { |
| 4880 fbBuilder.addOffset(0, offset_name); |
| 4881 } |
| 4882 if (_nameOffset != null && _nameOffset != 0) { |
| 4883 fbBuilder.addUint32(1, _nameOffset); |
| 4884 } |
| 4885 return fbBuilder.endTable(); |
| 4886 } |
| 4887 } |
| 4888 |
| 4889 class _UnlinkedEnumValueReader extends fb.TableReader<_UnlinkedEnumValueImpl> { |
| 4890 const _UnlinkedEnumValueReader(); |
| 4891 |
| 4892 @override |
| 4893 _UnlinkedEnumValueImpl createObject(fb.BufferContext bc, int offset) => new _U
nlinkedEnumValueImpl(bc, offset); |
| 4894 } |
| 4895 |
| 4896 class _UnlinkedEnumValueImpl extends Object with _UnlinkedEnumValueMixin impleme
nts idl.UnlinkedEnumValue { |
| 4897 final fb.BufferContext _bc; |
| 4898 final int _bcOffset; |
| 4899 |
| 4900 _UnlinkedEnumValueImpl(this._bc, this._bcOffset); |
| 4901 |
| 4902 idl.UnlinkedDocumentationComment _documentationComment; |
| 4903 String _name; |
| 4904 int _nameOffset; |
| 4905 |
| 4906 @override |
| 4907 idl.UnlinkedDocumentationComment get documentationComment { |
| 4908 _documentationComment ??= const _UnlinkedDocumentationCommentReader().vTable
Get(_bc, _bcOffset, 2, null); |
| 4909 return _documentationComment; |
| 4910 } |
| 4911 |
| 4912 @override |
| 4913 String get name { |
| 4914 _name ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, ''); |
| 4915 return _name; |
| 4916 } |
| 4917 |
| 4918 @override |
| 4919 int get nameOffset { |
| 4920 _nameOffset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 1, 0); |
| 4921 return _nameOffset; |
| 4922 } |
| 4923 } |
| 4924 |
| 4925 abstract class _UnlinkedEnumValueMixin implements idl.UnlinkedEnumValue { |
| 4926 @override |
| 4927 Map<String, Object> toJson() { |
| 4928 Map<String, Object> _result = <String, Object>{}; |
| 4929 if (documentationComment != null) _result["documentationComment"] = document
ationComment.toJson(); |
| 4930 if (name != '') _result["name"] = name; |
| 4931 if (nameOffset != 0) _result["nameOffset"] = nameOffset; |
| 4932 return _result; |
| 4933 } |
| 4934 |
| 4935 @override |
| 4936 Map<String, Object> toMap() => { |
| 4937 "documentationComment": documentationComment, |
| 4938 "name": name, |
| 4939 "nameOffset": nameOffset, |
| 4940 }; |
| 4941 |
| 4942 @override |
| 4943 String toString() => convert.JSON.encode(toJson()); |
| 4944 } |
| 4945 |
| 4946 class UnlinkedExecutableBuilder extends Object with _UnlinkedExecutableMixin imp
lements idl.UnlinkedExecutable { |
| 4947 List<UnlinkedConstBuilder> _annotations; |
| 4948 UnlinkedConstBuilder _bodyExpr; |
| 4949 CodeRangeBuilder _codeRange; |
| 4950 List<UnlinkedConstructorInitializerBuilder> _constantInitializers; |
| 4951 int _constCycleSlot; |
| 4952 UnlinkedDocumentationCommentBuilder _documentationComment; |
| 4953 int _inferredReturnTypeSlot; |
| 4954 bool _isAbstract; |
| 4955 bool _isAsynchronous; |
| 4956 bool _isConst; |
| 4957 bool _isExternal; |
| 4958 bool _isFactory; |
| 4959 bool _isGenerator; |
| 4960 bool _isRedirectedConstructor; |
| 4961 bool _isStatic; |
| 4962 idl.UnlinkedExecutableKind _kind; |
| 4963 List<UnlinkedExecutableBuilder> _localFunctions; |
| 4964 List<UnlinkedLabelBuilder> _localLabels; |
| 4965 List<UnlinkedVariableBuilder> _localVariables; |
| 4966 String _name; |
| 4967 int _nameEnd; |
| 4968 int _nameOffset; |
| 4969 List<UnlinkedParamBuilder> _parameters; |
| 4970 int _periodOffset; |
| 4971 EntityRefBuilder _redirectedConstructor; |
| 4972 String _redirectedConstructorName; |
| 4973 EntityRefBuilder _returnType; |
| 4974 List<UnlinkedTypeParamBuilder> _typeParameters; |
| 4975 int _visibleLength; |
| 4976 int _visibleOffset; |
| 4977 |
| 4978 @override |
| 4979 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; |
| 4980 |
| 4981 /** |
| 4982 * Annotations for this executable. |
| 4983 */ |
| 4984 void set annotations(List<UnlinkedConstBuilder> value) { |
| 4985 this._annotations = value; |
| 4986 } |
| 4987 |
| 4988 @override |
| 4989 UnlinkedConstBuilder get bodyExpr => _bodyExpr; |
| 4990 |
| 4991 /** |
| 4992 * If this executable's function body is declared using `=>`, the expression |
| 4993 * to the right of the `=>`. May be omitted if neither type inference nor |
| 4994 * constant evaluation depends on the function body. |
| 4995 */ |
| 4996 void set bodyExpr(UnlinkedConstBuilder value) { |
| 4997 this._bodyExpr = value; |
| 4998 } |
| 4999 |
| 5000 @override |
| 5001 CodeRangeBuilder get codeRange => _codeRange; |
| 5002 |
| 5003 /** |
| 5004 * Code range of the executable. |
| 5005 */ |
| 5006 void set codeRange(CodeRangeBuilder value) { |
| 5007 this._codeRange = value; |
| 5008 } |
| 5009 |
| 5010 @override |
| 5011 List<UnlinkedConstructorInitializerBuilder> get constantInitializers => _const
antInitializers ??= <UnlinkedConstructorInitializerBuilder>[]; |
| 5012 |
| 5013 /** |
| 5014 * If a constant [UnlinkedExecutableKind.constructor], the constructor |
| 5015 * initializers. Otherwise empty. |
| 5016 */ |
| 5017 void set constantInitializers(List<UnlinkedConstructorInitializerBuilder> valu
e) { |
| 5018 this._constantInitializers = value; |
| 5019 } |
| 5020 |
| 5021 @override |
| 5022 int get constCycleSlot => _constCycleSlot ??= 0; |
| 5023 |
| 5024 /** |
| 5025 * If [kind] is [UnlinkedExecutableKind.constructor] and [isConst] is `true`, |
| 5026 * a nonzero slot id which is unique within this compilation unit. If this id |
| 5027 * is found in [LinkedUnit.constCycles], then this constructor is part of a |
| 5028 * cycle. |
| 5029 * |
| 5030 * Otherwise, zero. |
| 5031 */ |
| 5032 void set constCycleSlot(int value) { |
| 5033 assert(value == null || value >= 0); |
| 5034 this._constCycleSlot = value; |
| 5035 } |
| 5036 |
| 5037 @override |
| 5038 UnlinkedDocumentationCommentBuilder get documentationComment => _documentation
Comment; |
| 5039 |
| 5040 /** |
| 5041 * Documentation comment for the executable, or `null` if there is no |
| 5042 * documentation comment. |
| 5043 */ |
| 5044 void set documentationComment(UnlinkedDocumentationCommentBuilder value) { |
| 5045 this._documentationComment = value; |
| 5046 } |
| 5047 |
| 5048 @override |
| 5049 int get inferredReturnTypeSlot => _inferredReturnTypeSlot ??= 0; |
| 5050 |
| 5051 /** |
| 5052 * If this executable's return type is inferable, nonzero slot id |
| 5053 * identifying which entry in [LinkedUnit.types] contains the inferred |
| 5054 * return type. If there is no matching entry in [LinkedUnit.types], then |
| 5055 * no return type was inferred for this variable, so its static type is |
| 5056 * `dynamic`. |
| 5057 */ |
| 5058 void set inferredReturnTypeSlot(int value) { |
| 5059 assert(value == null || value >= 0); |
| 5060 this._inferredReturnTypeSlot = value; |
| 5061 } |
| 5062 |
| 5063 @override |
| 5064 bool get isAbstract => _isAbstract ??= false; |
| 5065 |
| 5066 /** |
| 5067 * Indicates whether the executable is declared using the `abstract` keyword. |
| 5068 */ |
| 5069 void set isAbstract(bool value) { |
| 5070 this._isAbstract = value; |
| 5071 } |
| 5072 |
| 5073 @override |
| 5074 bool get isAsynchronous => _isAsynchronous ??= false; |
| 5075 |
| 5076 /** |
| 5077 * Indicates whether the executable has body marked as being asynchronous. |
| 5078 */ |
| 5079 void set isAsynchronous(bool value) { |
| 5080 this._isAsynchronous = value; |
| 5081 } |
| 5082 |
| 5083 @override |
| 5084 bool get isConst => _isConst ??= false; |
| 5085 |
| 5086 /** |
| 5087 * Indicates whether the executable is declared using the `const` keyword. |
| 5088 */ |
| 5089 void set isConst(bool value) { |
| 5090 this._isConst = value; |
| 5091 } |
| 5092 |
| 5093 @override |
| 5094 bool get isExternal => _isExternal ??= false; |
| 5095 |
| 5096 /** |
| 5097 * Indicates whether the executable is declared using the `external` keyword. |
| 5098 */ |
| 5099 void set isExternal(bool value) { |
| 5100 this._isExternal = value; |
| 5101 } |
| 5102 |
| 5103 @override |
| 5104 bool get isFactory => _isFactory ??= false; |
| 5105 |
| 5106 /** |
| 5107 * Indicates whether the executable is declared using the `factory` keyword. |
| 5108 */ |
| 5109 void set isFactory(bool value) { |
| 5110 this._isFactory = value; |
| 5111 } |
| 5112 |
| 5113 @override |
| 5114 bool get isGenerator => _isGenerator ??= false; |
| 5115 |
| 5116 /** |
| 5117 * Indicates whether the executable has body marked as being a generator. |
| 5118 */ |
| 5119 void set isGenerator(bool value) { |
| 5120 this._isGenerator = value; |
| 5121 } |
| 5122 |
| 5123 @override |
| 5124 bool get isRedirectedConstructor => _isRedirectedConstructor ??= false; |
| 5125 |
| 5126 /** |
| 5127 * Indicates whether the executable is a redirected constructor. |
| 5128 */ |
| 5129 void set isRedirectedConstructor(bool value) { |
| 5130 this._isRedirectedConstructor = value; |
| 5131 } |
| 5132 |
| 5133 @override |
| 5134 bool get isStatic => _isStatic ??= false; |
| 5135 |
| 5136 /** |
| 5137 * Indicates whether the executable is declared using the `static` keyword. |
| 5138 * |
| 5139 * Note that for top level executables, this flag is false, since they are |
| 5140 * not declared using the `static` keyword (even though they are considered |
| 5141 * static for semantic purposes). |
| 5142 */ |
| 5143 void set isStatic(bool value) { |
| 5144 this._isStatic = value; |
| 5145 } |
| 5146 |
| 5147 @override |
| 5148 idl.UnlinkedExecutableKind get kind => _kind ??= idl.UnlinkedExecutableKind.fu
nctionOrMethod; |
| 5149 |
| 5150 /** |
| 5151 * The kind of the executable (function/method, getter, setter, or |
| 5152 * constructor). |
| 5153 */ |
| 5154 void set kind(idl.UnlinkedExecutableKind value) { |
| 5155 this._kind = value; |
| 5156 } |
| 5157 |
| 5158 @override |
| 5159 List<UnlinkedExecutableBuilder> get localFunctions => _localFunctions ??= <Unl
inkedExecutableBuilder>[]; |
| 5160 |
| 5161 /** |
| 5162 * The list of local functions. |
| 5163 */ |
| 5164 void set localFunctions(List<UnlinkedExecutableBuilder> value) { |
| 5165 this._localFunctions = value; |
| 5166 } |
| 5167 |
| 5168 @override |
| 5169 List<UnlinkedLabelBuilder> get localLabels => _localLabels ??= <UnlinkedLabelB
uilder>[]; |
| 5170 |
| 5171 /** |
| 5172 * The list of local labels. |
| 5173 */ |
| 5174 void set localLabels(List<UnlinkedLabelBuilder> value) { |
| 5175 this._localLabels = value; |
| 5176 } |
| 5177 |
| 5178 @override |
| 5179 List<UnlinkedVariableBuilder> get localVariables => _localVariables ??= <Unlin
kedVariableBuilder>[]; |
| 5180 |
| 5181 /** |
| 5182 * The list of local variables. |
| 5183 */ |
| 5184 void set localVariables(List<UnlinkedVariableBuilder> value) { |
| 5185 this._localVariables = value; |
| 5186 } |
| 5187 |
| 5188 @override |
| 5189 String get name => _name ??= ''; |
| 5190 |
| 5191 /** |
| 5192 * Name of the executable. For setters, this includes the trailing "=". For |
| 5193 * named constructors, this excludes the class name and excludes the ".". |
| 5194 * For unnamed constructors, this is the empty string. |
| 5195 */ |
| 5196 void set name(String value) { |
| 5197 this._name = value; |
| 5198 } |
| 5199 |
| 5200 @override |
| 5201 int get nameEnd => _nameEnd ??= 0; |
| 5202 |
| 5203 /** |
| 5204 * If [kind] is [UnlinkedExecutableKind.constructor] and [name] is not empty, |
| 5205 * the offset of the end of the constructor name. Otherwise zero. |
| 5206 */ |
| 5207 void set nameEnd(int value) { |
| 5208 assert(value == null || value >= 0); |
| 5209 this._nameEnd = value; |
| 5210 } |
| 5211 |
| 5212 @override |
| 5213 int get nameOffset => _nameOffset ??= 0; |
| 5214 |
| 5215 /** |
| 5216 * Offset of the executable name relative to the beginning of the file. For |
| 5217 * named constructors, this excludes the class name and excludes the ".". |
| 5218 * For unnamed constructors, this is the offset of the class name (i.e. the |
| 5219 * offset of the second "C" in "class C { C(); }"). |
| 5220 */ |
| 5221 void set nameOffset(int value) { |
| 5222 assert(value == null || value >= 0); |
| 5223 this._nameOffset = value; |
| 5224 } |
| 5225 |
| 5226 @override |
| 5227 List<UnlinkedParamBuilder> get parameters => _parameters ??= <UnlinkedParamBui
lder>[]; |
| 5228 |
| 5229 /** |
| 5230 * Parameters of the executable, if any. Note that getters have no |
| 5231 * parameters (hence this will be the empty list), and setters have a single |
| 5232 * parameter. |
| 5233 */ |
| 5234 void set parameters(List<UnlinkedParamBuilder> value) { |
| 5235 this._parameters = value; |
| 5236 } |
| 5237 |
| 5238 @override |
| 5239 int get periodOffset => _periodOffset ??= 0; |
| 5240 |
| 5241 /** |
| 5242 * If [kind] is [UnlinkedExecutableKind.constructor] and [name] is not empty, |
| 5243 * the offset of the period before the constructor name. Otherwise zero. |
| 5244 */ |
| 5245 void set periodOffset(int value) { |
| 5246 assert(value == null || value >= 0); |
| 5247 this._periodOffset = value; |
| 5248 } |
| 5249 |
| 5250 @override |
| 5251 EntityRefBuilder get redirectedConstructor => _redirectedConstructor; |
| 5252 |
| 5253 /** |
| 5254 * If [isRedirectedConstructor] and [isFactory] are both `true`, the |
| 5255 * constructor to which this constructor redirects; otherwise empty. |
| 5256 */ |
| 5257 void set redirectedConstructor(EntityRefBuilder value) { |
| 5258 this._redirectedConstructor = value; |
| 5259 } |
| 5260 |
| 5261 @override |
| 5262 String get redirectedConstructorName => _redirectedConstructorName ??= ''; |
| 5263 |
| 5264 /** |
| 5265 * If [isRedirectedConstructor] is `true` and [isFactory] is `false`, the |
| 5266 * name of the constructor that this constructor redirects to; otherwise |
| 5267 * empty. |
| 5268 */ |
| 5269 void set redirectedConstructorName(String value) { |
| 5270 this._redirectedConstructorName = value; |
| 5271 } |
| 5272 |
| 5273 @override |
| 5274 EntityRefBuilder get returnType => _returnType; |
| 5275 |
| 5276 /** |
| 5277 * Declared return type of the executable. Absent if the executable is a |
| 5278 * constructor or the return type is implicit. Absent for executables |
| 5279 * associated with variable initializers and closures, since these |
| 5280 * executables may have return types that are not accessible via direct |
| 5281 * imports. |
| 5282 */ |
| 5283 void set returnType(EntityRefBuilder value) { |
| 5284 this._returnType = value; |
| 5285 } |
| 5286 |
| 5287 @override |
| 5288 List<UnlinkedTypeParamBuilder> get typeParameters => _typeParameters ??= <Unli
nkedTypeParamBuilder>[]; |
| 5289 |
| 5290 /** |
| 5291 * Type parameters of the executable, if any. Empty if support for generic |
| 5292 * method syntax is disabled. |
| 5293 */ |
| 5294 void set typeParameters(List<UnlinkedTypeParamBuilder> value) { |
| 5295 this._typeParameters = value; |
| 5296 } |
| 5297 |
| 5298 @override |
| 5299 int get visibleLength => _visibleLength ??= 0; |
| 5300 |
| 5301 /** |
| 5302 * If a local function, the length of the visible range; zero otherwise. |
| 5303 */ |
| 5304 void set visibleLength(int value) { |
| 5305 assert(value == null || value >= 0); |
| 5306 this._visibleLength = value; |
| 5307 } |
| 5308 |
| 5309 @override |
| 5310 int get visibleOffset => _visibleOffset ??= 0; |
| 5311 |
| 5312 /** |
| 5313 * If a local function, the beginning of the visible range; zero otherwise. |
| 5314 */ |
| 5315 void set visibleOffset(int value) { |
| 5316 assert(value == null || value >= 0); |
| 5317 this._visibleOffset = value; |
| 5318 } |
| 5319 |
| 5320 UnlinkedExecutableBuilder({List<UnlinkedConstBuilder> annotations, UnlinkedCon
stBuilder bodyExpr, CodeRangeBuilder codeRange, List<UnlinkedConstructorInitiali
zerBuilder> constantInitializers, int constCycleSlot, UnlinkedDocumentationComme
ntBuilder documentationComment, int inferredReturnTypeSlot, bool isAbstract, boo
l isAsynchronous, bool isConst, bool isExternal, bool isFactory, bool isGenerato
r, bool isRedirectedConstructor, bool isStatic, idl.UnlinkedExecutableKind kind,
List<UnlinkedExecutableBuilder> localFunctions, List<UnlinkedLabelBuilder> loca
lLabels, List<UnlinkedVariableBuilder> localVariables, String name, int nameEnd,
int nameOffset, List<UnlinkedParamBuilder> parameters, int periodOffset, Entity
RefBuilder redirectedConstructor, String redirectedConstructorName, EntityRefBui
lder returnType, List<UnlinkedTypeParamBuilder> typeParameters, int visibleLengt
h, int visibleOffset}) |
| 5321 : _annotations = annotations, |
| 5322 _bodyExpr = bodyExpr, |
| 5323 _codeRange = codeRange, |
| 5324 _constantInitializers = constantInitializers, |
| 5325 _constCycleSlot = constCycleSlot, |
| 5326 _documentationComment = documentationComment, |
| 5327 _inferredReturnTypeSlot = inferredReturnTypeSlot, |
| 5328 _isAbstract = isAbstract, |
| 5329 _isAsynchronous = isAsynchronous, |
| 5330 _isConst = isConst, |
| 5331 _isExternal = isExternal, |
| 5332 _isFactory = isFactory, |
| 5333 _isGenerator = isGenerator, |
| 5334 _isRedirectedConstructor = isRedirectedConstructor, |
| 5335 _isStatic = isStatic, |
| 5336 _kind = kind, |
| 5337 _localFunctions = localFunctions, |
| 5338 _localLabels = localLabels, |
| 5339 _localVariables = localVariables, |
| 5340 _name = name, |
| 5341 _nameEnd = nameEnd, |
| 5342 _nameOffset = nameOffset, |
| 5343 _parameters = parameters, |
| 5344 _periodOffset = periodOffset, |
| 5345 _redirectedConstructor = redirectedConstructor, |
| 5346 _redirectedConstructorName = redirectedConstructorName, |
| 5347 _returnType = returnType, |
| 5348 _typeParameters = typeParameters, |
| 5349 _visibleLength = visibleLength, |
| 5350 _visibleOffset = visibleOffset; |
| 5351 |
| 5352 /** |
| 5353 * Flush [informative] data recursively. |
| 5354 */ |
| 5355 void flushInformative() { |
| 5356 _annotations?.forEach((b) => b.flushInformative()); |
| 5357 _bodyExpr?.flushInformative(); |
| 5358 _codeRange = null; |
| 5359 _constantInitializers?.forEach((b) => b.flushInformative()); |
| 5360 _documentationComment = null; |
| 5361 _isAsynchronous = null; |
| 5362 _isGenerator = null; |
| 5363 _localFunctions?.forEach((b) => b.flushInformative()); |
| 5364 _localLabels = null; |
| 5365 _localVariables = null; |
| 5366 _nameEnd = null; |
| 5367 _nameOffset = null; |
| 5368 _parameters?.forEach((b) => b.flushInformative()); |
| 5369 _periodOffset = null; |
| 5370 _redirectedConstructor?.flushInformative(); |
| 5371 _returnType?.flushInformative(); |
| 5372 _typeParameters?.forEach((b) => b.flushInformative()); |
| 5373 } |
| 5374 |
| 5375 /** |
| 5376 * Accumulate non-[informative] data into [signature]. |
| 5377 */ |
| 5378 void collectApiSignature(api_sig.ApiSignature signature) { |
| 5379 signature.addString(this._name ?? ''); |
| 5380 if (this._parameters == null) { |
| 5381 signature.addInt(0); |
| 5382 } else { |
| 5383 signature.addInt(this._parameters.length); |
| 5384 for (var x in this._parameters) { |
| 5385 x?.collectApiSignature(signature); |
| 5386 } |
| 5387 } |
| 5388 signature.addBool(this._returnType != null); |
| 5389 this._returnType?.collectApiSignature(signature); |
| 5390 signature.addInt(this._kind == null ? 0 : this._kind.index); |
| 5391 signature.addInt(this._inferredReturnTypeSlot ?? 0); |
| 5392 if (this._annotations == null) { |
| 5393 signature.addInt(0); |
| 5394 } else { |
| 5395 signature.addInt(this._annotations.length); |
| 5396 for (var x in this._annotations) { |
| 5397 x?.collectApiSignature(signature); |
| 5398 } |
| 5399 } |
| 5400 signature.addBool(this._isFactory == true); |
| 5401 signature.addBool(this._isStatic == true); |
| 5402 signature.addBool(this._isAbstract == true); |
| 5403 signature.addBool(this._isExternal == true); |
| 5404 signature.addBool(this._isConst == true); |
| 5405 signature.addBool(this._isRedirectedConstructor == true); |
| 5406 if (this._constantInitializers == null) { |
| 5407 signature.addInt(0); |
| 5408 } else { |
| 5409 signature.addInt(this._constantInitializers.length); |
| 5410 for (var x in this._constantInitializers) { |
| 5411 x?.collectApiSignature(signature); |
| 5412 } |
| 5413 } |
| 5414 signature.addBool(this._redirectedConstructor != null); |
| 5415 this._redirectedConstructor?.collectApiSignature(signature); |
| 5416 if (this._typeParameters == null) { |
| 5417 signature.addInt(0); |
| 5418 } else { |
| 5419 signature.addInt(this._typeParameters.length); |
| 5420 for (var x in this._typeParameters) { |
| 5421 x?.collectApiSignature(signature); |
| 5422 } |
| 5423 } |
| 5424 signature.addString(this._redirectedConstructorName ?? ''); |
| 5425 if (this._localFunctions == null) { |
| 5426 signature.addInt(0); |
| 5427 } else { |
| 5428 signature.addInt(this._localFunctions.length); |
| 5429 for (var x in this._localFunctions) { |
| 5430 x?.collectApiSignature(signature); |
| 5431 } |
| 5432 } |
| 5433 signature.addInt(this._visibleLength ?? 0); |
| 5434 signature.addInt(this._visibleOffset ?? 0); |
| 5435 signature.addInt(this._constCycleSlot ?? 0); |
| 5436 signature.addBool(this._bodyExpr != null); |
| 5437 this._bodyExpr?.collectApiSignature(signature); |
| 5438 } |
| 5439 |
| 5440 fb.Offset finish(fb.Builder fbBuilder) { |
| 5441 fb.Offset offset_annotations; |
| 5442 fb.Offset offset_bodyExpr; |
| 5443 fb.Offset offset_codeRange; |
| 5444 fb.Offset offset_constantInitializers; |
| 5445 fb.Offset offset_documentationComment; |
| 5446 fb.Offset offset_localFunctions; |
| 5447 fb.Offset offset_localLabels; |
| 5448 fb.Offset offset_localVariables; |
| 5449 fb.Offset offset_name; |
| 5450 fb.Offset offset_parameters; |
| 5451 fb.Offset offset_redirectedConstructor; |
| 5452 fb.Offset offset_redirectedConstructorName; |
| 5453 fb.Offset offset_returnType; |
| 5454 fb.Offset offset_typeParameters; |
| 5455 if (!(_annotations == null || _annotations.isEmpty)) { |
| 5456 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); |
| 5457 } |
| 5458 if (_bodyExpr != null) { |
| 5459 offset_bodyExpr = _bodyExpr.finish(fbBuilder); |
| 5460 } |
| 5461 if (_codeRange != null) { |
| 5462 offset_codeRange = _codeRange.finish(fbBuilder); |
| 5463 } |
| 5464 if (!(_constantInitializers == null || _constantInitializers.isEmpty)) { |
| 5465 offset_constantInitializers = fbBuilder.writeList(_constantInitializers.ma
p((b) => b.finish(fbBuilder)).toList()); |
| 5466 } |
| 5467 if (_documentationComment != null) { |
| 5468 offset_documentationComment = _documentationComment.finish(fbBuilder); |
| 5469 } |
| 5470 if (!(_localFunctions == null || _localFunctions.isEmpty)) { |
| 5471 offset_localFunctions = fbBuilder.writeList(_localFunctions.map((b) => b.f
inish(fbBuilder)).toList()); |
| 5472 } |
| 5473 if (!(_localLabels == null || _localLabels.isEmpty)) { |
| 5474 offset_localLabels = fbBuilder.writeList(_localLabels.map((b) => b.finish(
fbBuilder)).toList()); |
| 5475 } |
| 5476 if (!(_localVariables == null || _localVariables.isEmpty)) { |
| 5477 offset_localVariables = fbBuilder.writeList(_localVariables.map((b) => b.f
inish(fbBuilder)).toList()); |
| 5478 } |
| 5479 if (_name != null) { |
| 5480 offset_name = fbBuilder.writeString(_name); |
| 5481 } |
| 5482 if (!(_parameters == null || _parameters.isEmpty)) { |
| 5483 offset_parameters = fbBuilder.writeList(_parameters.map((b) => b.finish(fb
Builder)).toList()); |
| 5484 } |
| 5485 if (_redirectedConstructor != null) { |
| 5486 offset_redirectedConstructor = _redirectedConstructor.finish(fbBuilder); |
| 5487 } |
| 5488 if (_redirectedConstructorName != null) { |
| 5489 offset_redirectedConstructorName = fbBuilder.writeString(_redirectedConstr
uctorName); |
| 5490 } |
| 5491 if (_returnType != null) { |
| 5492 offset_returnType = _returnType.finish(fbBuilder); |
| 5493 } |
| 5494 if (!(_typeParameters == null || _typeParameters.isEmpty)) { |
| 5495 offset_typeParameters = fbBuilder.writeList(_typeParameters.map((b) => b.f
inish(fbBuilder)).toList()); |
| 5496 } |
| 5497 fbBuilder.startTable(); |
| 5498 if (offset_annotations != null) { |
| 5499 fbBuilder.addOffset(6, offset_annotations); |
| 5500 } |
| 5501 if (offset_bodyExpr != null) { |
| 5502 fbBuilder.addOffset(29, offset_bodyExpr); |
| 5503 } |
| 5504 if (offset_codeRange != null) { |
| 5505 fbBuilder.addOffset(26, offset_codeRange); |
| 5506 } |
| 5507 if (offset_constantInitializers != null) { |
| 5508 fbBuilder.addOffset(14, offset_constantInitializers); |
| 5509 } |
| 5510 if (_constCycleSlot != null && _constCycleSlot != 0) { |
| 5511 fbBuilder.addUint32(25, _constCycleSlot); |
| 5512 } |
| 5513 if (offset_documentationComment != null) { |
| 5514 fbBuilder.addOffset(7, offset_documentationComment); |
| 5515 } |
| 5516 if (_inferredReturnTypeSlot != null && _inferredReturnTypeSlot != 0) { |
| 5517 fbBuilder.addUint32(5, _inferredReturnTypeSlot); |
| 5518 } |
| 5519 if (_isAbstract == true) { |
| 5520 fbBuilder.addBool(10, true); |
| 5521 } |
| 5522 if (_isAsynchronous == true) { |
| 5523 fbBuilder.addBool(27, true); |
| 5524 } |
| 5525 if (_isConst == true) { |
| 5526 fbBuilder.addBool(12, true); |
| 5527 } |
| 5528 if (_isExternal == true) { |
| 5529 fbBuilder.addBool(11, true); |
| 5530 } |
| 5531 if (_isFactory == true) { |
| 5532 fbBuilder.addBool(8, true); |
| 5533 } |
| 5534 if (_isGenerator == true) { |
| 5535 fbBuilder.addBool(28, true); |
| 5536 } |
| 5537 if (_isRedirectedConstructor == true) { |
| 5538 fbBuilder.addBool(13, true); |
| 5539 } |
| 5540 if (_isStatic == true) { |
| 5541 fbBuilder.addBool(9, true); |
| 5542 } |
| 5543 if (_kind != null && _kind != idl.UnlinkedExecutableKind.functionOrMethod) { |
| 5544 fbBuilder.addUint8(4, _kind.index); |
| 5545 } |
| 5546 if (offset_localFunctions != null) { |
| 5547 fbBuilder.addOffset(18, offset_localFunctions); |
| 5548 } |
| 5549 if (offset_localLabels != null) { |
| 5550 fbBuilder.addOffset(22, offset_localLabels); |
| 5551 } |
| 5552 if (offset_localVariables != null) { |
| 5553 fbBuilder.addOffset(19, offset_localVariables); |
| 5554 } |
| 5555 if (offset_name != null) { |
| 5556 fbBuilder.addOffset(1, offset_name); |
| 5557 } |
| 5558 if (_nameEnd != null && _nameEnd != 0) { |
| 5559 fbBuilder.addUint32(23, _nameEnd); |
| 5560 } |
| 5561 if (_nameOffset != null && _nameOffset != 0) { |
| 5562 fbBuilder.addUint32(0, _nameOffset); |
| 5563 } |
| 5564 if (offset_parameters != null) { |
| 5565 fbBuilder.addOffset(2, offset_parameters); |
| 5566 } |
| 5567 if (_periodOffset != null && _periodOffset != 0) { |
| 5568 fbBuilder.addUint32(24, _periodOffset); |
| 5569 } |
| 5570 if (offset_redirectedConstructor != null) { |
| 5571 fbBuilder.addOffset(15, offset_redirectedConstructor); |
| 5572 } |
| 5573 if (offset_redirectedConstructorName != null) { |
| 5574 fbBuilder.addOffset(17, offset_redirectedConstructorName); |
| 5575 } |
| 5576 if (offset_returnType != null) { |
| 5577 fbBuilder.addOffset(3, offset_returnType); |
| 5578 } |
| 5579 if (offset_typeParameters != null) { |
| 5580 fbBuilder.addOffset(16, offset_typeParameters); |
| 5581 } |
| 5582 if (_visibleLength != null && _visibleLength != 0) { |
| 5583 fbBuilder.addUint32(20, _visibleLength); |
| 5584 } |
| 5585 if (_visibleOffset != null && _visibleOffset != 0) { |
| 5586 fbBuilder.addUint32(21, _visibleOffset); |
| 5587 } |
| 5588 return fbBuilder.endTable(); |
| 5589 } |
| 5590 } |
| 5591 |
| 5592 class _UnlinkedExecutableReader extends fb.TableReader<_UnlinkedExecutableImpl>
{ |
| 5593 const _UnlinkedExecutableReader(); |
| 5594 |
| 5595 @override |
| 5596 _UnlinkedExecutableImpl createObject(fb.BufferContext bc, int offset) => new _
UnlinkedExecutableImpl(bc, offset); |
| 5597 } |
| 5598 |
| 5599 class _UnlinkedExecutableImpl extends Object with _UnlinkedExecutableMixin imple
ments idl.UnlinkedExecutable { |
| 5600 final fb.BufferContext _bc; |
| 5601 final int _bcOffset; |
| 5602 |
| 5603 _UnlinkedExecutableImpl(this._bc, this._bcOffset); |
| 5604 |
| 5605 List<idl.UnlinkedConst> _annotations; |
| 5606 idl.UnlinkedConst _bodyExpr; |
| 5607 idl.CodeRange _codeRange; |
| 5608 List<idl.UnlinkedConstructorInitializer> _constantInitializers; |
| 5609 int _constCycleSlot; |
| 5610 idl.UnlinkedDocumentationComment _documentationComment; |
| 5611 int _inferredReturnTypeSlot; |
| 5612 bool _isAbstract; |
| 5613 bool _isAsynchronous; |
| 5614 bool _isConst; |
| 5615 bool _isExternal; |
| 5616 bool _isFactory; |
| 5617 bool _isGenerator; |
| 5618 bool _isRedirectedConstructor; |
| 5619 bool _isStatic; |
| 5620 idl.UnlinkedExecutableKind _kind; |
| 5621 List<idl.UnlinkedExecutable> _localFunctions; |
| 5622 List<idl.UnlinkedLabel> _localLabels; |
| 5623 List<idl.UnlinkedVariable> _localVariables; |
| 5624 String _name; |
| 5625 int _nameEnd; |
| 5626 int _nameOffset; |
| 5627 List<idl.UnlinkedParam> _parameters; |
| 5628 int _periodOffset; |
| 5629 idl.EntityRef _redirectedConstructor; |
| 5630 String _redirectedConstructorName; |
| 5631 idl.EntityRef _returnType; |
| 5632 List<idl.UnlinkedTypeParam> _typeParameters; |
| 5633 int _visibleLength; |
| 5634 int _visibleOffset; |
| 5635 |
| 5636 @override |
| 5637 List<idl.UnlinkedConst> get annotations { |
| 5638 _annotations ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConst
Reader()).vTableGet(_bc, _bcOffset, 6, const <idl.UnlinkedConst>[]); |
| 5639 return _annotations; |
| 5640 } |
| 5641 |
| 5642 @override |
| 5643 idl.UnlinkedConst get bodyExpr { |
| 5644 _bodyExpr ??= const _UnlinkedConstReader().vTableGet(_bc, _bcOffset, 29, nul
l); |
| 5645 return _bodyExpr; |
| 5646 } |
| 5647 |
| 5648 @override |
| 5649 idl.CodeRange get codeRange { |
| 5650 _codeRange ??= const _CodeRangeReader().vTableGet(_bc, _bcOffset, 26, null); |
| 5651 return _codeRange; |
| 5652 } |
| 5653 |
| 5654 @override |
| 5655 List<idl.UnlinkedConstructorInitializer> get constantInitializers { |
| 5656 _constantInitializers ??= const fb.ListReader<idl.UnlinkedConstructorInitial
izer>(const _UnlinkedConstructorInitializerReader()).vTableGet(_bc, _bcOffset, 1
4, const <idl.UnlinkedConstructorInitializer>[]); |
| 5657 return _constantInitializers; |
| 5658 } |
| 5659 |
| 5660 @override |
| 5661 int get constCycleSlot { |
| 5662 _constCycleSlot ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 25, 0)
; |
| 5663 return _constCycleSlot; |
| 5664 } |
| 5665 |
| 5666 @override |
| 5667 idl.UnlinkedDocumentationComment get documentationComment { |
| 5668 _documentationComment ??= const _UnlinkedDocumentationCommentReader().vTable
Get(_bc, _bcOffset, 7, null); |
| 5669 return _documentationComment; |
| 5670 } |
| 5671 |
| 5672 @override |
| 5673 int get inferredReturnTypeSlot { |
| 5674 _inferredReturnTypeSlot ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset
, 5, 0); |
| 5675 return _inferredReturnTypeSlot; |
| 5676 } |
| 5677 |
| 5678 @override |
| 5679 bool get isAbstract { |
| 5680 _isAbstract ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 10, false); |
| 5681 return _isAbstract; |
| 5682 } |
| 5683 |
| 5684 @override |
| 5685 bool get isAsynchronous { |
| 5686 _isAsynchronous ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 27, fals
e); |
| 5687 return _isAsynchronous; |
| 5688 } |
| 5689 |
| 5690 @override |
| 5691 bool get isConst { |
| 5692 _isConst ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 12, false); |
| 5693 return _isConst; |
| 5694 } |
| 5695 |
| 5696 @override |
| 5697 bool get isExternal { |
| 5698 _isExternal ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 11, false); |
| 5699 return _isExternal; |
| 5700 } |
| 5701 |
| 5702 @override |
| 5703 bool get isFactory { |
| 5704 _isFactory ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 8, false); |
| 5705 return _isFactory; |
| 5706 } |
| 5707 |
| 5708 @override |
| 5709 bool get isGenerator { |
| 5710 _isGenerator ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 28, false); |
| 5711 return _isGenerator; |
| 5712 } |
| 5713 |
| 5714 @override |
| 5715 bool get isRedirectedConstructor { |
| 5716 _isRedirectedConstructor ??= const fb.BoolReader().vTableGet(_bc, _bcOffset,
13, false); |
| 5717 return _isRedirectedConstructor; |
| 5718 } |
| 5719 |
| 5720 @override |
| 5721 bool get isStatic { |
| 5722 _isStatic ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 9, false); |
| 5723 return _isStatic; |
| 5724 } |
| 5725 |
| 5726 @override |
| 5727 idl.UnlinkedExecutableKind get kind { |
| 5728 _kind ??= const _UnlinkedExecutableKindReader().vTableGet(_bc, _bcOffset, 4,
idl.UnlinkedExecutableKind.functionOrMethod); |
| 5729 return _kind; |
| 5730 } |
| 5731 |
| 5732 @override |
| 5733 List<idl.UnlinkedExecutable> get localFunctions { |
| 5734 _localFunctions ??= const fb.ListReader<idl.UnlinkedExecutable>(const _Unlin
kedExecutableReader()).vTableGet(_bc, _bcOffset, 18, const <idl.UnlinkedExecutab
le>[]); |
| 5735 return _localFunctions; |
| 5736 } |
| 5737 |
| 5738 @override |
| 5739 List<idl.UnlinkedLabel> get localLabels { |
| 5740 _localLabels ??= const fb.ListReader<idl.UnlinkedLabel>(const _UnlinkedLabel
Reader()).vTableGet(_bc, _bcOffset, 22, const <idl.UnlinkedLabel>[]); |
| 5741 return _localLabels; |
| 5742 } |
| 5743 |
| 5744 @override |
| 5745 List<idl.UnlinkedVariable> get localVariables { |
| 5746 _localVariables ??= const fb.ListReader<idl.UnlinkedVariable>(const _Unlinke
dVariableReader()).vTableGet(_bc, _bcOffset, 19, const <idl.UnlinkedVariable>[])
; |
| 5747 return _localVariables; |
| 5748 } |
| 5749 |
| 5750 @override |
| 5751 String get name { |
| 5752 _name ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 1, ''); |
| 5753 return _name; |
| 5754 } |
| 5755 |
| 5756 @override |
| 5757 int get nameEnd { |
| 5758 _nameEnd ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 23, 0); |
| 5759 return _nameEnd; |
| 5760 } |
| 5761 |
| 5762 @override |
| 5763 int get nameOffset { |
| 5764 _nameOffset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 0, 0); |
| 5765 return _nameOffset; |
| 5766 } |
| 5767 |
| 5768 @override |
| 5769 List<idl.UnlinkedParam> get parameters { |
| 5770 _parameters ??= const fb.ListReader<idl.UnlinkedParam>(const _UnlinkedParamR
eader()).vTableGet(_bc, _bcOffset, 2, const <idl.UnlinkedParam>[]); |
| 5771 return _parameters; |
| 5772 } |
| 5773 |
| 5774 @override |
| 5775 int get periodOffset { |
| 5776 _periodOffset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 24, 0); |
| 5777 return _periodOffset; |
| 5778 } |
| 5779 |
| 5780 @override |
| 5781 idl.EntityRef get redirectedConstructor { |
| 5782 _redirectedConstructor ??= const _EntityRefReader().vTableGet(_bc, _bcOffset
, 15, null); |
| 5783 return _redirectedConstructor; |
| 5784 } |
| 5785 |
| 5786 @override |
| 5787 String get redirectedConstructorName { |
| 5788 _redirectedConstructorName ??= const fb.StringReader().vTableGet(_bc, _bcOff
set, 17, ''); |
| 5789 return _redirectedConstructorName; |
| 5790 } |
| 5791 |
| 5792 @override |
| 5793 idl.EntityRef get returnType { |
| 5794 _returnType ??= const _EntityRefReader().vTableGet(_bc, _bcOffset, 3, null); |
| 5795 return _returnType; |
| 5796 } |
| 5797 |
| 5798 @override |
| 5799 List<idl.UnlinkedTypeParam> get typeParameters { |
| 5800 _typeParameters ??= const fb.ListReader<idl.UnlinkedTypeParam>(const _Unlink
edTypeParamReader()).vTableGet(_bc, _bcOffset, 16, const <idl.UnlinkedTypeParam>
[]); |
| 5801 return _typeParameters; |
| 5802 } |
| 5803 |
| 5804 @override |
| 5805 int get visibleLength { |
| 5806 _visibleLength ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 20, 0); |
| 5807 return _visibleLength; |
| 5808 } |
| 5809 |
| 5810 @override |
| 5811 int get visibleOffset { |
| 5812 _visibleOffset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 21, 0); |
| 5813 return _visibleOffset; |
| 5814 } |
| 5815 } |
| 5816 |
| 5817 abstract class _UnlinkedExecutableMixin implements idl.UnlinkedExecutable { |
| 5818 @override |
| 5819 Map<String, Object> toJson() { |
| 5820 Map<String, Object> _result = <String, Object>{}; |
| 5821 if (annotations.isNotEmpty) _result["annotations"] = annotations.map((_value
) => _value.toJson()).toList(); |
| 5822 if (bodyExpr != null) _result["bodyExpr"] = bodyExpr.toJson(); |
| 5823 if (codeRange != null) _result["codeRange"] = codeRange.toJson(); |
| 5824 if (constantInitializers.isNotEmpty) _result["constantInitializers"] = const
antInitializers.map((_value) => _value.toJson()).toList(); |
| 5825 if (constCycleSlot != 0) _result["constCycleSlot"] = constCycleSlot; |
| 5826 if (documentationComment != null) _result["documentationComment"] = document
ationComment.toJson(); |
| 5827 if (inferredReturnTypeSlot != 0) _result["inferredReturnTypeSlot"] = inferre
dReturnTypeSlot; |
| 5828 if (isAbstract != false) _result["isAbstract"] = isAbstract; |
| 5829 if (isAsynchronous != false) _result["isAsynchronous"] = isAsynchronous; |
| 5830 if (isConst != false) _result["isConst"] = isConst; |
| 5831 if (isExternal != false) _result["isExternal"] = isExternal; |
| 5832 if (isFactory != false) _result["isFactory"] = isFactory; |
| 5833 if (isGenerator != false) _result["isGenerator"] = isGenerator; |
| 5834 if (isRedirectedConstructor != false) _result["isRedirectedConstructor"] = i
sRedirectedConstructor; |
| 5835 if (isStatic != false) _result["isStatic"] = isStatic; |
| 5836 if (kind != idl.UnlinkedExecutableKind.functionOrMethod) _result["kind"] = k
ind.toString().split('.')[1]; |
| 5837 if (localFunctions.isNotEmpty) _result["localFunctions"] = localFunctions.ma
p((_value) => _value.toJson()).toList(); |
| 5838 if (localLabels.isNotEmpty) _result["localLabels"] = localLabels.map((_value
) => _value.toJson()).toList(); |
| 5839 if (localVariables.isNotEmpty) _result["localVariables"] = localVariables.ma
p((_value) => _value.toJson()).toList(); |
| 5840 if (name != '') _result["name"] = name; |
| 5841 if (nameEnd != 0) _result["nameEnd"] = nameEnd; |
| 5842 if (nameOffset != 0) _result["nameOffset"] = nameOffset; |
| 5843 if (parameters.isNotEmpty) _result["parameters"] = parameters.map((_value) =
> _value.toJson()).toList(); |
| 5844 if (periodOffset != 0) _result["periodOffset"] = periodOffset; |
| 5845 if (redirectedConstructor != null) _result["redirectedConstructor"] = redire
ctedConstructor.toJson(); |
| 5846 if (redirectedConstructorName != '') _result["redirectedConstructorName"] =
redirectedConstructorName; |
| 5847 if (returnType != null) _result["returnType"] = returnType.toJson(); |
| 5848 if (typeParameters.isNotEmpty) _result["typeParameters"] = typeParameters.ma
p((_value) => _value.toJson()).toList(); |
| 5849 if (visibleLength != 0) _result["visibleLength"] = visibleLength; |
| 5850 if (visibleOffset != 0) _result["visibleOffset"] = visibleOffset; |
| 5851 return _result; |
| 5852 } |
| 5853 |
| 5854 @override |
| 5855 Map<String, Object> toMap() => { |
| 5856 "annotations": annotations, |
| 5857 "bodyExpr": bodyExpr, |
| 5858 "codeRange": codeRange, |
| 5859 "constantInitializers": constantInitializers, |
| 5860 "constCycleSlot": constCycleSlot, |
| 5861 "documentationComment": documentationComment, |
| 5862 "inferredReturnTypeSlot": inferredReturnTypeSlot, |
| 5863 "isAbstract": isAbstract, |
| 5864 "isAsynchronous": isAsynchronous, |
| 5865 "isConst": isConst, |
| 5866 "isExternal": isExternal, |
| 5867 "isFactory": isFactory, |
| 5868 "isGenerator": isGenerator, |
| 5869 "isRedirectedConstructor": isRedirectedConstructor, |
| 5870 "isStatic": isStatic, |
| 5871 "kind": kind, |
| 5872 "localFunctions": localFunctions, |
| 5873 "localLabels": localLabels, |
| 5874 "localVariables": localVariables, |
| 5875 "name": name, |
| 5876 "nameEnd": nameEnd, |
| 5877 "nameOffset": nameOffset, |
| 5878 "parameters": parameters, |
| 5879 "periodOffset": periodOffset, |
| 5880 "redirectedConstructor": redirectedConstructor, |
| 5881 "redirectedConstructorName": redirectedConstructorName, |
| 5882 "returnType": returnType, |
| 5883 "typeParameters": typeParameters, |
| 5884 "visibleLength": visibleLength, |
| 5885 "visibleOffset": visibleOffset, |
| 5886 }; |
| 5887 |
| 5888 @override |
| 5889 String toString() => convert.JSON.encode(toJson()); |
| 5890 } |
| 5891 |
| 5892 class UnlinkedExportNonPublicBuilder extends Object with _UnlinkedExportNonPubli
cMixin implements idl.UnlinkedExportNonPublic { |
| 5893 List<UnlinkedConstBuilder> _annotations; |
| 5894 int _offset; |
| 5895 int _uriEnd; |
| 5896 int _uriOffset; |
| 5897 |
| 5898 @override |
| 5899 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; |
| 5900 |
| 5901 /** |
| 5902 * Annotations for this export directive. |
| 5903 */ |
| 5904 void set annotations(List<UnlinkedConstBuilder> value) { |
| 5905 this._annotations = value; |
| 5906 } |
| 5907 |
| 5908 @override |
| 5909 int get offset => _offset ??= 0; |
| 5910 |
| 5911 /** |
| 5912 * Offset of the "export" keyword. |
| 5913 */ |
| 5914 void set offset(int value) { |
| 5915 assert(value == null || value >= 0); |
| 5916 this._offset = value; |
| 5917 } |
| 5918 |
| 5919 @override |
| 5920 int get uriEnd => _uriEnd ??= 0; |
| 5921 |
| 5922 /** |
| 5923 * End of the URI string (including quotes) relative to the beginning of the |
| 5924 * file. |
| 5925 */ |
| 5926 void set uriEnd(int value) { |
| 5927 assert(value == null || value >= 0); |
| 5928 this._uriEnd = value; |
| 5929 } |
| 5930 |
| 5931 @override |
| 5932 int get uriOffset => _uriOffset ??= 0; |
| 5933 |
| 5934 /** |
| 5935 * Offset of the URI string (including quotes) relative to the beginning of |
| 5936 * the file. |
| 5937 */ |
| 5938 void set uriOffset(int value) { |
| 5939 assert(value == null || value >= 0); |
| 5940 this._uriOffset = value; |
| 5941 } |
| 5942 |
| 5943 UnlinkedExportNonPublicBuilder({List<UnlinkedConstBuilder> annotations, int of
fset, int uriEnd, int uriOffset}) |
| 5944 : _annotations = annotations, |
| 5945 _offset = offset, |
| 5946 _uriEnd = uriEnd, |
| 5947 _uriOffset = uriOffset; |
| 5948 |
| 5949 /** |
| 5950 * Flush [informative] data recursively. |
| 5951 */ |
| 5952 void flushInformative() { |
| 5953 _annotations?.forEach((b) => b.flushInformative()); |
| 5954 _offset = null; |
| 5955 _uriEnd = null; |
| 5956 _uriOffset = null; |
| 5957 } |
| 5958 |
| 5959 /** |
| 5960 * Accumulate non-[informative] data into [signature]. |
| 5961 */ |
| 5962 void collectApiSignature(api_sig.ApiSignature signature) { |
| 5963 if (this._annotations == null) { |
| 5964 signature.addInt(0); |
| 5965 } else { |
| 5966 signature.addInt(this._annotations.length); |
| 5967 for (var x in this._annotations) { |
| 5968 x?.collectApiSignature(signature); |
| 5969 } |
| 5970 } |
| 5971 } |
| 5972 |
| 5973 fb.Offset finish(fb.Builder fbBuilder) { |
| 5974 fb.Offset offset_annotations; |
| 5975 if (!(_annotations == null || _annotations.isEmpty)) { |
| 5976 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); |
| 5977 } |
| 5978 fbBuilder.startTable(); |
| 5979 if (offset_annotations != null) { |
| 5980 fbBuilder.addOffset(3, offset_annotations); |
| 5981 } |
| 5982 if (_offset != null && _offset != 0) { |
| 5983 fbBuilder.addUint32(0, _offset); |
| 5984 } |
| 5985 if (_uriEnd != null && _uriEnd != 0) { |
| 5986 fbBuilder.addUint32(1, _uriEnd); |
| 5987 } |
| 5988 if (_uriOffset != null && _uriOffset != 0) { |
| 5989 fbBuilder.addUint32(2, _uriOffset); |
| 5990 } |
| 5991 return fbBuilder.endTable(); |
| 5992 } |
| 5993 } |
| 5994 |
| 5995 class _UnlinkedExportNonPublicReader extends fb.TableReader<_UnlinkedExportNonPu
blicImpl> { |
| 5996 const _UnlinkedExportNonPublicReader(); |
| 5997 |
| 5998 @override |
| 5999 _UnlinkedExportNonPublicImpl createObject(fb.BufferContext bc, int offset) =>
new _UnlinkedExportNonPublicImpl(bc, offset); |
| 6000 } |
| 6001 |
| 6002 class _UnlinkedExportNonPublicImpl extends Object with _UnlinkedExportNonPublicM
ixin implements idl.UnlinkedExportNonPublic { |
| 6003 final fb.BufferContext _bc; |
| 6004 final int _bcOffset; |
| 6005 |
| 6006 _UnlinkedExportNonPublicImpl(this._bc, this._bcOffset); |
| 6007 |
| 6008 List<idl.UnlinkedConst> _annotations; |
| 6009 int _offset; |
| 6010 int _uriEnd; |
| 6011 int _uriOffset; |
| 6012 |
| 6013 @override |
| 6014 List<idl.UnlinkedConst> get annotations { |
| 6015 _annotations ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConst
Reader()).vTableGet(_bc, _bcOffset, 3, const <idl.UnlinkedConst>[]); |
| 6016 return _annotations; |
| 6017 } |
| 6018 |
| 6019 @override |
| 6020 int get offset { |
| 6021 _offset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 0, 0); |
| 6022 return _offset; |
| 6023 } |
| 6024 |
| 6025 @override |
| 6026 int get uriEnd { |
| 6027 _uriEnd ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 1, 0); |
| 6028 return _uriEnd; |
| 6029 } |
| 6030 |
| 6031 @override |
| 6032 int get uriOffset { |
| 6033 _uriOffset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 2, 0); |
| 6034 return _uriOffset; |
| 6035 } |
| 6036 } |
| 6037 |
| 6038 abstract class _UnlinkedExportNonPublicMixin implements idl.UnlinkedExportNonPub
lic { |
| 6039 @override |
| 6040 Map<String, Object> toJson() { |
| 6041 Map<String, Object> _result = <String, Object>{}; |
| 6042 if (annotations.isNotEmpty) _result["annotations"] = annotations.map((_value
) => _value.toJson()).toList(); |
| 6043 if (offset != 0) _result["offset"] = offset; |
| 6044 if (uriEnd != 0) _result["uriEnd"] = uriEnd; |
| 6045 if (uriOffset != 0) _result["uriOffset"] = uriOffset; |
| 6046 return _result; |
| 6047 } |
| 6048 |
| 6049 @override |
| 6050 Map<String, Object> toMap() => { |
| 6051 "annotations": annotations, |
| 6052 "offset": offset, |
| 6053 "uriEnd": uriEnd, |
| 6054 "uriOffset": uriOffset, |
| 6055 }; |
| 6056 |
| 6057 @override |
| 6058 String toString() => convert.JSON.encode(toJson()); |
| 6059 } |
| 6060 |
| 6061 class UnlinkedExportPublicBuilder extends Object with _UnlinkedExportPublicMixin
implements idl.UnlinkedExportPublic { |
| 6062 List<UnlinkedCombinatorBuilder> _combinators; |
| 6063 List<UnlinkedConfigurationBuilder> _configurations; |
| 6064 String _uri; |
| 6065 |
| 6066 @override |
| 6067 List<UnlinkedCombinatorBuilder> get combinators => _combinators ??= <UnlinkedC
ombinatorBuilder>[]; |
| 6068 |
| 6069 /** |
| 6070 * Combinators contained in this export declaration. |
| 6071 */ |
| 6072 void set combinators(List<UnlinkedCombinatorBuilder> value) { |
| 6073 this._combinators = value; |
| 6074 } |
| 6075 |
| 6076 @override |
| 6077 List<UnlinkedConfigurationBuilder> get configurations => _configurations ??= <
UnlinkedConfigurationBuilder>[]; |
| 6078 |
| 6079 /** |
| 6080 * Configurations used to control which library will actually be loaded at |
| 6081 * run-time. |
| 6082 */ |
| 6083 void set configurations(List<UnlinkedConfigurationBuilder> value) { |
| 6084 this._configurations = value; |
| 6085 } |
| 6086 |
| 6087 @override |
| 6088 String get uri => _uri ??= ''; |
| 6089 |
| 6090 /** |
| 6091 * URI used in the source code to reference the exported library. |
| 6092 */ |
| 6093 void set uri(String value) { |
| 6094 this._uri = value; |
| 6095 } |
| 6096 |
| 6097 UnlinkedExportPublicBuilder({List<UnlinkedCombinatorBuilder> combinators, List
<UnlinkedConfigurationBuilder> configurations, String uri}) |
| 6098 : _combinators = combinators, |
| 6099 _configurations = configurations, |
| 6100 _uri = uri; |
| 6101 |
| 6102 /** |
| 6103 * Flush [informative] data recursively. |
| 6104 */ |
| 6105 void flushInformative() { |
| 6106 _combinators?.forEach((b) => b.flushInformative()); |
| 6107 _configurations?.forEach((b) => b.flushInformative()); |
| 6108 } |
| 6109 |
| 6110 /** |
| 6111 * Accumulate non-[informative] data into [signature]. |
| 6112 */ |
| 6113 void collectApiSignature(api_sig.ApiSignature signature) { |
| 6114 signature.addString(this._uri ?? ''); |
| 6115 if (this._combinators == null) { |
| 6116 signature.addInt(0); |
| 6117 } else { |
| 6118 signature.addInt(this._combinators.length); |
| 6119 for (var x in this._combinators) { |
| 6120 x?.collectApiSignature(signature); |
| 6121 } |
| 6122 } |
| 6123 if (this._configurations == null) { |
| 6124 signature.addInt(0); |
| 6125 } else { |
| 6126 signature.addInt(this._configurations.length); |
| 6127 for (var x in this._configurations) { |
| 6128 x?.collectApiSignature(signature); |
| 6129 } |
| 6130 } |
| 6131 } |
| 6132 |
| 6133 fb.Offset finish(fb.Builder fbBuilder) { |
| 6134 fb.Offset offset_combinators; |
| 6135 fb.Offset offset_configurations; |
| 6136 fb.Offset offset_uri; |
| 6137 if (!(_combinators == null || _combinators.isEmpty)) { |
| 6138 offset_combinators = fbBuilder.writeList(_combinators.map((b) => b.finish(
fbBuilder)).toList()); |
| 6139 } |
| 6140 if (!(_configurations == null || _configurations.isEmpty)) { |
| 6141 offset_configurations = fbBuilder.writeList(_configurations.map((b) => b.f
inish(fbBuilder)).toList()); |
| 6142 } |
| 6143 if (_uri != null) { |
| 6144 offset_uri = fbBuilder.writeString(_uri); |
| 6145 } |
| 6146 fbBuilder.startTable(); |
| 6147 if (offset_combinators != null) { |
| 6148 fbBuilder.addOffset(1, offset_combinators); |
| 6149 } |
| 6150 if (offset_configurations != null) { |
| 6151 fbBuilder.addOffset(2, offset_configurations); |
| 6152 } |
| 6153 if (offset_uri != null) { |
| 6154 fbBuilder.addOffset(0, offset_uri); |
| 6155 } |
| 6156 return fbBuilder.endTable(); |
| 6157 } |
| 6158 } |
| 6159 |
| 6160 class _UnlinkedExportPublicReader extends fb.TableReader<_UnlinkedExportPublicIm
pl> { |
| 6161 const _UnlinkedExportPublicReader(); |
| 6162 |
| 6163 @override |
| 6164 _UnlinkedExportPublicImpl createObject(fb.BufferContext bc, int offset) => new
_UnlinkedExportPublicImpl(bc, offset); |
| 6165 } |
| 6166 |
| 6167 class _UnlinkedExportPublicImpl extends Object with _UnlinkedExportPublicMixin i
mplements idl.UnlinkedExportPublic { |
| 6168 final fb.BufferContext _bc; |
| 6169 final int _bcOffset; |
| 6170 |
| 6171 _UnlinkedExportPublicImpl(this._bc, this._bcOffset); |
| 6172 |
| 6173 List<idl.UnlinkedCombinator> _combinators; |
| 6174 List<idl.UnlinkedConfiguration> _configurations; |
| 6175 String _uri; |
| 6176 |
| 6177 @override |
| 6178 List<idl.UnlinkedCombinator> get combinators { |
| 6179 _combinators ??= const fb.ListReader<idl.UnlinkedCombinator>(const _Unlinked
CombinatorReader()).vTableGet(_bc, _bcOffset, 1, const <idl.UnlinkedCombinator>[
]); |
| 6180 return _combinators; |
| 6181 } |
| 6182 |
| 6183 @override |
| 6184 List<idl.UnlinkedConfiguration> get configurations { |
| 6185 _configurations ??= const fb.ListReader<idl.UnlinkedConfiguration>(const _Un
linkedConfigurationReader()).vTableGet(_bc, _bcOffset, 2, const <idl.UnlinkedCon
figuration>[]); |
| 6186 return _configurations; |
| 6187 } |
| 6188 |
| 6189 @override |
| 6190 String get uri { |
| 6191 _uri ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, ''); |
| 6192 return _uri; |
| 6193 } |
| 6194 } |
| 6195 |
| 6196 abstract class _UnlinkedExportPublicMixin implements idl.UnlinkedExportPublic { |
| 6197 @override |
| 6198 Map<String, Object> toJson() { |
| 6199 Map<String, Object> _result = <String, Object>{}; |
| 6200 if (combinators.isNotEmpty) _result["combinators"] = combinators.map((_value
) => _value.toJson()).toList(); |
| 6201 if (configurations.isNotEmpty) _result["configurations"] = configurations.ma
p((_value) => _value.toJson()).toList(); |
| 6202 if (uri != '') _result["uri"] = uri; |
| 6203 return _result; |
| 6204 } |
| 6205 |
| 6206 @override |
| 6207 Map<String, Object> toMap() => { |
| 6208 "combinators": combinators, |
| 6209 "configurations": configurations, |
| 6210 "uri": uri, |
| 6211 }; |
| 6212 |
| 6213 @override |
| 6214 String toString() => convert.JSON.encode(toJson()); |
| 6215 } |
| 6216 |
| 6217 class UnlinkedImportBuilder extends Object with _UnlinkedImportMixin implements
idl.UnlinkedImport { |
| 6218 List<UnlinkedConstBuilder> _annotations; |
| 6219 List<UnlinkedCombinatorBuilder> _combinators; |
| 6220 List<UnlinkedConfigurationBuilder> _configurations; |
| 6221 bool _isDeferred; |
| 6222 bool _isImplicit; |
| 6223 int _offset; |
| 6224 int _prefixOffset; |
| 6225 int _prefixReference; |
| 6226 String _uri; |
| 6227 int _uriEnd; |
| 6228 int _uriOffset; |
| 6229 |
| 6230 @override |
| 6231 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; |
| 6232 |
| 6233 /** |
| 6234 * Annotations for this import declaration. |
| 6235 */ |
| 6236 void set annotations(List<UnlinkedConstBuilder> value) { |
| 6237 this._annotations = value; |
| 6238 } |
| 6239 |
| 6240 @override |
| 6241 List<UnlinkedCombinatorBuilder> get combinators => _combinators ??= <UnlinkedC
ombinatorBuilder>[]; |
| 6242 |
| 6243 /** |
| 6244 * Combinators contained in this import declaration. |
| 6245 */ |
| 6246 void set combinators(List<UnlinkedCombinatorBuilder> value) { |
| 6247 this._combinators = value; |
| 6248 } |
| 6249 |
| 6250 @override |
| 6251 List<UnlinkedConfigurationBuilder> get configurations => _configurations ??= <
UnlinkedConfigurationBuilder>[]; |
| 6252 |
| 6253 /** |
| 6254 * Configurations used to control which library will actually be loaded at |
| 6255 * run-time. |
| 6256 */ |
| 6257 void set configurations(List<UnlinkedConfigurationBuilder> value) { |
| 6258 this._configurations = value; |
| 6259 } |
| 6260 |
| 6261 @override |
| 6262 bool get isDeferred => _isDeferred ??= false; |
| 6263 |
| 6264 /** |
| 6265 * Indicates whether the import declaration uses the `deferred` keyword. |
| 6266 */ |
| 6267 void set isDeferred(bool value) { |
| 6268 this._isDeferred = value; |
| 6269 } |
| 6270 |
| 6271 @override |
| 6272 bool get isImplicit => _isImplicit ??= false; |
| 6273 |
| 6274 /** |
| 6275 * Indicates whether the import declaration is implicit. |
| 6276 */ |
| 6277 void set isImplicit(bool value) { |
| 6278 this._isImplicit = value; |
| 6279 } |
| 6280 |
| 6281 @override |
| 6282 int get offset => _offset ??= 0; |
| 6283 |
| 6284 /** |
| 6285 * If [isImplicit] is false, offset of the "import" keyword. If [isImplicit] |
| 6286 * is true, zero. |
| 6287 */ |
| 6288 void set offset(int value) { |
| 6289 assert(value == null || value >= 0); |
| 6290 this._offset = value; |
| 6291 } |
| 6292 |
| 6293 @override |
| 6294 int get prefixOffset => _prefixOffset ??= 0; |
| 6295 |
| 6296 /** |
| 6297 * Offset of the prefix name relative to the beginning of the file, or zero |
| 6298 * if there is no prefix. |
| 6299 */ |
| 6300 void set prefixOffset(int value) { |
| 6301 assert(value == null || value >= 0); |
| 6302 this._prefixOffset = value; |
| 6303 } |
| 6304 |
| 6305 @override |
| 6306 int get prefixReference => _prefixReference ??= 0; |
| 6307 |
| 6308 /** |
| 6309 * Index into [UnlinkedUnit.references] of the prefix declared by this |
| 6310 * import declaration, or zero if this import declaration declares no prefix. |
| 6311 * |
| 6312 * Note that multiple imports can declare the same prefix. |
| 6313 */ |
| 6314 void set prefixReference(int value) { |
| 6315 assert(value == null || value >= 0); |
| 6316 this._prefixReference = value; |
| 6317 } |
| 6318 |
| 6319 @override |
| 6320 String get uri => _uri ??= ''; |
| 6321 |
| 6322 /** |
| 6323 * URI used in the source code to reference the imported library. |
| 6324 */ |
| 6325 void set uri(String value) { |
| 6326 this._uri = value; |
| 6327 } |
| 6328 |
| 6329 @override |
| 6330 int get uriEnd => _uriEnd ??= 0; |
| 6331 |
| 6332 /** |
| 6333 * End of the URI string (including quotes) relative to the beginning of the |
| 6334 * file. If [isImplicit] is true, zero. |
| 6335 */ |
| 6336 void set uriEnd(int value) { |
| 6337 assert(value == null || value >= 0); |
| 6338 this._uriEnd = value; |
| 6339 } |
| 6340 |
| 6341 @override |
| 6342 int get uriOffset => _uriOffset ??= 0; |
| 6343 |
| 6344 /** |
| 6345 * Offset of the URI string (including quotes) relative to the beginning of |
| 6346 * the file. If [isImplicit] is true, zero. |
| 6347 */ |
| 6348 void set uriOffset(int value) { |
| 6349 assert(value == null || value >= 0); |
| 6350 this._uriOffset = value; |
| 6351 } |
| 6352 |
| 6353 UnlinkedImportBuilder({List<UnlinkedConstBuilder> annotations, List<UnlinkedCo
mbinatorBuilder> combinators, List<UnlinkedConfigurationBuilder> configurations,
bool isDeferred, bool isImplicit, int offset, int prefixOffset, int prefixRefer
ence, String uri, int uriEnd, int uriOffset}) |
| 6354 : _annotations = annotations, |
| 6355 _combinators = combinators, |
| 6356 _configurations = configurations, |
| 6357 _isDeferred = isDeferred, |
| 6358 _isImplicit = isImplicit, |
| 6359 _offset = offset, |
| 6360 _prefixOffset = prefixOffset, |
| 6361 _prefixReference = prefixReference, |
| 6362 _uri = uri, |
| 6363 _uriEnd = uriEnd, |
| 6364 _uriOffset = uriOffset; |
| 6365 |
| 6366 /** |
| 6367 * Flush [informative] data recursively. |
| 6368 */ |
| 6369 void flushInformative() { |
| 6370 _annotations?.forEach((b) => b.flushInformative()); |
| 6371 _combinators?.forEach((b) => b.flushInformative()); |
| 6372 _configurations?.forEach((b) => b.flushInformative()); |
| 6373 _offset = null; |
| 6374 _prefixOffset = null; |
| 6375 _uriEnd = null; |
| 6376 _uriOffset = null; |
| 6377 } |
| 6378 |
| 6379 /** |
| 6380 * Accumulate non-[informative] data into [signature]. |
| 6381 */ |
| 6382 void collectApiSignature(api_sig.ApiSignature signature) { |
| 6383 signature.addString(this._uri ?? ''); |
| 6384 if (this._combinators == null) { |
| 6385 signature.addInt(0); |
| 6386 } else { |
| 6387 signature.addInt(this._combinators.length); |
| 6388 for (var x in this._combinators) { |
| 6389 x?.collectApiSignature(signature); |
| 6390 } |
| 6391 } |
| 6392 signature.addBool(this._isImplicit == true); |
| 6393 signature.addInt(this._prefixReference ?? 0); |
| 6394 if (this._annotations == null) { |
| 6395 signature.addInt(0); |
| 6396 } else { |
| 6397 signature.addInt(this._annotations.length); |
| 6398 for (var x in this._annotations) { |
| 6399 x?.collectApiSignature(signature); |
| 6400 } |
| 6401 } |
| 6402 signature.addBool(this._isDeferred == true); |
| 6403 if (this._configurations == null) { |
| 6404 signature.addInt(0); |
| 6405 } else { |
| 6406 signature.addInt(this._configurations.length); |
| 6407 for (var x in this._configurations) { |
| 6408 x?.collectApiSignature(signature); |
| 6409 } |
| 6410 } |
| 6411 } |
| 6412 |
| 6413 fb.Offset finish(fb.Builder fbBuilder) { |
| 6414 fb.Offset offset_annotations; |
| 6415 fb.Offset offset_combinators; |
| 6416 fb.Offset offset_configurations; |
| 6417 fb.Offset offset_uri; |
| 6418 if (!(_annotations == null || _annotations.isEmpty)) { |
| 6419 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); |
| 6420 } |
| 6421 if (!(_combinators == null || _combinators.isEmpty)) { |
| 6422 offset_combinators = fbBuilder.writeList(_combinators.map((b) => b.finish(
fbBuilder)).toList()); |
| 6423 } |
| 6424 if (!(_configurations == null || _configurations.isEmpty)) { |
| 6425 offset_configurations = fbBuilder.writeList(_configurations.map((b) => b.f
inish(fbBuilder)).toList()); |
| 6426 } |
| 6427 if (_uri != null) { |
| 6428 offset_uri = fbBuilder.writeString(_uri); |
| 6429 } |
| 6430 fbBuilder.startTable(); |
| 6431 if (offset_annotations != null) { |
| 6432 fbBuilder.addOffset(8, offset_annotations); |
| 6433 } |
| 6434 if (offset_combinators != null) { |
| 6435 fbBuilder.addOffset(4, offset_combinators); |
| 6436 } |
| 6437 if (offset_configurations != null) { |
| 6438 fbBuilder.addOffset(10, offset_configurations); |
| 6439 } |
| 6440 if (_isDeferred == true) { |
| 6441 fbBuilder.addBool(9, true); |
| 6442 } |
| 6443 if (_isImplicit == true) { |
| 6444 fbBuilder.addBool(5, true); |
| 6445 } |
| 6446 if (_offset != null && _offset != 0) { |
| 6447 fbBuilder.addUint32(0, _offset); |
| 6448 } |
| 6449 if (_prefixOffset != null && _prefixOffset != 0) { |
| 6450 fbBuilder.addUint32(6, _prefixOffset); |
| 6451 } |
| 6452 if (_prefixReference != null && _prefixReference != 0) { |
| 6453 fbBuilder.addUint32(7, _prefixReference); |
| 6454 } |
| 6455 if (offset_uri != null) { |
| 6456 fbBuilder.addOffset(1, offset_uri); |
| 6457 } |
| 6458 if (_uriEnd != null && _uriEnd != 0) { |
| 6459 fbBuilder.addUint32(2, _uriEnd); |
| 6460 } |
| 6461 if (_uriOffset != null && _uriOffset != 0) { |
| 6462 fbBuilder.addUint32(3, _uriOffset); |
| 6463 } |
| 6464 return fbBuilder.endTable(); |
| 6465 } |
| 6466 } |
| 6467 |
| 6468 class _UnlinkedImportReader extends fb.TableReader<_UnlinkedImportImpl> { |
| 6469 const _UnlinkedImportReader(); |
| 6470 |
| 6471 @override |
| 6472 _UnlinkedImportImpl createObject(fb.BufferContext bc, int offset) => new _Unli
nkedImportImpl(bc, offset); |
| 6473 } |
| 6474 |
| 6475 class _UnlinkedImportImpl extends Object with _UnlinkedImportMixin implements id
l.UnlinkedImport { |
| 6476 final fb.BufferContext _bc; |
| 6477 final int _bcOffset; |
| 6478 |
| 6479 _UnlinkedImportImpl(this._bc, this._bcOffset); |
| 6480 |
| 6481 List<idl.UnlinkedConst> _annotations; |
| 6482 List<idl.UnlinkedCombinator> _combinators; |
| 6483 List<idl.UnlinkedConfiguration> _configurations; |
| 6484 bool _isDeferred; |
| 6485 bool _isImplicit; |
| 6486 int _offset; |
| 6487 int _prefixOffset; |
| 6488 int _prefixReference; |
| 6489 String _uri; |
| 6490 int _uriEnd; |
| 6491 int _uriOffset; |
| 6492 |
| 6493 @override |
| 6494 List<idl.UnlinkedConst> get annotations { |
| 6495 _annotations ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConst
Reader()).vTableGet(_bc, _bcOffset, 8, const <idl.UnlinkedConst>[]); |
| 6496 return _annotations; |
| 6497 } |
| 6498 |
| 6499 @override |
| 6500 List<idl.UnlinkedCombinator> get combinators { |
| 6501 _combinators ??= const fb.ListReader<idl.UnlinkedCombinator>(const _Unlinked
CombinatorReader()).vTableGet(_bc, _bcOffset, 4, const <idl.UnlinkedCombinator>[
]); |
| 6502 return _combinators; |
| 6503 } |
| 6504 |
| 6505 @override |
| 6506 List<idl.UnlinkedConfiguration> get configurations { |
| 6507 _configurations ??= const fb.ListReader<idl.UnlinkedConfiguration>(const _Un
linkedConfigurationReader()).vTableGet(_bc, _bcOffset, 10, const <idl.UnlinkedCo
nfiguration>[]); |
| 6508 return _configurations; |
| 6509 } |
| 6510 |
| 6511 @override |
| 6512 bool get isDeferred { |
| 6513 _isDeferred ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 9, false); |
| 6514 return _isDeferred; |
| 6515 } |
| 6516 |
| 6517 @override |
| 6518 bool get isImplicit { |
| 6519 _isImplicit ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 5, false); |
| 6520 return _isImplicit; |
| 6521 } |
| 6522 |
| 6523 @override |
| 6524 int get offset { |
| 6525 _offset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 0, 0); |
| 6526 return _offset; |
| 6527 } |
| 6528 |
| 6529 @override |
| 6530 int get prefixOffset { |
| 6531 _prefixOffset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 6, 0); |
| 6532 return _prefixOffset; |
| 6533 } |
| 6534 |
| 6535 @override |
| 6536 int get prefixReference { |
| 6537 _prefixReference ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 7, 0)
; |
| 6538 return _prefixReference; |
| 6539 } |
| 6540 |
| 6541 @override |
| 6542 String get uri { |
| 6543 _uri ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 1, ''); |
| 6544 return _uri; |
| 6545 } |
| 6546 |
| 6547 @override |
| 6548 int get uriEnd { |
| 6549 _uriEnd ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 2, 0); |
| 6550 return _uriEnd; |
| 6551 } |
| 6552 |
| 6553 @override |
| 6554 int get uriOffset { |
| 6555 _uriOffset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 3, 0); |
| 6556 return _uriOffset; |
| 6557 } |
| 6558 } |
| 6559 |
| 6560 abstract class _UnlinkedImportMixin implements idl.UnlinkedImport { |
| 6561 @override |
| 6562 Map<String, Object> toJson() { |
| 6563 Map<String, Object> _result = <String, Object>{}; |
| 6564 if (annotations.isNotEmpty) _result["annotations"] = annotations.map((_value
) => _value.toJson()).toList(); |
| 6565 if (combinators.isNotEmpty) _result["combinators"] = combinators.map((_value
) => _value.toJson()).toList(); |
| 6566 if (configurations.isNotEmpty) _result["configurations"] = configurations.ma
p((_value) => _value.toJson()).toList(); |
| 6567 if (isDeferred != false) _result["isDeferred"] = isDeferred; |
| 6568 if (isImplicit != false) _result["isImplicit"] = isImplicit; |
| 6569 if (offset != 0) _result["offset"] = offset; |
| 6570 if (prefixOffset != 0) _result["prefixOffset"] = prefixOffset; |
| 6571 if (prefixReference != 0) _result["prefixReference"] = prefixReference; |
| 6572 if (uri != '') _result["uri"] = uri; |
| 6573 if (uriEnd != 0) _result["uriEnd"] = uriEnd; |
| 6574 if (uriOffset != 0) _result["uriOffset"] = uriOffset; |
| 6575 return _result; |
| 6576 } |
| 6577 |
| 6578 @override |
| 6579 Map<String, Object> toMap() => { |
| 6580 "annotations": annotations, |
| 6581 "combinators": combinators, |
| 6582 "configurations": configurations, |
| 6583 "isDeferred": isDeferred, |
| 6584 "isImplicit": isImplicit, |
| 6585 "offset": offset, |
| 6586 "prefixOffset": prefixOffset, |
| 6587 "prefixReference": prefixReference, |
| 6588 "uri": uri, |
| 6589 "uriEnd": uriEnd, |
| 6590 "uriOffset": uriOffset, |
| 6591 }; |
| 6592 |
| 6593 @override |
| 6594 String toString() => convert.JSON.encode(toJson()); |
| 6595 } |
| 6596 |
| 6597 class UnlinkedLabelBuilder extends Object with _UnlinkedLabelMixin implements id
l.UnlinkedLabel { |
| 6598 bool _isOnSwitchMember; |
| 6599 bool _isOnSwitchStatement; |
| 6600 String _name; |
| 6601 int _nameOffset; |
| 6602 |
| 6603 @override |
| 6604 bool get isOnSwitchMember => _isOnSwitchMember ??= false; |
| 6605 |
| 6606 /** |
| 6607 * Return `true` if this label is associated with a `switch` member (`case` or |
| 6608 * `default`). |
| 6609 */ |
| 6610 void set isOnSwitchMember(bool value) { |
| 6611 this._isOnSwitchMember = value; |
| 6612 } |
| 6613 |
| 6614 @override |
| 6615 bool get isOnSwitchStatement => _isOnSwitchStatement ??= false; |
| 6616 |
| 6617 /** |
| 6618 * Return `true` if this label is associated with a `switch` statement. |
| 6619 */ |
| 6620 void set isOnSwitchStatement(bool value) { |
| 6621 this._isOnSwitchStatement = value; |
| 6622 } |
| 6623 |
| 6624 @override |
| 6625 String get name => _name ??= ''; |
| 6626 |
| 6627 /** |
| 6628 * Name of the label. |
| 6629 */ |
| 6630 void set name(String value) { |
| 6631 this._name = value; |
| 6632 } |
| 6633 |
| 6634 @override |
| 6635 int get nameOffset => _nameOffset ??= 0; |
| 6636 |
| 6637 /** |
| 6638 * Offset of the label relative to the beginning of the file. |
| 6639 */ |
| 6640 void set nameOffset(int value) { |
| 6641 assert(value == null || value >= 0); |
| 6642 this._nameOffset = value; |
| 6643 } |
| 6644 |
| 6645 UnlinkedLabelBuilder({bool isOnSwitchMember, bool isOnSwitchStatement, String
name, int nameOffset}) |
| 6646 : _isOnSwitchMember = isOnSwitchMember, |
| 6647 _isOnSwitchStatement = isOnSwitchStatement, |
| 6648 _name = name, |
| 6649 _nameOffset = nameOffset; |
| 6650 |
| 6651 /** |
| 6652 * Flush [informative] data recursively. |
| 6653 */ |
| 6654 void flushInformative() { |
| 6655 _nameOffset = null; |
| 6656 } |
| 6657 |
| 6658 /** |
| 6659 * Accumulate non-[informative] data into [signature]. |
| 6660 */ |
| 6661 void collectApiSignature(api_sig.ApiSignature signature) { |
| 6662 signature.addString(this._name ?? ''); |
| 6663 signature.addBool(this._isOnSwitchMember == true); |
| 6664 signature.addBool(this._isOnSwitchStatement == true); |
| 6665 } |
| 6666 |
| 6667 fb.Offset finish(fb.Builder fbBuilder) { |
| 6668 fb.Offset offset_name; |
| 6669 if (_name != null) { |
| 6670 offset_name = fbBuilder.writeString(_name); |
| 6671 } |
| 6672 fbBuilder.startTable(); |
| 6673 if (_isOnSwitchMember == true) { |
| 6674 fbBuilder.addBool(2, true); |
| 6675 } |
| 6676 if (_isOnSwitchStatement == true) { |
| 6677 fbBuilder.addBool(3, true); |
| 6678 } |
| 6679 if (offset_name != null) { |
| 6680 fbBuilder.addOffset(0, offset_name); |
| 6681 } |
| 6682 if (_nameOffset != null && _nameOffset != 0) { |
| 6683 fbBuilder.addUint32(1, _nameOffset); |
| 6684 } |
| 6685 return fbBuilder.endTable(); |
| 6686 } |
| 6687 } |
| 6688 |
| 6689 class _UnlinkedLabelReader extends fb.TableReader<_UnlinkedLabelImpl> { |
| 6690 const _UnlinkedLabelReader(); |
| 6691 |
| 6692 @override |
| 6693 _UnlinkedLabelImpl createObject(fb.BufferContext bc, int offset) => new _Unlin
kedLabelImpl(bc, offset); |
| 6694 } |
| 6695 |
| 6696 class _UnlinkedLabelImpl extends Object with _UnlinkedLabelMixin implements idl.
UnlinkedLabel { |
| 6697 final fb.BufferContext _bc; |
| 6698 final int _bcOffset; |
| 6699 |
| 6700 _UnlinkedLabelImpl(this._bc, this._bcOffset); |
| 6701 |
| 6702 bool _isOnSwitchMember; |
| 6703 bool _isOnSwitchStatement; |
| 6704 String _name; |
| 6705 int _nameOffset; |
| 6706 |
| 6707 @override |
| 6708 bool get isOnSwitchMember { |
| 6709 _isOnSwitchMember ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 2, fal
se); |
| 6710 return _isOnSwitchMember; |
| 6711 } |
| 6712 |
| 6713 @override |
| 6714 bool get isOnSwitchStatement { |
| 6715 _isOnSwitchStatement ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 3,
false); |
| 6716 return _isOnSwitchStatement; |
| 6717 } |
| 6718 |
| 6719 @override |
| 6720 String get name { |
| 6721 _name ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, ''); |
| 6722 return _name; |
| 6723 } |
| 6724 |
| 6725 @override |
| 6726 int get nameOffset { |
| 6727 _nameOffset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 1, 0); |
| 6728 return _nameOffset; |
| 6729 } |
| 6730 } |
| 6731 |
| 6732 abstract class _UnlinkedLabelMixin implements idl.UnlinkedLabel { |
| 6733 @override |
| 6734 Map<String, Object> toJson() { |
| 6735 Map<String, Object> _result = <String, Object>{}; |
| 6736 if (isOnSwitchMember != false) _result["isOnSwitchMember"] = isOnSwitchMembe
r; |
| 6737 if (isOnSwitchStatement != false) _result["isOnSwitchStatement"] = isOnSwitc
hStatement; |
| 6738 if (name != '') _result["name"] = name; |
| 6739 if (nameOffset != 0) _result["nameOffset"] = nameOffset; |
| 6740 return _result; |
| 6741 } |
| 6742 |
| 6743 @override |
| 6744 Map<String, Object> toMap() => { |
| 6745 "isOnSwitchMember": isOnSwitchMember, |
| 6746 "isOnSwitchStatement": isOnSwitchStatement, |
| 6747 "name": name, |
| 6748 "nameOffset": nameOffset, |
| 6749 }; |
| 6750 |
| 6751 @override |
| 6752 String toString() => convert.JSON.encode(toJson()); |
| 6753 } |
| 6754 |
| 6755 class UnlinkedParamBuilder extends Object with _UnlinkedParamMixin implements id
l.UnlinkedParam { |
| 6756 List<UnlinkedConstBuilder> _annotations; |
| 6757 CodeRangeBuilder _codeRange; |
| 6758 String _defaultValueCode; |
| 6759 int _inferredTypeSlot; |
| 6760 int _inheritsCovariantSlot; |
| 6761 UnlinkedExecutableBuilder _initializer; |
| 6762 bool _isFunctionTyped; |
| 6763 bool _isInitializingFormal; |
| 6764 idl.UnlinkedParamKind _kind; |
| 6765 String _name; |
| 6766 int _nameOffset; |
| 6767 List<UnlinkedParamBuilder> _parameters; |
| 6768 EntityRefBuilder _type; |
| 6769 int _visibleLength; |
| 6770 int _visibleOffset; |
| 6771 |
| 6772 @override |
| 6773 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; |
| 6774 |
| 6775 /** |
| 6776 * Annotations for this parameter. |
| 6777 */ |
| 6778 void set annotations(List<UnlinkedConstBuilder> value) { |
| 6779 this._annotations = value; |
| 6780 } |
| 6781 |
| 6782 @override |
| 6783 CodeRangeBuilder get codeRange => _codeRange; |
| 6784 |
| 6785 /** |
| 6786 * Code range of the parameter. |
| 6787 */ |
| 6788 void set codeRange(CodeRangeBuilder value) { |
| 6789 this._codeRange = value; |
| 6790 } |
| 6791 |
| 6792 @override |
| 6793 String get defaultValueCode => _defaultValueCode ??= ''; |
| 6794 |
| 6795 /** |
| 6796 * If the parameter has a default value, the source text of the constant |
| 6797 * expression in the default value. Otherwise the empty string. |
| 6798 */ |
| 6799 void set defaultValueCode(String value) { |
| 6800 this._defaultValueCode = value; |
| 6801 } |
| 6802 |
| 6803 @override |
| 6804 int get inferredTypeSlot => _inferredTypeSlot ??= 0; |
| 6805 |
| 6806 /** |
| 6807 * If this parameter's type is inferable, nonzero slot id identifying which |
| 6808 * entry in [LinkedLibrary.types] contains the inferred type. If there is no |
| 6809 * matching entry in [LinkedLibrary.types], then no type was inferred for |
| 6810 * this variable, so its static type is `dynamic`. |
| 6811 * |
| 6812 * Note that although strong mode considers initializing formals to be |
| 6813 * inferable, they are not marked as such in the summary; if their type is |
| 6814 * not specified, they always inherit the static type of the corresponding |
| 6815 * field. |
| 6816 */ |
| 6817 void set inferredTypeSlot(int value) { |
| 6818 assert(value == null || value >= 0); |
| 6819 this._inferredTypeSlot = value; |
| 6820 } |
| 6821 |
| 6822 @override |
| 6823 int get inheritsCovariantSlot => _inheritsCovariantSlot ??= 0; |
| 6824 |
| 6825 /** |
| 6826 * If this is a parameter of an instance method, a nonzero slot id which is |
| 6827 * unique within this compilation unit. If this id is found in |
| 6828 * [LinkedUnit.parametersInheritingCovariant], then this parameter inherits |
| 6829 * `@covariant` behavior from a base class. |
| 6830 * |
| 6831 * Otherwise, zero. |
| 6832 */ |
| 6833 void set inheritsCovariantSlot(int value) { |
| 6834 assert(value == null || value >= 0); |
| 6835 this._inheritsCovariantSlot = value; |
| 6836 } |
| 6837 |
| 6838 @override |
| 6839 UnlinkedExecutableBuilder get initializer => _initializer; |
| 6840 |
| 6841 /** |
| 6842 * The synthetic initializer function of the parameter. Absent if the variabl
e |
| 6843 * does not have an initializer. |
| 6844 */ |
| 6845 void set initializer(UnlinkedExecutableBuilder value) { |
| 6846 this._initializer = value; |
| 6847 } |
| 6848 |
| 6849 @override |
| 6850 bool get isFunctionTyped => _isFunctionTyped ??= false; |
| 6851 |
| 6852 /** |
| 6853 * Indicates whether this is a function-typed parameter. |
| 6854 */ |
| 6855 void set isFunctionTyped(bool value) { |
| 6856 this._isFunctionTyped = value; |
| 6857 } |
| 6858 |
| 6859 @override |
| 6860 bool get isInitializingFormal => _isInitializingFormal ??= false; |
| 6861 |
| 6862 /** |
| 6863 * Indicates whether this is an initializing formal parameter (i.e. it is |
| 6864 * declared using `this.` syntax). |
| 6865 */ |
| 6866 void set isInitializingFormal(bool value) { |
| 6867 this._isInitializingFormal = value; |
| 6868 } |
| 6869 |
| 6870 @override |
| 6871 idl.UnlinkedParamKind get kind => _kind ??= idl.UnlinkedParamKind.required; |
| 6872 |
| 6873 /** |
| 6874 * Kind of the parameter. |
| 6875 */ |
| 6876 void set kind(idl.UnlinkedParamKind value) { |
| 6877 this._kind = value; |
| 6878 } |
| 6879 |
| 6880 @override |
| 6881 String get name => _name ??= ''; |
| 6882 |
| 6883 /** |
| 6884 * Name of the parameter. |
| 6885 */ |
| 6886 void set name(String value) { |
| 6887 this._name = value; |
| 6888 } |
| 6889 |
| 6890 @override |
| 6891 int get nameOffset => _nameOffset ??= 0; |
| 6892 |
| 6893 /** |
| 6894 * Offset of the parameter name relative to the beginning of the file. |
| 6895 */ |
| 6896 void set nameOffset(int value) { |
| 6897 assert(value == null || value >= 0); |
| 6898 this._nameOffset = value; |
| 6899 } |
| 6900 |
| 6901 @override |
| 6902 List<UnlinkedParamBuilder> get parameters => _parameters ??= <UnlinkedParamBui
lder>[]; |
| 6903 |
| 6904 /** |
| 6905 * If [isFunctionTyped] is `true`, the parameters of the function type. |
| 6906 */ |
| 6907 void set parameters(List<UnlinkedParamBuilder> value) { |
| 6908 this._parameters = value; |
| 6909 } |
| 6910 |
| 6911 @override |
| 6912 EntityRefBuilder get type => _type; |
| 6913 |
| 6914 /** |
| 6915 * If [isFunctionTyped] is `true`, the declared return type. If |
| 6916 * [isFunctionTyped] is `false`, the declared type. Absent if the type is |
| 6917 * implicit. |
| 6918 */ |
| 6919 void set type(EntityRefBuilder value) { |
| 6920 this._type = value; |
| 6921 } |
| 6922 |
| 6923 @override |
| 6924 int get visibleLength => _visibleLength ??= 0; |
| 6925 |
| 6926 /** |
| 6927 * The length of the visible range. |
| 6928 */ |
| 6929 void set visibleLength(int value) { |
| 6930 assert(value == null || value >= 0); |
| 6931 this._visibleLength = value; |
| 6932 } |
| 6933 |
| 6934 @override |
| 6935 int get visibleOffset => _visibleOffset ??= 0; |
| 6936 |
| 6937 /** |
| 6938 * The beginning of the visible range. |
| 6939 */ |
| 6940 void set visibleOffset(int value) { |
| 6941 assert(value == null || value >= 0); |
| 6942 this._visibleOffset = value; |
| 6943 } |
| 6944 |
| 6945 UnlinkedParamBuilder({List<UnlinkedConstBuilder> annotations, CodeRangeBuilder
codeRange, String defaultValueCode, int inferredTypeSlot, int inheritsCovariant
Slot, UnlinkedExecutableBuilder initializer, bool isFunctionTyped, bool isInitia
lizingFormal, idl.UnlinkedParamKind kind, String name, int nameOffset, List<Unli
nkedParamBuilder> parameters, EntityRefBuilder type, int visibleLength, int visi
bleOffset}) |
| 6946 : _annotations = annotations, |
| 6947 _codeRange = codeRange, |
| 6948 _defaultValueCode = defaultValueCode, |
| 6949 _inferredTypeSlot = inferredTypeSlot, |
| 6950 _inheritsCovariantSlot = inheritsCovariantSlot, |
| 6951 _initializer = initializer, |
| 6952 _isFunctionTyped = isFunctionTyped, |
| 6953 _isInitializingFormal = isInitializingFormal, |
| 6954 _kind = kind, |
| 6955 _name = name, |
| 6956 _nameOffset = nameOffset, |
| 6957 _parameters = parameters, |
| 6958 _type = type, |
| 6959 _visibleLength = visibleLength, |
| 6960 _visibleOffset = visibleOffset; |
| 6961 |
| 6962 /** |
| 6963 * Flush [informative] data recursively. |
| 6964 */ |
| 6965 void flushInformative() { |
| 6966 _annotations?.forEach((b) => b.flushInformative()); |
| 6967 _codeRange = null; |
| 6968 _defaultValueCode = null; |
| 6969 _initializer?.flushInformative(); |
| 6970 _nameOffset = null; |
| 6971 _parameters?.forEach((b) => b.flushInformative()); |
| 6972 _type?.flushInformative(); |
| 6973 } |
| 6974 |
| 6975 /** |
| 6976 * Accumulate non-[informative] data into [signature]. |
| 6977 */ |
| 6978 void collectApiSignature(api_sig.ApiSignature signature) { |
| 6979 signature.addString(this._name ?? ''); |
| 6980 signature.addInt(this._inferredTypeSlot ?? 0); |
| 6981 signature.addBool(this._type != null); |
| 6982 this._type?.collectApiSignature(signature); |
| 6983 signature.addInt(this._kind == null ? 0 : this._kind.index); |
| 6984 signature.addBool(this._isFunctionTyped == true); |
| 6985 signature.addBool(this._isInitializingFormal == true); |
| 6986 if (this._parameters == null) { |
| 6987 signature.addInt(0); |
| 6988 } else { |
| 6989 signature.addInt(this._parameters.length); |
| 6990 for (var x in this._parameters) { |
| 6991 x?.collectApiSignature(signature); |
| 6992 } |
| 6993 } |
| 6994 if (this._annotations == null) { |
| 6995 signature.addInt(0); |
| 6996 } else { |
| 6997 signature.addInt(this._annotations.length); |
| 6998 for (var x in this._annotations) { |
| 6999 x?.collectApiSignature(signature); |
| 7000 } |
| 7001 } |
| 7002 signature.addInt(this._visibleLength ?? 0); |
| 7003 signature.addInt(this._visibleOffset ?? 0); |
| 7004 signature.addBool(this._initializer != null); |
| 7005 this._initializer?.collectApiSignature(signature); |
| 7006 signature.addInt(this._inheritsCovariantSlot ?? 0); |
| 7007 } |
| 7008 |
| 7009 fb.Offset finish(fb.Builder fbBuilder) { |
| 7010 fb.Offset offset_annotations; |
| 7011 fb.Offset offset_codeRange; |
| 7012 fb.Offset offset_defaultValueCode; |
| 7013 fb.Offset offset_initializer; |
| 7014 fb.Offset offset_name; |
| 7015 fb.Offset offset_parameters; |
| 7016 fb.Offset offset_type; |
| 7017 if (!(_annotations == null || _annotations.isEmpty)) { |
| 7018 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); |
| 7019 } |
| 7020 if (_codeRange != null) { |
| 7021 offset_codeRange = _codeRange.finish(fbBuilder); |
| 7022 } |
| 7023 if (_defaultValueCode != null) { |
| 7024 offset_defaultValueCode = fbBuilder.writeString(_defaultValueCode); |
| 7025 } |
| 7026 if (_initializer != null) { |
| 7027 offset_initializer = _initializer.finish(fbBuilder); |
| 7028 } |
| 7029 if (_name != null) { |
| 7030 offset_name = fbBuilder.writeString(_name); |
| 7031 } |
| 7032 if (!(_parameters == null || _parameters.isEmpty)) { |
| 7033 offset_parameters = fbBuilder.writeList(_parameters.map((b) => b.finish(fb
Builder)).toList()); |
| 7034 } |
| 7035 if (_type != null) { |
| 7036 offset_type = _type.finish(fbBuilder); |
| 7037 } |
| 7038 fbBuilder.startTable(); |
| 7039 if (offset_annotations != null) { |
| 7040 fbBuilder.addOffset(9, offset_annotations); |
| 7041 } |
| 7042 if (offset_codeRange != null) { |
| 7043 fbBuilder.addOffset(7, offset_codeRange); |
| 7044 } |
| 7045 if (offset_defaultValueCode != null) { |
| 7046 fbBuilder.addOffset(13, offset_defaultValueCode); |
| 7047 } |
| 7048 if (_inferredTypeSlot != null && _inferredTypeSlot != 0) { |
| 7049 fbBuilder.addUint32(2, _inferredTypeSlot); |
| 7050 } |
| 7051 if (_inheritsCovariantSlot != null && _inheritsCovariantSlot != 0) { |
| 7052 fbBuilder.addUint32(14, _inheritsCovariantSlot); |
| 7053 } |
| 7054 if (offset_initializer != null) { |
| 7055 fbBuilder.addOffset(12, offset_initializer); |
| 7056 } |
| 7057 if (_isFunctionTyped == true) { |
| 7058 fbBuilder.addBool(5, true); |
| 7059 } |
| 7060 if (_isInitializingFormal == true) { |
| 7061 fbBuilder.addBool(6, true); |
| 7062 } |
| 7063 if (_kind != null && _kind != idl.UnlinkedParamKind.required) { |
| 7064 fbBuilder.addUint8(4, _kind.index); |
| 7065 } |
| 7066 if (offset_name != null) { |
| 7067 fbBuilder.addOffset(0, offset_name); |
| 7068 } |
| 7069 if (_nameOffset != null && _nameOffset != 0) { |
| 7070 fbBuilder.addUint32(1, _nameOffset); |
| 7071 } |
| 7072 if (offset_parameters != null) { |
| 7073 fbBuilder.addOffset(8, offset_parameters); |
| 7074 } |
| 7075 if (offset_type != null) { |
| 7076 fbBuilder.addOffset(3, offset_type); |
| 7077 } |
| 7078 if (_visibleLength != null && _visibleLength != 0) { |
| 7079 fbBuilder.addUint32(10, _visibleLength); |
| 7080 } |
| 7081 if (_visibleOffset != null && _visibleOffset != 0) { |
| 7082 fbBuilder.addUint32(11, _visibleOffset); |
| 7083 } |
| 7084 return fbBuilder.endTable(); |
| 7085 } |
| 7086 } |
| 7087 |
| 7088 class _UnlinkedParamReader extends fb.TableReader<_UnlinkedParamImpl> { |
| 7089 const _UnlinkedParamReader(); |
| 7090 |
| 7091 @override |
| 7092 _UnlinkedParamImpl createObject(fb.BufferContext bc, int offset) => new _Unlin
kedParamImpl(bc, offset); |
| 7093 } |
| 7094 |
| 7095 class _UnlinkedParamImpl extends Object with _UnlinkedParamMixin implements idl.
UnlinkedParam { |
| 7096 final fb.BufferContext _bc; |
| 7097 final int _bcOffset; |
| 7098 |
| 7099 _UnlinkedParamImpl(this._bc, this._bcOffset); |
| 7100 |
| 7101 List<idl.UnlinkedConst> _annotations; |
| 7102 idl.CodeRange _codeRange; |
| 7103 String _defaultValueCode; |
| 7104 int _inferredTypeSlot; |
| 7105 int _inheritsCovariantSlot; |
| 7106 idl.UnlinkedExecutable _initializer; |
| 7107 bool _isFunctionTyped; |
| 7108 bool _isInitializingFormal; |
| 7109 idl.UnlinkedParamKind _kind; |
| 7110 String _name; |
| 7111 int _nameOffset; |
| 7112 List<idl.UnlinkedParam> _parameters; |
| 7113 idl.EntityRef _type; |
| 7114 int _visibleLength; |
| 7115 int _visibleOffset; |
| 7116 |
| 7117 @override |
| 7118 List<idl.UnlinkedConst> get annotations { |
| 7119 _annotations ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConst
Reader()).vTableGet(_bc, _bcOffset, 9, const <idl.UnlinkedConst>[]); |
| 7120 return _annotations; |
| 7121 } |
| 7122 |
| 7123 @override |
| 7124 idl.CodeRange get codeRange { |
| 7125 _codeRange ??= const _CodeRangeReader().vTableGet(_bc, _bcOffset, 7, null); |
| 7126 return _codeRange; |
| 7127 } |
| 7128 |
| 7129 @override |
| 7130 String get defaultValueCode { |
| 7131 _defaultValueCode ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 13,
''); |
| 7132 return _defaultValueCode; |
| 7133 } |
| 7134 |
| 7135 @override |
| 7136 int get inferredTypeSlot { |
| 7137 _inferredTypeSlot ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 2, 0
); |
| 7138 return _inferredTypeSlot; |
| 7139 } |
| 7140 |
| 7141 @override |
| 7142 int get inheritsCovariantSlot { |
| 7143 _inheritsCovariantSlot ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset,
14, 0); |
| 7144 return _inheritsCovariantSlot; |
| 7145 } |
| 7146 |
| 7147 @override |
| 7148 idl.UnlinkedExecutable get initializer { |
| 7149 _initializer ??= const _UnlinkedExecutableReader().vTableGet(_bc, _bcOffset,
12, null); |
| 7150 return _initializer; |
| 7151 } |
| 7152 |
| 7153 @override |
| 7154 bool get isFunctionTyped { |
| 7155 _isFunctionTyped ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 5, fals
e); |
| 7156 return _isFunctionTyped; |
| 7157 } |
| 7158 |
| 7159 @override |
| 7160 bool get isInitializingFormal { |
| 7161 _isInitializingFormal ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 6,
false); |
| 7162 return _isInitializingFormal; |
| 7163 } |
| 7164 |
| 7165 @override |
| 7166 idl.UnlinkedParamKind get kind { |
| 7167 _kind ??= const _UnlinkedParamKindReader().vTableGet(_bc, _bcOffset, 4, idl.
UnlinkedParamKind.required); |
| 7168 return _kind; |
| 7169 } |
| 7170 |
| 7171 @override |
| 7172 String get name { |
| 7173 _name ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, ''); |
| 7174 return _name; |
| 7175 } |
| 7176 |
| 7177 @override |
| 7178 int get nameOffset { |
| 7179 _nameOffset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 1, 0); |
| 7180 return _nameOffset; |
| 7181 } |
| 7182 |
| 7183 @override |
| 7184 List<idl.UnlinkedParam> get parameters { |
| 7185 _parameters ??= const fb.ListReader<idl.UnlinkedParam>(const _UnlinkedParamR
eader()).vTableGet(_bc, _bcOffset, 8, const <idl.UnlinkedParam>[]); |
| 7186 return _parameters; |
| 7187 } |
| 7188 |
| 7189 @override |
| 7190 idl.EntityRef get type { |
| 7191 _type ??= const _EntityRefReader().vTableGet(_bc, _bcOffset, 3, null); |
| 7192 return _type; |
| 7193 } |
| 7194 |
| 7195 @override |
| 7196 int get visibleLength { |
| 7197 _visibleLength ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 10, 0); |
| 7198 return _visibleLength; |
| 7199 } |
| 7200 |
| 7201 @override |
| 7202 int get visibleOffset { |
| 7203 _visibleOffset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 11, 0); |
| 7204 return _visibleOffset; |
| 7205 } |
| 7206 } |
| 7207 |
| 7208 abstract class _UnlinkedParamMixin implements idl.UnlinkedParam { |
| 7209 @override |
| 7210 Map<String, Object> toJson() { |
| 7211 Map<String, Object> _result = <String, Object>{}; |
| 7212 if (annotations.isNotEmpty) _result["annotations"] = annotations.map((_value
) => _value.toJson()).toList(); |
| 7213 if (codeRange != null) _result["codeRange"] = codeRange.toJson(); |
| 7214 if (defaultValueCode != '') _result["defaultValueCode"] = defaultValueCode; |
| 7215 if (inferredTypeSlot != 0) _result["inferredTypeSlot"] = inferredTypeSlot; |
| 7216 if (inheritsCovariantSlot != 0) _result["inheritsCovariantSlot"] = inheritsC
ovariantSlot; |
| 7217 if (initializer != null) _result["initializer"] = initializer.toJson(); |
| 7218 if (isFunctionTyped != false) _result["isFunctionTyped"] = isFunctionTyped; |
| 7219 if (isInitializingFormal != false) _result["isInitializingFormal"] = isIniti
alizingFormal; |
| 7220 if (kind != idl.UnlinkedParamKind.required) _result["kind"] = kind.toString(
).split('.')[1]; |
| 7221 if (name != '') _result["name"] = name; |
| 7222 if (nameOffset != 0) _result["nameOffset"] = nameOffset; |
| 7223 if (parameters.isNotEmpty) _result["parameters"] = parameters.map((_value) =
> _value.toJson()).toList(); |
| 7224 if (type != null) _result["type"] = type.toJson(); |
| 7225 if (visibleLength != 0) _result["visibleLength"] = visibleLength; |
| 7226 if (visibleOffset != 0) _result["visibleOffset"] = visibleOffset; |
| 7227 return _result; |
| 7228 } |
| 7229 |
| 7230 @override |
| 7231 Map<String, Object> toMap() => { |
| 7232 "annotations": annotations, |
| 7233 "codeRange": codeRange, |
| 7234 "defaultValueCode": defaultValueCode, |
| 7235 "inferredTypeSlot": inferredTypeSlot, |
| 7236 "inheritsCovariantSlot": inheritsCovariantSlot, |
| 7237 "initializer": initializer, |
| 7238 "isFunctionTyped": isFunctionTyped, |
| 7239 "isInitializingFormal": isInitializingFormal, |
| 7240 "kind": kind, |
| 7241 "name": name, |
| 7242 "nameOffset": nameOffset, |
| 7243 "parameters": parameters, |
| 7244 "type": type, |
| 7245 "visibleLength": visibleLength, |
| 7246 "visibleOffset": visibleOffset, |
| 7247 }; |
| 7248 |
| 7249 @override |
| 7250 String toString() => convert.JSON.encode(toJson()); |
| 7251 } |
| 7252 |
| 7253 class UnlinkedPartBuilder extends Object with _UnlinkedPartMixin implements idl.
UnlinkedPart { |
| 7254 List<UnlinkedConstBuilder> _annotations; |
| 7255 int _uriEnd; |
| 7256 int _uriOffset; |
| 7257 |
| 7258 @override |
| 7259 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; |
| 7260 |
| 7261 /** |
| 7262 * Annotations for this part declaration. |
| 7263 */ |
| 7264 void set annotations(List<UnlinkedConstBuilder> value) { |
| 7265 this._annotations = value; |
| 7266 } |
| 7267 |
| 7268 @override |
| 7269 int get uriEnd => _uriEnd ??= 0; |
| 7270 |
| 7271 /** |
| 7272 * End of the URI string (including quotes) relative to the beginning of the |
| 7273 * file. |
| 7274 */ |
| 7275 void set uriEnd(int value) { |
| 7276 assert(value == null || value >= 0); |
| 7277 this._uriEnd = value; |
| 7278 } |
| 7279 |
| 7280 @override |
| 7281 int get uriOffset => _uriOffset ??= 0; |
| 7282 |
| 7283 /** |
| 7284 * Offset of the URI string (including quotes) relative to the beginning of |
| 7285 * the file. |
| 7286 */ |
| 7287 void set uriOffset(int value) { |
| 7288 assert(value == null || value >= 0); |
| 7289 this._uriOffset = value; |
| 7290 } |
| 7291 |
| 7292 UnlinkedPartBuilder({List<UnlinkedConstBuilder> annotations, int uriEnd, int u
riOffset}) |
| 7293 : _annotations = annotations, |
| 7294 _uriEnd = uriEnd, |
| 7295 _uriOffset = uriOffset; |
| 7296 |
| 7297 /** |
| 7298 * Flush [informative] data recursively. |
| 7299 */ |
| 7300 void flushInformative() { |
| 7301 _annotations?.forEach((b) => b.flushInformative()); |
| 7302 _uriEnd = null; |
| 7303 _uriOffset = null; |
| 7304 } |
| 7305 |
| 7306 /** |
| 7307 * Accumulate non-[informative] data into [signature]. |
| 7308 */ |
| 7309 void collectApiSignature(api_sig.ApiSignature signature) { |
| 7310 if (this._annotations == null) { |
| 7311 signature.addInt(0); |
| 7312 } else { |
| 7313 signature.addInt(this._annotations.length); |
| 7314 for (var x in this._annotations) { |
| 7315 x?.collectApiSignature(signature); |
| 7316 } |
| 7317 } |
| 7318 } |
| 7319 |
| 7320 fb.Offset finish(fb.Builder fbBuilder) { |
| 7321 fb.Offset offset_annotations; |
| 7322 if (!(_annotations == null || _annotations.isEmpty)) { |
| 7323 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); |
| 7324 } |
| 7325 fbBuilder.startTable(); |
| 7326 if (offset_annotations != null) { |
| 7327 fbBuilder.addOffset(2, offset_annotations); |
| 7328 } |
| 7329 if (_uriEnd != null && _uriEnd != 0) { |
| 7330 fbBuilder.addUint32(0, _uriEnd); |
| 7331 } |
| 7332 if (_uriOffset != null && _uriOffset != 0) { |
| 7333 fbBuilder.addUint32(1, _uriOffset); |
| 7334 } |
| 7335 return fbBuilder.endTable(); |
| 7336 } |
| 7337 } |
| 7338 |
| 7339 class _UnlinkedPartReader extends fb.TableReader<_UnlinkedPartImpl> { |
| 7340 const _UnlinkedPartReader(); |
| 7341 |
| 7342 @override |
| 7343 _UnlinkedPartImpl createObject(fb.BufferContext bc, int offset) => new _Unlink
edPartImpl(bc, offset); |
| 7344 } |
| 7345 |
| 7346 class _UnlinkedPartImpl extends Object with _UnlinkedPartMixin implements idl.Un
linkedPart { |
| 7347 final fb.BufferContext _bc; |
| 7348 final int _bcOffset; |
| 7349 |
| 7350 _UnlinkedPartImpl(this._bc, this._bcOffset); |
| 7351 |
| 7352 List<idl.UnlinkedConst> _annotations; |
| 7353 int _uriEnd; |
| 7354 int _uriOffset; |
| 7355 |
| 7356 @override |
| 7357 List<idl.UnlinkedConst> get annotations { |
| 7358 _annotations ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConst
Reader()).vTableGet(_bc, _bcOffset, 2, const <idl.UnlinkedConst>[]); |
| 7359 return _annotations; |
| 7360 } |
| 7361 |
| 7362 @override |
| 7363 int get uriEnd { |
| 7364 _uriEnd ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 0, 0); |
| 7365 return _uriEnd; |
| 7366 } |
| 7367 |
| 7368 @override |
| 7369 int get uriOffset { |
| 7370 _uriOffset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 1, 0); |
| 7371 return _uriOffset; |
| 7372 } |
| 7373 } |
| 7374 |
| 7375 abstract class _UnlinkedPartMixin implements idl.UnlinkedPart { |
| 7376 @override |
| 7377 Map<String, Object> toJson() { |
| 7378 Map<String, Object> _result = <String, Object>{}; |
| 7379 if (annotations.isNotEmpty) _result["annotations"] = annotations.map((_value
) => _value.toJson()).toList(); |
| 7380 if (uriEnd != 0) _result["uriEnd"] = uriEnd; |
| 7381 if (uriOffset != 0) _result["uriOffset"] = uriOffset; |
| 7382 return _result; |
| 7383 } |
| 7384 |
| 7385 @override |
| 7386 Map<String, Object> toMap() => { |
| 7387 "annotations": annotations, |
| 7388 "uriEnd": uriEnd, |
| 7389 "uriOffset": uriOffset, |
| 7390 }; |
| 7391 |
| 7392 @override |
| 7393 String toString() => convert.JSON.encode(toJson()); |
| 7394 } |
| 7395 |
| 7396 class UnlinkedPublicNameBuilder extends Object with _UnlinkedPublicNameMixin imp
lements idl.UnlinkedPublicName { |
| 7397 idl.ReferenceKind _kind; |
| 7398 List<UnlinkedPublicNameBuilder> _members; |
| 7399 String _name; |
| 7400 int _numTypeParameters; |
| 7401 |
| 7402 @override |
| 7403 idl.ReferenceKind get kind => _kind ??= idl.ReferenceKind.classOrEnum; |
| 7404 |
| 7405 /** |
| 7406 * The kind of object referred to by the name. |
| 7407 */ |
| 7408 void set kind(idl.ReferenceKind value) { |
| 7409 this._kind = value; |
| 7410 } |
| 7411 |
| 7412 @override |
| 7413 List<UnlinkedPublicNameBuilder> get members => _members ??= <UnlinkedPublicNam
eBuilder>[]; |
| 7414 |
| 7415 /** |
| 7416 * If this [UnlinkedPublicName] is a class, the list of members which can be |
| 7417 * referenced statically - static fields, static methods, and constructors. |
| 7418 * Otherwise empty. |
| 7419 * |
| 7420 * Unnamed constructors are not included since they do not constitute a |
| 7421 * separate name added to any namespace. |
| 7422 */ |
| 7423 void set members(List<UnlinkedPublicNameBuilder> value) { |
| 7424 this._members = value; |
| 7425 } |
| 7426 |
| 7427 @override |
| 7428 String get name => _name ??= ''; |
| 7429 |
| 7430 /** |
| 7431 * The name itself. |
| 7432 */ |
| 7433 void set name(String value) { |
| 7434 this._name = value; |
| 7435 } |
| 7436 |
| 7437 @override |
| 7438 int get numTypeParameters => _numTypeParameters ??= 0; |
| 7439 |
| 7440 /** |
| 7441 * If the entity being referred to is generic, the number of type parameters |
| 7442 * it accepts. Otherwise zero. |
| 7443 */ |
| 7444 void set numTypeParameters(int value) { |
| 7445 assert(value == null || value >= 0); |
| 7446 this._numTypeParameters = value; |
| 7447 } |
| 7448 |
| 7449 UnlinkedPublicNameBuilder({idl.ReferenceKind kind, List<UnlinkedPublicNameBuil
der> members, String name, int numTypeParameters}) |
| 7450 : _kind = kind, |
| 7451 _members = members, |
| 7452 _name = name, |
| 7453 _numTypeParameters = numTypeParameters; |
| 7454 |
| 7455 /** |
| 7456 * Flush [informative] data recursively. |
| 7457 */ |
| 7458 void flushInformative() { |
| 7459 _members?.forEach((b) => b.flushInformative()); |
| 7460 } |
| 7461 |
| 7462 /** |
| 7463 * Accumulate non-[informative] data into [signature]. |
| 7464 */ |
| 7465 void collectApiSignature(api_sig.ApiSignature signature) { |
| 7466 signature.addString(this._name ?? ''); |
| 7467 signature.addInt(this._kind == null ? 0 : this._kind.index); |
| 7468 if (this._members == null) { |
| 7469 signature.addInt(0); |
| 7470 } else { |
| 7471 signature.addInt(this._members.length); |
| 7472 for (var x in this._members) { |
| 7473 x?.collectApiSignature(signature); |
| 7474 } |
| 7475 } |
| 7476 signature.addInt(this._numTypeParameters ?? 0); |
| 7477 } |
| 7478 |
| 7479 fb.Offset finish(fb.Builder fbBuilder) { |
| 7480 fb.Offset offset_members; |
| 7481 fb.Offset offset_name; |
| 7482 if (!(_members == null || _members.isEmpty)) { |
| 7483 offset_members = fbBuilder.writeList(_members.map((b) => b.finish(fbBuilde
r)).toList()); |
| 7484 } |
| 7485 if (_name != null) { |
| 7486 offset_name = fbBuilder.writeString(_name); |
| 7487 } |
| 7488 fbBuilder.startTable(); |
| 7489 if (_kind != null && _kind != idl.ReferenceKind.classOrEnum) { |
| 7490 fbBuilder.addUint8(1, _kind.index); |
| 7491 } |
| 7492 if (offset_members != null) { |
| 7493 fbBuilder.addOffset(2, offset_members); |
| 7494 } |
| 7495 if (offset_name != null) { |
| 7496 fbBuilder.addOffset(0, offset_name); |
| 7497 } |
| 7498 if (_numTypeParameters != null && _numTypeParameters != 0) { |
| 7499 fbBuilder.addUint32(3, _numTypeParameters); |
| 7500 } |
| 7501 return fbBuilder.endTable(); |
| 7502 } |
| 7503 } |
| 7504 |
| 7505 class _UnlinkedPublicNameReader extends fb.TableReader<_UnlinkedPublicNameImpl>
{ |
| 7506 const _UnlinkedPublicNameReader(); |
| 7507 |
| 7508 @override |
| 7509 _UnlinkedPublicNameImpl createObject(fb.BufferContext bc, int offset) => new _
UnlinkedPublicNameImpl(bc, offset); |
| 7510 } |
| 7511 |
| 7512 class _UnlinkedPublicNameImpl extends Object with _UnlinkedPublicNameMixin imple
ments idl.UnlinkedPublicName { |
| 7513 final fb.BufferContext _bc; |
| 7514 final int _bcOffset; |
| 7515 |
| 7516 _UnlinkedPublicNameImpl(this._bc, this._bcOffset); |
| 7517 |
| 7518 idl.ReferenceKind _kind; |
| 7519 List<idl.UnlinkedPublicName> _members; |
| 7520 String _name; |
| 7521 int _numTypeParameters; |
| 7522 |
| 7523 @override |
| 7524 idl.ReferenceKind get kind { |
| 7525 _kind ??= const _ReferenceKindReader().vTableGet(_bc, _bcOffset, 1, idl.Refe
renceKind.classOrEnum); |
| 7526 return _kind; |
| 7527 } |
| 7528 |
| 7529 @override |
| 7530 List<idl.UnlinkedPublicName> get members { |
| 7531 _members ??= const fb.ListReader<idl.UnlinkedPublicName>(const _UnlinkedPubl
icNameReader()).vTableGet(_bc, _bcOffset, 2, const <idl.UnlinkedPublicName>[]); |
| 7532 return _members; |
| 7533 } |
| 7534 |
| 7535 @override |
| 7536 String get name { |
| 7537 _name ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, ''); |
| 7538 return _name; |
| 7539 } |
| 7540 |
| 7541 @override |
| 7542 int get numTypeParameters { |
| 7543 _numTypeParameters ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 3,
0); |
| 7544 return _numTypeParameters; |
| 7545 } |
| 7546 } |
| 7547 |
| 7548 abstract class _UnlinkedPublicNameMixin implements idl.UnlinkedPublicName { |
| 7549 @override |
| 7550 Map<String, Object> toJson() { |
| 7551 Map<String, Object> _result = <String, Object>{}; |
| 7552 if (kind != idl.ReferenceKind.classOrEnum) _result["kind"] = kind.toString()
.split('.')[1]; |
| 7553 if (members.isNotEmpty) _result["members"] = members.map((_value) => _value.
toJson()).toList(); |
| 7554 if (name != '') _result["name"] = name; |
| 7555 if (numTypeParameters != 0) _result["numTypeParameters"] = numTypeParameters
; |
| 7556 return _result; |
| 7557 } |
| 7558 |
| 7559 @override |
| 7560 Map<String, Object> toMap() => { |
| 7561 "kind": kind, |
| 7562 "members": members, |
| 7563 "name": name, |
| 7564 "numTypeParameters": numTypeParameters, |
| 7565 }; |
| 7566 |
| 7567 @override |
| 7568 String toString() => convert.JSON.encode(toJson()); |
| 7569 } |
| 7570 |
| 7571 class UnlinkedPublicNamespaceBuilder extends Object with _UnlinkedPublicNamespac
eMixin implements idl.UnlinkedPublicNamespace { |
| 7572 List<UnlinkedExportPublicBuilder> _exports; |
| 7573 List<UnlinkedPublicNameBuilder> _names; |
| 7574 List<String> _parts; |
| 7575 |
| 7576 @override |
| 7577 List<UnlinkedExportPublicBuilder> get exports => _exports ??= <UnlinkedExportP
ublicBuilder>[]; |
| 7578 |
| 7579 /** |
| 7580 * Export declarations in the compilation unit. |
| 7581 */ |
| 7582 void set exports(List<UnlinkedExportPublicBuilder> value) { |
| 7583 this._exports = value; |
| 7584 } |
| 7585 |
| 7586 @override |
| 7587 List<UnlinkedPublicNameBuilder> get names => _names ??= <UnlinkedPublicNameBui
lder>[]; |
| 7588 |
| 7589 /** |
| 7590 * Public names defined in the compilation unit. |
| 7591 * |
| 7592 * TODO(paulberry): consider sorting these names to reduce unnecessary |
| 7593 * relinking. |
| 7594 */ |
| 7595 void set names(List<UnlinkedPublicNameBuilder> value) { |
| 7596 this._names = value; |
| 7597 } |
| 7598 |
| 7599 @override |
| 7600 List<String> get parts => _parts ??= <String>[]; |
| 7601 |
| 7602 /** |
| 7603 * URIs referenced by part declarations in the compilation unit. |
| 7604 */ |
| 7605 void set parts(List<String> value) { |
| 7606 this._parts = value; |
| 7607 } |
| 7608 |
| 7609 UnlinkedPublicNamespaceBuilder({List<UnlinkedExportPublicBuilder> exports, Lis
t<UnlinkedPublicNameBuilder> names, List<String> parts}) |
| 7610 : _exports = exports, |
| 7611 _names = names, |
| 7612 _parts = parts; |
| 7613 |
| 7614 /** |
| 7615 * Flush [informative] data recursively. |
| 7616 */ |
| 7617 void flushInformative() { |
| 7618 _exports?.forEach((b) => b.flushInformative()); |
| 7619 _names?.forEach((b) => b.flushInformative()); |
| 7620 } |
| 7621 |
| 7622 /** |
| 7623 * Accumulate non-[informative] data into [signature]. |
| 7624 */ |
| 7625 void collectApiSignature(api_sig.ApiSignature signature) { |
| 7626 if (this._names == null) { |
| 7627 signature.addInt(0); |
| 7628 } else { |
| 7629 signature.addInt(this._names.length); |
| 7630 for (var x in this._names) { |
| 7631 x?.collectApiSignature(signature); |
| 7632 } |
| 7633 } |
| 7634 if (this._parts == null) { |
| 7635 signature.addInt(0); |
| 7636 } else { |
| 7637 signature.addInt(this._parts.length); |
| 7638 for (var x in this._parts) { |
| 7639 signature.addString(x); |
| 7640 } |
| 7641 } |
| 7642 if (this._exports == null) { |
| 7643 signature.addInt(0); |
| 7644 } else { |
| 7645 signature.addInt(this._exports.length); |
| 7646 for (var x in this._exports) { |
| 7647 x?.collectApiSignature(signature); |
| 7648 } |
| 7649 } |
| 7650 } |
| 7651 |
| 7652 List<int> toBuffer() { |
| 7653 fb.Builder fbBuilder = new fb.Builder(); |
| 7654 return fbBuilder.finish(finish(fbBuilder), "UPNS"); |
| 7655 } |
| 7656 |
| 7657 fb.Offset finish(fb.Builder fbBuilder) { |
| 7658 fb.Offset offset_exports; |
| 7659 fb.Offset offset_names; |
| 7660 fb.Offset offset_parts; |
| 7661 if (!(_exports == null || _exports.isEmpty)) { |
| 7662 offset_exports = fbBuilder.writeList(_exports.map((b) => b.finish(fbBuilde
r)).toList()); |
| 7663 } |
| 7664 if (!(_names == null || _names.isEmpty)) { |
| 7665 offset_names = fbBuilder.writeList(_names.map((b) => b.finish(fbBuilder)).
toList()); |
| 7666 } |
| 7667 if (!(_parts == null || _parts.isEmpty)) { |
| 7668 offset_parts = fbBuilder.writeList(_parts.map((b) => fbBuilder.writeString
(b)).toList()); |
| 7669 } |
| 7670 fbBuilder.startTable(); |
| 7671 if (offset_exports != null) { |
| 7672 fbBuilder.addOffset(2, offset_exports); |
| 7673 } |
| 7674 if (offset_names != null) { |
| 7675 fbBuilder.addOffset(0, offset_names); |
| 7676 } |
| 7677 if (offset_parts != null) { |
| 7678 fbBuilder.addOffset(1, offset_parts); |
| 7679 } |
| 7680 return fbBuilder.endTable(); |
| 7681 } |
| 7682 } |
| 7683 |
| 7684 idl.UnlinkedPublicNamespace readUnlinkedPublicNamespace(List<int> buffer) { |
| 7685 fb.BufferContext rootRef = new fb.BufferContext.fromBytes(buffer); |
| 7686 return const _UnlinkedPublicNamespaceReader().read(rootRef, 0); |
| 7687 } |
| 7688 |
| 7689 class _UnlinkedPublicNamespaceReader extends fb.TableReader<_UnlinkedPublicNames
paceImpl> { |
| 7690 const _UnlinkedPublicNamespaceReader(); |
| 7691 |
| 7692 @override |
| 7693 _UnlinkedPublicNamespaceImpl createObject(fb.BufferContext bc, int offset) =>
new _UnlinkedPublicNamespaceImpl(bc, offset); |
| 7694 } |
| 7695 |
| 7696 class _UnlinkedPublicNamespaceImpl extends Object with _UnlinkedPublicNamespaceM
ixin implements idl.UnlinkedPublicNamespace { |
| 7697 final fb.BufferContext _bc; |
| 7698 final int _bcOffset; |
| 7699 |
| 7700 _UnlinkedPublicNamespaceImpl(this._bc, this._bcOffset); |
| 7701 |
| 7702 List<idl.UnlinkedExportPublic> _exports; |
| 7703 List<idl.UnlinkedPublicName> _names; |
| 7704 List<String> _parts; |
| 7705 |
| 7706 @override |
| 7707 List<idl.UnlinkedExportPublic> get exports { |
| 7708 _exports ??= const fb.ListReader<idl.UnlinkedExportPublic>(const _UnlinkedEx
portPublicReader()).vTableGet(_bc, _bcOffset, 2, const <idl.UnlinkedExportPublic
>[]); |
| 7709 return _exports; |
| 7710 } |
| 7711 |
| 7712 @override |
| 7713 List<idl.UnlinkedPublicName> get names { |
| 7714 _names ??= const fb.ListReader<idl.UnlinkedPublicName>(const _UnlinkedPublic
NameReader()).vTableGet(_bc, _bcOffset, 0, const <idl.UnlinkedPublicName>[]); |
| 7715 return _names; |
| 7716 } |
| 7717 |
| 7718 @override |
| 7719 List<String> get parts { |
| 7720 _parts ??= const fb.ListReader<String>(const fb.StringReader()).vTableGet(_b
c, _bcOffset, 1, const <String>[]); |
| 7721 return _parts; |
| 7722 } |
| 7723 } |
| 7724 |
| 7725 abstract class _UnlinkedPublicNamespaceMixin implements idl.UnlinkedPublicNamesp
ace { |
| 7726 @override |
| 7727 Map<String, Object> toJson() { |
| 7728 Map<String, Object> _result = <String, Object>{}; |
| 7729 if (exports.isNotEmpty) _result["exports"] = exports.map((_value) => _value.
toJson()).toList(); |
| 7730 if (names.isNotEmpty) _result["names"] = names.map((_value) => _value.toJson
()).toList(); |
| 7731 if (parts.isNotEmpty) _result["parts"] = parts; |
| 7732 return _result; |
| 7733 } |
| 7734 |
| 7735 @override |
| 7736 Map<String, Object> toMap() => { |
| 7737 "exports": exports, |
| 7738 "names": names, |
| 7739 "parts": parts, |
| 7740 }; |
| 7741 |
| 7742 @override |
| 7743 String toString() => convert.JSON.encode(toJson()); |
| 7744 } |
| 7745 |
| 7746 class UnlinkedReferenceBuilder extends Object with _UnlinkedReferenceMixin imple
ments idl.UnlinkedReference { |
| 7747 String _name; |
| 7748 int _prefixReference; |
| 7749 |
| 7750 @override |
| 7751 String get name => _name ??= ''; |
| 7752 |
| 7753 /** |
| 7754 * Name of the entity being referred to. For the pseudo-type `dynamic`, the |
| 7755 * string is "dynamic". For the pseudo-type `void`, the string is "void". |
| 7756 * For the pseudo-type `bottom`, the string is "*bottom*". |
| 7757 */ |
| 7758 void set name(String value) { |
| 7759 this._name = value; |
| 7760 } |
| 7761 |
| 7762 @override |
| 7763 int get prefixReference => _prefixReference ??= 0; |
| 7764 |
| 7765 /** |
| 7766 * Prefix used to refer to the entity, or zero if no prefix is used. This is |
| 7767 * an index into [UnlinkedUnit.references]. |
| 7768 * |
| 7769 * Prefix references must always point backward; that is, for all i, if |
| 7770 * UnlinkedUnit.references[i].prefixReference != 0, then |
| 7771 * UnlinkedUnit.references[i].prefixReference < i. |
| 7772 */ |
| 7773 void set prefixReference(int value) { |
| 7774 assert(value == null || value >= 0); |
| 7775 this._prefixReference = value; |
| 7776 } |
| 7777 |
| 7778 UnlinkedReferenceBuilder({String name, int prefixReference}) |
| 7779 : _name = name, |
| 7780 _prefixReference = prefixReference; |
| 7781 |
| 7782 /** |
| 7783 * Flush [informative] data recursively. |
| 7784 */ |
| 7785 void flushInformative() { |
| 7786 } |
| 7787 |
| 7788 /** |
| 7789 * Accumulate non-[informative] data into [signature]. |
| 7790 */ |
| 7791 void collectApiSignature(api_sig.ApiSignature signature) { |
| 7792 signature.addString(this._name ?? ''); |
| 7793 signature.addInt(this._prefixReference ?? 0); |
| 7794 } |
| 7795 |
| 7796 fb.Offset finish(fb.Builder fbBuilder) { |
| 7797 fb.Offset offset_name; |
| 7798 if (_name != null) { |
| 7799 offset_name = fbBuilder.writeString(_name); |
| 7800 } |
| 7801 fbBuilder.startTable(); |
| 7802 if (offset_name != null) { |
| 7803 fbBuilder.addOffset(0, offset_name); |
| 7804 } |
| 7805 if (_prefixReference != null && _prefixReference != 0) { |
| 7806 fbBuilder.addUint32(1, _prefixReference); |
| 7807 } |
| 7808 return fbBuilder.endTable(); |
| 7809 } |
| 7810 } |
| 7811 |
| 7812 class _UnlinkedReferenceReader extends fb.TableReader<_UnlinkedReferenceImpl> { |
| 7813 const _UnlinkedReferenceReader(); |
| 7814 |
| 7815 @override |
| 7816 _UnlinkedReferenceImpl createObject(fb.BufferContext bc, int offset) => new _U
nlinkedReferenceImpl(bc, offset); |
| 7817 } |
| 7818 |
| 7819 class _UnlinkedReferenceImpl extends Object with _UnlinkedReferenceMixin impleme
nts idl.UnlinkedReference { |
| 7820 final fb.BufferContext _bc; |
| 7821 final int _bcOffset; |
| 7822 |
| 7823 _UnlinkedReferenceImpl(this._bc, this._bcOffset); |
| 7824 |
| 7825 String _name; |
| 7826 int _prefixReference; |
| 7827 |
| 7828 @override |
| 7829 String get name { |
| 7830 _name ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, ''); |
| 7831 return _name; |
| 7832 } |
| 7833 |
| 7834 @override |
| 7835 int get prefixReference { |
| 7836 _prefixReference ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 1, 0)
; |
| 7837 return _prefixReference; |
| 7838 } |
| 7839 } |
| 7840 |
| 7841 abstract class _UnlinkedReferenceMixin implements idl.UnlinkedReference { |
| 7842 @override |
| 7843 Map<String, Object> toJson() { |
| 7844 Map<String, Object> _result = <String, Object>{}; |
| 7845 if (name != '') _result["name"] = name; |
| 7846 if (prefixReference != 0) _result["prefixReference"] = prefixReference; |
| 7847 return _result; |
| 7848 } |
| 7849 |
| 7850 @override |
| 7851 Map<String, Object> toMap() => { |
| 7852 "name": name, |
| 7853 "prefixReference": prefixReference, |
| 7854 }; |
| 7855 |
| 7856 @override |
| 7857 String toString() => convert.JSON.encode(toJson()); |
| 7858 } |
| 7859 |
| 7860 class UnlinkedTypedefBuilder extends Object with _UnlinkedTypedefMixin implement
s idl.UnlinkedTypedef { |
| 7861 List<UnlinkedConstBuilder> _annotations; |
| 7862 CodeRangeBuilder _codeRange; |
| 7863 UnlinkedDocumentationCommentBuilder _documentationComment; |
| 7864 String _name; |
| 7865 int _nameOffset; |
| 7866 List<UnlinkedParamBuilder> _parameters; |
| 7867 EntityRefBuilder _returnType; |
| 7868 List<UnlinkedTypeParamBuilder> _typeParameters; |
| 7869 |
| 7870 @override |
| 7871 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; |
| 7872 |
| 7873 /** |
| 7874 * Annotations for this typedef. |
| 7875 */ |
| 7876 void set annotations(List<UnlinkedConstBuilder> value) { |
| 7877 this._annotations = value; |
| 7878 } |
| 7879 |
| 7880 @override |
| 7881 CodeRangeBuilder get codeRange => _codeRange; |
| 7882 |
| 7883 /** |
| 7884 * Code range of the typedef. |
| 7885 */ |
| 7886 void set codeRange(CodeRangeBuilder value) { |
| 7887 this._codeRange = value; |
| 7888 } |
| 7889 |
| 7890 @override |
| 7891 UnlinkedDocumentationCommentBuilder get documentationComment => _documentation
Comment; |
| 7892 |
| 7893 /** |
| 7894 * Documentation comment for the typedef, or `null` if there is no |
| 7895 * documentation comment. |
| 7896 */ |
| 7897 void set documentationComment(UnlinkedDocumentationCommentBuilder value) { |
| 7898 this._documentationComment = value; |
| 7899 } |
| 7900 |
| 7901 @override |
| 7902 String get name => _name ??= ''; |
| 7903 |
| 7904 /** |
| 7905 * Name of the typedef. |
| 7906 */ |
| 7907 void set name(String value) { |
| 7908 this._name = value; |
| 7909 } |
| 7910 |
| 7911 @override |
| 7912 int get nameOffset => _nameOffset ??= 0; |
| 7913 |
| 7914 /** |
| 7915 * Offset of the typedef name relative to the beginning of the file. |
| 7916 */ |
| 7917 void set nameOffset(int value) { |
| 7918 assert(value == null || value >= 0); |
| 7919 this._nameOffset = value; |
| 7920 } |
| 7921 |
| 7922 @override |
| 7923 List<UnlinkedParamBuilder> get parameters => _parameters ??= <UnlinkedParamBui
lder>[]; |
| 7924 |
| 7925 /** |
| 7926 * Parameters of the executable, if any. |
| 7927 */ |
| 7928 void set parameters(List<UnlinkedParamBuilder> value) { |
| 7929 this._parameters = value; |
| 7930 } |
| 7931 |
| 7932 @override |
| 7933 EntityRefBuilder get returnType => _returnType; |
| 7934 |
| 7935 /** |
| 7936 * Return type of the typedef. |
| 7937 */ |
| 7938 void set returnType(EntityRefBuilder value) { |
| 7939 this._returnType = value; |
| 7940 } |
| 7941 |
| 7942 @override |
| 7943 List<UnlinkedTypeParamBuilder> get typeParameters => _typeParameters ??= <Unli
nkedTypeParamBuilder>[]; |
| 7944 |
| 7945 /** |
| 7946 * Type parameters of the typedef, if any. |
| 7947 */ |
| 7948 void set typeParameters(List<UnlinkedTypeParamBuilder> value) { |
| 7949 this._typeParameters = value; |
| 7950 } |
| 7951 |
| 7952 UnlinkedTypedefBuilder({List<UnlinkedConstBuilder> annotations, CodeRangeBuild
er codeRange, UnlinkedDocumentationCommentBuilder documentationComment, String n
ame, int nameOffset, List<UnlinkedParamBuilder> parameters, EntityRefBuilder ret
urnType, List<UnlinkedTypeParamBuilder> typeParameters}) |
| 7953 : _annotations = annotations, |
| 7954 _codeRange = codeRange, |
| 7955 _documentationComment = documentationComment, |
| 7956 _name = name, |
| 7957 _nameOffset = nameOffset, |
| 7958 _parameters = parameters, |
| 7959 _returnType = returnType, |
| 7960 _typeParameters = typeParameters; |
| 7961 |
| 7962 /** |
| 7963 * Flush [informative] data recursively. |
| 7964 */ |
| 7965 void flushInformative() { |
| 7966 _annotations?.forEach((b) => b.flushInformative()); |
| 7967 _codeRange = null; |
| 7968 _documentationComment = null; |
| 7969 _nameOffset = null; |
| 7970 _parameters?.forEach((b) => b.flushInformative()); |
| 7971 _returnType?.flushInformative(); |
| 7972 _typeParameters?.forEach((b) => b.flushInformative()); |
| 7973 } |
| 7974 |
| 7975 /** |
| 7976 * Accumulate non-[informative] data into [signature]. |
| 7977 */ |
| 7978 void collectApiSignature(api_sig.ApiSignature signature) { |
| 7979 signature.addString(this._name ?? ''); |
| 7980 signature.addBool(this._returnType != null); |
| 7981 this._returnType?.collectApiSignature(signature); |
| 7982 if (this._parameters == null) { |
| 7983 signature.addInt(0); |
| 7984 } else { |
| 7985 signature.addInt(this._parameters.length); |
| 7986 for (var x in this._parameters) { |
| 7987 x?.collectApiSignature(signature); |
| 7988 } |
| 7989 } |
| 7990 if (this._annotations == null) { |
| 7991 signature.addInt(0); |
| 7992 } else { |
| 7993 signature.addInt(this._annotations.length); |
| 7994 for (var x in this._annotations) { |
| 7995 x?.collectApiSignature(signature); |
| 7996 } |
| 7997 } |
| 7998 if (this._typeParameters == null) { |
| 7999 signature.addInt(0); |
| 8000 } else { |
| 8001 signature.addInt(this._typeParameters.length); |
| 8002 for (var x in this._typeParameters) { |
| 8003 x?.collectApiSignature(signature); |
| 8004 } |
| 8005 } |
| 8006 } |
| 8007 |
| 8008 fb.Offset finish(fb.Builder fbBuilder) { |
| 8009 fb.Offset offset_annotations; |
| 8010 fb.Offset offset_codeRange; |
| 8011 fb.Offset offset_documentationComment; |
| 8012 fb.Offset offset_name; |
| 8013 fb.Offset offset_parameters; |
| 8014 fb.Offset offset_returnType; |
| 8015 fb.Offset offset_typeParameters; |
| 8016 if (!(_annotations == null || _annotations.isEmpty)) { |
| 8017 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); |
| 8018 } |
| 8019 if (_codeRange != null) { |
| 8020 offset_codeRange = _codeRange.finish(fbBuilder); |
| 8021 } |
| 8022 if (_documentationComment != null) { |
| 8023 offset_documentationComment = _documentationComment.finish(fbBuilder); |
| 8024 } |
| 8025 if (_name != null) { |
| 8026 offset_name = fbBuilder.writeString(_name); |
| 8027 } |
| 8028 if (!(_parameters == null || _parameters.isEmpty)) { |
| 8029 offset_parameters = fbBuilder.writeList(_parameters.map((b) => b.finish(fb
Builder)).toList()); |
| 8030 } |
| 8031 if (_returnType != null) { |
| 8032 offset_returnType = _returnType.finish(fbBuilder); |
| 8033 } |
| 8034 if (!(_typeParameters == null || _typeParameters.isEmpty)) { |
| 8035 offset_typeParameters = fbBuilder.writeList(_typeParameters.map((b) => b.f
inish(fbBuilder)).toList()); |
| 8036 } |
| 8037 fbBuilder.startTable(); |
| 8038 if (offset_annotations != null) { |
| 8039 fbBuilder.addOffset(4, offset_annotations); |
| 8040 } |
| 8041 if (offset_codeRange != null) { |
| 8042 fbBuilder.addOffset(7, offset_codeRange); |
| 8043 } |
| 8044 if (offset_documentationComment != null) { |
| 8045 fbBuilder.addOffset(6, offset_documentationComment); |
| 8046 } |
| 8047 if (offset_name != null) { |
| 8048 fbBuilder.addOffset(0, offset_name); |
| 8049 } |
| 8050 if (_nameOffset != null && _nameOffset != 0) { |
| 8051 fbBuilder.addUint32(1, _nameOffset); |
| 8052 } |
| 8053 if (offset_parameters != null) { |
| 8054 fbBuilder.addOffset(3, offset_parameters); |
| 8055 } |
| 8056 if (offset_returnType != null) { |
| 8057 fbBuilder.addOffset(2, offset_returnType); |
| 8058 } |
| 8059 if (offset_typeParameters != null) { |
| 8060 fbBuilder.addOffset(5, offset_typeParameters); |
| 8061 } |
| 8062 return fbBuilder.endTable(); |
| 8063 } |
| 8064 } |
| 8065 |
| 8066 class _UnlinkedTypedefReader extends fb.TableReader<_UnlinkedTypedefImpl> { |
| 8067 const _UnlinkedTypedefReader(); |
| 8068 |
| 8069 @override |
| 8070 _UnlinkedTypedefImpl createObject(fb.BufferContext bc, int offset) => new _Unl
inkedTypedefImpl(bc, offset); |
| 8071 } |
| 8072 |
| 8073 class _UnlinkedTypedefImpl extends Object with _UnlinkedTypedefMixin implements
idl.UnlinkedTypedef { |
| 8074 final fb.BufferContext _bc; |
| 8075 final int _bcOffset; |
| 8076 |
| 8077 _UnlinkedTypedefImpl(this._bc, this._bcOffset); |
| 8078 |
| 8079 List<idl.UnlinkedConst> _annotations; |
| 8080 idl.CodeRange _codeRange; |
| 8081 idl.UnlinkedDocumentationComment _documentationComment; |
| 8082 String _name; |
| 8083 int _nameOffset; |
| 8084 List<idl.UnlinkedParam> _parameters; |
| 8085 idl.EntityRef _returnType; |
| 8086 List<idl.UnlinkedTypeParam> _typeParameters; |
| 8087 |
| 8088 @override |
| 8089 List<idl.UnlinkedConst> get annotations { |
| 8090 _annotations ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConst
Reader()).vTableGet(_bc, _bcOffset, 4, const <idl.UnlinkedConst>[]); |
| 8091 return _annotations; |
| 8092 } |
| 8093 |
| 8094 @override |
| 8095 idl.CodeRange get codeRange { |
| 8096 _codeRange ??= const _CodeRangeReader().vTableGet(_bc, _bcOffset, 7, null); |
| 8097 return _codeRange; |
| 8098 } |
| 8099 |
| 8100 @override |
| 8101 idl.UnlinkedDocumentationComment get documentationComment { |
| 8102 _documentationComment ??= const _UnlinkedDocumentationCommentReader().vTable
Get(_bc, _bcOffset, 6, null); |
| 8103 return _documentationComment; |
| 8104 } |
| 8105 |
| 8106 @override |
| 8107 String get name { |
| 8108 _name ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, ''); |
| 8109 return _name; |
| 8110 } |
| 8111 |
| 8112 @override |
| 8113 int get nameOffset { |
| 8114 _nameOffset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 1, 0); |
| 8115 return _nameOffset; |
| 8116 } |
| 8117 |
| 8118 @override |
| 8119 List<idl.UnlinkedParam> get parameters { |
| 8120 _parameters ??= const fb.ListReader<idl.UnlinkedParam>(const _UnlinkedParamR
eader()).vTableGet(_bc, _bcOffset, 3, const <idl.UnlinkedParam>[]); |
| 8121 return _parameters; |
| 8122 } |
| 8123 |
| 8124 @override |
| 8125 idl.EntityRef get returnType { |
| 8126 _returnType ??= const _EntityRefReader().vTableGet(_bc, _bcOffset, 2, null); |
| 8127 return _returnType; |
| 8128 } |
| 8129 |
| 8130 @override |
| 8131 List<idl.UnlinkedTypeParam> get typeParameters { |
| 8132 _typeParameters ??= const fb.ListReader<idl.UnlinkedTypeParam>(const _Unlink
edTypeParamReader()).vTableGet(_bc, _bcOffset, 5, const <idl.UnlinkedTypeParam>[
]); |
| 8133 return _typeParameters; |
| 8134 } |
| 8135 } |
| 8136 |
| 8137 abstract class _UnlinkedTypedefMixin implements idl.UnlinkedTypedef { |
| 8138 @override |
| 8139 Map<String, Object> toJson() { |
| 8140 Map<String, Object> _result = <String, Object>{}; |
| 8141 if (annotations.isNotEmpty) _result["annotations"] = annotations.map((_value
) => _value.toJson()).toList(); |
| 8142 if (codeRange != null) _result["codeRange"] = codeRange.toJson(); |
| 8143 if (documentationComment != null) _result["documentationComment"] = document
ationComment.toJson(); |
| 8144 if (name != '') _result["name"] = name; |
| 8145 if (nameOffset != 0) _result["nameOffset"] = nameOffset; |
| 8146 if (parameters.isNotEmpty) _result["parameters"] = parameters.map((_value) =
> _value.toJson()).toList(); |
| 8147 if (returnType != null) _result["returnType"] = returnType.toJson(); |
| 8148 if (typeParameters.isNotEmpty) _result["typeParameters"] = typeParameters.ma
p((_value) => _value.toJson()).toList(); |
| 8149 return _result; |
| 8150 } |
| 8151 |
| 8152 @override |
| 8153 Map<String, Object> toMap() => { |
| 8154 "annotations": annotations, |
| 8155 "codeRange": codeRange, |
| 8156 "documentationComment": documentationComment, |
| 8157 "name": name, |
| 8158 "nameOffset": nameOffset, |
| 8159 "parameters": parameters, |
| 8160 "returnType": returnType, |
| 8161 "typeParameters": typeParameters, |
| 8162 }; |
| 8163 |
| 8164 @override |
| 8165 String toString() => convert.JSON.encode(toJson()); |
| 8166 } |
| 8167 |
| 8168 class UnlinkedTypeParamBuilder extends Object with _UnlinkedTypeParamMixin imple
ments idl.UnlinkedTypeParam { |
| 8169 List<UnlinkedConstBuilder> _annotations; |
| 8170 EntityRefBuilder _bound; |
| 8171 CodeRangeBuilder _codeRange; |
| 8172 String _name; |
| 8173 int _nameOffset; |
| 8174 |
| 8175 @override |
| 8176 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; |
| 8177 |
| 8178 /** |
| 8179 * Annotations for this type parameter. |
| 8180 */ |
| 8181 void set annotations(List<UnlinkedConstBuilder> value) { |
| 8182 this._annotations = value; |
| 8183 } |
| 8184 |
| 8185 @override |
| 8186 EntityRefBuilder get bound => _bound; |
| 8187 |
| 8188 /** |
| 8189 * Bound of the type parameter, if a bound is explicitly declared. Otherwise |
| 8190 * null. |
| 8191 */ |
| 8192 void set bound(EntityRefBuilder value) { |
| 8193 this._bound = value; |
| 8194 } |
| 8195 |
| 8196 @override |
| 8197 CodeRangeBuilder get codeRange => _codeRange; |
| 8198 |
| 8199 /** |
| 8200 * Code range of the type parameter. |
| 8201 */ |
| 8202 void set codeRange(CodeRangeBuilder value) { |
| 8203 this._codeRange = value; |
| 8204 } |
| 8205 |
| 8206 @override |
| 8207 String get name => _name ??= ''; |
| 8208 |
| 8209 /** |
| 8210 * Name of the type parameter. |
| 8211 */ |
| 8212 void set name(String value) { |
| 8213 this._name = value; |
| 8214 } |
| 8215 |
| 8216 @override |
| 8217 int get nameOffset => _nameOffset ??= 0; |
| 8218 |
| 8219 /** |
| 8220 * Offset of the type parameter name relative to the beginning of the file. |
| 8221 */ |
| 8222 void set nameOffset(int value) { |
| 8223 assert(value == null || value >= 0); |
| 8224 this._nameOffset = value; |
| 8225 } |
| 8226 |
| 8227 UnlinkedTypeParamBuilder({List<UnlinkedConstBuilder> annotations, EntityRefBui
lder bound, CodeRangeBuilder codeRange, String name, int nameOffset}) |
| 8228 : _annotations = annotations, |
| 8229 _bound = bound, |
| 8230 _codeRange = codeRange, |
| 8231 _name = name, |
| 8232 _nameOffset = nameOffset; |
| 8233 |
| 8234 /** |
| 8235 * Flush [informative] data recursively. |
| 8236 */ |
| 8237 void flushInformative() { |
| 8238 _annotations?.forEach((b) => b.flushInformative()); |
| 8239 _bound?.flushInformative(); |
| 8240 _codeRange = null; |
| 8241 _nameOffset = null; |
| 8242 } |
| 8243 |
| 8244 /** |
| 8245 * Accumulate non-[informative] data into [signature]. |
| 8246 */ |
| 8247 void collectApiSignature(api_sig.ApiSignature signature) { |
| 8248 signature.addString(this._name ?? ''); |
| 8249 signature.addBool(this._bound != null); |
| 8250 this._bound?.collectApiSignature(signature); |
| 8251 if (this._annotations == null) { |
| 8252 signature.addInt(0); |
| 8253 } else { |
| 8254 signature.addInt(this._annotations.length); |
| 8255 for (var x in this._annotations) { |
| 8256 x?.collectApiSignature(signature); |
| 8257 } |
| 8258 } |
| 8259 } |
| 8260 |
| 8261 fb.Offset finish(fb.Builder fbBuilder) { |
| 8262 fb.Offset offset_annotations; |
| 8263 fb.Offset offset_bound; |
| 8264 fb.Offset offset_codeRange; |
| 8265 fb.Offset offset_name; |
| 8266 if (!(_annotations == null || _annotations.isEmpty)) { |
| 8267 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); |
| 8268 } |
| 8269 if (_bound != null) { |
| 8270 offset_bound = _bound.finish(fbBuilder); |
| 8271 } |
| 8272 if (_codeRange != null) { |
| 8273 offset_codeRange = _codeRange.finish(fbBuilder); |
| 8274 } |
| 8275 if (_name != null) { |
| 8276 offset_name = fbBuilder.writeString(_name); |
| 8277 } |
| 8278 fbBuilder.startTable(); |
| 8279 if (offset_annotations != null) { |
| 8280 fbBuilder.addOffset(3, offset_annotations); |
| 8281 } |
| 8282 if (offset_bound != null) { |
| 8283 fbBuilder.addOffset(2, offset_bound); |
| 8284 } |
| 8285 if (offset_codeRange != null) { |
| 8286 fbBuilder.addOffset(4, offset_codeRange); |
| 8287 } |
| 8288 if (offset_name != null) { |
| 8289 fbBuilder.addOffset(0, offset_name); |
| 8290 } |
| 8291 if (_nameOffset != null && _nameOffset != 0) { |
| 8292 fbBuilder.addUint32(1, _nameOffset); |
| 8293 } |
| 8294 return fbBuilder.endTable(); |
| 8295 } |
| 8296 } |
| 8297 |
| 8298 class _UnlinkedTypeParamReader extends fb.TableReader<_UnlinkedTypeParamImpl> { |
| 8299 const _UnlinkedTypeParamReader(); |
| 8300 |
| 8301 @override |
| 8302 _UnlinkedTypeParamImpl createObject(fb.BufferContext bc, int offset) => new _U
nlinkedTypeParamImpl(bc, offset); |
| 8303 } |
| 8304 |
| 8305 class _UnlinkedTypeParamImpl extends Object with _UnlinkedTypeParamMixin impleme
nts idl.UnlinkedTypeParam { |
| 8306 final fb.BufferContext _bc; |
| 8307 final int _bcOffset; |
| 8308 |
| 8309 _UnlinkedTypeParamImpl(this._bc, this._bcOffset); |
| 8310 |
| 8311 List<idl.UnlinkedConst> _annotations; |
| 8312 idl.EntityRef _bound; |
| 8313 idl.CodeRange _codeRange; |
| 8314 String _name; |
| 8315 int _nameOffset; |
| 8316 |
| 8317 @override |
| 8318 List<idl.UnlinkedConst> get annotations { |
| 8319 _annotations ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConst
Reader()).vTableGet(_bc, _bcOffset, 3, const <idl.UnlinkedConst>[]); |
| 8320 return _annotations; |
| 8321 } |
| 8322 |
| 8323 @override |
| 8324 idl.EntityRef get bound { |
| 8325 _bound ??= const _EntityRefReader().vTableGet(_bc, _bcOffset, 2, null); |
| 8326 return _bound; |
| 8327 } |
| 8328 |
| 8329 @override |
| 8330 idl.CodeRange get codeRange { |
| 8331 _codeRange ??= const _CodeRangeReader().vTableGet(_bc, _bcOffset, 4, null); |
| 8332 return _codeRange; |
| 8333 } |
| 8334 |
| 8335 @override |
| 8336 String get name { |
| 8337 _name ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, ''); |
| 8338 return _name; |
| 8339 } |
| 8340 |
| 8341 @override |
| 8342 int get nameOffset { |
| 8343 _nameOffset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 1, 0); |
| 8344 return _nameOffset; |
| 8345 } |
| 8346 } |
| 8347 |
| 8348 abstract class _UnlinkedTypeParamMixin implements idl.UnlinkedTypeParam { |
| 8349 @override |
| 8350 Map<String, Object> toJson() { |
| 8351 Map<String, Object> _result = <String, Object>{}; |
| 8352 if (annotations.isNotEmpty) _result["annotations"] = annotations.map((_value
) => _value.toJson()).toList(); |
| 8353 if (bound != null) _result["bound"] = bound.toJson(); |
| 8354 if (codeRange != null) _result["codeRange"] = codeRange.toJson(); |
| 8355 if (name != '') _result["name"] = name; |
| 8356 if (nameOffset != 0) _result["nameOffset"] = nameOffset; |
| 8357 return _result; |
| 8358 } |
| 8359 |
| 8360 @override |
| 8361 Map<String, Object> toMap() => { |
| 8362 "annotations": annotations, |
| 8363 "bound": bound, |
| 8364 "codeRange": codeRange, |
| 8365 "name": name, |
| 8366 "nameOffset": nameOffset, |
| 8367 }; |
| 8368 |
| 8369 @override |
| 8370 String toString() => convert.JSON.encode(toJson()); |
| 8371 } |
| 8372 |
| 8373 class UnlinkedUnitBuilder extends Object with _UnlinkedUnitMixin implements idl.
UnlinkedUnit { |
| 8374 List<UnlinkedClassBuilder> _classes; |
| 8375 CodeRangeBuilder _codeRange; |
| 8376 List<UnlinkedEnumBuilder> _enums; |
| 8377 List<UnlinkedExecutableBuilder> _executables; |
| 8378 List<UnlinkedExportNonPublicBuilder> _exports; |
| 8379 String _fallbackModePath; |
| 8380 List<UnlinkedImportBuilder> _imports; |
| 8381 List<UnlinkedConstBuilder> _libraryAnnotations; |
| 8382 UnlinkedDocumentationCommentBuilder _libraryDocumentationComment; |
| 8383 String _libraryName; |
| 8384 int _libraryNameLength; |
| 8385 int _libraryNameOffset; |
| 8386 List<int> _lineStarts; |
| 8387 List<UnlinkedPartBuilder> _parts; |
| 8388 UnlinkedPublicNamespaceBuilder _publicNamespace; |
| 8389 List<UnlinkedReferenceBuilder> _references; |
| 8390 List<UnlinkedTypedefBuilder> _typedefs; |
| 8391 List<UnlinkedVariableBuilder> _variables; |
| 8392 |
| 8393 @override |
| 8394 List<UnlinkedClassBuilder> get classes => _classes ??= <UnlinkedClassBuilder>[
]; |
| 8395 |
| 8396 /** |
| 8397 * Classes declared in the compilation unit. |
| 8398 */ |
| 8399 void set classes(List<UnlinkedClassBuilder> value) { |
| 8400 this._classes = value; |
| 8401 } |
| 8402 |
| 8403 @override |
| 8404 CodeRangeBuilder get codeRange => _codeRange; |
| 8405 |
| 8406 /** |
| 8407 * Code range of the unit. |
| 8408 */ |
| 8409 void set codeRange(CodeRangeBuilder value) { |
| 8410 this._codeRange = value; |
| 8411 } |
| 8412 |
| 8413 @override |
| 8414 List<UnlinkedEnumBuilder> get enums => _enums ??= <UnlinkedEnumBuilder>[]; |
| 8415 |
| 8416 /** |
| 8417 * Enums declared in the compilation unit. |
| 8418 */ |
| 8419 void set enums(List<UnlinkedEnumBuilder> value) { |
| 8420 this._enums = value; |
| 8421 } |
| 8422 |
| 8423 @override |
| 8424 List<UnlinkedExecutableBuilder> get executables => _executables ??= <UnlinkedE
xecutableBuilder>[]; |
| 8425 |
| 8426 /** |
| 8427 * Top level executable objects (functions, getters, and setters) declared in |
| 8428 * the compilation unit. |
| 8429 */ |
| 8430 void set executables(List<UnlinkedExecutableBuilder> value) { |
| 8431 this._executables = value; |
| 8432 } |
| 8433 |
| 8434 @override |
| 8435 List<UnlinkedExportNonPublicBuilder> get exports => _exports ??= <UnlinkedExpo
rtNonPublicBuilder>[]; |
| 8436 |
| 8437 /** |
| 8438 * Export declarations in the compilation unit. |
| 8439 */ |
| 8440 void set exports(List<UnlinkedExportNonPublicBuilder> value) { |
| 8441 this._exports = value; |
| 8442 } |
| 8443 |
| 8444 @override |
| 8445 String get fallbackModePath => _fallbackModePath ??= ''; |
| 8446 |
| 8447 /** |
| 8448 * If this compilation unit was summarized in fallback mode, the path where |
| 8449 * the compilation unit may be found on disk. Otherwise empty. |
| 8450 * |
| 8451 * When this field is non-empty, all other fields in the data structure have |
| 8452 * their default values. |
| 8453 */ |
| 8454 void set fallbackModePath(String value) { |
| 8455 this._fallbackModePath = value; |
| 8456 } |
| 8457 |
| 8458 @override |
| 8459 List<UnlinkedImportBuilder> get imports => _imports ??= <UnlinkedImportBuilder
>[]; |
| 8460 |
| 8461 /** |
| 8462 * Import declarations in the compilation unit. |
| 8463 */ |
| 8464 void set imports(List<UnlinkedImportBuilder> value) { |
| 8465 this._imports = value; |
| 8466 } |
| 8467 |
| 8468 @override |
| 8469 List<UnlinkedConstBuilder> get libraryAnnotations => _libraryAnnotations ??= <
UnlinkedConstBuilder>[]; |
| 8470 |
| 8471 /** |
| 8472 * Annotations for the library declaration, or the empty list if there is no |
| 8473 * library declaration. |
| 8474 */ |
| 8475 void set libraryAnnotations(List<UnlinkedConstBuilder> value) { |
| 8476 this._libraryAnnotations = value; |
| 8477 } |
| 8478 |
| 8479 @override |
| 8480 UnlinkedDocumentationCommentBuilder get libraryDocumentationComment => _librar
yDocumentationComment; |
| 8481 |
| 8482 /** |
| 8483 * Documentation comment for the library, or `null` if there is no |
| 8484 * documentation comment. |
| 8485 */ |
| 8486 void set libraryDocumentationComment(UnlinkedDocumentationCommentBuilder value
) { |
| 8487 this._libraryDocumentationComment = value; |
| 8488 } |
| 8489 |
| 8490 @override |
| 8491 String get libraryName => _libraryName ??= ''; |
| 8492 |
| 8493 /** |
| 8494 * Name of the library (from a "library" declaration, if present). |
| 8495 */ |
| 8496 void set libraryName(String value) { |
| 8497 this._libraryName = value; |
| 8498 } |
| 8499 |
| 8500 @override |
| 8501 int get libraryNameLength => _libraryNameLength ??= 0; |
| 8502 |
| 8503 /** |
| 8504 * Length of the library name as it appears in the source code (or 0 if the |
| 8505 * library has no name). |
| 8506 */ |
| 8507 void set libraryNameLength(int value) { |
| 8508 assert(value == null || value >= 0); |
| 8509 this._libraryNameLength = value; |
| 8510 } |
| 8511 |
| 8512 @override |
| 8513 int get libraryNameOffset => _libraryNameOffset ??= 0; |
| 8514 |
| 8515 /** |
| 8516 * Offset of the library name relative to the beginning of the file (or 0 if |
| 8517 * the library has no name). |
| 8518 */ |
| 8519 void set libraryNameOffset(int value) { |
| 8520 assert(value == null || value >= 0); |
| 8521 this._libraryNameOffset = value; |
| 8522 } |
| 8523 |
| 8524 @override |
| 8525 List<int> get lineStarts => _lineStarts ??= <int>[]; |
| 8526 |
| 8527 /** |
| 8528 * Offsets of the first character of each line in the source code. |
| 8529 */ |
| 8530 void set lineStarts(List<int> value) { |
| 8531 assert(value == null || value.every((e) => e >= 0)); |
| 8532 this._lineStarts = value; |
| 8533 } |
| 8534 |
| 8535 @override |
| 8536 List<UnlinkedPartBuilder> get parts => _parts ??= <UnlinkedPartBuilder>[]; |
| 8537 |
| 8538 /** |
| 8539 * Part declarations in the compilation unit. |
| 8540 */ |
| 8541 void set parts(List<UnlinkedPartBuilder> value) { |
| 8542 this._parts = value; |
| 8543 } |
| 8544 |
| 8545 @override |
| 8546 UnlinkedPublicNamespaceBuilder get publicNamespace => _publicNamespace; |
| 8547 |
| 8548 /** |
| 8549 * Unlinked public namespace of this compilation unit. |
| 8550 */ |
| 8551 void set publicNamespace(UnlinkedPublicNamespaceBuilder value) { |
| 8552 this._publicNamespace = value; |
| 8553 } |
| 8554 |
| 8555 @override |
| 8556 List<UnlinkedReferenceBuilder> get references => _references ??= <UnlinkedRefe
renceBuilder>[]; |
| 8557 |
| 8558 /** |
| 8559 * Top level and prefixed names referred to by this compilation unit. The |
| 8560 * zeroth element of this array is always populated and is used to represent |
| 8561 * the absence of a reference in places where a reference is optional (for |
| 8562 * example [UnlinkedReference.prefixReference or |
| 8563 * UnlinkedImport.prefixReference]). |
| 8564 */ |
| 8565 void set references(List<UnlinkedReferenceBuilder> value) { |
| 8566 this._references = value; |
| 8567 } |
| 8568 |
| 8569 @override |
| 8570 List<UnlinkedTypedefBuilder> get typedefs => _typedefs ??= <UnlinkedTypedefBui
lder>[]; |
| 8571 |
| 8572 /** |
| 8573 * Typedefs declared in the compilation unit. |
| 8574 */ |
| 8575 void set typedefs(List<UnlinkedTypedefBuilder> value) { |
| 8576 this._typedefs = value; |
| 8577 } |
| 8578 |
| 8579 @override |
| 8580 List<UnlinkedVariableBuilder> get variables => _variables ??= <UnlinkedVariabl
eBuilder>[]; |
| 8581 |
| 8582 /** |
| 8583 * Top level variables declared in the compilation unit. |
| 8584 */ |
| 8585 void set variables(List<UnlinkedVariableBuilder> value) { |
| 8586 this._variables = value; |
| 8587 } |
| 8588 |
| 8589 UnlinkedUnitBuilder({List<UnlinkedClassBuilder> classes, CodeRangeBuilder code
Range, List<UnlinkedEnumBuilder> enums, List<UnlinkedExecutableBuilder> executab
les, List<UnlinkedExportNonPublicBuilder> exports, String fallbackModePath, List
<UnlinkedImportBuilder> imports, List<UnlinkedConstBuilder> libraryAnnotations,
UnlinkedDocumentationCommentBuilder libraryDocumentationComment, String libraryN
ame, int libraryNameLength, int libraryNameOffset, List<int> lineStarts, List<Un
linkedPartBuilder> parts, UnlinkedPublicNamespaceBuilder publicNamespace, List<U
nlinkedReferenceBuilder> references, List<UnlinkedTypedefBuilder> typedefs, List
<UnlinkedVariableBuilder> variables}) |
| 8590 : _classes = classes, |
| 8591 _codeRange = codeRange, |
| 8592 _enums = enums, |
| 8593 _executables = executables, |
| 8594 _exports = exports, |
| 8595 _fallbackModePath = fallbackModePath, |
| 8596 _imports = imports, |
| 8597 _libraryAnnotations = libraryAnnotations, |
| 8598 _libraryDocumentationComment = libraryDocumentationComment, |
| 8599 _libraryName = libraryName, |
| 8600 _libraryNameLength = libraryNameLength, |
| 8601 _libraryNameOffset = libraryNameOffset, |
| 8602 _lineStarts = lineStarts, |
| 8603 _parts = parts, |
| 8604 _publicNamespace = publicNamespace, |
| 8605 _references = references, |
| 8606 _typedefs = typedefs, |
| 8607 _variables = variables; |
| 8608 |
| 8609 /** |
| 8610 * Flush [informative] data recursively. |
| 8611 */ |
| 8612 void flushInformative() { |
| 8613 _classes?.forEach((b) => b.flushInformative()); |
| 8614 _codeRange = null; |
| 8615 _enums?.forEach((b) => b.flushInformative()); |
| 8616 _executables?.forEach((b) => b.flushInformative()); |
| 8617 _exports?.forEach((b) => b.flushInformative()); |
| 8618 _imports?.forEach((b) => b.flushInformative()); |
| 8619 _libraryAnnotations?.forEach((b) => b.flushInformative()); |
| 8620 _libraryDocumentationComment = null; |
| 8621 _libraryNameLength = null; |
| 8622 _libraryNameOffset = null; |
| 8623 _lineStarts = null; |
| 8624 _parts?.forEach((b) => b.flushInformative()); |
| 8625 _publicNamespace?.flushInformative(); |
| 8626 _references?.forEach((b) => b.flushInformative()); |
| 8627 _typedefs?.forEach((b) => b.flushInformative()); |
| 8628 _variables?.forEach((b) => b.flushInformative()); |
| 8629 } |
| 8630 |
| 8631 /** |
| 8632 * Accumulate non-[informative] data into [signature]. |
| 8633 */ |
| 8634 void collectApiSignature(api_sig.ApiSignature signature) { |
| 8635 signature.addBool(this._publicNamespace != null); |
| 8636 this._publicNamespace?.collectApiSignature(signature); |
| 8637 if (this._references == null) { |
| 8638 signature.addInt(0); |
| 8639 } else { |
| 8640 signature.addInt(this._references.length); |
| 8641 for (var x in this._references) { |
| 8642 x?.collectApiSignature(signature); |
| 8643 } |
| 8644 } |
| 8645 if (this._classes == null) { |
| 8646 signature.addInt(0); |
| 8647 } else { |
| 8648 signature.addInt(this._classes.length); |
| 8649 for (var x in this._classes) { |
| 8650 x?.collectApiSignature(signature); |
| 8651 } |
| 8652 } |
| 8653 if (this._variables == null) { |
| 8654 signature.addInt(0); |
| 8655 } else { |
| 8656 signature.addInt(this._variables.length); |
| 8657 for (var x in this._variables) { |
| 8658 x?.collectApiSignature(signature); |
| 8659 } |
| 8660 } |
| 8661 if (this._executables == null) { |
| 8662 signature.addInt(0); |
| 8663 } else { |
| 8664 signature.addInt(this._executables.length); |
| 8665 for (var x in this._executables) { |
| 8666 x?.collectApiSignature(signature); |
| 8667 } |
| 8668 } |
| 8669 if (this._imports == null) { |
| 8670 signature.addInt(0); |
| 8671 } else { |
| 8672 signature.addInt(this._imports.length); |
| 8673 for (var x in this._imports) { |
| 8674 x?.collectApiSignature(signature); |
| 8675 } |
| 8676 } |
| 8677 signature.addString(this._libraryName ?? ''); |
| 8678 if (this._typedefs == null) { |
| 8679 signature.addInt(0); |
| 8680 } else { |
| 8681 signature.addInt(this._typedefs.length); |
| 8682 for (var x in this._typedefs) { |
| 8683 x?.collectApiSignature(signature); |
| 8684 } |
| 8685 } |
| 8686 if (this._parts == null) { |
| 8687 signature.addInt(0); |
| 8688 } else { |
| 8689 signature.addInt(this._parts.length); |
| 8690 for (var x in this._parts) { |
| 8691 x?.collectApiSignature(signature); |
| 8692 } |
| 8693 } |
| 8694 if (this._enums == null) { |
| 8695 signature.addInt(0); |
| 8696 } else { |
| 8697 signature.addInt(this._enums.length); |
| 8698 for (var x in this._enums) { |
| 8699 x?.collectApiSignature(signature); |
| 8700 } |
| 8701 } |
| 8702 if (this._exports == null) { |
| 8703 signature.addInt(0); |
| 8704 } else { |
| 8705 signature.addInt(this._exports.length); |
| 8706 for (var x in this._exports) { |
| 8707 x?.collectApiSignature(signature); |
| 8708 } |
| 8709 } |
| 8710 if (this._libraryAnnotations == null) { |
| 8711 signature.addInt(0); |
| 8712 } else { |
| 8713 signature.addInt(this._libraryAnnotations.length); |
| 8714 for (var x in this._libraryAnnotations) { |
| 8715 x?.collectApiSignature(signature); |
| 8716 } |
| 8717 } |
| 8718 signature.addString(this._fallbackModePath ?? ''); |
| 8719 } |
| 8720 |
| 8721 List<int> toBuffer() { |
| 8722 fb.Builder fbBuilder = new fb.Builder(); |
| 8723 return fbBuilder.finish(finish(fbBuilder), "UUnt"); |
| 8724 } |
| 8725 |
| 8726 fb.Offset finish(fb.Builder fbBuilder) { |
| 8727 fb.Offset offset_classes; |
| 8728 fb.Offset offset_codeRange; |
| 8729 fb.Offset offset_enums; |
| 8730 fb.Offset offset_executables; |
| 8731 fb.Offset offset_exports; |
| 8732 fb.Offset offset_fallbackModePath; |
| 8733 fb.Offset offset_imports; |
| 8734 fb.Offset offset_libraryAnnotations; |
| 8735 fb.Offset offset_libraryDocumentationComment; |
| 8736 fb.Offset offset_libraryName; |
| 8737 fb.Offset offset_lineStarts; |
| 8738 fb.Offset offset_parts; |
| 8739 fb.Offset offset_publicNamespace; |
| 8740 fb.Offset offset_references; |
| 8741 fb.Offset offset_typedefs; |
| 8742 fb.Offset offset_variables; |
| 8743 if (!(_classes == null || _classes.isEmpty)) { |
| 8744 offset_classes = fbBuilder.writeList(_classes.map((b) => b.finish(fbBuilde
r)).toList()); |
| 8745 } |
| 8746 if (_codeRange != null) { |
| 8747 offset_codeRange = _codeRange.finish(fbBuilder); |
| 8748 } |
| 8749 if (!(_enums == null || _enums.isEmpty)) { |
| 8750 offset_enums = fbBuilder.writeList(_enums.map((b) => b.finish(fbBuilder)).
toList()); |
| 8751 } |
| 8752 if (!(_executables == null || _executables.isEmpty)) { |
| 8753 offset_executables = fbBuilder.writeList(_executables.map((b) => b.finish(
fbBuilder)).toList()); |
| 8754 } |
| 8755 if (!(_exports == null || _exports.isEmpty)) { |
| 8756 offset_exports = fbBuilder.writeList(_exports.map((b) => b.finish(fbBuilde
r)).toList()); |
| 8757 } |
| 8758 if (_fallbackModePath != null) { |
| 8759 offset_fallbackModePath = fbBuilder.writeString(_fallbackModePath); |
| 8760 } |
| 8761 if (!(_imports == null || _imports.isEmpty)) { |
| 8762 offset_imports = fbBuilder.writeList(_imports.map((b) => b.finish(fbBuilde
r)).toList()); |
| 8763 } |
| 8764 if (!(_libraryAnnotations == null || _libraryAnnotations.isEmpty)) { |
| 8765 offset_libraryAnnotations = fbBuilder.writeList(_libraryAnnotations.map((b
) => b.finish(fbBuilder)).toList()); |
| 8766 } |
| 8767 if (_libraryDocumentationComment != null) { |
| 8768 offset_libraryDocumentationComment = _libraryDocumentationComment.finish(f
bBuilder); |
| 8769 } |
| 8770 if (_libraryName != null) { |
| 8771 offset_libraryName = fbBuilder.writeString(_libraryName); |
| 8772 } |
| 8773 if (!(_lineStarts == null || _lineStarts.isEmpty)) { |
| 8774 offset_lineStarts = fbBuilder.writeListUint32(_lineStarts); |
| 8775 } |
| 8776 if (!(_parts == null || _parts.isEmpty)) { |
| 8777 offset_parts = fbBuilder.writeList(_parts.map((b) => b.finish(fbBuilder)).
toList()); |
| 8778 } |
| 8779 if (_publicNamespace != null) { |
| 8780 offset_publicNamespace = _publicNamespace.finish(fbBuilder); |
| 8781 } |
| 8782 if (!(_references == null || _references.isEmpty)) { |
| 8783 offset_references = fbBuilder.writeList(_references.map((b) => b.finish(fb
Builder)).toList()); |
| 8784 } |
| 8785 if (!(_typedefs == null || _typedefs.isEmpty)) { |
| 8786 offset_typedefs = fbBuilder.writeList(_typedefs.map((b) => b.finish(fbBuil
der)).toList()); |
| 8787 } |
| 8788 if (!(_variables == null || _variables.isEmpty)) { |
| 8789 offset_variables = fbBuilder.writeList(_variables.map((b) => b.finish(fbBu
ilder)).toList()); |
| 8790 } |
| 8791 fbBuilder.startTable(); |
| 8792 if (offset_classes != null) { |
| 8793 fbBuilder.addOffset(2, offset_classes); |
| 8794 } |
| 8795 if (offset_codeRange != null) { |
| 8796 fbBuilder.addOffset(15, offset_codeRange); |
| 8797 } |
| 8798 if (offset_enums != null) { |
| 8799 fbBuilder.addOffset(12, offset_enums); |
| 8800 } |
| 8801 if (offset_executables != null) { |
| 8802 fbBuilder.addOffset(4, offset_executables); |
| 8803 } |
| 8804 if (offset_exports != null) { |
| 8805 fbBuilder.addOffset(13, offset_exports); |
| 8806 } |
| 8807 if (offset_fallbackModePath != null) { |
| 8808 fbBuilder.addOffset(16, offset_fallbackModePath); |
| 8809 } |
| 8810 if (offset_imports != null) { |
| 8811 fbBuilder.addOffset(5, offset_imports); |
| 8812 } |
| 8813 if (offset_libraryAnnotations != null) { |
| 8814 fbBuilder.addOffset(14, offset_libraryAnnotations); |
| 8815 } |
| 8816 if (offset_libraryDocumentationComment != null) { |
| 8817 fbBuilder.addOffset(9, offset_libraryDocumentationComment); |
| 8818 } |
| 8819 if (offset_libraryName != null) { |
| 8820 fbBuilder.addOffset(6, offset_libraryName); |
| 8821 } |
| 8822 if (_libraryNameLength != null && _libraryNameLength != 0) { |
| 8823 fbBuilder.addUint32(7, _libraryNameLength); |
| 8824 } |
| 8825 if (_libraryNameOffset != null && _libraryNameOffset != 0) { |
| 8826 fbBuilder.addUint32(8, _libraryNameOffset); |
| 8827 } |
| 8828 if (offset_lineStarts != null) { |
| 8829 fbBuilder.addOffset(17, offset_lineStarts); |
| 8830 } |
| 8831 if (offset_parts != null) { |
| 8832 fbBuilder.addOffset(11, offset_parts); |
| 8833 } |
| 8834 if (offset_publicNamespace != null) { |
| 8835 fbBuilder.addOffset(0, offset_publicNamespace); |
| 8836 } |
| 8837 if (offset_references != null) { |
| 8838 fbBuilder.addOffset(1, offset_references); |
| 8839 } |
| 8840 if (offset_typedefs != null) { |
| 8841 fbBuilder.addOffset(10, offset_typedefs); |
| 8842 } |
| 8843 if (offset_variables != null) { |
| 8844 fbBuilder.addOffset(3, offset_variables); |
| 8845 } |
| 8846 return fbBuilder.endTable(); |
| 8847 } |
| 8848 } |
| 8849 |
| 8850 idl.UnlinkedUnit readUnlinkedUnit(List<int> buffer) { |
| 8851 fb.BufferContext rootRef = new fb.BufferContext.fromBytes(buffer); |
| 8852 return const _UnlinkedUnitReader().read(rootRef, 0); |
| 8853 } |
| 8854 |
| 8855 class _UnlinkedUnitReader extends fb.TableReader<_UnlinkedUnitImpl> { |
| 8856 const _UnlinkedUnitReader(); |
| 8857 |
| 8858 @override |
| 8859 _UnlinkedUnitImpl createObject(fb.BufferContext bc, int offset) => new _Unlink
edUnitImpl(bc, offset); |
| 8860 } |
| 8861 |
| 8862 class _UnlinkedUnitImpl extends Object with _UnlinkedUnitMixin implements idl.Un
linkedUnit { |
| 8863 final fb.BufferContext _bc; |
| 8864 final int _bcOffset; |
| 8865 |
| 8866 _UnlinkedUnitImpl(this._bc, this._bcOffset); |
| 8867 |
| 8868 List<idl.UnlinkedClass> _classes; |
| 8869 idl.CodeRange _codeRange; |
| 8870 List<idl.UnlinkedEnum> _enums; |
| 8871 List<idl.UnlinkedExecutable> _executables; |
| 8872 List<idl.UnlinkedExportNonPublic> _exports; |
| 8873 String _fallbackModePath; |
| 8874 List<idl.UnlinkedImport> _imports; |
| 8875 List<idl.UnlinkedConst> _libraryAnnotations; |
| 8876 idl.UnlinkedDocumentationComment _libraryDocumentationComment; |
| 8877 String _libraryName; |
| 8878 int _libraryNameLength; |
| 8879 int _libraryNameOffset; |
| 8880 List<int> _lineStarts; |
| 8881 List<idl.UnlinkedPart> _parts; |
| 8882 idl.UnlinkedPublicNamespace _publicNamespace; |
| 8883 List<idl.UnlinkedReference> _references; |
| 8884 List<idl.UnlinkedTypedef> _typedefs; |
| 8885 List<idl.UnlinkedVariable> _variables; |
| 8886 |
| 8887 @override |
| 8888 List<idl.UnlinkedClass> get classes { |
| 8889 _classes ??= const fb.ListReader<idl.UnlinkedClass>(const _UnlinkedClassRead
er()).vTableGet(_bc, _bcOffset, 2, const <idl.UnlinkedClass>[]); |
| 8890 return _classes; |
| 8891 } |
| 8892 |
| 8893 @override |
| 8894 idl.CodeRange get codeRange { |
| 8895 _codeRange ??= const _CodeRangeReader().vTableGet(_bc, _bcOffset, 15, null); |
| 8896 return _codeRange; |
| 8897 } |
| 8898 |
| 8899 @override |
| 8900 List<idl.UnlinkedEnum> get enums { |
| 8901 _enums ??= const fb.ListReader<idl.UnlinkedEnum>(const _UnlinkedEnumReader()
).vTableGet(_bc, _bcOffset, 12, const <idl.UnlinkedEnum>[]); |
| 8902 return _enums; |
| 8903 } |
| 8904 |
| 8905 @override |
| 8906 List<idl.UnlinkedExecutable> get executables { |
| 8907 _executables ??= const fb.ListReader<idl.UnlinkedExecutable>(const _Unlinked
ExecutableReader()).vTableGet(_bc, _bcOffset, 4, const <idl.UnlinkedExecutable>[
]); |
| 8908 return _executables; |
| 8909 } |
| 8910 |
| 8911 @override |
| 8912 List<idl.UnlinkedExportNonPublic> get exports { |
| 8913 _exports ??= const fb.ListReader<idl.UnlinkedExportNonPublic>(const _Unlinke
dExportNonPublicReader()).vTableGet(_bc, _bcOffset, 13, const <idl.UnlinkedExpor
tNonPublic>[]); |
| 8914 return _exports; |
| 8915 } |
| 8916 |
| 8917 @override |
| 8918 String get fallbackModePath { |
| 8919 _fallbackModePath ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 16,
''); |
| 8920 return _fallbackModePath; |
| 8921 } |
| 8922 |
| 8923 @override |
| 8924 List<idl.UnlinkedImport> get imports { |
| 8925 _imports ??= const fb.ListReader<idl.UnlinkedImport>(const _UnlinkedImportRe
ader()).vTableGet(_bc, _bcOffset, 5, const <idl.UnlinkedImport>[]); |
| 8926 return _imports; |
| 8927 } |
| 8928 |
| 8929 @override |
| 8930 List<idl.UnlinkedConst> get libraryAnnotations { |
| 8931 _libraryAnnotations ??= const fb.ListReader<idl.UnlinkedConst>(const _Unlink
edConstReader()).vTableGet(_bc, _bcOffset, 14, const <idl.UnlinkedConst>[]); |
| 8932 return _libraryAnnotations; |
| 8933 } |
| 8934 |
| 8935 @override |
| 8936 idl.UnlinkedDocumentationComment get libraryDocumentationComment { |
| 8937 _libraryDocumentationComment ??= const _UnlinkedDocumentationCommentReader()
.vTableGet(_bc, _bcOffset, 9, null); |
| 8938 return _libraryDocumentationComment; |
| 8939 } |
| 8940 |
| 8941 @override |
| 8942 String get libraryName { |
| 8943 _libraryName ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 6, ''); |
| 8944 return _libraryName; |
| 8945 } |
| 8946 |
| 8947 @override |
| 8948 int get libraryNameLength { |
| 8949 _libraryNameLength ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 7,
0); |
| 8950 return _libraryNameLength; |
| 8951 } |
| 8952 |
| 8953 @override |
| 8954 int get libraryNameOffset { |
| 8955 _libraryNameOffset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 8,
0); |
| 8956 return _libraryNameOffset; |
| 8957 } |
| 8958 |
| 8959 @override |
| 8960 List<int> get lineStarts { |
| 8961 _lineStarts ??= const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 17, co
nst <int>[]); |
| 8962 return _lineStarts; |
| 8963 } |
| 8964 |
| 8965 @override |
| 8966 List<idl.UnlinkedPart> get parts { |
| 8967 _parts ??= const fb.ListReader<idl.UnlinkedPart>(const _UnlinkedPartReader()
).vTableGet(_bc, _bcOffset, 11, const <idl.UnlinkedPart>[]); |
| 8968 return _parts; |
| 8969 } |
| 8970 |
| 8971 @override |
| 8972 idl.UnlinkedPublicNamespace get publicNamespace { |
| 8973 _publicNamespace ??= const _UnlinkedPublicNamespaceReader().vTableGet(_bc, _
bcOffset, 0, null); |
| 8974 return _publicNamespace; |
| 8975 } |
| 8976 |
| 8977 @override |
| 8978 List<idl.UnlinkedReference> get references { |
| 8979 _references ??= const fb.ListReader<idl.UnlinkedReference>(const _UnlinkedRe
ferenceReader()).vTableGet(_bc, _bcOffset, 1, const <idl.UnlinkedReference>[]); |
| 8980 return _references; |
| 8981 } |
| 8982 |
| 8983 @override |
| 8984 List<idl.UnlinkedTypedef> get typedefs { |
| 8985 _typedefs ??= const fb.ListReader<idl.UnlinkedTypedef>(const _UnlinkedTypede
fReader()).vTableGet(_bc, _bcOffset, 10, const <idl.UnlinkedTypedef>[]); |
| 8986 return _typedefs; |
| 8987 } |
| 8988 |
| 8989 @override |
| 8990 List<idl.UnlinkedVariable> get variables { |
| 8991 _variables ??= const fb.ListReader<idl.UnlinkedVariable>(const _UnlinkedVari
ableReader()).vTableGet(_bc, _bcOffset, 3, const <idl.UnlinkedVariable>[]); |
| 8992 return _variables; |
| 8993 } |
| 8994 } |
| 8995 |
| 8996 abstract class _UnlinkedUnitMixin implements idl.UnlinkedUnit { |
| 8997 @override |
| 8998 Map<String, Object> toJson() { |
| 8999 Map<String, Object> _result = <String, Object>{}; |
| 9000 if (classes.isNotEmpty) _result["classes"] = classes.map((_value) => _value.
toJson()).toList(); |
| 9001 if (codeRange != null) _result["codeRange"] = codeRange.toJson(); |
| 9002 if (enums.isNotEmpty) _result["enums"] = enums.map((_value) => _value.toJson
()).toList(); |
| 9003 if (executables.isNotEmpty) _result["executables"] = executables.map((_value
) => _value.toJson()).toList(); |
| 9004 if (exports.isNotEmpty) _result["exports"] = exports.map((_value) => _value.
toJson()).toList(); |
| 9005 if (fallbackModePath != '') _result["fallbackModePath"] = fallbackModePath; |
| 9006 if (imports.isNotEmpty) _result["imports"] = imports.map((_value) => _value.
toJson()).toList(); |
| 9007 if (libraryAnnotations.isNotEmpty) _result["libraryAnnotations"] = libraryAn
notations.map((_value) => _value.toJson()).toList(); |
| 9008 if (libraryDocumentationComment != null) _result["libraryDocumentationCommen
t"] = libraryDocumentationComment.toJson(); |
| 9009 if (libraryName != '') _result["libraryName"] = libraryName; |
| 9010 if (libraryNameLength != 0) _result["libraryNameLength"] = libraryNameLength
; |
| 9011 if (libraryNameOffset != 0) _result["libraryNameOffset"] = libraryNameOffset
; |
| 9012 if (lineStarts.isNotEmpty) _result["lineStarts"] = lineStarts; |
| 9013 if (parts.isNotEmpty) _result["parts"] = parts.map((_value) => _value.toJson
()).toList(); |
| 9014 if (publicNamespace != null) _result["publicNamespace"] = publicNamespace.to
Json(); |
| 9015 if (references.isNotEmpty) _result["references"] = references.map((_value) =
> _value.toJson()).toList(); |
| 9016 if (typedefs.isNotEmpty) _result["typedefs"] = typedefs.map((_value) => _val
ue.toJson()).toList(); |
| 9017 if (variables.isNotEmpty) _result["variables"] = variables.map((_value) => _
value.toJson()).toList(); |
| 9018 return _result; |
| 9019 } |
| 9020 |
| 9021 @override |
| 9022 Map<String, Object> toMap() => { |
| 9023 "classes": classes, |
| 9024 "codeRange": codeRange, |
| 9025 "enums": enums, |
| 9026 "executables": executables, |
| 9027 "exports": exports, |
| 9028 "fallbackModePath": fallbackModePath, |
| 9029 "imports": imports, |
| 9030 "libraryAnnotations": libraryAnnotations, |
| 9031 "libraryDocumentationComment": libraryDocumentationComment, |
| 9032 "libraryName": libraryName, |
| 9033 "libraryNameLength": libraryNameLength, |
| 9034 "libraryNameOffset": libraryNameOffset, |
| 9035 "lineStarts": lineStarts, |
| 9036 "parts": parts, |
| 9037 "publicNamespace": publicNamespace, |
| 9038 "references": references, |
| 9039 "typedefs": typedefs, |
| 9040 "variables": variables, |
| 9041 }; |
| 9042 |
| 9043 @override |
| 9044 String toString() => convert.JSON.encode(toJson()); |
| 9045 } |
| 9046 |
| 9047 class UnlinkedVariableBuilder extends Object with _UnlinkedVariableMixin impleme
nts idl.UnlinkedVariable { |
| 9048 List<UnlinkedConstBuilder> _annotations; |
| 9049 CodeRangeBuilder _codeRange; |
| 9050 UnlinkedDocumentationCommentBuilder _documentationComment; |
| 9051 int _inferredTypeSlot; |
| 9052 UnlinkedExecutableBuilder _initializer; |
| 9053 bool _isConst; |
| 9054 bool _isFinal; |
| 9055 bool _isStatic; |
| 9056 String _name; |
| 9057 int _nameOffset; |
| 9058 int _propagatedTypeSlot; |
| 9059 EntityRefBuilder _type; |
| 9060 int _visibleLength; |
| 9061 int _visibleOffset; |
| 9062 |
| 9063 @override |
| 9064 List<UnlinkedConstBuilder> get annotations => _annotations ??= <UnlinkedConstB
uilder>[]; |
| 9065 |
| 9066 /** |
| 9067 * Annotations for this variable. |
| 9068 */ |
| 9069 void set annotations(List<UnlinkedConstBuilder> value) { |
| 9070 this._annotations = value; |
| 9071 } |
| 9072 |
| 9073 @override |
| 9074 CodeRangeBuilder get codeRange => _codeRange; |
| 9075 |
| 9076 /** |
| 9077 * Code range of the variable. |
| 9078 */ |
| 9079 void set codeRange(CodeRangeBuilder value) { |
| 9080 this._codeRange = value; |
| 9081 } |
| 9082 |
| 9083 @override |
| 9084 UnlinkedDocumentationCommentBuilder get documentationComment => _documentation
Comment; |
| 9085 |
| 9086 /** |
| 9087 * Documentation comment for the variable, or `null` if there is no |
| 9088 * documentation comment. |
| 9089 */ |
| 9090 void set documentationComment(UnlinkedDocumentationCommentBuilder value) { |
| 9091 this._documentationComment = value; |
| 9092 } |
| 9093 |
| 9094 @override |
| 9095 int get inferredTypeSlot => _inferredTypeSlot ??= 0; |
| 9096 |
| 9097 /** |
| 9098 * If this variable is inferable, nonzero slot id identifying which entry in |
| 9099 * [LinkedLibrary.types] contains the inferred type for this variable. If |
| 9100 * there is no matching entry in [LinkedLibrary.types], then no type was |
| 9101 * inferred for this variable, so its static type is `dynamic`. |
| 9102 */ |
| 9103 void set inferredTypeSlot(int value) { |
| 9104 assert(value == null || value >= 0); |
| 9105 this._inferredTypeSlot = value; |
| 9106 } |
| 9107 |
| 9108 @override |
| 9109 UnlinkedExecutableBuilder get initializer => _initializer; |
| 9110 |
| 9111 /** |
| 9112 * The synthetic initializer function of the variable. Absent if the variable |
| 9113 * does not have an initializer. |
| 9114 */ |
| 9115 void set initializer(UnlinkedExecutableBuilder value) { |
| 9116 this._initializer = value; |
| 9117 } |
| 9118 |
| 9119 @override |
| 9120 bool get isConst => _isConst ??= false; |
| 9121 |
| 9122 /** |
| 9123 * Indicates whether the variable is declared using the `const` keyword. |
| 9124 */ |
| 9125 void set isConst(bool value) { |
| 9126 this._isConst = value; |
| 9127 } |
| 9128 |
| 9129 @override |
| 9130 bool get isFinal => _isFinal ??= false; |
| 9131 |
| 9132 /** |
| 9133 * Indicates whether the variable is declared using the `final` keyword. |
| 9134 */ |
| 9135 void set isFinal(bool value) { |
| 9136 this._isFinal = value; |
| 9137 } |
| 9138 |
| 9139 @override |
| 9140 bool get isStatic => _isStatic ??= false; |
| 9141 |
| 9142 /** |
| 9143 * Indicates whether the variable is declared using the `static` keyword. |
| 9144 * |
| 9145 * Note that for top level variables, this flag is false, since they are not |
| 9146 * declared using the `static` keyword (even though they are considered |
| 9147 * static for semantic purposes). |
| 9148 */ |
| 9149 void set isStatic(bool value) { |
| 9150 this._isStatic = value; |
| 9151 } |
| 9152 |
| 9153 @override |
| 9154 String get name => _name ??= ''; |
| 9155 |
| 9156 /** |
| 9157 * Name of the variable. |
| 9158 */ |
| 9159 void set name(String value) { |
| 9160 this._name = value; |
| 9161 } |
| 9162 |
| 9163 @override |
| 9164 int get nameOffset => _nameOffset ??= 0; |
| 9165 |
| 9166 /** |
| 9167 * Offset of the variable name relative to the beginning of the file. |
| 9168 */ |
| 9169 void set nameOffset(int value) { |
| 9170 assert(value == null || value >= 0); |
| 9171 this._nameOffset = value; |
| 9172 } |
| 9173 |
| 9174 @override |
| 9175 int get propagatedTypeSlot => _propagatedTypeSlot ??= 0; |
| 9176 |
| 9177 /** |
| 9178 * If this variable is propagable, nonzero slot id identifying which entry in |
| 9179 * [LinkedLibrary.types] contains the propagated type for this variable. If |
| 9180 * there is no matching entry in [LinkedLibrary.types], then this variable's |
| 9181 * propagated type is the same as its declared type. |
| 9182 * |
| 9183 * Non-propagable variables have a [propagatedTypeSlot] of zero. |
| 9184 */ |
| 9185 void set propagatedTypeSlot(int value) { |
| 9186 assert(value == null || value >= 0); |
| 9187 this._propagatedTypeSlot = value; |
| 9188 } |
| 9189 |
| 9190 @override |
| 9191 EntityRefBuilder get type => _type; |
| 9192 |
| 9193 /** |
| 9194 * Declared type of the variable. Absent if the type is implicit. |
| 9195 */ |
| 9196 void set type(EntityRefBuilder value) { |
| 9197 this._type = value; |
| 9198 } |
| 9199 |
| 9200 @override |
| 9201 int get visibleLength => _visibleLength ??= 0; |
| 9202 |
| 9203 /** |
| 9204 * If a local variable, the length of the visible range; zero otherwise. |
| 9205 */ |
| 9206 void set visibleLength(int value) { |
| 9207 assert(value == null || value >= 0); |
| 9208 this._visibleLength = value; |
| 9209 } |
| 9210 |
| 9211 @override |
| 9212 int get visibleOffset => _visibleOffset ??= 0; |
| 9213 |
| 9214 /** |
| 9215 * If a local variable, the beginning of the visible range; zero otherwise. |
| 9216 */ |
| 9217 void set visibleOffset(int value) { |
| 9218 assert(value == null || value >= 0); |
| 9219 this._visibleOffset = value; |
| 9220 } |
| 9221 |
| 9222 UnlinkedVariableBuilder({List<UnlinkedConstBuilder> annotations, CodeRangeBuil
der codeRange, UnlinkedDocumentationCommentBuilder documentationComment, int inf
erredTypeSlot, UnlinkedExecutableBuilder initializer, bool isConst, bool isFinal
, bool isStatic, String name, int nameOffset, int propagatedTypeSlot, EntityRefB
uilder type, int visibleLength, int visibleOffset}) |
| 9223 : _annotations = annotations, |
| 9224 _codeRange = codeRange, |
| 9225 _documentationComment = documentationComment, |
| 9226 _inferredTypeSlot = inferredTypeSlot, |
| 9227 _initializer = initializer, |
| 9228 _isConst = isConst, |
| 9229 _isFinal = isFinal, |
| 9230 _isStatic = isStatic, |
| 9231 _name = name, |
| 9232 _nameOffset = nameOffset, |
| 9233 _propagatedTypeSlot = propagatedTypeSlot, |
| 9234 _type = type, |
| 9235 _visibleLength = visibleLength, |
| 9236 _visibleOffset = visibleOffset; |
| 9237 |
| 9238 /** |
| 9239 * Flush [informative] data recursively. |
| 9240 */ |
| 9241 void flushInformative() { |
| 9242 _annotations?.forEach((b) => b.flushInformative()); |
| 9243 _codeRange = null; |
| 9244 _documentationComment = null; |
| 9245 _initializer?.flushInformative(); |
| 9246 _nameOffset = null; |
| 9247 _type?.flushInformative(); |
| 9248 } |
| 9249 |
| 9250 /** |
| 9251 * Accumulate non-[informative] data into [signature]. |
| 9252 */ |
| 9253 void collectApiSignature(api_sig.ApiSignature signature) { |
| 9254 signature.addString(this._name ?? ''); |
| 9255 signature.addInt(this._propagatedTypeSlot ?? 0); |
| 9256 signature.addBool(this._type != null); |
| 9257 this._type?.collectApiSignature(signature); |
| 9258 signature.addBool(this._isStatic == true); |
| 9259 signature.addBool(this._isConst == true); |
| 9260 signature.addBool(this._isFinal == true); |
| 9261 if (this._annotations == null) { |
| 9262 signature.addInt(0); |
| 9263 } else { |
| 9264 signature.addInt(this._annotations.length); |
| 9265 for (var x in this._annotations) { |
| 9266 x?.collectApiSignature(signature); |
| 9267 } |
| 9268 } |
| 9269 signature.addInt(this._inferredTypeSlot ?? 0); |
| 9270 signature.addInt(this._visibleLength ?? 0); |
| 9271 signature.addInt(this._visibleOffset ?? 0); |
| 9272 signature.addBool(this._initializer != null); |
| 9273 this._initializer?.collectApiSignature(signature); |
| 9274 } |
| 9275 |
| 9276 fb.Offset finish(fb.Builder fbBuilder) { |
| 9277 fb.Offset offset_annotations; |
| 9278 fb.Offset offset_codeRange; |
| 9279 fb.Offset offset_documentationComment; |
| 9280 fb.Offset offset_initializer; |
| 9281 fb.Offset offset_name; |
| 9282 fb.Offset offset_type; |
| 9283 if (!(_annotations == null || _annotations.isEmpty)) { |
| 9284 offset_annotations = fbBuilder.writeList(_annotations.map((b) => b.finish(
fbBuilder)).toList()); |
| 9285 } |
| 9286 if (_codeRange != null) { |
| 9287 offset_codeRange = _codeRange.finish(fbBuilder); |
| 9288 } |
| 9289 if (_documentationComment != null) { |
| 9290 offset_documentationComment = _documentationComment.finish(fbBuilder); |
| 9291 } |
| 9292 if (_initializer != null) { |
| 9293 offset_initializer = _initializer.finish(fbBuilder); |
| 9294 } |
| 9295 if (_name != null) { |
| 9296 offset_name = fbBuilder.writeString(_name); |
| 9297 } |
| 9298 if (_type != null) { |
| 9299 offset_type = _type.finish(fbBuilder); |
| 9300 } |
| 9301 fbBuilder.startTable(); |
| 9302 if (offset_annotations != null) { |
| 9303 fbBuilder.addOffset(8, offset_annotations); |
| 9304 } |
| 9305 if (offset_codeRange != null) { |
| 9306 fbBuilder.addOffset(5, offset_codeRange); |
| 9307 } |
| 9308 if (offset_documentationComment != null) { |
| 9309 fbBuilder.addOffset(10, offset_documentationComment); |
| 9310 } |
| 9311 if (_inferredTypeSlot != null && _inferredTypeSlot != 0) { |
| 9312 fbBuilder.addUint32(9, _inferredTypeSlot); |
| 9313 } |
| 9314 if (offset_initializer != null) { |
| 9315 fbBuilder.addOffset(13, offset_initializer); |
| 9316 } |
| 9317 if (_isConst == true) { |
| 9318 fbBuilder.addBool(6, true); |
| 9319 } |
| 9320 if (_isFinal == true) { |
| 9321 fbBuilder.addBool(7, true); |
| 9322 } |
| 9323 if (_isStatic == true) { |
| 9324 fbBuilder.addBool(4, true); |
| 9325 } |
| 9326 if (offset_name != null) { |
| 9327 fbBuilder.addOffset(0, offset_name); |
| 9328 } |
| 9329 if (_nameOffset != null && _nameOffset != 0) { |
| 9330 fbBuilder.addUint32(1, _nameOffset); |
| 9331 } |
| 9332 if (_propagatedTypeSlot != null && _propagatedTypeSlot != 0) { |
| 9333 fbBuilder.addUint32(2, _propagatedTypeSlot); |
| 9334 } |
| 9335 if (offset_type != null) { |
| 9336 fbBuilder.addOffset(3, offset_type); |
| 9337 } |
| 9338 if (_visibleLength != null && _visibleLength != 0) { |
| 9339 fbBuilder.addUint32(11, _visibleLength); |
| 9340 } |
| 9341 if (_visibleOffset != null && _visibleOffset != 0) { |
| 9342 fbBuilder.addUint32(12, _visibleOffset); |
| 9343 } |
| 9344 return fbBuilder.endTable(); |
| 9345 } |
| 9346 } |
| 9347 |
| 9348 class _UnlinkedVariableReader extends fb.TableReader<_UnlinkedVariableImpl> { |
| 9349 const _UnlinkedVariableReader(); |
| 9350 |
| 9351 @override |
| 9352 _UnlinkedVariableImpl createObject(fb.BufferContext bc, int offset) => new _Un
linkedVariableImpl(bc, offset); |
| 9353 } |
| 9354 |
| 9355 class _UnlinkedVariableImpl extends Object with _UnlinkedVariableMixin implement
s idl.UnlinkedVariable { |
| 9356 final fb.BufferContext _bc; |
| 9357 final int _bcOffset; |
| 9358 |
| 9359 _UnlinkedVariableImpl(this._bc, this._bcOffset); |
| 9360 |
| 9361 List<idl.UnlinkedConst> _annotations; |
| 9362 idl.CodeRange _codeRange; |
| 9363 idl.UnlinkedDocumentationComment _documentationComment; |
| 9364 int _inferredTypeSlot; |
| 9365 idl.UnlinkedExecutable _initializer; |
| 9366 bool _isConst; |
| 9367 bool _isFinal; |
| 9368 bool _isStatic; |
| 9369 String _name; |
| 9370 int _nameOffset; |
| 9371 int _propagatedTypeSlot; |
| 9372 idl.EntityRef _type; |
| 9373 int _visibleLength; |
| 9374 int _visibleOffset; |
| 9375 |
| 9376 @override |
| 9377 List<idl.UnlinkedConst> get annotations { |
| 9378 _annotations ??= const fb.ListReader<idl.UnlinkedConst>(const _UnlinkedConst
Reader()).vTableGet(_bc, _bcOffset, 8, const <idl.UnlinkedConst>[]); |
| 9379 return _annotations; |
| 9380 } |
| 9381 |
| 9382 @override |
| 9383 idl.CodeRange get codeRange { |
| 9384 _codeRange ??= const _CodeRangeReader().vTableGet(_bc, _bcOffset, 5, null); |
| 9385 return _codeRange; |
| 9386 } |
| 9387 |
| 9388 @override |
| 9389 idl.UnlinkedDocumentationComment get documentationComment { |
| 9390 _documentationComment ??= const _UnlinkedDocumentationCommentReader().vTable
Get(_bc, _bcOffset, 10, null); |
| 9391 return _documentationComment; |
| 9392 } |
| 9393 |
| 9394 @override |
| 9395 int get inferredTypeSlot { |
| 9396 _inferredTypeSlot ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 9, 0
); |
| 9397 return _inferredTypeSlot; |
| 9398 } |
| 9399 |
| 9400 @override |
| 9401 idl.UnlinkedExecutable get initializer { |
| 9402 _initializer ??= const _UnlinkedExecutableReader().vTableGet(_bc, _bcOffset,
13, null); |
| 9403 return _initializer; |
| 9404 } |
| 9405 |
| 9406 @override |
| 9407 bool get isConst { |
| 9408 _isConst ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 6, false); |
| 9409 return _isConst; |
| 9410 } |
| 9411 |
| 9412 @override |
| 9413 bool get isFinal { |
| 9414 _isFinal ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 7, false); |
| 9415 return _isFinal; |
| 9416 } |
| 9417 |
| 9418 @override |
| 9419 bool get isStatic { |
| 9420 _isStatic ??= const fb.BoolReader().vTableGet(_bc, _bcOffset, 4, false); |
| 9421 return _isStatic; |
| 9422 } |
| 9423 |
| 9424 @override |
| 9425 String get name { |
| 9426 _name ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, ''); |
| 9427 return _name; |
| 9428 } |
| 9429 |
| 9430 @override |
| 9431 int get nameOffset { |
| 9432 _nameOffset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 1, 0); |
| 9433 return _nameOffset; |
| 9434 } |
| 9435 |
| 9436 @override |
| 9437 int get propagatedTypeSlot { |
| 9438 _propagatedTypeSlot ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 2,
0); |
| 9439 return _propagatedTypeSlot; |
| 9440 } |
| 9441 |
| 9442 @override |
| 9443 idl.EntityRef get type { |
| 9444 _type ??= const _EntityRefReader().vTableGet(_bc, _bcOffset, 3, null); |
| 9445 return _type; |
| 9446 } |
| 9447 |
| 9448 @override |
| 9449 int get visibleLength { |
| 9450 _visibleLength ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 11, 0); |
| 9451 return _visibleLength; |
| 9452 } |
| 9453 |
| 9454 @override |
| 9455 int get visibleOffset { |
| 9456 _visibleOffset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 12, 0); |
| 9457 return _visibleOffset; |
| 9458 } |
| 9459 } |
| 9460 |
| 9461 abstract class _UnlinkedVariableMixin implements idl.UnlinkedVariable { |
| 9462 @override |
| 9463 Map<String, Object> toJson() { |
| 9464 Map<String, Object> _result = <String, Object>{}; |
| 9465 if (annotations.isNotEmpty) _result["annotations"] = annotations.map((_value
) => _value.toJson()).toList(); |
| 9466 if (codeRange != null) _result["codeRange"] = codeRange.toJson(); |
| 9467 if (documentationComment != null) _result["documentationComment"] = document
ationComment.toJson(); |
| 9468 if (inferredTypeSlot != 0) _result["inferredTypeSlot"] = inferredTypeSlot; |
| 9469 if (initializer != null) _result["initializer"] = initializer.toJson(); |
| 9470 if (isConst != false) _result["isConst"] = isConst; |
| 9471 if (isFinal != false) _result["isFinal"] = isFinal; |
| 9472 if (isStatic != false) _result["isStatic"] = isStatic; |
| 9473 if (name != '') _result["name"] = name; |
| 9474 if (nameOffset != 0) _result["nameOffset"] = nameOffset; |
| 9475 if (propagatedTypeSlot != 0) _result["propagatedTypeSlot"] = propagatedTypeS
lot; |
| 9476 if (type != null) _result["type"] = type.toJson(); |
| 9477 if (visibleLength != 0) _result["visibleLength"] = visibleLength; |
| 9478 if (visibleOffset != 0) _result["visibleOffset"] = visibleOffset; |
| 9479 return _result; |
| 9480 } |
| 9481 |
| 9482 @override |
| 9483 Map<String, Object> toMap() => { |
| 9484 "annotations": annotations, |
| 9485 "codeRange": codeRange, |
| 9486 "documentationComment": documentationComment, |
| 9487 "inferredTypeSlot": inferredTypeSlot, |
| 9488 "initializer": initializer, |
| 9489 "isConst": isConst, |
| 9490 "isFinal": isFinal, |
| 9491 "isStatic": isStatic, |
| 9492 "name": name, |
| 9493 "nameOffset": nameOffset, |
| 9494 "propagatedTypeSlot": propagatedTypeSlot, |
| 9495 "type": type, |
| 9496 "visibleLength": visibleLength, |
| 9497 "visibleOffset": visibleOffset, |
| 9498 }; |
| 9499 |
| 9500 @override |
| 9501 String toString() => convert.JSON.encode(toJson()); |
| 9502 } |
| 9503 |
| OLD | NEW |