Class TypedAstDeserializer
java.lang.Object
com.google.javascript.jscomp.serialization.TypedAstDeserializer
Deserializes a list of TypedAst protos into the JSCompiler AST structure.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe result of deserializing a TypedAst.List -
Method Summary
Modifier and TypeMethodDescriptiondeserializeFullAst(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 ASTdeserializeRuntimeLibraries(AbstractCompiler compiler, SourceFile syntheticExterns, com.google.common.base.Optional<ColorPool.Builder> colorPool, InputStream typedAstsStream, boolean resolveSourceMapAnnotations, boolean parseInlineSourceMaps) Transforms the special runtime library TypedAst
-
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.
-