Interface SourceAst

  • All Known Implementing Classes:
    JsAst, RecoverableJsAst

    public interface SourceAst
    An interface for accessing the AST root of an input.
    • Method Detail

      • getAstRoot

        Node getAstRoot​(AbstractCompiler compiler)
        Gets the root node of the AST for the source file this represents. The AST is lazily instantiated and cached. This node is always non-null, even in the case of parse errors.
      • clearAst

        void clearAst()
        Removes any references to root node of the AST. If it is requested again, another parse will be performed. This method is needed to allow the ASTs to be garbage collected if the inputs are still around after compilation.
      • getInputId

        InputId getInputId()
        Returns:
        The input id associated with this AST
      • getSourceFile

        SourceFile getSourceFile()
        Returns the source file the generated AST represents.