C# Класс Pytocs.TypeInference.AstCache

Provides a factory for python source ASTs. Maintains configurable on-disk and in-memory caches to avoid re-parsing files during analysis.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AstCache ( Analyzer analyzer, IFileSystem fs, ILogger logger, string cacheDir ) : Pytocs.Syntax
Clear ( ) : void

Clears the memory cache.

clearDiskCache ( ) : bool

Removes all serialized ASTs from the on-disk cache.

close ( ) : void
getAST ( string path ) : Module

Returns the syntax tree for path. May find and/or create a cached copy in the mem cache or the disk cache. Absolute path to a source file. The AST, or null if the parse failed for any reason

getCachePath ( string sourcePath ) : string

Each source file's AST is saved in an object file named for the MD5 checksum of the source file. All that is needed is the MD5, but the file's base name is included for ease of debugging.

Приватные методы

Метод Описание
GetSerializedModule ( string sourcePath ) : Module
deserialize ( string sourcePath ) : Module

Описание методов

AstCache() публичный Метод

public AstCache ( Analyzer analyzer, IFileSystem fs, ILogger logger, string cacheDir ) : Pytocs.Syntax
analyzer Analyzer
fs IFileSystem
logger ILogger
cacheDir string
Результат Pytocs.Syntax

Clear() публичный Метод

Clears the memory cache.
public Clear ( ) : void
Результат void

clearDiskCache() публичный Метод

Removes all serialized ASTs from the on-disk cache.
public clearDiskCache ( ) : bool
Результат bool

close() публичный Метод

public close ( ) : void
Результат void

getAST() публичный Метод

Returns the syntax tree for path. May find and/or create a cached copy in the mem cache or the disk cache. Absolute path to a source file. The AST, or null if the parse failed for any reason
public getAST ( string path ) : Module
path string
Результат Pytocs.Syntax.Module

getCachePath() публичный Метод

Each source file's AST is saved in an object file named for the MD5 checksum of the source file. All that is needed is the MD5, but the file's base name is included for ease of debugging.
public getCachePath ( string sourcePath ) : string
sourcePath string
Результат string