@classmethod<EOL><INDENT>def from_ast_file(cls, filename, index=None):<DEDENT>
if index is None:<EOL><INDENT>index = Index.create()<EOL><DEDENT>ptr = conf.lib.clang_createTranslationUnit(index, filename)<EOL>if not ptr:<EOL><INDENT>raise TranslationUnitLoadError(filename)<EOL><DEDENT>return cls(ptr=ptr, index=index)<EOL>
Create a TranslationUnit instance from a saved AST file.

        A previously-saved AST file (provided with -emit-ast or
        TranslationUnit.save()) is loaded from the filename specified.

        If the file cannot be loaded, a TranslationUnitLoadError will be
        raised.

        index is optional and is the Index instance to use. If not provided,
        a default Index will be created.