Class TypedAstDeserializer

java.lang.Object
com.google.javascript.jscomp.serialization.TypedAstDeserializer

public final class TypedAstDeserializer extends Object
Deserializes a list of TypedAst protos into the JSCompiler AST structure.
  • Method Details

    • deserializeFullAst

      public static TypedAstDeserializer.DeserializedAst deserializeFullAst(AbstractCompiler compiler, SourceFile syntheticExterns, com.google.common.collect.ImmutableSet<SourceFile> requiredInputFiles, InputStream typedAstsStream, boolean includeTypeInformation, boolean resolveSourceMapAnnotations, boolean parseInlineSourceMaps)
      Transforms a given TypedAst delimited stream into a compiler AST
      Parameters:
      requiredInputFiles - All SourceFiles that should go into the typedAstFilesystem. If a TypedAst contains a file not in this set, that file will not be added to the typedAstFilesystem to avoid wasting memory.
      includeTypeInformation - Whether to deserialize the "Typed" half of a "TypedAst". If false ignores the TypePool, any TypePointers on AstNodes, and does not create a ColorRegistry.
      resolveSourceMapAnnotations - Whether to create and register a SourceMapInput for a given `//# sourceMappingURL` (stored in LazyAst) when deserializing.
      parseInlineSourceMaps - Whether a given `//# sourceMappingURL` should be registered as a Base64 encoded source map.
    • deserializeRuntimeLibraries

      public static TypedAstDeserializer.DeserializedAst deserializeRuntimeLibraries(AbstractCompiler compiler, SourceFile syntheticExterns, com.google.common.base.Optional<ColorPool.Builder> colorPool, InputStream typedAstsStream, boolean resolveSourceMapAnnotations, boolean parseInlineSourceMaps)
      Transforms the special runtime library TypedAst
      Parameters:
      colorPool - a ColorPool.Builder holding the colors on the full AST. We want to merge these colors with the runtime library colors to allow injecting runtime libraries without re-typechecking them.