| // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| // for details. All rights reserved. Use of this source code is governed by a |
| // BSD-style license that can be found in the LICENSE file. |
| // |
| // This file has been automatically generated. Please do not edit it manually. |
| // To regenerate the file, use the script "pkg/analyzer/tool/generate_files". |
| |
| library analyzer.src.summary.format; |
| |
| import 'dart:convert' as convert; |
| |
| import 'package:analyzer/src/summary/api_signature.dart' as api_sig; |
| import 'package:analyzer/src/summary/flat_buffers.dart' as fb; |
| |
| import 'idl.dart' as idl; |
| |
| class _EntityRefKindReader extends fb.Reader<idl.EntityRefKind> { |
| const _EntityRefKindReader() : super(); |
| |
| @override |
| int get size => 1; |
| |
| @override |
| idl.EntityRefKind read(fb.BufferContext bc, int offset) { |
| int index = const fb.Uint8Reader().read(bc, offset); |
| return index < idl.EntityRefKind.values.length |
| ? idl.EntityRefKind.values[index] |
| : idl.EntityRefKind.named; |
| } |
| } |
| |
| class _IndexNameKindReader extends fb.Reader<idl.IndexNameKind> { |
| const _IndexNameKindReader() : super(); |
| |
| @override |
| int get size => 1; |
| |
| @override |
| idl.IndexNameKind read(fb.BufferContext bc, int offset) { |
| int index = const fb.Uint8Reader().read(bc, offset); |
| return index < idl.IndexNameKind.values.length |
| ? idl.IndexNameKind.values[index] |
| : idl.IndexNameKind.topLevel; |
| } |
| } |
| |
| class _IndexRelationKindReader extends fb.Reader<idl.IndexRelationKind> { |
| const _IndexRelationKindReader() : super(); |
| |
| @override |
| int get size => 1; |
| |
| @override |
| idl.IndexRelationKind read(fb.BufferContext bc, int offset) { |
| int index = const fb.Uint8Reader().read(bc, offset); |
| return index < idl.IndexRelationKind.values.length |
| ? idl.IndexRelationKind.values[index] |
| : idl.IndexRelationKind.IS_ANCESTOR_OF; |
| } |
| } |
| |
| class _IndexSyntheticElementKindReader |
| extends fb.Reader<idl.IndexSyntheticElementKind> { |
| const _IndexSyntheticElementKindReader() : super(); |
| |
| @override |
| int get size => 1; |
| |
| @override |
| idl.IndexSyntheticElementKind read(fb.BufferContext bc, int offset) { |
| int index = const fb.Uint8Reader().read(bc, offset); |
| return index < idl.IndexSyntheticElementKind.values.length |
| ? idl.IndexSyntheticElementKind.values[index] |
| : idl.IndexSyntheticElementKind.notSynthetic; |
| } |
| } |
| |
| class _ReferenceKindReader extends fb.Reader<idl.ReferenceKind> { |
| const _ReferenceKindReader() : super(); |
| |
| @override |
| int get size => 1; |
| |
| @override |
| idl.ReferenceKind read(fb.BufferContext bc, int offset) { |
| int index = const fb.Uint8Reader().read(bc, offset); |
| return index < idl.ReferenceKind.values.length |
| ? idl.ReferenceKind.values[index] |
| : idl.ReferenceKind.classOrEnum; |
| } |
| } |
| |
| class _TopLevelInferenceErrorKindReader |
| extends fb.Reader<idl.TopLevelInferenceErrorKind> { |
| const _TopLevelInferenceErrorKindReader() : super(); |
| |
| @override |
| int get size => 1; |
| |
| @override |
| idl.TopLevelInferenceErrorKind read(fb.BufferContext bc, int offset) { |
| int index = const fb.Uint8Reader().read(bc, offset); |
| return index < idl.TopLevelInferenceErrorKind.values.length |
| ? idl.TopLevelInferenceErrorKind.values[index] |
| : idl.TopLevelInferenceErrorKind.assignment; |
| } |
| } |
| |
| class _TypedefStyleReader extends fb.Reader<idl.TypedefStyle> { |
| const _TypedefStyleReader() : super(); |
| |
| @override |
| int get size => 1; |
| |
| @override |
| idl.TypedefStyle read(fb.BufferContext bc, int offset) { |
| int index = const fb.Uint8Reader().read(bc, offset); |
| return index < idl.TypedefStyle.values.length |
| ? idl.TypedefStyle.values[index] |
| : idl.TypedefStyle.functionType; |
| } |
| } |
| |
| class _UnlinkedConstructorInitializerKindReader |
| extends fb.Reader<idl.UnlinkedConstructorInitializerKind> { |
| const _UnlinkedConstructorInitializerKindReader() : super(); |
| |
| @override |
| int get size => 1; |
| |
| @override |
| idl.UnlinkedConstructorInitializerKind read(fb.BufferContext bc, int offset) { |
| int index = const fb.Uint8Reader().read(bc, offset); |
| return index < idl.UnlinkedConstructorInitializerKind.values.length |
| ? idl.UnlinkedConstructorInitializerKind.values[index] |
| : idl.UnlinkedConstructorInitializerKind.field; |
| } |
| } |
| |
| class _UnlinkedExecutableKindReader |
| extends fb.Reader<idl.UnlinkedExecutableKind> { |
| const _UnlinkedExecutableKindReader() : super(); |
| |
| @override |
| int get size => 1; |
| |
| @override |
| idl.UnlinkedExecutableKind read(fb.BufferContext bc, int offset) { |
| int index = const fb.Uint8Reader().read(bc, offset); |
| return index < idl.UnlinkedExecutableKind.values.length |
| ? idl.UnlinkedExecutableKind.values[index] |
| : idl.UnlinkedExecutableKind.functionOrMethod; |
| } |
| } |
| |
| class _UnlinkedExprAssignOperatorReader |
| extends fb.Reader<idl.UnlinkedExprAssignOperator> { |
| const _UnlinkedExprAssignOperatorReader() : super(); |
| |
| @override |
| int get size => 1; |
| |
| @override |
| idl.UnlinkedExprAssignOperator read(fb.BufferContext bc, int offset) { |
| int index = const fb.Uint8Reader().read(bc, offset); |
| return index < idl.UnlinkedExprAssignOperator.values.length |
| ? idl.UnlinkedExprAssignOperator.values[index] |
| : idl.UnlinkedExprAssignOperator.assign; |
| } |
| } |
| |
| class _UnlinkedExprOperationReader |
| extends fb.Reader<idl.UnlinkedExprOperation> { |
| const _UnlinkedExprOperationReader() : super(); |
| |
| @override |
| int get size => 1; |
| |
| @override |
| idl.UnlinkedExprOperation read(fb.BufferContext bc, int offset) { |
| int index = const fb.Uint8Reader().read(bc, offset); |
| return index < idl.UnlinkedExprOperation.values.length |
| ? idl.UnlinkedExprOperation.values[index] |
| : idl.UnlinkedExprOperation.pushInt; |
| } |
| } |
| |
| class _UnlinkedParamKindReader extends fb.Reader<idl.UnlinkedParamKind> { |
| const _UnlinkedParamKindReader() : super(); |
| |
| @override |
| int get size => 1; |
| |
| @override |
| idl.UnlinkedParamKind read(fb.BufferContext bc, int offset) { |
| int index = const fb.Uint8Reader().read(bc, offset); |
| return index < idl.UnlinkedParamKind.values.length |
| ? idl.UnlinkedParamKind.values[index] |
| : idl.UnlinkedParamKind.required; |
| } |
| } |
| |
| class AnalysisDriverExceptionContextBuilder extends Object |
| with _AnalysisDriverExceptionContextMixin |
| implements idl.AnalysisDriverExceptionContext { |
| String _exception; |
| List<AnalysisDriverExceptionFileBuilder> _files; |
| String _path; |
| String _stackTrace; |
| |
| @override |
| String get exception => _exception ??= ''; |
| |
| /** |
| * The exception string. |
| */ |
| void set exception(String value) { |
| this._exception = value; |
| } |
| |
| @override |
| List<AnalysisDriverExceptionFileBuilder> get files => |
| _files ??= <AnalysisDriverExceptionFileBuilder>[]; |
| |
| /** |
| * The state of files when the exception happened. |
| */ |
| void set files(List<AnalysisDriverExceptionFileBuilder> value) { |
| this._files = value; |
| } |
| |
| @override |
| String get path => _path ??= ''; |
| |
| /** |
| * The path of the file being analyzed when the exception happened. |
| */ |
| void set path(String value) { |
| this._path = value; |
| } |
| |
| @override |
| String get stackTrace => _stackTrace ??= ''; |
| |
| /** |
| * The exception stack trace string. |
| */ |
| void set stackTrace(String value) { |
| this._stackTrace = value; |
| } |
| |
| AnalysisDriverExceptionContextBuilder( |
| {String exception, |
| List<AnalysisDriverExceptionFileBuilder> files, |
| String path, |
| String stackTrace}) |
| : _exception = exception, |
| _files = files, |
| _path = path, |
| _stackTrace = stackTrace; |
| |
| /** |
| * Flush [informative] data recursively. |
| */ |
| void flushInformative() { |
| _files?.forEach((b) => b.flushInformative()); |
| } |
| |
| /** |
| * Accumulate non-[informative] data into [signature]. |
| */ |
| void collectApiSignature(api_sig.ApiSignature signature) { |
| signature.addString(this._path ?? ''); |
| signature.addString(this._exception ?? ''); |
| signature.addString(this._stackTrace ?? ''); |
| if (this._files == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._files.length); |
| for (var x in this._files) { |
| x?.collectApiSignature(signature); |
| } |
| } |
| } |
| |
| List<int> toBuffer() { |
| fb.Builder fbBuilder = new fb.Builder(); |
| return fbBuilder.finish(finish(fbBuilder), "ADEC"); |
| } |
| |
| fb.Offset finish(fb.Builder fbBuilder) { |
| fb.Offset offset_exception; |
| fb.Offset offset_files; |
| fb.Offset offset_path; |
| fb.Offset offset_stackTrace; |
| if (_exception != null) { |
| offset_exception = fbBuilder.writeString(_exception); |
| } |
| if (!(_files == null || _files.isEmpty)) { |
| offset_files = |
| fbBuilder.writeList(_files.map((b) => b.finish(fbBuilder)).toList()); |
| } |
| if (_path != null) { |
| offset_path = fbBuilder.writeString(_path); |
| } |
| if (_stackTrace != null) { |
| offset_stackTrace = fbBuilder.writeString(_stackTrace); |
| } |
| fbBuilder.startTable(); |
| if (offset_exception != null) { |
| fbBuilder.addOffset(1, offset_exception); |
| } |
| if (offset_files != null) { |
| fbBuilder.addOffset(3, offset_files); |
| } |
| if (offset_path != null) { |
| fbBuilder.addOffset(0, offset_path); |
| } |
| if (offset_stackTrace != null) { |
| fbBuilder.addOffset(2, offset_stackTrace); |
| } |
| return fbBuilder.endTable(); |
| } |
| } |
| |
| idl.AnalysisDriverExceptionContext readAnalysisDriverExceptionContext( |
| List<int> buffer) { |
| fb.BufferContext rootRef = new fb.BufferContext.fromBytes(buffer); |
| return const _AnalysisDriverExceptionContextReader().read(rootRef, 0); |
| } |
| |
| class _AnalysisDriverExceptionContextReader |
| extends fb.TableReader<_AnalysisDriverExceptionContextImpl> { |
| const _AnalysisDriverExceptionContextReader(); |
| |
| @override |
| _AnalysisDriverExceptionContextImpl createObject( |
| fb.BufferContext bc, int offset) => |
| new _AnalysisDriverExceptionContextImpl(bc, offset); |
| } |
| |
| class _AnalysisDriverExceptionContextImpl extends Object |
| with _AnalysisDriverExceptionContextMixin |
| implements idl.AnalysisDriverExceptionContext { |
| final fb.BufferContext _bc; |
| final int _bcOffset; |
| |
| _AnalysisDriverExceptionContextImpl(this._bc, this._bcOffset); |
| |
| String _exception; |
| List<idl.AnalysisDriverExceptionFile> _files; |
| String _path; |
| String _stackTrace; |
| |
| @override |
| String get exception { |
| _exception ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 1, ''); |
| return _exception; |
| } |
| |
| @override |
| List<idl.AnalysisDriverExceptionFile> get files { |
| _files ??= const fb.ListReader<idl.AnalysisDriverExceptionFile>( |
| const _AnalysisDriverExceptionFileReader()) |
| .vTableGet( |
| _bc, _bcOffset, 3, const <idl.AnalysisDriverExceptionFile>[]); |
| return _files; |
| } |
| |
| @override |
| String get path { |
| _path ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, ''); |
| return _path; |
| } |
| |
| @override |
| String get stackTrace { |
| _stackTrace ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 2, ''); |
| return _stackTrace; |
| } |
| } |
| |
| abstract class _AnalysisDriverExceptionContextMixin |
| implements idl.AnalysisDriverExceptionContext { |
| @override |
| Map<String, Object> toJson() { |
| Map<String, Object> _result = <String, Object>{}; |
| if (exception != '') _result["exception"] = exception; |
| if (files.isNotEmpty) |
| _result["files"] = files.map((_value) => _value.toJson()).toList(); |
| if (path != '') _result["path"] = path; |
| if (stackTrace != '') _result["stackTrace"] = stackTrace; |
| return _result; |
| } |
| |
| @override |
| Map<String, Object> toMap() => { |
| "exception": exception, |
| "files": files, |
| "path": path, |
| "stackTrace": stackTrace, |
| }; |
| |
| @override |
| String toString() => convert.json.encode(toJson()); |
| } |
| |
| class AnalysisDriverExceptionFileBuilder extends Object |
| with _AnalysisDriverExceptionFileMixin |
| implements idl.AnalysisDriverExceptionFile { |
| String _content; |
| String _path; |
| |
| @override |
| String get content => _content ??= ''; |
| |
| /** |
| * The content of the file. |
| */ |
| void set content(String value) { |
| this._content = value; |
| } |
| |
| @override |
| String get path => _path ??= ''; |
| |
| /** |
| * The path of the file. |
| */ |
| void set path(String value) { |
| this._path = value; |
| } |
| |
| AnalysisDriverExceptionFileBuilder({String content, String path}) |
| : _content = content, |
| _path = path; |
| |
| /** |
| * Flush [informative] data recursively. |
| */ |
| void flushInformative() {} |
| |
| /** |
| * Accumulate non-[informative] data into [signature]. |
| */ |
| void collectApiSignature(api_sig.ApiSignature signature) { |
| signature.addString(this._path ?? ''); |
| signature.addString(this._content ?? ''); |
| } |
| |
| fb.Offset finish(fb.Builder fbBuilder) { |
| fb.Offset offset_content; |
| fb.Offset offset_path; |
| if (_content != null) { |
| offset_content = fbBuilder.writeString(_content); |
| } |
| if (_path != null) { |
| offset_path = fbBuilder.writeString(_path); |
| } |
| fbBuilder.startTable(); |
| if (offset_content != null) { |
| fbBuilder.addOffset(1, offset_content); |
| } |
| if (offset_path != null) { |
| fbBuilder.addOffset(0, offset_path); |
| } |
| return fbBuilder.endTable(); |
| } |
| } |
| |
| class _AnalysisDriverExceptionFileReader |
| extends fb.TableReader<_AnalysisDriverExceptionFileImpl> { |
| const _AnalysisDriverExceptionFileReader(); |
| |
| @override |
| _AnalysisDriverExceptionFileImpl createObject( |
| fb.BufferContext bc, int offset) => |
| new _AnalysisDriverExceptionFileImpl(bc, offset); |
| } |
| |
| class _AnalysisDriverExceptionFileImpl extends Object |
| with _AnalysisDriverExceptionFileMixin |
| implements idl.AnalysisDriverExceptionFile { |
| final fb.BufferContext _bc; |
| final int _bcOffset; |
| |
| _AnalysisDriverExceptionFileImpl(this._bc, this._bcOffset); |
| |
| String _content; |
| String _path; |
| |
| @override |
| String get content { |
| _content ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 1, ''); |
| return _content; |
| } |
| |
| @override |
| String get path { |
| _path ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, ''); |
| return _path; |
| } |
| } |
| |
| abstract class _AnalysisDriverExceptionFileMixin |
| implements idl.AnalysisDriverExceptionFile { |
| @override |
| Map<String, Object> toJson() { |
| Map<String, Object> _result = <String, Object>{}; |
| if (content != '') _result["content"] = content; |
| if (path != '') _result["path"] = path; |
| return _result; |
| } |
| |
| @override |
| Map<String, Object> toMap() => { |
| "content": content, |
| "path": path, |
| }; |
| |
| @override |
| String toString() => convert.json.encode(toJson()); |
| } |
| |
| class AnalysisDriverResolvedUnitBuilder extends Object |
| with _AnalysisDriverResolvedUnitMixin |
| implements idl.AnalysisDriverResolvedUnit { |
| List<AnalysisDriverUnitErrorBuilder> _errors; |
| AnalysisDriverUnitIndexBuilder _index; |
| |
| @override |
| List<AnalysisDriverUnitErrorBuilder> get errors => |
| _errors ??= <AnalysisDriverUnitErrorBuilder>[]; |
| |
| /** |
| * The full list of analysis errors, both syntactic and semantic. |
| */ |
| void set errors(List<AnalysisDriverUnitErrorBuilder> value) { |
| this._errors = value; |
| } |
| |
| @override |
| AnalysisDriverUnitIndexBuilder get index => _index; |
| |
| /** |
| * The index of the unit. |
| */ |
| void set index(AnalysisDriverUnitIndexBuilder value) { |
| this._index = value; |
| } |
| |
| AnalysisDriverResolvedUnitBuilder( |
| {List<AnalysisDriverUnitErrorBuilder> errors, |
| AnalysisDriverUnitIndexBuilder index}) |
| : _errors = errors, |
| _index = index; |
| |
| /** |
| * Flush [informative] data recursively. |
| */ |
| void flushInformative() { |
| _errors?.forEach((b) => b.flushInformative()); |
| _index?.flushInformative(); |
| } |
| |
| /** |
| * Accumulate non-[informative] data into [signature]. |
| */ |
| void collectApiSignature(api_sig.ApiSignature signature) { |
| if (this._errors == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._errors.length); |
| for (var x in this._errors) { |
| x?.collectApiSignature(signature); |
| } |
| } |
| signature.addBool(this._index != null); |
| this._index?.collectApiSignature(signature); |
| } |
| |
| List<int> toBuffer() { |
| fb.Builder fbBuilder = new fb.Builder(); |
| return fbBuilder.finish(finish(fbBuilder), "ADRU"); |
| } |
| |
| fb.Offset finish(fb.Builder fbBuilder) { |
| fb.Offset offset_errors; |
| fb.Offset offset_index; |
| if (!(_errors == null || _errors.isEmpty)) { |
| offset_errors = |
| fbBuilder.writeList(_errors.map((b) => b.finish(fbBuilder)).toList()); |
| } |
| if (_index != null) { |
| offset_index = _index.finish(fbBuilder); |
| } |
| fbBuilder.startTable(); |
| if (offset_errors != null) { |
| fbBuilder.addOffset(0, offset_errors); |
| } |
| if (offset_index != null) { |
| fbBuilder.addOffset(1, offset_index); |
| } |
| return fbBuilder.endTable(); |
| } |
| } |
| |
| idl.AnalysisDriverResolvedUnit readAnalysisDriverResolvedUnit( |
| List<int> buffer) { |
| fb.BufferContext rootRef = new fb.BufferContext.fromBytes(buffer); |
| return const _AnalysisDriverResolvedUnitReader().read(rootRef, 0); |
| } |
| |
| class _AnalysisDriverResolvedUnitReader |
| extends fb.TableReader<_AnalysisDriverResolvedUnitImpl> { |
| const _AnalysisDriverResolvedUnitReader(); |
| |
| @override |
| _AnalysisDriverResolvedUnitImpl createObject( |
| fb.BufferContext bc, int offset) => |
| new _AnalysisDriverResolvedUnitImpl(bc, offset); |
| } |
| |
| class _AnalysisDriverResolvedUnitImpl extends Object |
| with _AnalysisDriverResolvedUnitMixin |
| implements idl.AnalysisDriverResolvedUnit { |
| final fb.BufferContext _bc; |
| final int _bcOffset; |
| |
| _AnalysisDriverResolvedUnitImpl(this._bc, this._bcOffset); |
| |
| List<idl.AnalysisDriverUnitError> _errors; |
| idl.AnalysisDriverUnitIndex _index; |
| |
| @override |
| List<idl.AnalysisDriverUnitError> get errors { |
| _errors ??= const fb.ListReader<idl.AnalysisDriverUnitError>( |
| const _AnalysisDriverUnitErrorReader()) |
| .vTableGet(_bc, _bcOffset, 0, const <idl.AnalysisDriverUnitError>[]); |
| return _errors; |
| } |
| |
| @override |
| idl.AnalysisDriverUnitIndex get index { |
| _index ??= const _AnalysisDriverUnitIndexReader() |
| .vTableGet(_bc, _bcOffset, 1, null); |
| return _index; |
| } |
| } |
| |
| abstract class _AnalysisDriverResolvedUnitMixin |
| implements idl.AnalysisDriverResolvedUnit { |
| @override |
| Map<String, Object> toJson() { |
| Map<String, Object> _result = <String, Object>{}; |
| if (errors.isNotEmpty) |
| _result["errors"] = errors.map((_value) => _value.toJson()).toList(); |
| if (index != null) _result["index"] = index.toJson(); |
| return _result; |
| } |
| |
| @override |
| Map<String, Object> toMap() => { |
| "errors": errors, |
| "index": index, |
| }; |
| |
| @override |
| String toString() => convert.json.encode(toJson()); |
| } |
| |
| class AnalysisDriverSubtypeBuilder extends Object |
| with _AnalysisDriverSubtypeMixin |
| implements idl.AnalysisDriverSubtype { |
| List<String> _members; |
| String _name; |
| List<String> _supertypes; |
| |
| @override |
| List<String> get members => _members ??= <String>[]; |
| |
| /** |
| * The names of defined instance members. |
| * The list is sorted in ascending order. |
| */ |
| void set members(List<String> value) { |
| this._members = value; |
| } |
| |
| @override |
| String get name => _name ??= ''; |
| |
| /** |
| * The name of the class. |
| */ |
| void set name(String value) { |
| this._name = value; |
| } |
| |
| @override |
| List<String> get supertypes => _supertypes ??= <String>[]; |
| |
| /** |
| * The identifiers of the direct supertypes. |
| * The list is sorted in ascending order. |
| */ |
| void set supertypes(List<String> value) { |
| this._supertypes = value; |
| } |
| |
| AnalysisDriverSubtypeBuilder( |
| {List<String> members, String name, List<String> supertypes}) |
| : _members = members, |
| _name = name, |
| _supertypes = supertypes; |
| |
| /** |
| * Flush [informative] data recursively. |
| */ |
| void flushInformative() {} |
| |
| /** |
| * Accumulate non-[informative] data into [signature]. |
| */ |
| void collectApiSignature(api_sig.ApiSignature signature) { |
| signature.addString(this._name ?? ''); |
| if (this._supertypes == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._supertypes.length); |
| for (var x in this._supertypes) { |
| signature.addString(x); |
| } |
| } |
| if (this._members == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._members.length); |
| for (var x in this._members) { |
| signature.addString(x); |
| } |
| } |
| } |
| |
| fb.Offset finish(fb.Builder fbBuilder) { |
| fb.Offset offset_members; |
| fb.Offset offset_name; |
| fb.Offset offset_supertypes; |
| if (!(_members == null || _members.isEmpty)) { |
| offset_members = fbBuilder |
| .writeList(_members.map((b) => fbBuilder.writeString(b)).toList()); |
| } |
| if (_name != null) { |
| offset_name = fbBuilder.writeString(_name); |
| } |
| if (!(_supertypes == null || _supertypes.isEmpty)) { |
| offset_supertypes = fbBuilder |
| .writeList(_supertypes.map((b) => fbBuilder.writeString(b)).toList()); |
| } |
| fbBuilder.startTable(); |
| if (offset_members != null) { |
| fbBuilder.addOffset(2, offset_members); |
| } |
| if (offset_name != null) { |
| fbBuilder.addOffset(0, offset_name); |
| } |
| if (offset_supertypes != null) { |
| fbBuilder.addOffset(1, offset_supertypes); |
| } |
| return fbBuilder.endTable(); |
| } |
| } |
| |
| class _AnalysisDriverSubtypeReader |
| extends fb.TableReader<_AnalysisDriverSubtypeImpl> { |
| const _AnalysisDriverSubtypeReader(); |
| |
| @override |
| _AnalysisDriverSubtypeImpl createObject(fb.BufferContext bc, int offset) => |
| new _AnalysisDriverSubtypeImpl(bc, offset); |
| } |
| |
| class _AnalysisDriverSubtypeImpl extends Object |
| with _AnalysisDriverSubtypeMixin |
| implements idl.AnalysisDriverSubtype { |
| final fb.BufferContext _bc; |
| final int _bcOffset; |
| |
| _AnalysisDriverSubtypeImpl(this._bc, this._bcOffset); |
| |
| List<String> _members; |
| String _name; |
| List<String> _supertypes; |
| |
| @override |
| List<String> get members { |
| _members ??= const fb.ListReader<String>(const fb.StringReader()) |
| .vTableGet(_bc, _bcOffset, 2, const <String>[]); |
| return _members; |
| } |
| |
| @override |
| String get name { |
| _name ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, ''); |
| return _name; |
| } |
| |
| @override |
| List<String> get supertypes { |
| _supertypes ??= const fb.ListReader<String>(const fb.StringReader()) |
| .vTableGet(_bc, _bcOffset, 1, const <String>[]); |
| return _supertypes; |
| } |
| } |
| |
| abstract class _AnalysisDriverSubtypeMixin |
| implements idl.AnalysisDriverSubtype { |
| @override |
| Map<String, Object> toJson() { |
| Map<String, Object> _result = <String, Object>{}; |
| if (members.isNotEmpty) _result["members"] = members; |
| if (name != '') _result["name"] = name; |
| if (supertypes.isNotEmpty) _result["supertypes"] = supertypes; |
| return _result; |
| } |
| |
| @override |
| Map<String, Object> toMap() => { |
| "members": members, |
| "name": name, |
| "supertypes": supertypes, |
| }; |
| |
| @override |
| String toString() => convert.json.encode(toJson()); |
| } |
| |
| class AnalysisDriverUnitErrorBuilder extends Object |
| with _AnalysisDriverUnitErrorMixin |
| implements idl.AnalysisDriverUnitError { |
| String _correction; |
| int _length; |
| String _message; |
| int _offset; |
| String _uniqueName; |
| |
| @override |
| String get correction => _correction ??= ''; |
| |
| /** |
| * The optional correction hint for the error. |
| */ |
| void set correction(String value) { |
| this._correction = value; |
| } |
| |
| @override |
| int get length => _length ??= 0; |
| |
| /** |
| * The length of the error in the file. |
| */ |
| void set length(int value) { |
| assert(value == null || value >= 0); |
| this._length = value; |
| } |
| |
| @override |
| String get message => _message ??= ''; |
| |
| /** |
| * The message of the error. |
| */ |
| void set message(String value) { |
| this._message = value; |
| } |
| |
| @override |
| int get offset => _offset ??= 0; |
| |
| /** |
| * The offset from the beginning of the file. |
| */ |
| void set offset(int value) { |
| assert(value == null || value >= 0); |
| this._offset = value; |
| } |
| |
| @override |
| String get uniqueName => _uniqueName ??= ''; |
| |
| /** |
| * The unique name of the error code. |
| */ |
| void set uniqueName(String value) { |
| this._uniqueName = value; |
| } |
| |
| AnalysisDriverUnitErrorBuilder( |
| {String correction, |
| int length, |
| String message, |
| int offset, |
| String uniqueName}) |
| : _correction = correction, |
| _length = length, |
| _message = message, |
| _offset = offset, |
| _uniqueName = uniqueName; |
| |
| /** |
| * Flush [informative] data recursively. |
| */ |
| void flushInformative() {} |
| |
| /** |
| * Accumulate non-[informative] data into [signature]. |
| */ |
| void collectApiSignature(api_sig.ApiSignature signature) { |
| signature.addInt(this._offset ?? 0); |
| signature.addInt(this._length ?? 0); |
| signature.addString(this._uniqueName ?? ''); |
| signature.addString(this._message ?? ''); |
| signature.addString(this._correction ?? ''); |
| } |
| |
| fb.Offset finish(fb.Builder fbBuilder) { |
| fb.Offset offset_correction; |
| fb.Offset offset_message; |
| fb.Offset offset_uniqueName; |
| if (_correction != null) { |
| offset_correction = fbBuilder.writeString(_correction); |
| } |
| if (_message != null) { |
| offset_message = fbBuilder.writeString(_message); |
| } |
| if (_uniqueName != null) { |
| offset_uniqueName = fbBuilder.writeString(_uniqueName); |
| } |
| fbBuilder.startTable(); |
| if (offset_correction != null) { |
| fbBuilder.addOffset(4, offset_correction); |
| } |
| if (_length != null && _length != 0) { |
| fbBuilder.addUint32(1, _length); |
| } |
| if (offset_message != null) { |
| fbBuilder.addOffset(3, offset_message); |
| } |
| if (_offset != null && _offset != 0) { |
| fbBuilder.addUint32(0, _offset); |
| } |
| if (offset_uniqueName != null) { |
| fbBuilder.addOffset(2, offset_uniqueName); |
| } |
| return fbBuilder.endTable(); |
| } |
| } |
| |
| class _AnalysisDriverUnitErrorReader |
| extends fb.TableReader<_AnalysisDriverUnitErrorImpl> { |
| const _AnalysisDriverUnitErrorReader(); |
| |
| @override |
| _AnalysisDriverUnitErrorImpl createObject(fb.BufferContext bc, int offset) => |
| new _AnalysisDriverUnitErrorImpl(bc, offset); |
| } |
| |
| class _AnalysisDriverUnitErrorImpl extends Object |
| with _AnalysisDriverUnitErrorMixin |
| implements idl.AnalysisDriverUnitError { |
| final fb.BufferContext _bc; |
| final int _bcOffset; |
| |
| _AnalysisDriverUnitErrorImpl(this._bc, this._bcOffset); |
| |
| String _correction; |
| int _length; |
| String _message; |
| int _offset; |
| String _uniqueName; |
| |
| @override |
| String get correction { |
| _correction ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 4, ''); |
| return _correction; |
| } |
| |
| @override |
| int get length { |
| _length ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 1, 0); |
| return _length; |
| } |
| |
| @override |
| String get message { |
| _message ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 3, ''); |
| return _message; |
| } |
| |
| @override |
| int get offset { |
| _offset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 0, 0); |
| return _offset; |
| } |
| |
| @override |
| String get uniqueName { |
| _uniqueName ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 2, ''); |
| return _uniqueName; |
| } |
| } |
| |
| abstract class _AnalysisDriverUnitErrorMixin |
| implements idl.AnalysisDriverUnitError { |
| @override |
| Map<String, Object> toJson() { |
| Map<String, Object> _result = <String, Object>{}; |
| if (correction != '') _result["correction"] = correction; |
| if (length != 0) _result["length"] = length; |
| if (message != '') _result["message"] = message; |
| if (offset != 0) _result["offset"] = offset; |
| if (uniqueName != '') _result["uniqueName"] = uniqueName; |
| return _result; |
| } |
| |
| @override |
| Map<String, Object> toMap() => { |
| "correction": correction, |
| "length": length, |
| "message": message, |
| "offset": offset, |
| "uniqueName": uniqueName, |
| }; |
| |
| @override |
| String toString() => convert.json.encode(toJson()); |
| } |
| |
| class AnalysisDriverUnitIndexBuilder extends Object |
| with _AnalysisDriverUnitIndexMixin |
| implements idl.AnalysisDriverUnitIndex { |
| List<idl.IndexSyntheticElementKind> _elementKinds; |
| List<int> _elementNameClassMemberIds; |
| List<int> _elementNameParameterIds; |
| List<int> _elementNameUnitMemberIds; |
| List<int> _elementUnits; |
| int _nullStringId; |
| List<String> _strings; |
| List<AnalysisDriverSubtypeBuilder> _subtypes; |
| List<int> _unitLibraryUris; |
| List<int> _unitUnitUris; |
| List<bool> _usedElementIsQualifiedFlags; |
| List<idl.IndexRelationKind> _usedElementKinds; |
| List<int> _usedElementLengths; |
| List<int> _usedElementOffsets; |
| List<int> _usedElements; |
| List<bool> _usedNameIsQualifiedFlags; |
| List<idl.IndexRelationKind> _usedNameKinds; |
| List<int> _usedNameOffsets; |
| List<int> _usedNames; |
| |
| @override |
| List<idl.IndexSyntheticElementKind> get elementKinds => |
| _elementKinds ??= <idl.IndexSyntheticElementKind>[]; |
| |
| /** |
| * Each item of this list corresponds to a unique referenced element. It is |
| * the kind of the synthetic element. |
| */ |
| void set elementKinds(List<idl.IndexSyntheticElementKind> value) { |
| this._elementKinds = value; |
| } |
| |
| @override |
| List<int> get elementNameClassMemberIds => |
| _elementNameClassMemberIds ??= <int>[]; |
| |
| /** |
| * Each item of this list corresponds to a unique referenced element. It is |
| * the identifier of the class member element name, or `null` if the element |
| * is a top-level element. The list is sorted in ascending order, so that the |
| * client can quickly check whether an element is referenced in this index. |
| */ |
| void set elementNameClassMemberIds(List<int> value) { |
| assert(value == null || value.every((e) => e >= 0)); |
| this._elementNameClassMemberIds = value; |
| } |
| |
| @override |
| List<int> get elementNameParameterIds => _elementNameParameterIds ??= <int>[]; |
| |
| /** |
| * Each item of this list corresponds to a unique referenced element. It is |
| * the identifier of the named parameter name, or `null` if the element is not |
| * a named parameter. The list is sorted in ascending order, so that the |
| * client can quickly check whether an element is referenced in this index. |
| */ |
| void set elementNameParameterIds(List<int> value) { |
| assert(value == null || value.every((e) => e >= 0)); |
| this._elementNameParameterIds = value; |
| } |
| |
| @override |
| List<int> get elementNameUnitMemberIds => |
| _elementNameUnitMemberIds ??= <int>[]; |
| |
| /** |
| * Each item of this list corresponds to a unique referenced element. It is |
| * the identifier of the top-level element name, or `null` if the element is |
| * the unit. The list is sorted in ascending order, so that the client can |
| * quickly check whether an element is referenced in this index. |
| */ |
| void set elementNameUnitMemberIds(List<int> value) { |
| assert(value == null || value.every((e) => e >= 0)); |
| this._elementNameUnitMemberIds = value; |
| } |
| |
| @override |
| List<int> get elementUnits => _elementUnits ??= <int>[]; |
| |
| /** |
| * Each item of this list corresponds to a unique referenced element. It is |
| * the index into [unitLibraryUris] and [unitUnitUris] for the library |
| * specific unit where the element is declared. |
| */ |
| void set elementUnits(List<int> value) { |
| assert(value == null || value.every((e) => e >= 0)); |
| this._elementUnits = value; |
| } |
| |
| @override |
| int get nullStringId => _nullStringId ??= 0; |
| |
| /** |
| * Identifier of the null string in [strings]. |
| */ |
| void set nullStringId(int value) { |
| assert(value == null || value >= 0); |
| this._nullStringId = value; |
| } |
| |
| @override |
| List<String> get strings => _strings ??= <String>[]; |
| |
| /** |
| * List of unique element strings used in this index. The list is sorted in |
| * ascending order, so that the client can quickly check the presence of a |
| * string in this index. |
| */ |
| void set strings(List<String> value) { |
| this._strings = value; |
| } |
| |
| @override |
| List<AnalysisDriverSubtypeBuilder> get subtypes => |
| _subtypes ??= <AnalysisDriverSubtypeBuilder>[]; |
| |
| /** |
| * The list of classes declared in the unit. |
| */ |
| void set subtypes(List<AnalysisDriverSubtypeBuilder> value) { |
| this._subtypes = value; |
| } |
| |
| @override |
| List<int> get unitLibraryUris => _unitLibraryUris ??= <int>[]; |
| |
| /** |
| * Each item of this list corresponds to the library URI of a unique library |
| * specific unit referenced in the index. It is an index into [strings] list. |
| */ |
| void set unitLibraryUris(List<int> value) { |
| assert(value == null || value.every((e) => e >= 0)); |
| this._unitLibraryUris = value; |
| } |
| |
| @override |
| List<int> get unitUnitUris => _unitUnitUris ??= <int>[]; |
| |
| /** |
| * Each item of this list corresponds to the unit URI of a unique library |
| * specific unit referenced in the index. It is an index into [strings] list. |
| */ |
| void set unitUnitUris(List<int> value) { |
| assert(value == null || value.every((e) => e >= 0)); |
| this._unitUnitUris = value; |
| } |
| |
| @override |
| List<bool> get usedElementIsQualifiedFlags => |
| _usedElementIsQualifiedFlags ??= <bool>[]; |
| |
| /** |
| * Each item of this list is the `true` if the corresponding element usage |
| * is qualified with some prefix. |
| */ |
| void set usedElementIsQualifiedFlags(List<bool> value) { |
| this._usedElementIsQualifiedFlags = value; |
| } |
| |
| @override |
| List<idl.IndexRelationKind> get usedElementKinds => |
| _usedElementKinds ??= <idl.IndexRelationKind>[]; |
| |
| /** |
| * Each item of this list is the kind of the element usage. |
| */ |
| void set usedElementKinds(List<idl.IndexRelationKind> value) { |
| this._usedElementKinds = value; |
| } |
| |
| @override |
| List<int> get usedElementLengths => _usedElementLengths ??= <int>[]; |
| |
| /** |
| * Each item of this list is the length of the element usage. |
| */ |
| void set usedElementLengths(List<int> value) { |
| assert(value == null || value.every((e) => e >= 0)); |
| this._usedElementLengths = value; |
| } |
| |
| @override |
| List<int> get usedElementOffsets => _usedElementOffsets ??= <int>[]; |
| |
| /** |
| * Each item of this list is the offset of the element usage relative to the |
| * beginning of the file. |
| */ |
| void set usedElementOffsets(List<int> value) { |
| assert(value == null || value.every((e) => e >= 0)); |
| this._usedElementOffsets = value; |
| } |
| |
| @override |
| List<int> get usedElements => _usedElements ??= <int>[]; |
| |
| /** |
| * Each item of this list is the index into [elementUnits], |
| * [elementNameUnitMemberIds], [elementNameClassMemberIds] and |
| * [elementNameParameterIds]. The list is sorted in ascending order, so |
| * that the client can quickly find element references in this index. |
| */ |
| void set usedElements(List<int> value) { |
| assert(value == null || value.every((e) => e >= 0)); |
| this._usedElements = value; |
| } |
| |
| @override |
| List<bool> get usedNameIsQualifiedFlags => |
| _usedNameIsQualifiedFlags ??= <bool>[]; |
| |
| /** |
| * Each item of this list is the `true` if the corresponding name usage |
| * is qualified with some prefix. |
| */ |
| void set usedNameIsQualifiedFlags(List<bool> value) { |
| this._usedNameIsQualifiedFlags = value; |
| } |
| |
| @override |
| List<idl.IndexRelationKind> get usedNameKinds => |
| _usedNameKinds ??= <idl.IndexRelationKind>[]; |
| |
| /** |
| * Each item of this list is the kind of the name usage. |
| */ |
| void set usedNameKinds(List<idl.IndexRelationKind> value) { |
| this._usedNameKinds = value; |
| } |
| |
| @override |
| List<int> get usedNameOffsets => _usedNameOffsets ??= <int>[]; |
| |
| /** |
| * Each item of this list is the offset of the name usage relative to the |
| * beginning of the file. |
| */ |
| void set usedNameOffsets(List<int> value) { |
| assert(value == null || value.every((e) => e >= 0)); |
| this._usedNameOffsets = value; |
| } |
| |
| @override |
| List<int> get usedNames => _usedNames ??= <int>[]; |
| |
| /** |
| * Each item of this list is the index into [strings] for a used name. The |
| * list is sorted in ascending order, so that the client can quickly find |
| * whether a name is used in this index. |
| */ |
| void set usedNames(List<int> value) { |
| assert(value == null || value.every((e) => e >= 0)); |
| this._usedNames = value; |
| } |
| |
| AnalysisDriverUnitIndexBuilder( |
| {List<idl.IndexSyntheticElementKind> elementKinds, |
| List<int> elementNameClassMemberIds, |
| List<int> elementNameParameterIds, |
| List<int> elementNameUnitMemberIds, |
| List<int> elementUnits, |
| int nullStringId, |
| List<String> strings, |
| List<AnalysisDriverSubtypeBuilder> subtypes, |
| List<int> unitLibraryUris, |
| List<int> unitUnitUris, |
| List<bool> usedElementIsQualifiedFlags, |
| List<idl.IndexRelationKind> usedElementKinds, |
| List<int> usedElementLengths, |
| List<int> usedElementOffsets, |
| List<int> usedElements, |
| List<bool> usedNameIsQualifiedFlags, |
| List<idl.IndexRelationKind> usedNameKinds, |
| List<int> usedNameOffsets, |
| List<int> usedNames}) |
| : _elementKinds = elementKinds, |
| _elementNameClassMemberIds = elementNameClassMemberIds, |
| _elementNameParameterIds = elementNameParameterIds, |
| _elementNameUnitMemberIds = elementNameUnitMemberIds, |
| _elementUnits = elementUnits, |
| _nullStringId = nullStringId, |
| _strings = strings, |
| _subtypes = subtypes, |
| _unitLibraryUris = unitLibraryUris, |
| _unitUnitUris = unitUnitUris, |
| _usedElementIsQualifiedFlags = usedElementIsQualifiedFlags, |
| _usedElementKinds = usedElementKinds, |
| _usedElementLengths = usedElementLengths, |
| _usedElementOffsets = usedElementOffsets, |
| _usedElements = usedElements, |
| _usedNameIsQualifiedFlags = usedNameIsQualifiedFlags, |
| _usedNameKinds = usedNameKinds, |
| _usedNameOffsets = usedNameOffsets, |
| _usedNames = usedNames; |
| |
| /** |
| * Flush [informative] data recursively. |
| */ |
| void flushInformative() { |
| _subtypes?.forEach((b) => b.flushInformative()); |
| } |
| |
| /** |
| * Accumulate non-[informative] data into [signature]. |
| */ |
| void collectApiSignature(api_sig.ApiSignature signature) { |
| if (this._strings == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._strings.length); |
| for (var x in this._strings) { |
| signature.addString(x); |
| } |
| } |
| signature.addInt(this._nullStringId ?? 0); |
| if (this._unitLibraryUris == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._unitLibraryUris.length); |
| for (var x in this._unitLibraryUris) { |
| signature.addInt(x); |
| } |
| } |
| if (this._unitUnitUris == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._unitUnitUris.length); |
| for (var x in this._unitUnitUris) { |
| signature.addInt(x); |
| } |
| } |
| if (this._elementKinds == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._elementKinds.length); |
| for (var x in this._elementKinds) { |
| signature.addInt(x.index); |
| } |
| } |
| if (this._elementUnits == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._elementUnits.length); |
| for (var x in this._elementUnits) { |
| signature.addInt(x); |
| } |
| } |
| if (this._elementNameUnitMemberIds == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._elementNameUnitMemberIds.length); |
| for (var x in this._elementNameUnitMemberIds) { |
| signature.addInt(x); |
| } |
| } |
| if (this._elementNameClassMemberIds == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._elementNameClassMemberIds.length); |
| for (var x in this._elementNameClassMemberIds) { |
| signature.addInt(x); |
| } |
| } |
| if (this._elementNameParameterIds == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._elementNameParameterIds.length); |
| for (var x in this._elementNameParameterIds) { |
| signature.addInt(x); |
| } |
| } |
| if (this._usedElements == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._usedElements.length); |
| for (var x in this._usedElements) { |
| signature.addInt(x); |
| } |
| } |
| if (this._usedElementKinds == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._usedElementKinds.length); |
| for (var x in this._usedElementKinds) { |
| signature.addInt(x.index); |
| } |
| } |
| if (this._usedElementOffsets == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._usedElementOffsets.length); |
| for (var x in this._usedElementOffsets) { |
| signature.addInt(x); |
| } |
| } |
| if (this._usedElementLengths == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._usedElementLengths.length); |
| for (var x in this._usedElementLengths) { |
| signature.addInt(x); |
| } |
| } |
| if (this._usedElementIsQualifiedFlags == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._usedElementIsQualifiedFlags.length); |
| for (var x in this._usedElementIsQualifiedFlags) { |
| signature.addBool(x); |
| } |
| } |
| if (this._usedNames == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._usedNames.length); |
| for (var x in this._usedNames) { |
| signature.addInt(x); |
| } |
| } |
| if (this._usedNameKinds == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._usedNameKinds.length); |
| for (var x in this._usedNameKinds) { |
| signature.addInt(x.index); |
| } |
| } |
| if (this._usedNameOffsets == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._usedNameOffsets.length); |
| for (var x in this._usedNameOffsets) { |
| signature.addInt(x); |
| } |
| } |
| if (this._usedNameIsQualifiedFlags == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._usedNameIsQualifiedFlags.length); |
| for (var x in this._usedNameIsQualifiedFlags) { |
| signature.addBool(x); |
| } |
| } |
| if (this._subtypes == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._subtypes.length); |
| for (var x in this._subtypes) { |
| x?.collectApiSignature(signature); |
| } |
| } |
| } |
| |
| List<int> toBuffer() { |
| fb.Builder fbBuilder = new fb.Builder(); |
| return fbBuilder.finish(finish(fbBuilder), "ADUI"); |
| } |
| |
| fb.Offset finish(fb.Builder fbBuilder) { |
| fb.Offset offset_elementKinds; |
| fb.Offset offset_elementNameClassMemberIds; |
| fb.Offset offset_elementNameParameterIds; |
| fb.Offset offset_elementNameUnitMemberIds; |
| fb.Offset offset_elementUnits; |
| fb.Offset offset_strings; |
| fb.Offset offset_subtypes; |
| fb.Offset offset_unitLibraryUris; |
| fb.Offset offset_unitUnitUris; |
| fb.Offset offset_usedElementIsQualifiedFlags; |
| fb.Offset offset_usedElementKinds; |
| fb.Offset offset_usedElementLengths; |
| fb.Offset offset_usedElementOffsets; |
| fb.Offset offset_usedElements; |
| fb.Offset offset_usedNameIsQualifiedFlags; |
| fb.Offset offset_usedNameKinds; |
| fb.Offset offset_usedNameOffsets; |
| fb.Offset offset_usedNames; |
| if (!(_elementKinds == null || _elementKinds.isEmpty)) { |
| offset_elementKinds = |
| fbBuilder.writeListUint8(_elementKinds.map((b) => b.index).toList()); |
| } |
| if (!(_elementNameClassMemberIds == null || |
| _elementNameClassMemberIds.isEmpty)) { |
| offset_elementNameClassMemberIds = |
| fbBuilder.writeListUint32(_elementNameClassMemberIds); |
| } |
| if (!(_elementNameParameterIds == null || |
| _elementNameParameterIds.isEmpty)) { |
| offset_elementNameParameterIds = |
| fbBuilder.writeListUint32(_elementNameParameterIds); |
| } |
| if (!(_elementNameUnitMemberIds == null || |
| _elementNameUnitMemberIds.isEmpty)) { |
| offset_elementNameUnitMemberIds = |
| fbBuilder.writeListUint32(_elementNameUnitMemberIds); |
| } |
| if (!(_elementUnits == null || _elementUnits.isEmpty)) { |
| offset_elementUnits = fbBuilder.writeListUint32(_elementUnits); |
| } |
| if (!(_strings == null || _strings.isEmpty)) { |
| offset_strings = fbBuilder |
| .writeList(_strings.map((b) => fbBuilder.writeString(b)).toList()); |
| } |
| if (!(_subtypes == null || _subtypes.isEmpty)) { |
| offset_subtypes = fbBuilder |
| .writeList(_subtypes.map((b) => b.finish(fbBuilder)).toList()); |
| } |
| if (!(_unitLibraryUris == null || _unitLibraryUris.isEmpty)) { |
| offset_unitLibraryUris = fbBuilder.writeListUint32(_unitLibraryUris); |
| } |
| if (!(_unitUnitUris == null || _unitUnitUris.isEmpty)) { |
| offset_unitUnitUris = fbBuilder.writeListUint32(_unitUnitUris); |
| } |
| if (!(_usedElementIsQualifiedFlags == null || |
| _usedElementIsQualifiedFlags.isEmpty)) { |
| offset_usedElementIsQualifiedFlags = |
| fbBuilder.writeListBool(_usedElementIsQualifiedFlags); |
| } |
| if (!(_usedElementKinds == null || _usedElementKinds.isEmpty)) { |
| offset_usedElementKinds = fbBuilder |
| .writeListUint8(_usedElementKinds.map((b) => b.index).toList()); |
| } |
| if (!(_usedElementLengths == null || _usedElementLengths.isEmpty)) { |
| offset_usedElementLengths = |
| fbBuilder.writeListUint32(_usedElementLengths); |
| } |
| if (!(_usedElementOffsets == null || _usedElementOffsets.isEmpty)) { |
| offset_usedElementOffsets = |
| fbBuilder.writeListUint32(_usedElementOffsets); |
| } |
| if (!(_usedElements == null || _usedElements.isEmpty)) { |
| offset_usedElements = fbBuilder.writeListUint32(_usedElements); |
| } |
| if (!(_usedNameIsQualifiedFlags == null || |
| _usedNameIsQualifiedFlags.isEmpty)) { |
| offset_usedNameIsQualifiedFlags = |
| fbBuilder.writeListBool(_usedNameIsQualifiedFlags); |
| } |
| if (!(_usedNameKinds == null || _usedNameKinds.isEmpty)) { |
| offset_usedNameKinds = |
| fbBuilder.writeListUint8(_usedNameKinds.map((b) => b.index).toList()); |
| } |
| if (!(_usedNameOffsets == null || _usedNameOffsets.isEmpty)) { |
| offset_usedNameOffsets = fbBuilder.writeListUint32(_usedNameOffsets); |
| } |
| if (!(_usedNames == null || _usedNames.isEmpty)) { |
| offset_usedNames = fbBuilder.writeListUint32(_usedNames); |
| } |
| fbBuilder.startTable(); |
| if (offset_elementKinds != null) { |
| fbBuilder.addOffset(4, offset_elementKinds); |
| } |
| if (offset_elementNameClassMemberIds != null) { |
| fbBuilder.addOffset(7, offset_elementNameClassMemberIds); |
| } |
| if (offset_elementNameParameterIds != null) { |
| fbBuilder.addOffset(8, offset_elementNameParameterIds); |
| } |
| if (offset_elementNameUnitMemberIds != null) { |
| fbBuilder.addOffset(6, offset_elementNameUnitMemberIds); |
| } |
| if (offset_elementUnits != null) { |
| fbBuilder.addOffset(5, offset_elementUnits); |
| } |
| if (_nullStringId != null && _nullStringId != 0) { |
| fbBuilder.addUint32(1, _nullStringId); |
| } |
| if (offset_strings != null) { |
| fbBuilder.addOffset(0, offset_strings); |
| } |
| if (offset_subtypes != null) { |
| fbBuilder.addOffset(18, offset_subtypes); |
| } |
| if (offset_unitLibraryUris != null) { |
| fbBuilder.addOffset(2, offset_unitLibraryUris); |
| } |
| if (offset_unitUnitUris != null) { |
| fbBuilder.addOffset(3, offset_unitUnitUris); |
| } |
| if (offset_usedElementIsQualifiedFlags != null) { |
| fbBuilder.addOffset(13, offset_usedElementIsQualifiedFlags); |
| } |
| if (offset_usedElementKinds != null) { |
| fbBuilder.addOffset(10, offset_usedElementKinds); |
| } |
| if (offset_usedElementLengths != null) { |
| fbBuilder.addOffset(12, offset_usedElementLengths); |
| } |
| if (offset_usedElementOffsets != null) { |
| fbBuilder.addOffset(11, offset_usedElementOffsets); |
| } |
| if (offset_usedElements != null) { |
| fbBuilder.addOffset(9, offset_usedElements); |
| } |
| if (offset_usedNameIsQualifiedFlags != null) { |
| fbBuilder.addOffset(17, offset_usedNameIsQualifiedFlags); |
| } |
| if (offset_usedNameKinds != null) { |
| fbBuilder.addOffset(15, offset_usedNameKinds); |
| } |
| if (offset_usedNameOffsets != null) { |
| fbBuilder.addOffset(16, offset_usedNameOffsets); |
| } |
| if (offset_usedNames != null) { |
| fbBuilder.addOffset(14, offset_usedNames); |
| } |
| return fbBuilder.endTable(); |
| } |
| } |
| |
| idl.AnalysisDriverUnitIndex readAnalysisDriverUnitIndex(List<int> buffer) { |
| fb.BufferContext rootRef = new fb.BufferContext.fromBytes(buffer); |
| return const _AnalysisDriverUnitIndexReader().read(rootRef, 0); |
| } |
| |
| class _AnalysisDriverUnitIndexReader |
| extends fb.TableReader<_AnalysisDriverUnitIndexImpl> { |
| const _AnalysisDriverUnitIndexReader(); |
| |
| @override |
| _AnalysisDriverUnitIndexImpl createObject(fb.BufferContext bc, int offset) => |
| new _AnalysisDriverUnitIndexImpl(bc, offset); |
| } |
| |
| class _AnalysisDriverUnitIndexImpl extends Object |
| with _AnalysisDriverUnitIndexMixin |
| implements idl.AnalysisDriverUnitIndex { |
| final fb.BufferContext _bc; |
| final int _bcOffset; |
| |
| _AnalysisDriverUnitIndexImpl(this._bc, this._bcOffset); |
| |
| List<idl.IndexSyntheticElementKind> _elementKinds; |
| List<int> _elementNameClassMemberIds; |
| List<int> _elementNameParameterIds; |
| List<int> _elementNameUnitMemberIds; |
| List<int> _elementUnits; |
| int _nullStringId; |
| List<String> _strings; |
| List<idl.AnalysisDriverSubtype> _subtypes; |
| List<int> _unitLibraryUris; |
| List<int> _unitUnitUris; |
| List<bool> _usedElementIsQualifiedFlags; |
| List<idl.IndexRelationKind> _usedElementKinds; |
| List<int> _usedElementLengths; |
| List<int> _usedElementOffsets; |
| List<int> _usedElements; |
| List<bool> _usedNameIsQualifiedFlags; |
| List<idl.IndexRelationKind> _usedNameKinds; |
| List<int> _usedNameOffsets; |
| List<int> _usedNames; |
| |
| @override |
| List<idl.IndexSyntheticElementKind> get elementKinds { |
| _elementKinds ??= const fb.ListReader<idl.IndexSyntheticElementKind>( |
| const _IndexSyntheticElementKindReader()) |
| .vTableGet(_bc, _bcOffset, 4, const <idl.IndexSyntheticElementKind>[]); |
| return _elementKinds; |
| } |
| |
| @override |
| List<int> get elementNameClassMemberIds { |
| _elementNameClassMemberIds ??= |
| const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 7, const <int>[]); |
| return _elementNameClassMemberIds; |
| } |
| |
| @override |
| List<int> get elementNameParameterIds { |
| _elementNameParameterIds ??= |
| const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 8, const <int>[]); |
| return _elementNameParameterIds; |
| } |
| |
| @override |
| List<int> get elementNameUnitMemberIds { |
| _elementNameUnitMemberIds ??= |
| const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 6, const <int>[]); |
| return _elementNameUnitMemberIds; |
| } |
| |
| @override |
| List<int> get elementUnits { |
| _elementUnits ??= |
| const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 5, const <int>[]); |
| return _elementUnits; |
| } |
| |
| @override |
| int get nullStringId { |
| _nullStringId ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 1, 0); |
| return _nullStringId; |
| } |
| |
| @override |
| List<String> get strings { |
| _strings ??= const fb.ListReader<String>(const fb.StringReader()) |
| .vTableGet(_bc, _bcOffset, 0, const <String>[]); |
| return _strings; |
| } |
| |
| @override |
| List<idl.AnalysisDriverSubtype> get subtypes { |
| _subtypes ??= const fb.ListReader<idl.AnalysisDriverSubtype>( |
| const _AnalysisDriverSubtypeReader()) |
| .vTableGet(_bc, _bcOffset, 18, const <idl.AnalysisDriverSubtype>[]); |
| return _subtypes; |
| } |
| |
| @override |
| List<int> get unitLibraryUris { |
| _unitLibraryUris ??= |
| const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 2, const <int>[]); |
| return _unitLibraryUris; |
| } |
| |
| @override |
| List<int> get unitUnitUris { |
| _unitUnitUris ??= |
| const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 3, const <int>[]); |
| return _unitUnitUris; |
| } |
| |
| @override |
| List<bool> get usedElementIsQualifiedFlags { |
| _usedElementIsQualifiedFlags ??= |
| const fb.BoolListReader().vTableGet(_bc, _bcOffset, 13, const <bool>[]); |
| return _usedElementIsQualifiedFlags; |
| } |
| |
| @override |
| List<idl.IndexRelationKind> get usedElementKinds { |
| _usedElementKinds ??= const fb.ListReader<idl.IndexRelationKind>( |
| const _IndexRelationKindReader()) |
| .vTableGet(_bc, _bcOffset, 10, const <idl.IndexRelationKind>[]); |
| return _usedElementKinds; |
| } |
| |
| @override |
| List<int> get usedElementLengths { |
| _usedElementLengths ??= const fb.Uint32ListReader() |
| .vTableGet(_bc, _bcOffset, 12, const <int>[]); |
| return _usedElementLengths; |
| } |
| |
| @override |
| List<int> get usedElementOffsets { |
| _usedElementOffsets ??= const fb.Uint32ListReader() |
| .vTableGet(_bc, _bcOffset, 11, const <int>[]); |
| return _usedElementOffsets; |
| } |
| |
| @override |
| List<int> get usedElements { |
| _usedElements ??= |
| const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 9, const <int>[]); |
| return _usedElements; |
| } |
| |
| @override |
| List<bool> get usedNameIsQualifiedFlags { |
| _usedNameIsQualifiedFlags ??= |
| const fb.BoolListReader().vTableGet(_bc, _bcOffset, 17, const <bool>[]); |
| return _usedNameIsQualifiedFlags; |
| } |
| |
| @override |
| List<idl.IndexRelationKind> get usedNameKinds { |
| _usedNameKinds ??= const fb.ListReader<idl.IndexRelationKind>( |
| const _IndexRelationKindReader()) |
| .vTableGet(_bc, _bcOffset, 15, const <idl.IndexRelationKind>[]); |
| return _usedNameKinds; |
| } |
| |
| @override |
| List<int> get usedNameOffsets { |
| _usedNameOffsets ??= const fb.Uint32ListReader() |
| .vTableGet(_bc, _bcOffset, 16, const <int>[]); |
| return _usedNameOffsets; |
| } |
| |
| @override |
| List<int> get usedNames { |
| _usedNames ??= const fb.Uint32ListReader() |
| .vTableGet(_bc, _bcOffset, 14, const <int>[]); |
| return _usedNames; |
| } |
| } |
| |
| abstract class _AnalysisDriverUnitIndexMixin |
| implements idl.AnalysisDriverUnitIndex { |
| @override |
| Map<String, Object> toJson() { |
| Map<String, Object> _result = <String, Object>{}; |
| if (elementKinds.isNotEmpty) |
| _result["elementKinds"] = elementKinds |
| .map((_value) => _value.toString().split('.')[1]) |
| .toList(); |
| if (elementNameClassMemberIds.isNotEmpty) |
| _result["elementNameClassMemberIds"] = elementNameClassMemberIds; |
| if (elementNameParameterIds.isNotEmpty) |
| _result["elementNameParameterIds"] = elementNameParameterIds; |
| if (elementNameUnitMemberIds.isNotEmpty) |
| _result["elementNameUnitMemberIds"] = elementNameUnitMemberIds; |
| if (elementUnits.isNotEmpty) _result["elementUnits"] = elementUnits; |
| if (nullStringId != 0) _result["nullStringId"] = nullStringId; |
| if (strings.isNotEmpty) _result["strings"] = strings; |
| if (subtypes.isNotEmpty) |
| _result["subtypes"] = subtypes.map((_value) => _value.toJson()).toList(); |
| if (unitLibraryUris.isNotEmpty) |
| _result["unitLibraryUris"] = unitLibraryUris; |
| if (unitUnitUris.isNotEmpty) _result["unitUnitUris"] = unitUnitUris; |
| if (usedElementIsQualifiedFlags.isNotEmpty) |
| _result["usedElementIsQualifiedFlags"] = usedElementIsQualifiedFlags; |
| if (usedElementKinds.isNotEmpty) |
| _result["usedElementKinds"] = usedElementKinds |
| .map((_value) => _value.toString().split('.')[1]) |
| .toList(); |
| if (usedElementLengths.isNotEmpty) |
| _result["usedElementLengths"] = usedElementLengths; |
| if (usedElementOffsets.isNotEmpty) |
| _result["usedElementOffsets"] = usedElementOffsets; |
| if (usedElements.isNotEmpty) _result["usedElements"] = usedElements; |
| if (usedNameIsQualifiedFlags.isNotEmpty) |
| _result["usedNameIsQualifiedFlags"] = usedNameIsQualifiedFlags; |
| if (usedNameKinds.isNotEmpty) |
| _result["usedNameKinds"] = usedNameKinds |
| .map((_value) => _value.toString().split('.')[1]) |
| .toList(); |
| if (usedNameOffsets.isNotEmpty) |
| _result["usedNameOffsets"] = usedNameOffsets; |
| if (usedNames.isNotEmpty) _result["usedNames"] = usedNames; |
| return _result; |
| } |
| |
| @override |
| Map<String, Object> toMap() => { |
| "elementKinds": elementKinds, |
| "elementNameClassMemberIds": elementNameClassMemberIds, |
| "elementNameParameterIds": elementNameParameterIds, |
| "elementNameUnitMemberIds": elementNameUnitMemberIds, |
| "elementUnits": elementUnits, |
| "nullStringId": nullStringId, |
| "strings": strings, |
| "subtypes": subtypes, |
| "unitLibraryUris": unitLibraryUris, |
| "unitUnitUris": unitUnitUris, |
| "usedElementIsQualifiedFlags": usedElementIsQualifiedFlags, |
| "usedElementKinds": usedElementKinds, |
| "usedElementLengths": usedElementLengths, |
| "usedElementOffsets": usedElementOffsets, |
| "usedElements": usedElements, |
| "usedNameIsQualifiedFlags": usedNameIsQualifiedFlags, |
| "usedNameKinds": usedNameKinds, |
| "usedNameOffsets": usedNameOffsets, |
| "usedNames": usedNames, |
| }; |
| |
| @override |
| String toString() => convert.json.encode(toJson()); |
| } |
| |
| class AnalysisDriverUnlinkedUnitBuilder extends Object |
| with _AnalysisDriverUnlinkedUnitMixin |
| implements idl.AnalysisDriverUnlinkedUnit { |
| List<String> _definedClassMemberNames; |
| List<String> _definedTopLevelNames; |
| List<String> _referencedNames; |
| List<String> _subtypedNames; |
| UnlinkedUnitBuilder _unit; |
| |
| @override |
| List<String> get definedClassMemberNames => |
| _definedClassMemberNames ??= <String>[]; |
| |
| /** |
| * List of class member names defined by the unit. |
| */ |
| void set definedClassMemberNames(List<String> value) { |
| this._definedClassMemberNames = value; |
| } |
| |
| @override |
| List<String> get definedTopLevelNames => _definedTopLevelNames ??= <String>[]; |
| |
| /** |
| * List of top-level names defined by the unit. |
| */ |
| void set definedTopLevelNames(List<String> value) { |
| this._definedTopLevelNames = value; |
| } |
| |
| @override |
| List<String> get referencedNames => _referencedNames ??= <String>[]; |
| |
| /** |
| * List of external names referenced by the unit. |
| */ |
| void set referencedNames(List<String> value) { |
| this._referencedNames = value; |
| } |
| |
| @override |
| List<String> get subtypedNames => _subtypedNames ??= <String>[]; |
| |
| /** |
| * List of names which are used in `extends`, `with` or `implements` clauses |
| * in the file. Import prefixes and type arguments are not included. |
| */ |
| void set subtypedNames(List<String> value) { |
| this._subtypedNames = value; |
| } |
| |
| @override |
| UnlinkedUnitBuilder get unit => _unit; |
| |
| /** |
| * Unlinked information for the unit. |
| */ |
| void set unit(UnlinkedUnitBuilder value) { |
| this._unit = value; |
| } |
| |
| AnalysisDriverUnlinkedUnitBuilder( |
| {List<String> definedClassMemberNames, |
| List<String> definedTopLevelNames, |
| List<String> referencedNames, |
| List<String> subtypedNames, |
| UnlinkedUnitBuilder unit}) |
| : _definedClassMemberNames = definedClassMemberNames, |
| _definedTopLevelNames = definedTopLevelNames, |
| _referencedNames = referencedNames, |
| _subtypedNames = subtypedNames, |
| _unit = unit; |
| |
| /** |
| * Flush [informative] data recursively. |
| */ |
| void flushInformative() { |
| _unit?.flushInformative(); |
| } |
| |
| /** |
| * Accumulate non-[informative] data into [signature]. |
| */ |
| void collectApiSignature(api_sig.ApiSignature signature) { |
| if (this._referencedNames == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._referencedNames.length); |
| for (var x in this._referencedNames) { |
| signature.addString(x); |
| } |
| } |
| signature.addBool(this._unit != null); |
| this._unit?.collectApiSignature(signature); |
| if (this._definedTopLevelNames == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._definedTopLevelNames.length); |
| for (var x in this._definedTopLevelNames) { |
| signature.addString(x); |
| } |
| } |
| if (this._definedClassMemberNames == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._definedClassMemberNames.length); |
| for (var x in this._definedClassMemberNames) { |
| signature.addString(x); |
| } |
| } |
| if (this._subtypedNames == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._subtypedNames.length); |
| for (var x in this._subtypedNames) { |
| signature.addString(x); |
| } |
| } |
| } |
| |
| List<int> toBuffer() { |
| fb.Builder fbBuilder = new fb.Builder(); |
| return fbBuilder.finish(finish(fbBuilder), "ADUU"); |
| } |
| |
| fb.Offset finish(fb.Builder fbBuilder) { |
| fb.Offset offset_definedClassMemberNames; |
| fb.Offset offset_definedTopLevelNames; |
| fb.Offset offset_referencedNames; |
| fb.Offset offset_subtypedNames; |
| fb.Offset offset_unit; |
| if (!(_definedClassMemberNames == null || |
| _definedClassMemberNames.isEmpty)) { |
| offset_definedClassMemberNames = fbBuilder.writeList( |
| _definedClassMemberNames |
| .map((b) => fbBuilder.writeString(b)) |
| .toList()); |
| } |
| if (!(_definedTopLevelNames == null || _definedTopLevelNames.isEmpty)) { |
| offset_definedTopLevelNames = fbBuilder.writeList( |
| _definedTopLevelNames.map((b) => fbBuilder.writeString(b)).toList()); |
| } |
| if (!(_referencedNames == null || _referencedNames.isEmpty)) { |
| offset_referencedNames = fbBuilder.writeList( |
| _referencedNames.map((b) => fbBuilder.writeString(b)).toList()); |
| } |
| if (!(_subtypedNames == null || _subtypedNames.isEmpty)) { |
| offset_subtypedNames = fbBuilder.writeList( |
| _subtypedNames.map((b) => fbBuilder.writeString(b)).toList()); |
| } |
| if (_unit != null) { |
| offset_unit = _unit.finish(fbBuilder); |
| } |
| fbBuilder.startTable(); |
| if (offset_definedClassMemberNames != null) { |
| fbBuilder.addOffset(3, offset_definedClassMemberNames); |
| } |
| if (offset_definedTopLevelNames != null) { |
| fbBuilder.addOffset(2, offset_definedTopLevelNames); |
| } |
| if (offset_referencedNames != null) { |
| fbBuilder.addOffset(0, offset_referencedNames); |
| } |
| if (offset_subtypedNames != null) { |
| fbBuilder.addOffset(4, offset_subtypedNames); |
| } |
| if (offset_unit != null) { |
| fbBuilder.addOffset(1, offset_unit); |
| } |
| return fbBuilder.endTable(); |
| } |
| } |
| |
| idl.AnalysisDriverUnlinkedUnit readAnalysisDriverUnlinkedUnit( |
| List<int> buffer) { |
| fb.BufferContext rootRef = new fb.BufferContext.fromBytes(buffer); |
| return const _AnalysisDriverUnlinkedUnitReader().read(rootRef, 0); |
| } |
| |
| class _AnalysisDriverUnlinkedUnitReader |
| extends fb.TableReader<_AnalysisDriverUnlinkedUnitImpl> { |
| const _AnalysisDriverUnlinkedUnitReader(); |
| |
| @override |
| _AnalysisDriverUnlinkedUnitImpl createObject( |
| fb.BufferContext bc, int offset) => |
| new _AnalysisDriverUnlinkedUnitImpl(bc, offset); |
| } |
| |
| class _AnalysisDriverUnlinkedUnitImpl extends Object |
| with _AnalysisDriverUnlinkedUnitMixin |
| implements idl.AnalysisDriverUnlinkedUnit { |
| final fb.BufferContext _bc; |
| final int _bcOffset; |
| |
| _AnalysisDriverUnlinkedUnitImpl(this._bc, this._bcOffset); |
| |
| List<String> _definedClassMemberNames; |
| List<String> _definedTopLevelNames; |
| List<String> _referencedNames; |
| List<String> _subtypedNames; |
| idl.UnlinkedUnit _unit; |
| |
| @override |
| List<String> get definedClassMemberNames { |
| _definedClassMemberNames ??= |
| const fb.ListReader<String>(const fb.StringReader()) |
| .vTableGet(_bc, _bcOffset, 3, const <String>[]); |
| return _definedClassMemberNames; |
| } |
| |
| @override |
| List<String> get definedTopLevelNames { |
| _definedTopLevelNames ??= |
| const fb.ListReader<String>(const fb.StringReader()) |
| .vTableGet(_bc, _bcOffset, 2, const <String>[]); |
| return _definedTopLevelNames; |
| } |
| |
| @override |
| List<String> get referencedNames { |
| _referencedNames ??= const fb.ListReader<String>(const fb.StringReader()) |
| .vTableGet(_bc, _bcOffset, 0, const <String>[]); |
| return _referencedNames; |
| } |
| |
| @override |
| List<String> get subtypedNames { |
| _subtypedNames ??= const fb.ListReader<String>(const fb.StringReader()) |
| .vTableGet(_bc, _bcOffset, 4, const <String>[]); |
| return _subtypedNames; |
| } |
| |
| @override |
| idl.UnlinkedUnit get unit { |
| _unit ??= const _UnlinkedUnitReader().vTableGet(_bc, _bcOffset, 1, null); |
| return _unit; |
| } |
| } |
| |
| abstract class _AnalysisDriverUnlinkedUnitMixin |
| implements idl.AnalysisDriverUnlinkedUnit { |
| @override |
| Map<String, Object> toJson() { |
| Map<String, Object> _result = <String, Object>{}; |
| if (definedClassMemberNames.isNotEmpty) |
| _result["definedClassMemberNames"] = definedClassMemberNames; |
| if (definedTopLevelNames.isNotEmpty) |
| _result["definedTopLevelNames"] = definedTopLevelNames; |
| if (referencedNames.isNotEmpty) |
| _result["referencedNames"] = referencedNames; |
| if (subtypedNames.isNotEmpty) _result["subtypedNames"] = subtypedNames; |
| if (unit != null) _result["unit"] = unit.toJson(); |
| return _result; |
| } |
| |
| @override |
| Map<String, Object> toMap() => { |
| "definedClassMemberNames": definedClassMemberNames, |
| "definedTopLevelNames": definedTopLevelNames, |
| "referencedNames": referencedNames, |
| "subtypedNames": subtypedNames, |
| "unit": unit, |
| }; |
| |
| @override |
| String toString() => convert.json.encode(toJson()); |
| } |
| |
| class CodeRangeBuilder extends Object |
| with _CodeRangeMixin |
| implements idl.CodeRange { |
| int _length; |
| int _offset; |
| |
| @override |
| int get length => _length ??= 0; |
| |
| /** |
| * Length of the element code. |
| */ |
| void set length(int value) { |
| assert(value == null || value >= 0); |
| this._length = value; |
| } |
| |
| @override |
| int get offset => _offset ??= 0; |
| |
| /** |
| * Offset of the element code relative to the beginning of the file. |
| */ |
| void set offset(int value) { |
| assert(value == null || value >= 0); |
| this._offset = value; |
| } |
| |
| CodeRangeBuilder({int length, int offset}) |
| : _length = length, |
| _offset = offset; |
| |
| /** |
| * Flush [informative] data recursively. |
| */ |
| void flushInformative() {} |
| |
| /** |
| * Accumulate non-[informative] data into [signature]. |
| */ |
| void collectApiSignature(api_sig.ApiSignature signature) { |
| signature.addInt(this._offset ?? 0); |
| signature.addInt(this._length ?? 0); |
| } |
| |
| fb.Offset finish(fb.Builder fbBuilder) { |
| fbBuilder.startTable(); |
| if (_length != null && _length != 0) { |
| fbBuilder.addUint32(1, _length); |
| } |
| if (_offset != null && _offset != 0) { |
| fbBuilder.addUint32(0, _offset); |
| } |
| return fbBuilder.endTable(); |
| } |
| } |
| |
| class _CodeRangeReader extends fb.TableReader<_CodeRangeImpl> { |
| const _CodeRangeReader(); |
| |
| @override |
| _CodeRangeImpl createObject(fb.BufferContext bc, int offset) => |
| new _CodeRangeImpl(bc, offset); |
| } |
| |
| class _CodeRangeImpl extends Object |
| with _CodeRangeMixin |
| implements idl.CodeRange { |
| final fb.BufferContext _bc; |
| final int _bcOffset; |
| |
| _CodeRangeImpl(this._bc, this._bcOffset); |
| |
| int _length; |
| int _offset; |
| |
| @override |
| int get length { |
| _length ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 1, 0); |
| return _length; |
| } |
| |
| @override |
| int get offset { |
| _offset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 0, 0); |
| return _offset; |
| } |
| } |
| |
| abstract class _CodeRangeMixin implements idl.CodeRange { |
| @override |
| Map<String, Object> toJson() { |
| Map<String, Object> _result = <String, Object>{}; |
| if (length != 0) _result["length"] = length; |
| if (offset != 0) _result["offset"] = offset; |
| return _result; |
| } |
| |
| @override |
| Map<String, Object> toMap() => { |
| "length": length, |
| "offset": offset, |
| }; |
| |
| @override |
| String toString() => convert.json.encode(toJson()); |
| } |
| |
| class EntityRefBuilder extends Object |
| with _EntityRefMixin |
| implements idl.EntityRef { |
| idl.EntityRefKind _entityKind; |
| List<int> _implicitFunctionTypeIndices; |
| int _paramReference; |
| int _reference; |
| int _refinedSlot; |
| int _slot; |
| List<UnlinkedParamBuilder> _syntheticParams; |
| EntityRefBuilder _syntheticReturnType; |
| List<EntityRefBuilder> _typeArguments; |
| List<UnlinkedTypeParamBuilder> _typeParameters; |
| |
| @override |
| idl.EntityRefKind get entityKind => _entityKind ??= idl.EntityRefKind.named; |
| |
| /** |
| * The kind of entity being represented. |
| */ |
| void set entityKind(idl.EntityRefKind value) { |
| this._entityKind = value; |
| } |
| |
| @override |
| List<int> get implicitFunctionTypeIndices => |
| _implicitFunctionTypeIndices ??= <int>[]; |
| |
| /** |
| * Notice: This will be deprecated. However, its not deprecated yet, as we're |
| * keeping it for backwards compatibilty, and marking it deprecated makes it |
| * unreadable. |
| * |
| * TODO(mfairhurst) mark this deprecated, and remove its logic. |
| * |
| * If this is a reference to a function type implicitly defined by a |
| * function-typed parameter, a list of zero-based indices indicating the path |
| * from the entity referred to by [reference] to the appropriate type |
| * parameter. Otherwise the empty list. |
| * |
| * If there are N indices in this list, then the entity being referred to is |
| * the function type implicitly defined by a function-typed parameter of a |
| * function-typed parameter, to N levels of nesting. The first index in the |
| * list refers to the outermost level of nesting; for example if [reference] |
| * refers to the entity defined by: |
| * |
| * void f(x, void g(y, z, int h(String w))) { ... } |
| * |
| * Then to refer to the function type implicitly defined by parameter `h` |
| * (which is parameter 2 of parameter 1 of `f`), then |
| * [implicitFunctionTypeIndices] should be [1, 2]. |
| * |
| * Note that if the entity being referred to is a generic method inside a |
| * generic class, then the type arguments in [typeArguments] are applied |
| * first to the class and then to the method. |
| */ |
| void set implicitFunctionTypeIndices(List<int> value) { |
| assert(value == null || value.every((e) => e >= 0)); |
| this._implicitFunctionTypeIndices = value; |
| } |
| |
| @override |
| int get paramReference => _paramReference ??= 0; |
| |
| /** |
| * If this is a reference to a type parameter, one-based index into the list |
| * of [UnlinkedTypeParam]s currently in effect. Indexing is done using De |
| * Bruijn index conventions; that is, innermost parameters come first, and |
| * if a class or method has multiple parameters, they are indexed from right |
| * to left. So for instance, if the enclosing declaration is |
| * |
| * class C<T,U> { |
| * m<V,W> { |
| * ... |
| * } |
| * } |
| * |
| * Then [paramReference] values of 1, 2, 3, and 4 represent W, V, U, and T, |
| * respectively. |
| * |
| * If the type being referred to is not a type parameter, [paramReference] is |
| * zero. |
| */ |
| void set paramReference(int value) { |
| assert(value == null || value >= 0); |
| this._paramReference = value; |
| } |
| |
| @override |
| int get reference => _reference ??= 0; |
| |
| /** |
| * Index into [UnlinkedUnit.references] for the entity being referred to, or |
| * zero if this is a reference to a type parameter. |
| */ |
| void set reference(int value) { |
| assert(value == null || value >= 0); |
| this._reference = value; |
| } |
| |
| @override |
| int get refinedSlot => _refinedSlot ??= 0; |
| |
| /** |
| * If this [EntityRef] appears in a syntactic context where its type arguments |
| * might need to be inferred by a method other than instantiate-to-bounds, |
| * and [typeArguments] is empty, a slot id (which is unique within the |
| * compilation unit). If an entry appears in [LinkedUnit.types] whose [slot] |
| * matches this value, that entry will contain the complete inferred type. |
| * |
| * This is called `refinedSlot` to clarify that if it points to an inferred |
| * type, it points to a type that is a "refinement" of this one (one in which |
| * some type arguments have been inferred). |
| */ |
| void set refinedSlot(int value) { |
| assert(value == null || value >= 0); |
| this._refinedSlot = value; |
| } |
| |
| @override |
| int get slot => _slot ??= 0; |
| |
| /** |
| * If this [EntityRef] is contained within [LinkedUnit.types], slot id (which |
| * is unique within the compilation unit) identifying the target of type |
| * propagation or type inference with which this [EntityRef] is associated. |
| * |
| * Otherwise zero. |
| */ |
| void set slot(int value) { |
| assert(value == null || value >= 0); |
| this._slot = value; |
| } |
| |
| @override |
| List<UnlinkedParamBuilder> get syntheticParams => |
| _syntheticParams ??= <UnlinkedParamBuilder>[]; |
| |
| /** |
| * If this [EntityRef] is a reference to a function type whose |
| * [FunctionElement] is not in any library (e.g. a function type that was |
| * synthesized by a LUB computation), the function parameters. Otherwise |
| * empty. |
| */ |
| void set syntheticParams(List<UnlinkedParamBuilder> value) { |
| this._syntheticParams = value; |
| } |
| |
| @override |
| EntityRefBuilder get syntheticReturnType => _syntheticReturnType; |
| |
| /** |
| * If this [EntityRef] is a reference to a function type whose |
| * [FunctionElement] is not in any library (e.g. a function type that was |
| * synthesized by a LUB computation), the return type of the function. |
| * Otherwise `null`. |
| */ |
| void set syntheticReturnType(EntityRefBuilder value) { |
| this._syntheticReturnType = value; |
| } |
| |
| @override |
| List<EntityRefBuilder> get typeArguments => |
| _typeArguments ??= <EntityRefBuilder>[]; |
| |
| /** |
| * If this is an instantiation of a generic type or generic executable, the |
| * type arguments used to instantiate it (if any). |
| */ |
| void set typeArguments(List<EntityRefBuilder> value) { |
| this._typeArguments = value; |
| } |
| |
| @override |
| List<UnlinkedTypeParamBuilder> get typeParameters => |
| _typeParameters ??= <UnlinkedTypeParamBuilder>[]; |
| |
| /** |
| * If this is a function type, the type parameters defined for the function |
| * type (if any). |
| */ |
| void set typeParameters(List<UnlinkedTypeParamBuilder> value) { |
| this._typeParameters = value; |
| } |
| |
| EntityRefBuilder( |
| {idl.EntityRefKind entityKind, |
| List<int> implicitFunctionTypeIndices, |
| int paramReference, |
| int reference, |
| int refinedSlot, |
| int slot, |
| List<UnlinkedParamBuilder> syntheticParams, |
| EntityRefBuilder syntheticReturnType, |
| List<EntityRefBuilder> typeArguments, |
| List<UnlinkedTypeParamBuilder> typeParameters}) |
| : _entityKind = entityKind, |
| _implicitFunctionTypeIndices = implicitFunctionTypeIndices, |
| _paramReference = paramReference, |
| _reference = reference, |
| _refinedSlot = refinedSlot, |
| _slot = slot, |
| _syntheticParams = syntheticParams, |
| _syntheticReturnType = syntheticReturnType, |
| _typeArguments = typeArguments, |
| _typeParameters = typeParameters; |
| |
| /** |
| * Flush [informative] data recursively. |
| */ |
| void flushInformative() { |
| _syntheticParams?.forEach((b) => b.flushInformative()); |
| _syntheticReturnType?.flushInformative(); |
| _typeArguments?.forEach((b) => b.flushInformative()); |
| _typeParameters?.forEach((b) => b.flushInformative()); |
| } |
| |
| /** |
| * Accumulate non-[informative] data into [signature]. |
| */ |
| void collectApiSignature(api_sig.ApiSignature signature) { |
| signature.addInt(this._reference ?? 0); |
| if (this._typeArguments == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._typeArguments.length); |
| for (var x in this._typeArguments) { |
| x?.collectApiSignature(signature); |
| } |
| } |
| signature.addInt(this._slot ?? 0); |
| signature.addInt(this._paramReference ?? 0); |
| if (this._implicitFunctionTypeIndices == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._implicitFunctionTypeIndices.length); |
| for (var x in this._implicitFunctionTypeIndices) { |
| signature.addInt(x); |
| } |
| } |
| signature.addBool(this._syntheticReturnType != null); |
| this._syntheticReturnType?.collectApiSignature(signature); |
| if (this._syntheticParams == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._syntheticParams.length); |
| for (var x in this._syntheticParams) { |
| x?.collectApiSignature(signature); |
| } |
| } |
| if (this._typeParameters == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._typeParameters.length); |
| for (var x in this._typeParameters) { |
| x?.collectApiSignature(signature); |
| } |
| } |
| signature.addInt(this._entityKind == null ? 0 : this._entityKind.index); |
| signature.addInt(this._refinedSlot ?? 0); |
| } |
| |
| fb.Offset finish(fb.Builder fbBuilder) { |
| fb.Offset offset_implicitFunctionTypeIndices; |
| fb.Offset offset_syntheticParams; |
| fb.Offset offset_syntheticReturnType; |
| fb.Offset offset_typeArguments; |
| fb.Offset offset_typeParameters; |
| if (!(_implicitFunctionTypeIndices == null || |
| _implicitFunctionTypeIndices.isEmpty)) { |
| offset_implicitFunctionTypeIndices = |
| fbBuilder.writeListUint32(_implicitFunctionTypeIndices); |
| } |
| if (!(_syntheticParams == null || _syntheticParams.isEmpty)) { |
| offset_syntheticParams = fbBuilder |
| .writeList(_syntheticParams.map((b) => b.finish(fbBuilder)).toList()); |
| } |
| if (_syntheticReturnType != null) { |
| offset_syntheticReturnType = _syntheticReturnType.finish(fbBuilder); |
| } |
| if (!(_typeArguments == null || _typeArguments.isEmpty)) { |
| offset_typeArguments = fbBuilder |
| .writeList(_typeArguments.map((b) => b.finish(fbBuilder)).toList()); |
| } |
| if (!(_typeParameters == null || _typeParameters.isEmpty)) { |
| offset_typeParameters = fbBuilder |
| .writeList(_typeParameters.map((b) => b.finish(fbBuilder)).toList()); |
| } |
| fbBuilder.startTable(); |
| if (_entityKind != null && _entityKind != idl.EntityRefKind.named) { |
| fbBuilder.addUint8(8, _entityKind.index); |
| } |
| if (offset_implicitFunctionTypeIndices != null) { |
| fbBuilder.addOffset(4, offset_implicitFunctionTypeIndices); |
| } |
| if (_paramReference != null && _paramReference != 0) { |
| fbBuilder.addUint32(3, _paramReference); |
| } |
| if (_reference != null && _reference != 0) { |
| fbBuilder.addUint32(0, _reference); |
| } |
| if (_refinedSlot != null && _refinedSlot != 0) { |
| fbBuilder.addUint32(9, _refinedSlot); |
| } |
| if (_slot != null && _slot != 0) { |
| fbBuilder.addUint32(2, _slot); |
| } |
| if (offset_syntheticParams != null) { |
| fbBuilder.addOffset(6, offset_syntheticParams); |
| } |
| if (offset_syntheticReturnType != null) { |
| fbBuilder.addOffset(5, offset_syntheticReturnType); |
| } |
| if (offset_typeArguments != null) { |
| fbBuilder.addOffset(1, offset_typeArguments); |
| } |
| if (offset_typeParameters != null) { |
| fbBuilder.addOffset(7, offset_typeParameters); |
| } |
| return fbBuilder.endTable(); |
| } |
| } |
| |
| class _EntityRefReader extends fb.TableReader<_EntityRefImpl> { |
| const _EntityRefReader(); |
| |
| @override |
| _EntityRefImpl createObject(fb.BufferContext bc, int offset) => |
| new _EntityRefImpl(bc, offset); |
| } |
| |
| class _EntityRefImpl extends Object |
| with _EntityRefMixin |
| implements idl.EntityRef { |
| final fb.BufferContext _bc; |
| final int _bcOffset; |
| |
| _EntityRefImpl(this._bc, this._bcOffset); |
| |
| idl.EntityRefKind _entityKind; |
| List<int> _implicitFunctionTypeIndices; |
| int _paramReference; |
| int _reference; |
| int _refinedSlot; |
| int _slot; |
| List<idl.UnlinkedParam> _syntheticParams; |
| idl.EntityRef _syntheticReturnType; |
| List<idl.EntityRef> _typeArguments; |
| List<idl.UnlinkedTypeParam> _typeParameters; |
| |
| @override |
| idl.EntityRefKind get entityKind { |
| _entityKind ??= const _EntityRefKindReader() |
| .vTableGet(_bc, _bcOffset, 8, idl.EntityRefKind.named); |
| return _entityKind; |
| } |
| |
| @override |
| List<int> get implicitFunctionTypeIndices { |
| _implicitFunctionTypeIndices ??= |
| const fb.Uint32ListReader().vTableGet(_bc, _bcOffset, 4, const <int>[]); |
| return _implicitFunctionTypeIndices; |
| } |
| |
| @override |
| int get paramReference { |
| _paramReference ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 3, 0); |
| return _paramReference; |
| } |
| |
| @override |
| int get reference { |
| _reference ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 0, 0); |
| return _reference; |
| } |
| |
| @override |
| int get refinedSlot { |
| _refinedSlot ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 9, 0); |
| return _refinedSlot; |
| } |
| |
| @override |
| int get slot { |
| _slot ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 2, 0); |
| return _slot; |
| } |
| |
| @override |
| List<idl.UnlinkedParam> get syntheticParams { |
| _syntheticParams ??= |
| const fb.ListReader<idl.UnlinkedParam>(const _UnlinkedParamReader()) |
| .vTableGet(_bc, _bcOffset, 6, const <idl.UnlinkedParam>[]); |
| return _syntheticParams; |
| } |
| |
| @override |
| idl.EntityRef get syntheticReturnType { |
| _syntheticReturnType ??= |
| const _EntityRefReader().vTableGet(_bc, _bcOffset, 5, null); |
| return _syntheticReturnType; |
| } |
| |
| @override |
| List<idl.EntityRef> get typeArguments { |
| _typeArguments ??= |
| const fb.ListReader<idl.EntityRef>(const _EntityRefReader()) |
| .vTableGet(_bc, _bcOffset, 1, const <idl.EntityRef>[]); |
| return _typeArguments; |
| } |
| |
| @override |
| List<idl.UnlinkedTypeParam> get typeParameters { |
| _typeParameters ??= const fb.ListReader<idl.UnlinkedTypeParam>( |
| const _UnlinkedTypeParamReader()) |
| .vTableGet(_bc, _bcOffset, 7, const <idl.UnlinkedTypeParam>[]); |
| return _typeParameters; |
| } |
| } |
| |
| abstract class _EntityRefMixin implements idl.EntityRef { |
| @override |
| Map<String, Object> toJson() { |
| Map<String, Object> _result = <String, Object>{}; |
| if (entityKind != idl.EntityRefKind.named) |
| _result["entityKind"] = entityKind.toString().split('.')[1]; |
| if (implicitFunctionTypeIndices.isNotEmpty) |
| _result["implicitFunctionTypeIndices"] = implicitFunctionTypeIndices; |
| if (paramReference != 0) _result["paramReference"] = paramReference; |
| if (reference != 0) _result["reference"] = reference; |
| if (refinedSlot != 0) _result["refinedSlot"] = refinedSlot; |
| if (slot != 0) _result["slot"] = slot; |
| if (syntheticParams.isNotEmpty) |
| _result["syntheticParams"] = |
| syntheticParams.map((_value) => _value.toJson()).toList(); |
| if (syntheticReturnType != null) |
| _result["syntheticReturnType"] = syntheticReturnType.toJson(); |
| if (typeArguments.isNotEmpty) |
| _result["typeArguments"] = |
| typeArguments.map((_value) => _value.toJson()).toList(); |
| if (typeParameters.isNotEmpty) |
| _result["typeParameters"] = |
| typeParameters.map((_value) => _value.toJson()).toList(); |
| return _result; |
| } |
| |
| @override |
| Map<String, Object> toMap() => { |
| "entityKind": entityKind, |
| "implicitFunctionTypeIndices": implicitFunctionTypeIndices, |
| "paramReference": paramReference, |
| "reference": reference, |
| "refinedSlot": refinedSlot, |
| "slot": slot, |
| "syntheticParams": syntheticParams, |
| "syntheticReturnType": syntheticReturnType, |
| "typeArguments": typeArguments, |
| "typeParameters": typeParameters, |
| }; |
| |
| @override |
| String toString() => convert.json.encode(toJson()); |
| } |
| |
| class LinkedDependencyBuilder extends Object |
| with _LinkedDependencyMixin |
| implements idl.LinkedDependency { |
| List<String> _parts; |
| String _uri; |
| |
| @override |
| List<String> get parts => _parts ??= <String>[]; |
| |
| /** |
| * Absolute URI for the compilation units listed in the library's `part` |
| * declarations, empty string for invalid URI. |
| */ |
| void set parts(List<String> value) { |
| this._parts = value; |
| } |
| |
| @override |
| String get uri => _uri ??= ''; |
| |
| /** |
| * The absolute URI of the dependent library, e.g. `package:foo/bar.dart`. |
| */ |
| void set uri(String value) { |
| this._uri = value; |
| } |
| |
| LinkedDependencyBuilder({List<String> parts, String uri}) |
| : _parts = parts, |
| _uri = uri; |
| |
| /** |
| * Flush [informative] data recursively. |
| */ |
| void flushInformative() {} |
| |
| /** |
| * Accumulate non-[informative] data into [signature]. |
| */ |
| void collectApiSignature(api_sig.ApiSignature signature) { |
| signature.addString(this._uri ?? ''); |
| if (this._parts == null) { |
| signature.addInt(0); |
| } else { |
| signature.addInt(this._parts.length); |
| for (var x in this._parts) { |
| signature.addString(x); |
| } |
| } |
| } |
| |
| fb.Offset finish(fb.Builder fbBuilder) { |
| fb.Offset offset_parts; |
| fb.Offset offset_uri; |
| if (!(_parts == null || _parts.isEmpty)) { |
| offset_parts = fbBuilder |
| .writeList(_parts.map((b) => fbBuilder.writeString(b)).toList()); |
| } |
| if (_uri != null) { |
| offset_uri = fbBuilder.writeString(_uri); |
| } |
| fbBuilder.startTable(); |
| if (offset_parts != null) { |
| fbBuilder.addOffset(1, offset_parts); |
| } |
| if (offset_uri != null) { |
| fbBuilder.addOffset(0, offset_uri); |
| } |
| return fbBuilder.endTable(); |
| } |
| } |
| |
| class _LinkedDependencyReader extends fb.TableReader<_LinkedDependencyImpl> { |
| const _LinkedDependencyReader(); |
| |
| @override |
| _LinkedDependencyImpl createObject(fb.BufferContext bc, int offset) => |
| new _LinkedDependencyImpl(bc, offset); |
| } |
| |
| class _LinkedDependencyImpl extends Object |
| with _LinkedDependencyMixin |
| implements idl.LinkedDependency { |
| final fb.BufferContext _bc; |
| final int _bcOffset; |
| |
| _LinkedDependencyImpl(this._bc, this._bcOffset); |
| |
| List<String> _parts; |
| String _uri; |
| |
| @override |
| List<String> get parts { |
| _parts ??= const fb.ListReader<String>(const fb.StringReader()) |
| .vTableGet(_bc, _bcOffset, 1, const <String>[]); |
| return _parts; |
| } |
| |
| @override |
| String get uri { |
| _uri ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 0, ''); |
| return _uri; |
| } |
| } |
| |
| abstract class _LinkedDependencyMixin implements idl.LinkedDependency { |
| @override |
| Map<String, Object> toJson() { |
| Map<String, Object> _result = <String, Object>{}; |
| if (parts.isNotEmpty) _result["parts"] = parts; |
| if (uri != '') _result["uri"] = uri; |
| return _result; |
| } |
| |
| @override |
| Map<String, Object> toMap() => { |
| "parts": parts, |
| "uri": uri, |
| }; |
| |
| @override |
| String toString() => convert.json.encode(toJson()); |
| } |
| |
| class LinkedExportNameBuilder extends Object |
| with _LinkedExportNameMixin |
| implements idl.LinkedExportName { |
| int _dependency; |
| idl.ReferenceKind _kind; |
| String _name; |
| int _unit; |
| |
| @override |
| int get dependency => _dependency ??= 0; |
| |
| /** |
| * Index into [LinkedLibrary.dependencies] for the library in which the |
| * entity is defined. |
| */ |
| void set dependency(int value) { |
| assert(value == null || value >= 0); |
| this._dependency = value; |
| } |
| |
| @override |
| idl.ReferenceKind get kind => _kind ??= idl.ReferenceKind.classOrEnum; |
| |
| /** |
| * The kind of the entity being referred to. |
| */ |
| void set kind(idl.ReferenceKind value) { |
| this._kind = value; |
| } |
| |
| @override |
| String get name => _name ??= ''; |
| |
| /** |
| * Name of the exported entity. For an exported setter, this name includes |
| * the trailing '='. |
| */ |
| void set name(String value) { |
| this._name = value; |
| } |
| |
| @override |
| int get unit => _unit ??= 0; |
| |
| /** |
| * Integer index indicating which unit in the exported library contains the |
| * definition of the entity. As with indices into [LinkedLibrary.units], |
| * zero represents the defining compilation unit, and nonzero values |
| * represent parts in the order of the corresponding `part` declarations. |
| */ |
| void set unit(int value) { |
| assert(value == null || value >= 0); |
| this._unit = value; |
| } |
| |
| LinkedExportNameBuilder( |
| {int dependency, idl.ReferenceKind kind, String name, int unit}) |
| : _dependency = dependency, |
| _kind = kind, |
| _name = name, |
| _unit = unit; |
| |
| /** |
| * Flush [informative] data recursively. |
| */ |
| void flushInformative() {} |
| |
| /** |
| * Accumulate non-[informative] data into [signature]. |
| */ |
| void collectApiSignature(api_sig.ApiSignature signature) { |
| signature.addInt(this._dependency ?? 0); |
| signature.addString(this._name ?? ''); |
| signature.addInt(this._unit ?? 0); |
| signature.addInt(this._kind == null ? 0 : this._kind.index); |
| } |
| |
| fb.Offset finish(fb.Builder fbBuilder) { |
| fb.Offset offset_name; |
| if (_name != null) { |
| offset_name = fbBuilder.writeString(_name); |
| } |
|