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

Unified Diff: pkg/analyzer/lib/src/summary/format.fbs

Issue 1743713002: Generate a ".fbs" file representing the summary format. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/tool/summary/check_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/format.fbs
diff --git a/pkg/analyzer/lib/src/summary/idl.dart b/pkg/analyzer/lib/src/summary/format.fbs
similarity index 76%
copy from pkg/analyzer/lib/src/summary/idl.dart
copy to pkg/analyzer/lib/src/summary/format.fbs
index 453fef1242f7d84f88ad89df5a023c8a02fbb51c..383b67783400aa1ff52675f4cc7d2e6e62a929b5 100644
--- a/pkg/analyzer/lib/src/summary/idl.dart
+++ b/pkg/analyzer/lib/src/summary/format.fbs
@@ -1,157 +1,15 @@
// 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".
-/**
- * This file is an "idl" style description of the summary format. It
- * contains abstract classes which declare the interface for reading data from
- * summaries. It is parsed and transformed into code that implements the
- * summary format.
- *
- * The code generation process introduces the following semantics:
- * - Getters of type List never return null, and have a default value of the
- * empty list.
- * - Getters of type int return unsigned 32-bit integers, never null, and have
- * a default value of zero.
- * - Getters of type String never return null, and have a default value of ''.
- * - Getters of type bool never return null, and have a default value of false.
- * - Getters whose type is an enum never return null, and have a default value
- * of the first value declared in the enum.
- *
- * Terminology used in this document:
- * - "Unlinked" refers to information that can be determined from reading a
- * single .dart file in isolation.
- * - "Prelinked" refers to information that can be determined from the defining
- * compilation unit of a library, plus direct imports, plus the transitive
- * closure of exports reachable from those libraries, plus all part files
- * constituting those libraries.
- * - "Linked" refers to all other information; in theory, this information may
- * depend on all files in the transitive import/export closure. However, in
- * practice we expect that the number of additional dependencies will usually
- * be small, since the additional dependencies only need to be consulted for
- * type propagation, type inference, and constant evaluation, which typically
- * have short dependency chains.
- *
- * Since we expect "linked" and "prelinked" dependencies to be similar, we only
- * rarely distinguish between them; most information is that is not "unlinked"
- * is typically considered "linked" for simplicity.
- *
- * Except as otherwise noted, synthetic elements are not stored in the summary;
- * they are re-synthesized at the time the summary is read.
- */
-library analyzer.tool.summary.idl;
-
-import 'base.dart' as base;
-import 'base.dart' show Id, TopLevel;
-import 'format.dart' as generated;
-
-/**
- * Annotation describing information which is not part of Dart semantics; in
- * other words, if this information (or any information it refers to) changes,
- * static analysis and runtime behavior of the library are unaffected.
- */
-const informative = null;
-
-/**
- * Summary information about a reference to a an entity such as a type, top
- * level executable, or executable within a class.
- */
-abstract class EntityRef extends base.SummaryClass {
- /**
- * 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.
- */
- @Id(4)
- List<int> get implicitFunctionTypeIndices;
-
- /**
- * 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.
- */
- @Id(3)
- int get paramReference;
-
- /**
- * Index into [UnlinkedUnit.references] for the entity being referred to, or
- * zero if this is a reference to a type parameter.
- */
- @Id(0)
- int get reference;
-
- /**
- * 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.
- */
- @Id(2)
- int get slot;
-
- /**
- * 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.
- */
- @Id(6)
- List<UnlinkedParam> get syntheticParams;
-
- /**
- * 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`.
- */
- @Id(5)
- EntityRef get syntheticReturnType;
-
- /**
- * If this is an instantiation of a generic type or generic executable, the
- * type arguments used to instantiate it. Trailing type arguments of type
- * `dynamic` are omitted.
- */
- @Id(1)
- List<EntityRef> get typeArguments;
-}
/**
* Enum used to indicate the kind of index relation.
*/
-enum IndexRelationKind {
+enum IndexRelationKind : byte {
/**
* Left: class.
* Is extended by.
@@ -189,921 +47,996 @@ enum IndexRelationKind {
}
/**
- * Information about a dependency that exists between one library and another
- * due to an "import" declaration.
+ * Enum used to indicate the kind of entity referred to by a
+ * [LinkedReference].
*/
-abstract class LinkedDependency extends base.SummaryClass {
+enum ReferenceKind : byte {
/**
- * URI for the compilation units listed in the library's `part` declarations.
- * These URIs are relative to the importing library.
+ * The entity is a class or enum.
*/
- @Id(1)
- List<String> get parts;
+ classOrEnum,
/**
- * The relative URI of the dependent library. This URI is relative to the
- * importing library, even if there are intervening `export` declarations.
- * So, for example, if `a.dart` imports `b/c.dart` and `b/c.dart` exports
- * `d/e.dart`, the URI listed for `a.dart`'s dependency on `e.dart` will be
- * `b/d/e.dart`.
+ * The entity is a constructor.
*/
- @Id(0)
- String get uri;
-}
+ constructor,
-/**
- * Information about a single name in the export namespace of the library that
- * is not in the public namespace.
- */
-abstract class LinkedExportName extends base.SummaryClass {
/**
- * Index into [LinkedLibrary.dependencies] for the library in which the
- * entity is defined.
+ * The entity is a getter or setter inside a class. Note: this is used in
+ * the case where a constant refers to a static const declared inside a
+ * class.
*/
- @Id(0)
- int get dependency;
+ propertyAccessor,
/**
- * The kind of the entity being referred to.
+ * The entity is a method.
*/
- @Id(3)
- ReferenceKind get kind;
+ method,
/**
- * Name of the exported entity. For an exported setter, this name includes
- * the trailing '='.
+ * The `length` property access.
*/
- @Id(1)
- String get name;
+ length,
/**
- * 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.
+ * The entity is a typedef.
*/
- @Id(2)
- int get unit;
-}
+ typedef,
-/**
- * Linked summary of a library.
- */
-@TopLevel('LLib')
-abstract class LinkedLibrary extends base.SummaryClass {
- factory LinkedLibrary.fromBuffer(List<int> buffer) =>
- generated.readLinkedLibrary(buffer);
+ /**
+ * The entity is a local function.
+ */
+ function,
/**
- * The libraries that this library depends on (either via an explicit import
- * statement or via the implicit dependencies on `dart:core` and
- * `dart:async`). The first element of this array is a pseudo-dependency
- * representing the library itself (it is also used for `dynamic` and
- * `void`). This is followed by elements representing "prelinked"
- * dependencies (direct imports and the transitive closure of exports).
- * After the prelinked dependencies are elements representing "linked"
- * dependencies.
- *
- * A library is only included as a "linked" dependency if it is a true
- * dependency (e.g. a propagated or inferred type or constant value
- * implicitly refers to an element declared in the library) or
- * anti-dependency (e.g. the result of type propagation or type inference
- * depends on the lack of a certain declaration in the library).
+ * The entity is a local variable.
*/
- @Id(0)
- List<LinkedDependency> get dependencies;
+ variable,
/**
- * Information about entities in the export namespace of the library that are
- * not in the public namespace of the library (that is, entities that are
- * brought into the namespace via `export` directives).
- *
- * Sorted by name.
+ * The entity is a top level function.
*/
- @Id(4)
- List<LinkedExportName> get exportNames;
+ topLevelFunction,
/**
- * For each import in [UnlinkedUnit.imports], an index into [dependencies]
- * of the library being imported.
+ * The entity is a top level getter or setter.
*/
- @Id(1)
- List<int> get importDependencies;
+ topLevelPropertyAccessor,
/**
- * The number of elements in [dependencies] which are not "linked"
- * dependencies (that is, the number of libraries in the direct imports plus
- * the transitive closure of exports, plus the library itself).
+ * The entity is a prefix.
*/
- @Id(2)
- int get numPrelinkedDependencies;
+ prefix,
/**
- * The linked summary of all the compilation units constituting the
- * library. The summary of the defining compilation unit is listed first,
- * followed by the summary of each part, in the order of the `part`
- * declarations in the defining compilation unit.
+ * The entity being referred to does not exist.
*/
- @Id(3)
- List<LinkedUnit> get units;
+ unresolved
}
/**
- * Information about the resolution of an [UnlinkedReference].
+ * Enum representing the various kinds of operations which may be performed to
+ * produce a constant value. These options are assumed to execute in the
+ * context of a stack which is initially empty.
*/
-abstract class LinkedReference extends base.SummaryClass {
+enum UnlinkedConstOperation : byte {
/**
- * If this [LinkedReference] doesn't have an associated [UnlinkedReference],
- * and the entity being referred to is contained within another entity, index
- * of the containing entity. This behaves similarly to
- * [UnlinkedReference.prefixReference], however it is only used for class
- * members, not for prefixed imports.
+ * Push the next value from [UnlinkedConst.ints] (a 32-bit unsigned integer)
+ * onto the stack.
*
- * Containing references must always point backward; that is, for all i, if
- * LinkedUnit.references[i].containingReference != 0, then
- * LinkedUnit.references[i].containingReference < i.
+ * Note that Dart supports integers larger than 32 bits; these are
+ * represented by composing 32-bit values using the [pushLongInt] operation.
*/
- @Id(5)
- int get containingReference;
+ pushInt,
/**
- * Index into [LinkedLibrary.dependencies] indicating which imported library
- * declares the entity being referred to.
- *
- * Zero if this entity is contained within another entity (e.g. a class
- * member), or if [kind] is [ReferenceKind.prefix].
+ * Get the number of components from [UnlinkedConst.ints], then do this number
+ * of times the following operations: multiple the current value by 2^32, "or"
+ * it with the next value in [UnlinkedConst.ints]. The initial value is zero.
+ * Push the result into the stack.
*/
- @Id(1)
- int get dependency;
+ pushLongInt,
/**
- * The kind of the entity being referred to. For the pseudo-types `dynamic`
- * and `void`, the kind is [ReferenceKind.classOrEnum].
+ * Push the next value from [UnlinkedConst.doubles] (a double precision
+ * floating point value) onto the stack.
*/
- @Id(2)
- ReferenceKind get kind;
+ pushDouble,
/**
- * If [kind] is [ReferenceKind.function] (that is, the entity being referred
- * to is a local function), the index of the function within
- * [UnlinkedExecutable.localFunctions]. If [kind] is
- * [ReferenceKind.variable], the index of the variable within
- * [UnlinkedExecutable.localVariables]. Otherwise zero.
+ * Push the constant `true` onto the stack.
*/
- @Id(6)
- int get localIndex;
+ pushTrue,
/**
- * If this [LinkedReference] doesn't have an associated [UnlinkedReference],
- * name of the entity being referred to. For the pseudo-type `dynamic`, the
- * string is "dynamic". For the pseudo-type `void`, the string is "void".
+ * Push the constant `false` onto the stack.
*/
- @Id(3)
- String get name;
+ pushFalse,
/**
- * If the entity being referred to is generic, the number of type parameters
- * it declares (does not include type parameters of enclosing entities).
- * Otherwise zero.
+ * Push the next value from [UnlinkedConst.strings] onto the stack.
*/
- @Id(4)
- int get numTypeParameters;
+ pushString,
/**
- * Integer index indicating which unit in the imported 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.
+ * Pop the top n values from the stack (where n is obtained from
+ * [UnlinkedConst.ints]), convert them to strings (if they aren't already),
+ * concatenate them into a single string, and push it back onto the stack.
*
- * Zero if this entity is contained within another entity (e.g. a class
- * member).
+ * This operation is used to represent constants whose value is a literal
+ * string containing string interpolations.
*/
- @Id(0)
- int get unit;
-}
+ concatenate,
-/**
- * Linked summary of a compilation unit.
- */
-abstract class LinkedUnit extends base.SummaryClass {
/**
- * Information about the resolution of references within the compilation
- * unit. Each element of [UnlinkedUnit.references] has a corresponding
- * element in this list (at the same index). If this list has additional
- * elements beyond the number of elements in [UnlinkedUnit.references], those
- * additional elements are references that are only referred to implicitly
- * (e.g. elements involved in inferred or propagated types).
+ * Get the next value from [UnlinkedConst.strings], convert it to a symbol,
+ * and push it onto the stack.
*/
- @Id(0)
- List<LinkedReference> get references;
+ makeSymbol,
/**
- * List associating slot ids found inside the unlinked summary for the
- * compilation unit with propagated and inferred types.
+ * Push the constant `null` onto the stack.
*/
- @Id(1)
- List<EntityRef> get types;
-}
-
-/**
- * Summary information about a package.
- */
-@TopLevel('PBdl')
-abstract class PackageBundle extends base.SummaryClass {
- factory PackageBundle.fromBuffer(List<int> buffer) =>
- generated.readPackageBundle(buffer);
+ pushNull,
/**
- * Linked libraries.
+ * Push the value of the constant constructor parameter with
+ * the name obtained from [UnlinkedConst.strings].
*/
- @Id(0)
- List<LinkedLibrary> get linkedLibraries;
+ pushConstructorParameter,
/**
- * The list of URIs of items in [linkedLibraries], e.g. `dart:core` or
- * `package:foo/bar.dart`.
+ * Evaluate a (potentially qualified) identifier expression and push the
+ * resulting value onto the stack. The identifier to be evaluated is
+ * obtained from [UnlinkedConst.references].
+ *
+ * This operation is used to represent the following kinds of constants
+ * (which are indistinguishable from an unresolved AST alone):
+ *
+ * - A qualified reference to a static constant variable (e.g. `C.v`, where
+ * C is a class and `v` is a constant static variable in `C`).
+ * - An identifier expression referring to a constant variable.
+ * - A simple or qualified identifier denoting a class or type alias.
+ * - A simple or qualified identifier denoting a top-level function or a
+ * static method.
*/
- @Id(1)
- List<String> get linkedLibraryUris;
+ pushReference,
/**
- * List of MD5 hashes of the files listed in [unlinkedUnitUris]. Each hash
- * is encoded as a hexadecimal string using lower case letters.
+ * Pop the top `n` values from the stack (where `n` is obtained from
+ * [UnlinkedConst.ints]) into a list (filled from the end) and take the next
+ * `n` values from [UnlinkedConst.strings] and use the lists of names and
+ * values to create named arguments. Then pop the top `m` values from the
+ * stack (where `m` is obtained from [UnlinkedConst.ints]) into a list (filled
+ * from the end) and use them as positional arguments. Use the lists of
+ * positional and names arguments to invoke a constant constructor obtained
+ * from [UnlinkedConst.references], and push the resulting value back onto the
+ * stack.
+ *
+ * Note that for an invocation of the form `const a.b(...)` (where no type
+ * arguments are specified), it is impossible to tell from the unresolved AST
+ * alone whether `a` is a class name and `b` is a constructor name, or `a` is
+ * a prefix name and `b` is a class name. For consistency between AST based
+ * and elements based summaries, references to default constructors are always
+ * recorded as references to corresponding classes.
*/
- @Id(4)
- List<String> get unlinkedUnitHashes;
+ invokeConstructor,
/**
- * Unlinked information for the compilation units constituting the package.
+ * Pop the top n values from the stack (where n is obtained from
+ * [UnlinkedConst.ints]), place them in a [List], and push the result back
+ * onto the stack. The type parameter for the [List] is implicitly `dynamic`.
*/
- @Id(2)
- List<UnlinkedUnit> get unlinkedUnits;
+ makeUntypedList,
/**
- * The list of URIs of items in [unlinkedUnits], e.g. `dart:core/bool.dart`.
+ * Pop the top 2*n values from the stack (where n is obtained from
+ * [UnlinkedConst.ints]), interpret them as key/value pairs, place them in a
+ * [Map], and push the result back onto the stack. The two type parameters
+ * for the [Map] are implicitly `dynamic`.
*/
- @Id(3)
- List<String> get unlinkedUnitUris;
-}
-
-/**
- * Index information about a package.
- */
-@TopLevel('Indx')
-abstract class PackageIndex extends base.SummaryClass {
- factory PackageIndex.fromBuffer(List<int> buffer) =>
- generated.readPackageIndex(buffer);
+ makeUntypedMap,
/**
- * Each item of this list corresponds to a unique library URI with an element
- * referenced in the [PackageIndex]. It is an index into [uris] list.
+ * Pop the top n values from the stack (where n is obtained from
+ * [UnlinkedConst.ints]), place them in a [List], and push the result back
+ * onto the stack. The type parameter for the [List] is obtained from
+ * [UnlinkedConst.references].
*/
- @Id(2)
- List<int> get elementLibraryUris;
+ makeTypedList,
/**
- * Each item of this list corresponds to a unique referenced element. It is
- * the offset of the element name relative to the beginning of the file. The
- * list is sorted in ascending order, so that the client can quickly check
- * whether an element is referenced in this [PackageIndex].
+ * Pop the top 2*n values from the stack (where n is obtained from
+ * [UnlinkedConst.ints]), interpret them as key/value pairs, place them in a
+ * [Map], and push the result back onto the stack. The two type parameters for
+ * the [Map] are obtained from [UnlinkedConst.references].
*/
- @Id(1)
- List<int> get elementOffsets;
+ makeTypedMap,
/**
- * Each item of this list corresponds to a unique referenced element. It is
- * the index into [elementLibraryUris] and [elementUnitUris] for the library
- * specific unit where the element is declared.
+ * Pop the top 2 values from the stack, pass them to the predefined Dart
+ * function `identical`, and push the result back onto the stack.
*/
- @Id(0)
- List<int> get elementUnits;
+ identical,
/**
- * Each item of this list corresponds to a unique unit URI with an element
- * referenced in the [PackageIndex]. It is an index into [uris] list.
+ * Pop the top 2 values from the stack, evaluate `v1 == v2`, and push the
+ * result back onto the stack.
*/
- @Id(3)
- List<int> get elementUnitUris;
+ equal,
/**
- * List of units indexed in this [PackageIndex].
+ * Pop the top 2 values from the stack, evaluate `v1 != v2`, and push the
+ * result back onto the stack.
*/
- @Id(5)
- List<UnitIndex> get units;
+ notEqual,
/**
- * List of unique URIs used in this [PackageIndex].
+ * Pop the top value from the stack, compute its boolean negation, and push
+ * the result back onto the stack.
*/
- @Id(4)
- List<String> get uris;
-}
+ not,
-/**
- * Enum used to indicate the kind of entity referred to by a
- * [LinkedReference].
- */
-enum ReferenceKind {
/**
- * The entity is a class or enum.
+ * Pop the top 2 values from the stack, compute `v1 && v2`, and push the
+ * result back onto the stack.
*/
- classOrEnum,
+ and,
/**
- * The entity is a constructor.
+ * Pop the top 2 values from the stack, compute `v1 || v2`, and push the
+ * result back onto the stack.
*/
- constructor,
+ or,
/**
- * The entity is a getter or setter inside a class. Note: this is used in
- * the case where a constant refers to a static const declared inside a
- * class.
+ * Pop the top value from the stack, compute its integer complement, and push
+ * the result back onto the stack.
*/
- propertyAccessor,
+ complement,
/**
- * The entity is a method.
+ * Pop the top 2 values from the stack, compute `v1 ^ v2`, and push the
+ * result back onto the stack.
*/
- method,
+ bitXor,
/**
- * The `length` property access.
+ * Pop the top 2 values from the stack, compute `v1 & v2`, and push the
+ * result back onto the stack.
*/
- length,
+ bitAnd,
/**
- * The entity is a typedef.
+ * Pop the top 2 values from the stack, compute `v1 | v2`, and push the
+ * result back onto the stack.
*/
- typedef,
+ bitOr,
/**
- * The entity is a local function.
+ * Pop the top 2 values from the stack, compute `v1 >> v2`, and push the
+ * result back onto the stack.
*/
- function,
+ bitShiftRight,
/**
- * The entity is a local variable.
+ * Pop the top 2 values from the stack, compute `v1 << v2`, and push the
+ * result back onto the stack.
*/
- variable,
+ bitShiftLeft,
/**
- * The entity is a top level function.
+ * Pop the top 2 values from the stack, compute `v1 + v2`, and push the
+ * result back onto the stack.
*/
- topLevelFunction,
+ add,
/**
- * The entity is a top level getter or setter.
+ * Pop the top value from the stack, compute its integer negation, and push
+ * the result back onto the stack.
*/
- topLevelPropertyAccessor,
+ negate,
/**
- * The entity is a prefix.
+ * Pop the top 2 values from the stack, compute `v1 - v2`, and push the
+ * result back onto the stack.
*/
- prefix,
+ subtract,
/**
- * The entity being referred to does not exist.
+ * Pop the top 2 values from the stack, compute `v1 * v2`, and push the
+ * result back onto the stack.
*/
- unresolved
-}
+ multiply,
-/**
- * Index information about a unit in a [PackageIndex].
- */
-abstract class UnitIndex extends base.SummaryClass {
/**
- * Each item of this list is the index into [PackageIndex.elementUnits] and
- * [PackageIndex.elementOffsets]. The list is sorted in ascending order, so
- * that the client can quickly find element references in this [UnitIndex].
+ * Pop the top 2 values from the stack, compute `v1 / v2`, and push the
+ * result back onto the stack.
*/
- @Id(4)
- List<int> get elements;
+ divide,
/**
- * Each item of this list is the kind of the element usage.
+ * Pop the top 2 values from the stack, compute `v1 ~/ v2`, and push the
+ * result back onto the stack.
*/
- @Id(5)
- List<IndexRelationKind> get kinds;
+ floorDivide,
/**
- * The library source URI of this unit, e.g. `dart:core` or
- * `package:foo/bar.dart`, as index into [PackageIndex.uris].
+ * Pop the top 2 values from the stack, compute `v1 > v2`, and push the
+ * result back onto the stack.
*/
- @Id(0)
- int get libraryUri;
+ greater,
/**
- * Each item of this list is the length of the element usage.
+ * Pop the top 2 values from the stack, compute `v1 < v2`, and push the
+ * result back onto the stack.
*/
- @Id(2)
- List<int> get locationLengths;
+ less,
/**
- * Each item of this list is the offset of the element usage relative to the
- * beginning of the file.
+ * Pop the top 2 values from the stack, compute `v1 >= v2`, and push the
+ * result back onto the stack.
*/
- @Id(3)
- List<int> get locationOffsets;
+ greaterEqual,
/**
- * The unit source URI of this unit, e.g. `dart:core/int.dart` or
- * `package:foo/bar/baz.dart`, as index into [PackageIndex.uris].
+ * Pop the top 2 values from the stack, compute `v1 <= v2`, and push the
+ * result back onto the stack.
*/
- @Id(1)
- int get unitUri;
-}
+ lessEqual,
-/**
- * Unlinked summary information about a class declaration.
- */
-abstract class UnlinkedClass extends base.SummaryClass {
/**
- * Annotations for this class.
+ * Pop the top 2 values from the stack, compute `v1 % v2`, and push the
+ * result back onto the stack.
*/
- @Id(5)
- List<UnlinkedConst> get annotations;
+ modulo,
/**
- * Documentation comment for the class, or `null` if there is no
- * documentation comment.
+ * Pop the top 3 values from the stack, compute `v1 ? v2 : v3`, and push the
+ * result back onto the stack.
*/
- @informative
- @Id(6)
- UnlinkedDocumentationComment get documentationComment;
+ conditional,
/**
- * Executable objects (methods, getters, and setters) contained in the class.
+ * Pop the top value from the stack, evaluate `v.length`, and push the result
+ * back onto the stack.
*/
- @Id(2)
- List<UnlinkedExecutable> get executables;
+ length
+}
+/**
+ * Enum used to indicate the kind of an constructor initializer.
+ */
+enum UnlinkedConstructorInitializerKind : byte {
/**
- * Field declarations contained in the class.
+ * Initialization of a field.
*/
- @Id(4)
- List<UnlinkedVariable> get fields;
+ field,
/**
- * Indicates whether this class is the core "Object" class (and hence has no
- * supertype)
+ * Invocation of a constructor in the same class.
*/
- @Id(12)
- bool get hasNoSupertype;
+ thisInvocation,
/**
- * Interfaces appearing in an `implements` clause, if any.
+ * Invocation of a superclass' constructor.
*/
- @Id(7)
- List<EntityRef> get interfaces;
+ superInvocation
+}
+/**
+ * Enum used to indicate the kind of an executable.
+ */
+enum UnlinkedExecutableKind : byte {
/**
- * Indicates whether the class is declared with the `abstract` keyword.
+ * Executable is a function or method.
*/
- @Id(8)
- bool get isAbstract;
+ functionOrMethod,
/**
- * Indicates whether the class is declared using mixin application syntax.
+ * Executable is a getter.
*/
- @Id(11)
- bool get isMixinApplication;
+ getter,
/**
- * Mixins appearing in a `with` clause, if any.
+ * Executable is a setter.
*/
- @Id(10)
- List<EntityRef> get mixins;
+ setter,
/**
- * Name of the class.
+ * Executable is a constructor.
*/
- @Id(0)
- String get name;
+ constructor
+}
+/**
+ * Enum used to indicate the kind of a parameter.
+ */
+enum UnlinkedParamKind : byte {
/**
- * Offset of the class name relative to the beginning of the file.
+ * Parameter is required.
*/
- @informative
- @Id(1)
- int get nameOffset;
+ required,
/**
- * Supertype of the class, or `null` if either (a) the class doesn't
- * explicitly declare a supertype (and hence has supertype `Object`), or (b)
- * the class *is* `Object` (and hence has no supertype).
+ * Parameter is positional optional (enclosed in `[]`)
*/
- @Id(3)
- EntityRef get supertype;
+ positional,
/**
- * Type parameters of the class, if any.
+ * Parameter is named optional (enclosed in `{}`)
*/
- @Id(9)
- List<UnlinkedTypeParam> get typeParameters;
+ named
}
/**
- * Unlinked summary information about a `show` or `hide` combinator in an
- * import or export declaration.
+ * Summary information about a reference to a an entity such as a type, top
+ * level executable, or executable within a class.
*/
-abstract class UnlinkedCombinator extends base.SummaryClass {
+table EntityRef {
/**
- * If this is a `show` combinator, offset of the end of the list of shown
- * names. Otherwise zero.
+ * 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.
*/
- @informative
- @Id(3)
- int get end;
+ implicitFunctionTypeIndices:[uint] (id: 4);
/**
- * List of names which are hidden. Empty if this is a `show` combinator.
+ * 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.
*/
- @Id(1)
- List<String> get hides;
+ paramReference:uint (id: 3);
/**
- * If this is a `show` combinator, offset of the `show` keyword. Otherwise
- * zero.
+ * Index into [UnlinkedUnit.references] for the entity being referred to, or
+ * zero if this is a reference to a type parameter.
*/
- @informative
- @Id(2)
- int get offset;
+ reference:uint (id: 0);
/**
- * List of names which are shown. Empty if this is a `hide` combinator.
+ * 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.
+ */
+ slot:uint (id: 2);
+
+ /**
+ * 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.
+ */
+ syntheticParams:[UnlinkedParam] (id: 6);
+
+ /**
+ * 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`.
*/
- @Id(0)
- List<String> get shows;
+ syntheticReturnType:EntityRef (id: 5);
+
+ /**
+ * If this is an instantiation of a generic type or generic executable, the
+ * type arguments used to instantiate it. Trailing type arguments of type
+ * `dynamic` are omitted.
+ */
+ typeArguments:[EntityRef] (id: 1);
}
/**
- * Unlinked summary information about a compile-time constant expression, or a
- * potentially constant expression.
- *
- * Constant expressions are represented using a simple stack-based language
- * where [operations] is a sequence of operations to execute starting with an
- * empty stack. Once all operations have been executed, the stack should
- * contain a single value which is the value of the constant. Note that some
- * operations consume additional data from the other fields of this class.
+ * Information about a dependency that exists between one library and another
+ * due to an "import" declaration.
*/
-abstract class UnlinkedConst extends base.SummaryClass {
+table LinkedDependency {
/**
- * Sequence of 64-bit doubles consumed by the operation `pushDouble`.
+ * URI for the compilation units listed in the library's `part` declarations.
+ * These URIs are relative to the importing library.
*/
- @Id(4)
- List<double> get doubles;
+ parts:[string] (id: 1);
/**
- * Sequence of unsigned 32-bit integers consumed by the operations
- * `pushArgument`, `pushInt`, `shiftOr`, `concatenate`, `invokeConstructor`,
- * `makeList`, and `makeMap`.
+ * The relative URI of the dependent library. This URI is relative to the
+ * importing library, even if there are intervening `export` declarations.
+ * So, for example, if `a.dart` imports `b/c.dart` and `b/c.dart` exports
+ * `d/e.dart`, the URI listed for `a.dart`'s dependency on `e.dart` will be
+ * `b/d/e.dart`.
*/
- @Id(1)
- List<int> get ints;
+ uri:string (id: 0);
+}
+/**
+ * Information about a single name in the export namespace of the library that
+ * is not in the public namespace.
+ */
+table LinkedExportName {
/**
- * Indicates whether the expression is not a valid potentially constant
- * expression.
+ * Index into [LinkedLibrary.dependencies] for the library in which the
+ * entity is defined.
*/
- @Id(5)
- bool get isInvalid;
+ dependency:uint (id: 0);
/**
- * Sequence of operations to execute (starting with an empty stack) to form
- * the constant value.
+ * The kind of the entity being referred to.
*/
- @Id(0)
- List<UnlinkedConstOperation> get operations;
+ kind:ReferenceKind (id: 3);
/**
- * Sequence of language constructs consumed by the operations
- * `pushReference`, `invokeConstructor`, `makeList`, and `makeMap`. Note
- * that in the case of `pushReference` (and sometimes `invokeConstructor` the
- * actual entity being referred to may be something other than a type.
+ * Name of the exported entity. For an exported setter, this name includes
+ * the trailing '='.
*/
- @Id(2)
- List<EntityRef> get references;
+ name:string (id: 1);
/**
- * Sequence of strings consumed by the operations `pushString` and
- * `invokeConstructor`.
+ * 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.
*/
- @Id(3)
- List<String> get strings;
+ unit:uint (id: 2);
}
/**
- * Enum representing the various kinds of operations which may be performed to
- * produce a constant value. These options are assumed to execute in the
- * context of a stack which is initially empty.
+ * Linked summary of a library.
*/
-enum UnlinkedConstOperation {
+table LinkedLibrary {
/**
- * Push the next value from [UnlinkedConst.ints] (a 32-bit unsigned integer)
- * onto the stack.
+ * The libraries that this library depends on (either via an explicit import
+ * statement or via the implicit dependencies on `dart:core` and
+ * `dart:async`). The first element of this array is a pseudo-dependency
+ * representing the library itself (it is also used for `dynamic` and
+ * `void`). This is followed by elements representing "prelinked"
+ * dependencies (direct imports and the transitive closure of exports).
+ * After the prelinked dependencies are elements representing "linked"
+ * dependencies.
*
- * Note that Dart supports integers larger than 32 bits; these are
- * represented by composing 32-bit values using the [pushLongInt] operation.
+ * A library is only included as a "linked" dependency if it is a true
+ * dependency (e.g. a propagated or inferred type or constant value
+ * implicitly refers to an element declared in the library) or
+ * anti-dependency (e.g. the result of type propagation or type inference
+ * depends on the lack of a certain declaration in the library).
*/
- pushInt,
+ dependencies:[LinkedDependency] (id: 0);
/**
- * Get the number of components from [UnlinkedConst.ints], then do this number
- * of times the following operations: multiple the current value by 2^32, "or"
- * it with the next value in [UnlinkedConst.ints]. The initial value is zero.
- * Push the result into the stack.
+ * Information about entities in the export namespace of the library that are
+ * not in the public namespace of the library (that is, entities that are
+ * brought into the namespace via `export` directives).
+ *
+ * Sorted by name.
*/
- pushLongInt,
+ exportNames:[LinkedExportName] (id: 4);
/**
- * Push the next value from [UnlinkedConst.doubles] (a double precision
- * floating point value) onto the stack.
+ * For each import in [UnlinkedUnit.imports], an index into [dependencies]
+ * of the library being imported.
*/
- pushDouble,
+ importDependencies:[uint] (id: 1);
/**
- * Push the constant `true` onto the stack.
+ * The number of elements in [dependencies] which are not "linked"
+ * dependencies (that is, the number of libraries in the direct imports plus
+ * the transitive closure of exports, plus the library itself).
*/
- pushTrue,
+ numPrelinkedDependencies:uint (id: 2);
/**
- * Push the constant `false` onto the stack.
+ * The linked summary of all the compilation units constituting the
+ * library. The summary of the defining compilation unit is listed first,
+ * followed by the summary of each part, in the order of the `part`
+ * declarations in the defining compilation unit.
*/
- pushFalse,
+ units:[LinkedUnit] (id: 3);
+}
+/**
+ * Information about the resolution of an [UnlinkedReference].
+ */
+table LinkedReference {
/**
- * Push the next value from [UnlinkedConst.strings] onto the stack.
+ * If this [LinkedReference] doesn't have an associated [UnlinkedReference],
+ * and the entity being referred to is contained within another entity, index
+ * of the containing entity. This behaves similarly to
+ * [UnlinkedReference.prefixReference], however it is only used for class
+ * members, not for prefixed imports.
+ *
+ * Containing references must always point backward; that is, for all i, if
+ * LinkedUnit.references[i].containingReference != 0, then
+ * LinkedUnit.references[i].containingReference < i.
*/
- pushString,
+ containingReference:uint (id: 5);
/**
- * Pop the top n values from the stack (where n is obtained from
- * [UnlinkedConst.ints]), convert them to strings (if they aren't already),
- * concatenate them into a single string, and push it back onto the stack.
+ * Index into [LinkedLibrary.dependencies] indicating which imported library
+ * declares the entity being referred to.
*
- * This operation is used to represent constants whose value is a literal
- * string containing string interpolations.
+ * Zero if this entity is contained within another entity (e.g. a class
+ * member), or if [kind] is [ReferenceKind.prefix].
*/
- concatenate,
+ dependency:uint (id: 1);
/**
- * Get the next value from [UnlinkedConst.strings], convert it to a symbol,
- * and push it onto the stack.
+ * The kind of the entity being referred to. For the pseudo-types `dynamic`
+ * and `void`, the kind is [ReferenceKind.classOrEnum].
*/
- makeSymbol,
+ kind:ReferenceKind (id: 2);
/**
- * Push the constant `null` onto the stack.
+ * If [kind] is [ReferenceKind.function] (that is, the entity being referred
+ * to is a local function), the index of the function within
+ * [UnlinkedExecutable.localFunctions]. If [kind] is
+ * [ReferenceKind.variable], the index of the variable within
+ * [UnlinkedExecutable.localVariables]. Otherwise zero.
*/
- pushNull,
+ localIndex:uint (id: 6);
/**
- * Push the value of the constant constructor parameter with
- * the name obtained from [UnlinkedConst.strings].
+ * If this [LinkedReference] doesn't have an associated [UnlinkedReference],
+ * name of the entity being referred to. For the pseudo-type `dynamic`, the
+ * string is "dynamic". For the pseudo-type `void`, the string is "void".
*/
- pushConstructorParameter,
+ name:string (id: 3);
/**
- * Evaluate a (potentially qualified) identifier expression and push the
- * resulting value onto the stack. The identifier to be evaluated is
- * obtained from [UnlinkedConst.references].
- *
- * This operation is used to represent the following kinds of constants
- * (which are indistinguishable from an unresolved AST alone):
+ * If the entity being referred to is generic, the number of type parameters
+ * it declares (does not include type parameters of enclosing entities).
+ * Otherwise zero.
+ */
+ numTypeParameters:uint (id: 4);
+
+ /**
+ * Integer index indicating which unit in the imported 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.
*
- * - A qualified reference to a static constant variable (e.g. `C.v`, where
- * C is a class and `v` is a constant static variable in `C`).
- * - An identifier expression referring to a constant variable.
- * - A simple or qualified identifier denoting a class or type alias.
- * - A simple or qualified identifier denoting a top-level function or a
- * static method.
+ * Zero if this entity is contained within another entity (e.g. a class
+ * member).
+ */
+ unit:uint (id: 0);
+}
+
+/**
+ * Linked summary of a compilation unit.
+ */
+table LinkedUnit {
+ /**
+ * Information about the resolution of references within the compilation
+ * unit. Each element of [UnlinkedUnit.references] has a corresponding
+ * element in this list (at the same index). If this list has additional
+ * elements beyond the number of elements in [UnlinkedUnit.references], those
+ * additional elements are references that are only referred to implicitly
+ * (e.g. elements involved in inferred or propagated types).
+ */
+ references:[LinkedReference] (id: 0);
+
+ /**
+ * List associating slot ids found inside the unlinked summary for the
+ * compilation unit with propagated and inferred types.
+ */
+ types:[EntityRef] (id: 1);
+}
+
+/**
+ * Summary information about a package.
+ */
+table PackageBundle {
+ /**
+ * Linked libraries.
+ */
+ linkedLibraries:[LinkedLibrary] (id: 0);
+
+ /**
+ * The list of URIs of items in [linkedLibraries], e.g. `dart:core` or
+ * `package:foo/bar.dart`.
+ */
+ linkedLibraryUris:[string] (id: 1);
+
+ /**
+ * List of MD5 hashes of the files listed in [unlinkedUnitUris]. Each hash
+ * is encoded as a hexadecimal string using lower case letters.
+ */
+ unlinkedUnitHashes:[string] (id: 4);
+
+ /**
+ * Unlinked information for the compilation units constituting the package.
+ */
+ unlinkedUnits:[UnlinkedUnit] (id: 2);
+
+ /**
+ * The list of URIs of items in [unlinkedUnits], e.g. `dart:core/bool.dart`.
+ */
+ unlinkedUnitUris:[string] (id: 3);
+}
+
+/**
+ * Index information about a package.
+ */
+table PackageIndex {
+ /**
+ * Each item of this list corresponds to a unique library URI with an element
+ * referenced in the [PackageIndex]. It is an index into [uris] list.
+ */
+ elementLibraryUris:[uint] (id: 2);
+
+ /**
+ * Each item of this list corresponds to a unique referenced element. It is
+ * the offset of the element name relative to the beginning of the file. The
+ * list is sorted in ascending order, so that the client can quickly check
+ * whether an element is referenced in this [PackageIndex].
+ */
+ elementOffsets:[uint] (id: 1);
+
+ /**
+ * Each item of this list corresponds to a unique referenced element. It is
+ * the index into [elementLibraryUris] and [elementUnitUris] for the library
+ * specific unit where the element is declared.
+ */
+ elementUnits:[uint] (id: 0);
+
+ /**
+ * Each item of this list corresponds to a unique unit URI with an element
+ * referenced in the [PackageIndex]. It is an index into [uris] list.
*/
- pushReference,
+ elementUnitUris:[uint] (id: 3);
/**
- * Pop the top `n` values from the stack (where `n` is obtained from
- * [UnlinkedConst.ints]) into a list (filled from the end) and take the next
- * `n` values from [UnlinkedConst.strings] and use the lists of names and
- * values to create named arguments. Then pop the top `m` values from the
- * stack (where `m` is obtained from [UnlinkedConst.ints]) into a list (filled
- * from the end) and use them as positional arguments. Use the lists of
- * positional and names arguments to invoke a constant constructor obtained
- * from [UnlinkedConst.references], and push the resulting value back onto the
- * stack.
- *
- * Note that for an invocation of the form `const a.b(...)` (where no type
- * arguments are specified), it is impossible to tell from the unresolved AST
- * alone whether `a` is a class name and `b` is a constructor name, or `a` is
- * a prefix name and `b` is a class name. For consistency between AST based
- * and elements based summaries, references to default constructors are always
- * recorded as references to corresponding classes.
+ * List of units indexed in this [PackageIndex].
*/
- invokeConstructor,
+ units:[UnitIndex] (id: 5);
/**
- * Pop the top n values from the stack (where n is obtained from
- * [UnlinkedConst.ints]), place them in a [List], and push the result back
- * onto the stack. The type parameter for the [List] is implicitly `dynamic`.
+ * List of unique URIs used in this [PackageIndex].
*/
- makeUntypedList,
+ uris:[string] (id: 4);
+}
+/**
+ * Index information about a unit in a [PackageIndex].
+ */
+table UnitIndex {
/**
- * Pop the top 2*n values from the stack (where n is obtained from
- * [UnlinkedConst.ints]), interpret them as key/value pairs, place them in a
- * [Map], and push the result back onto the stack. The two type parameters
- * for the [Map] are implicitly `dynamic`.
+ * Each item of this list is the index into [PackageIndex.elementUnits] and
+ * [PackageIndex.elementOffsets]. The list is sorted in ascending order, so
+ * that the client can quickly find element references in this [UnitIndex].
*/
- makeUntypedMap,
+ elements:[uint] (id: 4);
/**
- * Pop the top n values from the stack (where n is obtained from
- * [UnlinkedConst.ints]), place them in a [List], and push the result back
- * onto the stack. The type parameter for the [List] is obtained from
- * [UnlinkedConst.references].
+ * Each item of this list is the kind of the element usage.
*/
- makeTypedList,
+ kinds:[IndexRelationKind] (id: 5);
/**
- * Pop the top 2*n values from the stack (where n is obtained from
- * [UnlinkedConst.ints]), interpret them as key/value pairs, place them in a
- * [Map], and push the result back onto the stack. The two type parameters for
- * the [Map] are obtained from [UnlinkedConst.references].
+ * The library source URI of this unit, e.g. `dart:core` or
+ * `package:foo/bar.dart`, as index into [PackageIndex.uris].
*/
- makeTypedMap,
+ libraryUri:uint (id: 0);
/**
- * Pop the top 2 values from the stack, pass them to the predefined Dart
- * function `identical`, and push the result back onto the stack.
+ * Each item of this list is the length of the element usage.
*/
- identical,
+ locationLengths:[uint] (id: 2);
/**
- * Pop the top 2 values from the stack, evaluate `v1 == v2`, and push the
- * result back onto the stack.
+ * Each item of this list is the offset of the element usage relative to the
+ * beginning of the file.
*/
- equal,
+ locationOffsets:[uint] (id: 3);
/**
- * Pop the top 2 values from the stack, evaluate `v1 != v2`, and push the
- * result back onto the stack.
+ * The unit source URI of this unit, e.g. `dart:core/int.dart` or
+ * `package:foo/bar/baz.dart`, as index into [PackageIndex.uris].
*/
- notEqual,
+ unitUri:uint (id: 1);
+}
+/**
+ * Unlinked summary information about a class declaration.
+ */
+table UnlinkedClass {
/**
- * Pop the top value from the stack, compute its boolean negation, and push
- * the result back onto the stack.
+ * Annotations for this class.
*/
- not,
+ annotations:[UnlinkedConst] (id: 5);
/**
- * Pop the top 2 values from the stack, compute `v1 && v2`, and push the
- * result back onto the stack.
+ * Documentation comment for the class, or `null` if there is no
+ * documentation comment.
*/
- and,
+ documentationComment:UnlinkedDocumentationComment (id: 6);
/**
- * Pop the top 2 values from the stack, compute `v1 || v2`, and push the
- * result back onto the stack.
+ * Executable objects (methods, getters, and setters) contained in the class.
*/
- or,
+ executables:[UnlinkedExecutable] (id: 2);
/**
- * Pop the top value from the stack, compute its integer complement, and push
- * the result back onto the stack.
+ * Field declarations contained in the class.
*/
- complement,
+ fields:[UnlinkedVariable] (id: 4);
/**
- * Pop the top 2 values from the stack, compute `v1 ^ v2`, and push the
- * result back onto the stack.
+ * Indicates whether this class is the core "Object" class (and hence has no
+ * supertype)
*/
- bitXor,
+ hasNoSupertype:bool (id: 12);
/**
- * Pop the top 2 values from the stack, compute `v1 & v2`, and push the
- * result back onto the stack.
+ * Interfaces appearing in an `implements` clause, if any.
*/
- bitAnd,
+ interfaces:[EntityRef] (id: 7);
/**
- * Pop the top 2 values from the stack, compute `v1 | v2`, and push the
- * result back onto the stack.
+ * Indicates whether the class is declared with the `abstract` keyword.
*/
- bitOr,
+ isAbstract:bool (id: 8);
/**
- * Pop the top 2 values from the stack, compute `v1 >> v2`, and push the
- * result back onto the stack.
+ * Indicates whether the class is declared using mixin application syntax.
*/
- bitShiftRight,
+ isMixinApplication:bool (id: 11);
/**
- * Pop the top 2 values from the stack, compute `v1 << v2`, and push the
- * result back onto the stack.
+ * Mixins appearing in a `with` clause, if any.
*/
- bitShiftLeft,
+ mixins:[EntityRef] (id: 10);
/**
- * Pop the top 2 values from the stack, compute `v1 + v2`, and push the
- * result back onto the stack.
+ * Name of the class.
*/
- add,
+ name:string (id: 0);
/**
- * Pop the top value from the stack, compute its integer negation, and push
- * the result back onto the stack.
+ * Offset of the class name relative to the beginning of the file.
*/
- negate,
+ nameOffset:uint (id: 1);
/**
- * Pop the top 2 values from the stack, compute `v1 - v2`, and push the
- * result back onto the stack.
+ * Supertype of the class, or `null` if either (a) the class doesn't
+ * explicitly declare a supertype (and hence has supertype `Object`), or (b)
+ * the class *is* `Object` (and hence has no supertype).
*/
- subtract,
+ supertype:EntityRef (id: 3);
/**
- * Pop the top 2 values from the stack, compute `v1 * v2`, and push the
- * result back onto the stack.
+ * Type parameters of the class, if any.
*/
- multiply,
+ typeParameters:[UnlinkedTypeParam] (id: 9);
+}
+
+/**
+ * Unlinked summary information about a `show` or `hide` combinator in an
+ * import or export declaration.
+ */
+table UnlinkedCombinator {
+ /**
+ * If this is a `show` combinator, offset of the end of the list of shown
+ * names. Otherwise zero.
+ */
+ end:uint (id: 3);
/**
- * Pop the top 2 values from the stack, compute `v1 / v2`, and push the
- * result back onto the stack.
+ * List of names which are hidden. Empty if this is a `show` combinator.
*/
- divide,
+ hides:[string] (id: 1);
/**
- * Pop the top 2 values from the stack, compute `v1 ~/ v2`, and push the
- * result back onto the stack.
+ * If this is a `show` combinator, offset of the `show` keyword. Otherwise
+ * zero.
*/
- floorDivide,
+ offset:uint (id: 2);
/**
- * Pop the top 2 values from the stack, compute `v1 > v2`, and push the
- * result back onto the stack.
+ * List of names which are shown. Empty if this is a `hide` combinator.
*/
- greater,
+ shows:[string] (id: 0);
+}
+/**
+ * Unlinked summary information about a compile-time constant expression, or a
+ * potentially constant expression.
+ *
+ * Constant expressions are represented using a simple stack-based language
+ * where [operations] is a sequence of operations to execute starting with an
+ * empty stack. Once all operations have been executed, the stack should
+ * contain a single value which is the value of the constant. Note that some
+ * operations consume additional data from the other fields of this class.
+ */
+table UnlinkedConst {
/**
- * Pop the top 2 values from the stack, compute `v1 < v2`, and push the
- * result back onto the stack.
+ * Sequence of 64-bit doubles consumed by the operation `pushDouble`.
*/
- less,
+ doubles:[double] (id: 4);
/**
- * Pop the top 2 values from the stack, compute `v1 >= v2`, and push the
- * result back onto the stack.
+ * Sequence of unsigned 32-bit integers consumed by the operations
+ * `pushArgument`, `pushInt`, `shiftOr`, `concatenate`, `invokeConstructor`,
+ * `makeList`, and `makeMap`.
*/
- greaterEqual,
+ ints:[uint] (id: 1);
/**
- * Pop the top 2 values from the stack, compute `v1 <= v2`, and push the
- * result back onto the stack.
+ * Indicates whether the expression is not a valid potentially constant
+ * expression.
*/
- lessEqual,
+ isInvalid:bool (id: 5);
/**
- * Pop the top 2 values from the stack, compute `v1 % v2`, and push the
- * result back onto the stack.
+ * Sequence of operations to execute (starting with an empty stack) to form
+ * the constant value.
*/
- modulo,
+ operations:[UnlinkedConstOperation] (id: 0);
/**
- * Pop the top 3 values from the stack, compute `v1 ? v2 : v3`, and push the
- * result back onto the stack.
+ * Sequence of language constructs consumed by the operations
+ * `pushReference`, `invokeConstructor`, `makeList`, and `makeMap`. Note
+ * that in the case of `pushReference` (and sometimes `invokeConstructor` the
+ * actual entity being referred to may be something other than a type.
*/
- conditional,
+ references:[EntityRef] (id: 2);
/**
- * Pop the top value from the stack, evaluate `v.length`, and push the result
- * back onto the stack.
+ * Sequence of strings consumed by the operations `pushString` and
+ * `invokeConstructor`.
*/
- length,
+ strings:[string] (id: 3);
}
/**
* Unlinked summary information about a constructor initializer.
*/
-abstract class UnlinkedConstructorInitializer extends base.SummaryClass {
+table UnlinkedConstructorInitializer {
/**
* If [kind] is `thisInvocation` or `superInvocation`, the arguments of the
* invocation. Otherwise empty.
*/
- @Id(3)
- List<UnlinkedConst> get arguments;
+ arguments:[UnlinkedConst] (id: 3);
/**
* If [kind] is `field`, the expression of the field initializer.
* Otherwise `null`.
*/
- @Id(1)
- UnlinkedConst get expression;
+ expression:UnlinkedConst (id: 1);
/**
* The kind of the constructor initializer (field, redirect, super).
*/
- @Id(2)
- UnlinkedConstructorInitializerKind get kind;
+ kind:UnlinkedConstructorInitializerKind (id: 2);
/**
* If [kind] is `field`, the name of the field declared in the class. If
@@ -1111,46 +1044,23 @@ abstract class UnlinkedConstructorInitializer extends base.SummaryClass {
* class, to redirect to. If [kind] is `superInvocation`, the name of the
* constructor, declared in the superclass, to invoke.
*/
- @Id(0)
- String get name;
-}
-
-/**
- * Enum used to indicate the kind of an constructor initializer.
- */
-enum UnlinkedConstructorInitializerKind {
- /**
- * Initialization of a field.
- */
- field,
-
- /**
- * Invocation of a constructor in the same class.
- */
- thisInvocation,
-
- /**
- * Invocation of a superclass' constructor.
- */
- superInvocation
+ name:string (id: 0);
}
/**
* Unlinked summary information about a documentation comment.
*/
-abstract class UnlinkedDocumentationComment extends base.SummaryClass {
+table UnlinkedDocumentationComment {
/**
* Length of the documentation comment (prior to replacing '\r\n' with '\n').
*/
- @Id(0)
- int get length;
+ length:uint (id: 0);
/**
* Offset of the beginning of the documentation comment relative to the
* beginning of the file.
*/
- @Id(2)
- int get offset;
+ offset:uint (id: 2);
/**
* Text of the documentation comment, with '\r\n' replaced by '\n'.
@@ -1158,100 +1068,83 @@ abstract class UnlinkedDocumentationComment extends base.SummaryClass {
* References appearing within the doc comment in square brackets are not
* specially encoded.
*/
- @Id(1)
- String get text;
+ text:string (id: 1);
}
/**
* Unlinked summary information about an enum declaration.
*/
-abstract class UnlinkedEnum extends base.SummaryClass {
+table UnlinkedEnum {
/**
* Annotations for this enum.
*/
- @Id(4)
- List<UnlinkedConst> get annotations;
+ annotations:[UnlinkedConst] (id: 4);
/**
* Documentation comment for the enum, or `null` if there is no documentation
* comment.
*/
- @informative
- @Id(3)
- UnlinkedDocumentationComment get documentationComment;
+ documentationComment:UnlinkedDocumentationComment (id: 3);
/**
* Name of the enum type.
*/
- @Id(0)
- String get name;
+ name:string (id: 0);
/**
* Offset of the enum name relative to the beginning of the file.
*/
- @informative
- @Id(1)
- int get nameOffset;
+ nameOffset:uint (id: 1);
/**
* Values listed in the enum declaration, in declaration order.
*/
- @Id(2)
- List<UnlinkedEnumValue> get values;
+ values:[UnlinkedEnumValue] (id: 2);
}
/**
* Unlinked summary information about a single enumerated value in an enum
* declaration.
*/
-abstract class UnlinkedEnumValue extends base.SummaryClass {
+table UnlinkedEnumValue {
/**
* Documentation comment for the enum value, or `null` if there is no
* documentation comment.
*/
- @informative
- @Id(2)
- UnlinkedDocumentationComment get documentationComment;
+ documentationComment:UnlinkedDocumentationComment (id: 2);
/**
* Name of the enumerated value.
*/
- @Id(0)
- String get name;
+ name:string (id: 0);
/**
* Offset of the enum value name relative to the beginning of the file.
*/
- @informative
- @Id(1)
- int get nameOffset;
+ nameOffset:uint (id: 1);
}
/**
* Unlinked summary information about a function, method, getter, or setter
* declaration.
*/
-abstract class UnlinkedExecutable extends base.SummaryClass {
+table UnlinkedExecutable {
/**
* Annotations for this executable.
*/
- @Id(6)
- List<UnlinkedConst> get annotations;
+ annotations:[UnlinkedConst] (id: 6);
/**
* If a constant [UnlinkedExecutableKind.constructor], the constructor
* initializers. Otherwise empty.
*/
- @Id(14)
- List<UnlinkedConstructorInitializer> get constantInitializers;
+ constantInitializers:[UnlinkedConstructorInitializer] (id: 14);
/**
* Documentation comment for the executable, or `null` if there is no
* documentation comment.
*/
- @informative
- @Id(7)
- UnlinkedDocumentationComment get documentationComment;
+ documentationComment:UnlinkedDocumentationComment (id: 7);
/**
* If this executable's return type is inferable, nonzero slot id
@@ -1260,38 +1153,32 @@ abstract class UnlinkedExecutable extends base.SummaryClass {
* no return type was inferred for this variable, so its static type is
* `dynamic`.
*/
- @Id(5)
- int get inferredReturnTypeSlot;
+ inferredReturnTypeSlot:uint (id: 5);
/**
* Indicates whether the executable is declared using the `abstract` keyword.
*/
- @Id(10)
- bool get isAbstract;
+ isAbstract:bool (id: 10);
/**
* Indicates whether the executable is declared using the `const` keyword.
*/
- @Id(12)
- bool get isConst;
+ isConst:bool (id: 12);
/**
* Indicates whether the executable is declared using the `external` keyword.
*/
- @Id(11)
- bool get isExternal;
+ isExternal:bool (id: 11);
/**
* Indicates whether the executable is declared using the `factory` keyword.
*/
- @Id(8)
- bool get isFactory;
+ isFactory:bool (id: 8);
/**
* Indicates whether the executable is a redirected constructor.
*/
- @Id(13)
- bool get isRedirectedConstructor;
+ isRedirectedConstructor:bool (id: 13);
/**
* Indicates whether the executable is declared using the `static` keyword.
@@ -1300,49 +1187,41 @@ abstract class UnlinkedExecutable extends base.SummaryClass {
* not declared using the `static` keyword (even though they are considered
* static for semantic purposes).
*/
- @Id(9)
- bool get isStatic;
+ isStatic:bool (id: 9);
/**
* The kind of the executable (function/method, getter, setter, or
* constructor).
*/
- @Id(4)
- UnlinkedExecutableKind get kind;
+ kind:UnlinkedExecutableKind (id: 4);
/**
* The list of local functions.
*/
- @Id(18)
- List<UnlinkedExecutable> get localFunctions;
+ localFunctions:[UnlinkedExecutable] (id: 18);
/**
* The list of local labels.
*/
- @Id(22)
- List<UnlinkedLabel> get localLabels;
+ localLabels:[UnlinkedLabel] (id: 22);
/**
* The list of local variables.
*/
- @Id(19)
- List<UnlinkedVariable> get localVariables;
+ localVariables:[UnlinkedVariable] (id: 19);
/**
* Name of the executable. For setters, this includes the trailing "=". For
* named constructors, this excludes the class name and excludes the ".".
* For unnamed constructors, this is the empty string.
*/
- @Id(1)
- String get name;
+ name:string (id: 1);
/**
* If [kind] is [UnlinkedExecutableKind.constructor] and [name] is not empty,
* the offset of the end of the constructor name. Otherwise zero.
*/
- @informative
- @Id(23)
- int get nameEnd;
+ nameEnd:uint (id: 23);
/**
* Offset of the executable name relative to the beginning of the file. For
@@ -1350,40 +1229,33 @@ abstract class UnlinkedExecutable extends base.SummaryClass {
* For unnamed constructors, this is the offset of the class name (i.e. the
* offset of the second "C" in "class C { C(); }").
*/
- @informative
- @Id(0)
- int get nameOffset;
+ nameOffset:uint (id: 0);
/**
* Parameters of the executable, if any. Note that getters have no
* parameters (hence this will be the empty list), and setters have a single
* parameter.
*/
- @Id(2)
- List<UnlinkedParam> get parameters;
+ parameters:[UnlinkedParam] (id: 2);
/**
* If [kind] is [UnlinkedExecutableKind.constructor] and [name] is not empty,
* the offset of the period before the constructor name. Otherwise zero.
*/
- @informative
- @Id(24)
- int get periodOffset;
+ periodOffset:uint (id: 24);
/**
* If [isRedirectedConstructor] and [isFactory] are both `true`, the
* constructor to which this constructor redirects; otherwise empty.
*/
- @Id(15)
- EntityRef get redirectedConstructor;
+ redirectedConstructor:EntityRef (id: 15);
/**
* If [isRedirectedConstructor] is `true` and [isFactory] is `false`, the
* name of the constructor that this constructor redirects to; otherwise
* empty.
*/
- @Id(17)
- String get redirectedConstructorName;
+ redirectedConstructorName:string (id: 17);
/**
* Declared return type of the executable. Absent if the executable is a
@@ -1392,150 +1264,104 @@ abstract class UnlinkedExecutable extends base.SummaryClass {
* executables may have return types that are not accessible via direct
* imports.
*/
- @Id(3)
- EntityRef get returnType;
+ returnType:EntityRef (id: 3);
/**
* Type parameters of the executable, if any. Empty if support for generic
* method syntax is disabled.
*/
- @Id(16)
- List<UnlinkedTypeParam> get typeParameters;
+ typeParameters:[UnlinkedTypeParam] (id: 16);
/**
* If a local function, the length of the visible range; zero otherwise.
*/
- @Id(20)
- int get visibleLength;
+ visibleLength:uint (id: 20);
/**
* If a local function, the beginning of the visible range; zero otherwise.
*/
- @Id(21)
- int get visibleOffset;
-}
-
-/**
- * Enum used to indicate the kind of an executable.
- */
-enum UnlinkedExecutableKind {
- /**
- * Executable is a function or method.
- */
- functionOrMethod,
-
- /**
- * Executable is a getter.
- */
- getter,
-
- /**
- * Executable is a setter.
- */
- setter,
-
- /**
- * Executable is a constructor.
- */
- constructor
+ visibleOffset:uint (id: 21);
}
/**
* Unlinked summary information about an export declaration (stored outside
* [UnlinkedPublicNamespace]).
*/
-abstract class UnlinkedExportNonPublic extends base.SummaryClass {
+table UnlinkedExportNonPublic {
/**
* Annotations for this export directive.
*/
- @Id(3)
- List<UnlinkedConst> get annotations;
+ annotations:[UnlinkedConst] (id: 3);
/**
* Offset of the "export" keyword.
*/
- @informative
- @Id(0)
- int get offset;
+ offset:uint (id: 0);
/**
* End of the URI string (including quotes) relative to the beginning of the
* file.
*/
- @informative
- @Id(1)
- int get uriEnd;
+ uriEnd:uint (id: 1);
/**
* Offset of the URI string (including quotes) relative to the beginning of
* the file.
*/
- @informative
- @Id(2)
- int get uriOffset;
+ uriOffset:uint (id: 2);
}
/**
* Unlinked summary information about an export declaration (stored inside
* [UnlinkedPublicNamespace]).
*/
-abstract class UnlinkedExportPublic extends base.SummaryClass {
+table UnlinkedExportPublic {
/**
* Combinators contained in this import declaration.
*/
- @Id(1)
- List<UnlinkedCombinator> get combinators;
+ combinators:[UnlinkedCombinator] (id: 1);
/**
* URI used in the source code to reference the exported library.
*/
- @Id(0)
- String get uri;
+ uri:string (id: 0);
}
/**
* Unlinked summary information about an import declaration.
*/
-abstract class UnlinkedImport extends base.SummaryClass {
+table UnlinkedImport {
/**
* Annotations for this import declaration.
*/
- @Id(8)
- List<UnlinkedConst> get annotations;
+ annotations:[UnlinkedConst] (id: 8);
/**
* Combinators contained in this import declaration.
*/
- @Id(4)
- List<UnlinkedCombinator> get combinators;
+ combinators:[UnlinkedCombinator] (id: 4);
/**
* Indicates whether the import declaration uses the `deferred` keyword.
*/
- @Id(9)
- bool get isDeferred;
+ isDeferred:bool (id: 9);
/**
* Indicates whether the import declaration is implicit.
*/
- @Id(5)
- bool get isImplicit;
+ isImplicit:bool (id: 5);
/**
* If [isImplicit] is false, offset of the "import" keyword. If [isImplicit]
* is true, zero.
*/
- @informative
- @Id(0)
- int get offset;
+ offset:uint (id: 0);
/**
* Offset of the prefix name relative to the beginning of the file, or zero
* if there is no prefix.
*/
- @informative
- @Id(6)
- int get prefixOffset;
+ prefixOffset:uint (id: 6);
/**
* Index into [UnlinkedUnit.references] of the prefix declared by this
@@ -1543,88 +1369,73 @@ abstract class UnlinkedImport extends base.SummaryClass {
*
* Note that multiple imports can declare the same prefix.
*/
- @Id(7)
- int get prefixReference;
+ prefixReference:uint (id: 7);
/**
* URI used in the source code to reference the imported library.
*/
- @Id(1)
- String get uri;
+ uri:string (id: 1);
/**
* End of the URI string (including quotes) relative to the beginning of the
* file. If [isImplicit] is true, zero.
*/
- @informative
- @Id(2)
- int get uriEnd;
+ uriEnd:uint (id: 2);
/**
* Offset of the URI string (including quotes) relative to the beginning of
* the file. If [isImplicit] is true, zero.
*/
- @informative
- @Id(3)
- int get uriOffset;
+ uriOffset:uint (id: 3);
}
/**
* Unlinked summary information about a label.
*/
-abstract class UnlinkedLabel extends base.SummaryClass {
+table UnlinkedLabel {
/**
* Return `true` if this label is associated with a `switch` member (`case` or
* `default`).
*/
- @Id(2)
- bool get isOnSwitchMember;
+ isOnSwitchMember:bool (id: 2);
/**
* Return `true` if this label is associated with a `switch` statement.
*/
- @Id(3)
- bool get isOnSwitchStatement;
+ isOnSwitchStatement:bool (id: 3);
/**
* Name of the label.
*/
- @Id(0)
- String get name;
+ name:string (id: 0);
/**
* Offset of the label relative to the beginning of the file.
*/
- @informative
- @Id(1)
- int get nameOffset;
+ nameOffset:uint (id: 1);
}
/**
* Unlinked summary information about a function parameter.
*/
-abstract class UnlinkedParam extends base.SummaryClass {
+table UnlinkedParam {
/**
* Annotations for this parameter.
*/
- @Id(9)
- List<UnlinkedConst> get annotations;
+ annotations:[UnlinkedConst] (id: 9);
/**
* If the parameter has a default value, the constant expression in the
* default value. Note that the presence of this expression does not mean
* that it is a valid, check [UnlinkedConst.isInvalid].
*/
- @Id(7)
- UnlinkedConst get defaultValue;
+ defaultValue:UnlinkedConst (id: 7);
/**
* If the parameter has a default value, the source text of the constant
* expression in the default value. Otherwise the empty string.
*/
- @informative
- @Id(13)
- String get defaultValueCode;
+ defaultValueCode:string (id: 13);
/**
* If this parameter's type is inferable, nonzero slot id identifying which
@@ -1637,120 +1448,83 @@ abstract class UnlinkedParam extends base.SummaryClass {
* not specified, they always inherit the static type of the corresponding
* field.
*/
- @Id(2)
- int get inferredTypeSlot;
+ inferredTypeSlot:uint (id: 2);
/**
* The synthetic initializer function of the parameter. Absent if the variable
* does not have an initializer.
*/
- @Id(12)
- UnlinkedExecutable get initializer;
+ initializer:UnlinkedExecutable (id: 12);
/**
* Indicates whether this is a function-typed parameter.
*/
- @Id(5)
- bool get isFunctionTyped;
+ isFunctionTyped:bool (id: 5);
/**
* Indicates whether this is an initializing formal parameter (i.e. it is
* declared using `this.` syntax).
*/
- @Id(6)
- bool get isInitializingFormal;
+ isInitializingFormal:bool (id: 6);
/**
* Kind of the parameter.
*/
- @Id(4)
- UnlinkedParamKind get kind;
+ kind:UnlinkedParamKind (id: 4);
/**
* Name of the parameter.
*/
- @Id(0)
- String get name;
+ name:string (id: 0);
/**
* Offset of the parameter name relative to the beginning of the file.
*/
- @informative
- @Id(1)
- int get nameOffset;
+ nameOffset:uint (id: 1);
/**
* If [isFunctionTyped] is `true`, the parameters of the function type.
*/
- @Id(8)
- List<UnlinkedParam> get parameters;
+ parameters:[UnlinkedParam] (id: 8);
/**
* If [isFunctionTyped] is `true`, the declared return type. If
* [isFunctionTyped] is `false`, the declared type. Absent if the type is
* implicit.
*/
- @Id(3)
- EntityRef get type;
+ type:EntityRef (id: 3);
/**
* The length of the visible range.
*/
- @Id(10)
- int get visibleLength;
+ visibleLength:uint (id: 10);
/**
* The beginning of the visible range.
*/
- @Id(11)
- int get visibleOffset;
-}
-
-/**
- * Enum used to indicate the kind of a parameter.
- */
-enum UnlinkedParamKind {
- /**
- * Parameter is required.
- */
- required,
-
- /**
- * Parameter is positional optional (enclosed in `[]`)
- */
- positional,
-
- /**
- * Parameter is named optional (enclosed in `{}`)
- */
- named
+ visibleOffset:uint (id: 11);
}
/**
* Unlinked summary information about a part declaration.
*/
-abstract class UnlinkedPart extends base.SummaryClass {
+table UnlinkedPart {
/**
* Annotations for this part declaration.
*/
- @Id(2)
- List<UnlinkedConst> get annotations;
+ annotations:[UnlinkedConst] (id: 2);
/**
* End of the URI string (including quotes) relative to the beginning of the
* file.
*/
- @informative
- @Id(0)
- int get uriEnd;
+ uriEnd:uint (id: 0);
/**
* Offset of the URI string (including quotes) relative to the beginning of
* the file.
*/
- @informative
- @Id(1)
- int get uriOffset;
+ uriOffset:uint (id: 1);
}
/**
@@ -1761,12 +1535,11 @@ abstract class UnlinkedPart extends base.SummaryClass {
* elsewhere in the summary. Consider reducing the redundancy to reduce
* summary size.
*/
-abstract class UnlinkedPublicName extends base.SummaryClass {
+table UnlinkedPublicName {
/**
* The kind of object referred to by the name.
*/
- @Id(1)
- ReferenceKind get kind;
+ kind:ReferenceKind (id: 1);
/**
* If this [UnlinkedPublicName] is a class, the list of members which can be
@@ -1776,21 +1549,18 @@ abstract class UnlinkedPublicName extends base.SummaryClass {
* Unnamed constructors are not included since they do not constitute a
* separate name added to any namespace.
*/
- @Id(2)
- List<UnlinkedPublicName> get members;
+ members:[UnlinkedPublicName] (id: 2);
/**
* The name itself.
*/
- @Id(0)
- String get name;
+ name:string (id: 0);
/**
* If the entity being referred to is generic, the number of type parameters
* it accepts. Otherwise zero.
*/
- @Id(3)
- int get numTypeParameters;
+ numTypeParameters:uint (id: 3);
}
/**
@@ -1798,16 +1568,11 @@ abstract class UnlinkedPublicName extends base.SummaryClass {
* library's public namespace. This is the subset of [UnlinkedUnit] that is
* required from dependent libraries in order to perform prelinking.
*/
-@TopLevel('UPNS')
-abstract class UnlinkedPublicNamespace extends base.SummaryClass {
- factory UnlinkedPublicNamespace.fromBuffer(List<int> buffer) =>
- generated.readUnlinkedPublicNamespace(buffer);
-
+table UnlinkedPublicNamespace {
/**
* Export declarations in the compilation unit.
*/
- @Id(2)
- List<UnlinkedExportPublic> get exports;
+ exports:[UnlinkedExportPublic] (id: 2);
/**
* Public names defined in the compilation unit.
@@ -1815,28 +1580,25 @@ abstract class UnlinkedPublicNamespace extends base.SummaryClass {
* TODO(paulberry): consider sorting these names to reduce unnecessary
* relinking.
*/
- @Id(0)
- List<UnlinkedPublicName> get names;
+ names:[UnlinkedPublicName] (id: 0);
/**
* URIs referenced by part declarations in the compilation unit.
*/
- @Id(1)
- List<String> get parts;
+ parts:[string] (id: 1);
}
/**
* Unlinked summary information about a name referred to in one library that
* might be defined in another.
*/
-abstract class UnlinkedReference extends base.SummaryClass {
+table UnlinkedReference {
/**
* Name of the entity being referred to. For the pseudo-type `dynamic`, the
* string is "dynamic". For the pseudo-type `void`, the string is "void".
* For the pseudo-type `bottom`, the string is "*bottom*".
*/
- @Id(0)
- String get name;
+ name:string (id: 0);
/**
* Prefix used to refer to the entity, or zero if no prefix is used. This is
@@ -1846,178 +1608,144 @@ abstract class UnlinkedReference extends base.SummaryClass {
* UnlinkedUnit.references[i].prefixReference != 0, then
* UnlinkedUnit.references[i].prefixReference < i.
*/
- @Id(1)
- int get prefixReference;
+ prefixReference:uint (id: 1);
}
/**
* Unlinked summary information about a typedef declaration.
*/
-abstract class UnlinkedTypedef extends base.SummaryClass {
+table UnlinkedTypedef {
/**
* Annotations for this typedef.
*/
- @Id(4)
- List<UnlinkedConst> get annotations;
+ annotations:[UnlinkedConst] (id: 4);
/**
* Documentation comment for the typedef, or `null` if there is no
* documentation comment.
*/
- @informative
- @Id(6)
- UnlinkedDocumentationComment get documentationComment;
+ documentationComment:UnlinkedDocumentationComment (id: 6);
/**
* Name of the typedef.
*/
- @Id(0)
- String get name;
+ name:string (id: 0);
/**
* Offset of the typedef name relative to the beginning of the file.
*/
- @informative
- @Id(1)
- int get nameOffset;
+ nameOffset:uint (id: 1);
/**
* Parameters of the executable, if any.
*/
- @Id(3)
- List<UnlinkedParam> get parameters;
+ parameters:[UnlinkedParam] (id: 3);
/**
* Return type of the typedef.
*/
- @Id(2)
- EntityRef get returnType;
+ returnType:EntityRef (id: 2);
/**
* Type parameters of the typedef, if any.
*/
- @Id(5)
- List<UnlinkedTypeParam> get typeParameters;
+ typeParameters:[UnlinkedTypeParam] (id: 5);
}
/**
* Unlinked summary information about a type parameter declaration.
*/
-abstract class UnlinkedTypeParam extends base.SummaryClass {
+table UnlinkedTypeParam {
/**
* Annotations for this type parameter.
*/
- @Id(3)
- List<UnlinkedConst> get annotations;
+ annotations:[UnlinkedConst] (id: 3);
/**
* Bound of the type parameter, if a bound is explicitly declared. Otherwise
* null.
*/
- @Id(2)
- EntityRef get bound;
+ bound:EntityRef (id: 2);
/**
* Name of the type parameter.
*/
- @Id(0)
- String get name;
+ name:string (id: 0);
/**
* Offset of the type parameter name relative to the beginning of the file.
*/
- @informative
- @Id(1)
- int get nameOffset;
+ nameOffset:uint (id: 1);
}
/**
* Unlinked summary information about a compilation unit ("part file").
*/
-@TopLevel('UUnt')
-abstract class UnlinkedUnit extends base.SummaryClass {
- factory UnlinkedUnit.fromBuffer(List<int> buffer) =>
- generated.readUnlinkedUnit(buffer);
-
+table UnlinkedUnit {
/**
* Classes declared in the compilation unit.
*/
- @Id(2)
- List<UnlinkedClass> get classes;
+ classes:[UnlinkedClass] (id: 2);
/**
* Enums declared in the compilation unit.
*/
- @Id(12)
- List<UnlinkedEnum> get enums;
+ enums:[UnlinkedEnum] (id: 12);
/**
* Top level executable objects (functions, getters, and setters) declared in
* the compilation unit.
*/
- @Id(4)
- List<UnlinkedExecutable> get executables;
+ executables:[UnlinkedExecutable] (id: 4);
/**
* Export declarations in the compilation unit.
*/
- @Id(13)
- List<UnlinkedExportNonPublic> get exports;
+ exports:[UnlinkedExportNonPublic] (id: 13);
/**
* Import declarations in the compilation unit.
*/
- @Id(5)
- List<UnlinkedImport> get imports;
+ imports:[UnlinkedImport] (id: 5);
/**
* Annotations for the library declaration, or the empty list if there is no
* library declaration.
*/
- @Id(14)
- List<UnlinkedConst> get libraryAnnotations;
+ libraryAnnotations:[UnlinkedConst] (id: 14);
/**
* Documentation comment for the library, or `null` if there is no
* documentation comment.
*/
- @informative
- @Id(9)
- UnlinkedDocumentationComment get libraryDocumentationComment;
+ libraryDocumentationComment:UnlinkedDocumentationComment (id: 9);
/**
* Name of the library (from a "library" declaration, if present).
*/
- @Id(6)
- String get libraryName;
+ libraryName:string (id: 6);
/**
* Length of the library name as it appears in the source code (or 0 if the
* library has no name).
*/
- @informative
- @Id(7)
- int get libraryNameLength;
+ libraryNameLength:uint (id: 7);
/**
* Offset of the library name relative to the beginning of the file (or 0 if
* the library has no name).
*/
- @informative
- @Id(8)
- int get libraryNameOffset;
+ libraryNameOffset:uint (id: 8);
/**
* Part declarations in the compilation unit.
*/
- @Id(11)
- List<UnlinkedPart> get parts;
+ parts:[UnlinkedPart] (id: 11);
/**
* Unlinked public namespace of this compilation unit.
*/
- @Id(0)
- UnlinkedPublicNamespace get publicNamespace;
+ publicNamespace:UnlinkedPublicNamespace (id: 0);
/**
* Top level and prefixed names referred to by this compilation unit. The
@@ -2026,48 +1754,41 @@ abstract class UnlinkedUnit extends base.SummaryClass {
* example [UnlinkedReference.prefixReference or
* UnlinkedImport.prefixReference]).
*/
- @Id(1)
- List<UnlinkedReference> get references;
+ references:[UnlinkedReference] (id: 1);
/**
* Typedefs declared in the compilation unit.
*/
- @Id(10)
- List<UnlinkedTypedef> get typedefs;
+ typedefs:[UnlinkedTypedef] (id: 10);
/**
* Top level variables declared in the compilation unit.
*/
- @Id(3)
- List<UnlinkedVariable> get variables;
+ variables:[UnlinkedVariable] (id: 3);
}
/**
* Unlinked summary information about a top level variable, local variable, or
* a field.
*/
-abstract class UnlinkedVariable extends base.SummaryClass {
+table UnlinkedVariable {
/**
* Annotations for this variable.
*/
- @Id(8)
- List<UnlinkedConst> get annotations;
+ annotations:[UnlinkedConst] (id: 8);
/**
* If [isConst] is true, and the variable has an initializer, the constant
* expression in the initializer. Note that the presence of this expression
* does not mean that it is a valid, check [UnlinkedConst.isInvalid].
*/
- @Id(5)
- UnlinkedConst get constExpr;
+ constExpr:UnlinkedConst (id: 5);
/**
* Documentation comment for the variable, or `null` if there is no
* documentation comment.
*/
- @informative
- @Id(10)
- UnlinkedDocumentationComment get documentationComment;
+ documentationComment:UnlinkedDocumentationComment (id: 10);
/**
* If this variable is inferable, nonzero slot id identifying which entry in
@@ -2075,27 +1796,23 @@ abstract class UnlinkedVariable extends base.SummaryClass {
* there is no matching entry in [LinkedLibrary.types], then no type was
* inferred for this variable, so its static type is `dynamic`.
*/
- @Id(9)
- int get inferredTypeSlot;
+ inferredTypeSlot:uint (id: 9);
/**
* The synthetic initializer function of the variable. Absent if the variable
* does not have an initializer.
*/
- @Id(13)
- UnlinkedExecutable get initializer;
+ initializer:UnlinkedExecutable (id: 13);
/**
* Indicates whether the variable is declared using the `const` keyword.
*/
- @Id(6)
- bool get isConst;
+ isConst:bool (id: 6);
/**
* Indicates whether the variable is declared using the `final` keyword.
*/
- @Id(7)
- bool get isFinal;
+ isFinal:bool (id: 7);
/**
* Indicates whether the variable is declared using the `static` keyword.
@@ -2104,21 +1821,17 @@ abstract class UnlinkedVariable extends base.SummaryClass {
* declared using the `static` keyword (even though they are considered
* static for semantic purposes).
*/
- @Id(4)
- bool get isStatic;
+ isStatic:bool (id: 4);
/**
* Name of the variable.
*/
- @Id(0)
- String get name;
+ name:string (id: 0);
/**
* Offset of the variable name relative to the beginning of the file.
*/
- @informative
- @Id(1)
- int get nameOffset;
+ nameOffset:uint (id: 1);
/**
* If this variable is propagable, nonzero slot id identifying which entry in
@@ -2128,24 +1841,24 @@ abstract class UnlinkedVariable extends base.SummaryClass {
*
* Non-propagable variables have a [propagatedTypeSlot] of zero.
*/
- @Id(2)
- int get propagatedTypeSlot;
+ propagatedTypeSlot:uint (id: 2);
/**
* Declared type of the variable. Absent if the type is implicit.
*/
- @Id(3)
- EntityRef get type;
+ type:EntityRef (id: 3);
/**
* If a local variable, the length of the visible range; zero otherwise.
*/
- @Id(11)
- int get visibleLength;
+ visibleLength:uint (id: 11);
/**
* If a local variable, the beginning of the visible range; zero otherwise.
*/
- @Id(12)
- int get visibleOffset;
+ visibleOffset:uint (id: 12);
}
+
+root_type PackageBundle;
+
+file_identifier "PBdl";
« no previous file with comments | « no previous file | pkg/analyzer/tool/summary/check_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698