C# Class 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.
Afficher le fichier Open project: uxmal/pytocs Class Usage Examples

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
GetSerializedModule ( string sourcePath ) : Module
deserialize ( string sourcePath ) : Module

Method Details

AstCache() public méthode

public AstCache ( Analyzer analyzer, IFileSystem fs, ILogger logger, string cacheDir ) : Pytocs.Syntax
analyzer Analyzer
fs IFileSystem
logger ILogger
cacheDir string
Résultat Pytocs.Syntax

Clear() public méthode

Clears the memory cache.
public Clear ( ) : void
Résultat void

clearDiskCache() public méthode

Removes all serialized ASTs from the on-disk cache.
public clearDiskCache ( ) : bool
Résultat bool

close() public méthode

public close ( ) : void
Résultat void

getAST() public méthode

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
Résultat Pytocs.Syntax.Module

getCachePath() public méthode

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
Résultat string