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.
파일 보기 프로젝트 열기: uxmal/pytocs 1 사용 예제들

공개 메소드들

메소드 설명
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