Class TypedAstDeserializer


  • @GwtIncompatible("protobuf.lite")
    public final class TypedAstDeserializer
    extends java.lang.Object
    Deserializes a list of TypedAst protos into the JSCompiler AST structure.
    • Method Detail

      • deserializeFullAst

        public static TypedAstDeserializer.DeserializedAst deserializeFullAst​(AbstractCompiler compiler,
                                                                              SourceFile syntheticExterns,
                                                                              com.google.common.collect.ImmutableList<SourceFile> existingSourceFiles,
                                                                              java.io.InputStream typedAstsStream)
        Transforms a given TypedAst.List stream into a compiler AST
        Parameters:
        existingSourceFiles - TypedAst nodes referencing a named SourceFile in this list will use the SourceFile object rather than creating a new SourceFile instance. AST references to SourceFiles not in this list will always create new SourceFile instances.
      • deserializeRuntimeLibraries

        public static TypedAstDeserializer.DeserializedAst deserializeRuntimeLibraries​(AbstractCompiler compiler,
                                                                                       SourceFile syntheticExterns,
                                                                                       ColorPool.Builder colorPool,
                                                                                       java.io.InputStream typedAstsStream)
        Transforms the special runtime library TypedAst
        Parameters:
        colorPoolBuilder - 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.