C# Class Pytocs.TypeInference.AnalyzerImpl

Analyzes a directory of Python files, collecting and inferring type information as it parses all the files.
Inheritance: Analyzer
Afficher le fichier Open project: uxmal/pytocs Class Usage Examples

Méthodes publiques

Свойство Type Description
ModuleTable State
options object>.Dictionary

Méthodes publiques

Méthode Description
AddUncalled ( FunType cl ) : void
Analyze ( string path ) : void

Main entry to the analyzer

AnalyzerImpl ( IFileSystem fs, ILogger logger, object>.Dictionary options, System.DateTime startTime ) : System
AnalyzerImpl ( ILogger logger ) : System
ApplyUncalled ( ) : void
CreateBinding ( string id, Node node, DataType type, BindingKind kind ) : Binding
ExtendPath ( string path, string name ) : string
Finish ( ) : void
FormatTime ( System.TimeSpan span ) : string
GetAllBindings ( ) : List
GetDiagnosticsForFile ( string file ) : List
GetModuleBindings ( ) : IEnumerable
GetModuleQname ( string file ) : string
LoadFile ( string path ) : DataType
LoadFileRecursive ( string fullname ) : void

Load all Python source files recursively if the given fullname is a directory; otherwise just load a file. Looks at file extension to determine whether to load a given file.

LoadModule ( List name, State state ) : DataType
MakeQname ( List names ) : string
ModuleName ( string path ) : string

Given an absolute {@code path} to a file (not a directory), returns the module name for the file. If the file is an __init__.py, returns the last component of the file's parent directory, else returns the filename without path or extension.

Percent ( long num, long total ) : string
RegisterBinding ( Binding b ) : void
RemoveUncalled ( FunType f ) : void
ToString ( ) : string
addFileErr ( string file, int begin, int end, string msg ) : void
addPath ( string p ) : void
addPaths ( List p ) : void
addRef ( AttributeAccess attr, DataType targetType, ISet bs ) : void
banner ( string msg ) : string
close ( ) : void
countFileRecursive ( string fullname ) : int

Count number of .py files

getAnalysisSummary ( ) : string
getAstForFile ( string file ) : Module

Returns the syntax tree for {@code file}.

getBuiltinModule ( string qname ) : ModuleType
getLoadPath ( ) : List
getLoadedFiles ( ) : List
getReferences ( ) : List>.Dictionary
hasOption ( string option ) : bool
inImportStack ( object f ) : bool
inStack ( Exp f ) : bool
locateModule ( string headName ) : string

Find the path that contains modname. Used to find the starting point of locating a qname.

msg ( string m ) : void
msg_ ( string m ) : void
popImportStack ( object f ) : void
popStack ( Exp f ) : void
pushImportStack ( object f ) : void
pushStack ( Exp f ) : void
putProblem ( Node loc, string msg ) : void
putProblem ( string file, int begin, int end, string msg ) : void
putRef ( Node node, Binding b ) : void
putRef ( Node node, ICollection bs ) : void
setCWD ( string cd ) : void
setOption ( string option ) : void
setPath ( List path ) : void

Private Methods

Méthode Description
AddPythonPath ( ) : void
CopyModels ( ) : void
CreateCacheDirectory ( ) : void
GetAstCache ( ) : AstCache
GetCachedModule ( string file ) : ModuleType
getFileErrs ( string file, Dictionary map ) : List
parseAndResolve ( string file ) : DataType

Method Details

AddUncalled() public méthode

public AddUncalled ( FunType cl ) : void
cl FunType
Résultat void

Analyze() public méthode

Main entry to the analyzer
public Analyze ( string path ) : void
path string
Résultat void

AnalyzerImpl() public méthode

public AnalyzerImpl ( IFileSystem fs, ILogger logger, object>.Dictionary options, System.DateTime startTime ) : System
fs IFileSystem
logger ILogger
options object>.Dictionary
startTime System.DateTime
Résultat System

AnalyzerImpl() public méthode

public AnalyzerImpl ( ILogger logger ) : System
logger ILogger
Résultat System

ApplyUncalled() public méthode

public ApplyUncalled ( ) : void
Résultat void

CreateBinding() public méthode

public CreateBinding ( string id, Node node, DataType type, BindingKind kind ) : Binding
id string
node Node
type DataType
kind BindingKind
Résultat Binding

ExtendPath() public méthode

public ExtendPath ( string path, string name ) : string
path string
name string
Résultat string

Finish() public méthode

public Finish ( ) : void
Résultat void

FormatTime() public méthode

public FormatTime ( System.TimeSpan span ) : string
span System.TimeSpan
Résultat string

GetAllBindings() public méthode

public GetAllBindings ( ) : List
Résultat List

GetDiagnosticsForFile() public méthode

public GetDiagnosticsForFile ( string file ) : List
file string
Résultat List

GetModuleBindings() public méthode

public GetModuleBindings ( ) : IEnumerable
Résultat IEnumerable

GetModuleQname() public méthode

public GetModuleQname ( string file ) : string
file string
Résultat string

LoadFile() public méthode

public LoadFile ( string path ) : DataType
path string
Résultat DataType

LoadFileRecursive() public méthode

Load all Python source files recursively if the given fullname is a directory; otherwise just load a file. Looks at file extension to determine whether to load a given file.
public LoadFileRecursive ( string fullname ) : void
fullname string
Résultat void

LoadModule() public méthode

public LoadModule ( List name, State state ) : DataType
name List
state State
Résultat DataType

MakeQname() public méthode

public MakeQname ( List names ) : string
names List
Résultat string

ModuleName() public méthode

Given an absolute {@code path} to a file (not a directory), returns the module name for the file. If the file is an __init__.py, returns the last component of the file's parent directory, else returns the filename without path or extension.
public ModuleName ( string path ) : string
path string
Résultat string

Percent() public méthode

public Percent ( long num, long total ) : string
num long
total long
Résultat string

RegisterBinding() public méthode

public RegisterBinding ( Binding b ) : void
b Binding
Résultat void

RemoveUncalled() public méthode

public RemoveUncalled ( FunType f ) : void
f FunType
Résultat void

ToString() public méthode

public ToString ( ) : string
Résultat string

addFileErr() public méthode

public addFileErr ( string file, int begin, int end, string msg ) : void
file string
begin int
end int
msg string
Résultat void

addPath() public méthode

public addPath ( string p ) : void
p string
Résultat void

addPaths() public méthode

public addPaths ( List p ) : void
p List
Résultat void

addRef() public méthode

public addRef ( AttributeAccess attr, DataType targetType, ISet bs ) : void
attr AttributeAccess
targetType DataType
bs ISet
Résultat void

banner() public méthode

public banner ( string msg ) : string
msg string
Résultat string

close() public méthode

public close ( ) : void
Résultat void

countFileRecursive() public méthode

Count number of .py files
public countFileRecursive ( string fullname ) : int
fullname string
Résultat int

getAnalysisSummary() public méthode

public getAnalysisSummary ( ) : string
Résultat string

getAstForFile() public méthode

Returns the syntax tree for {@code file}.

public getAstForFile ( string file ) : Module
file string
Résultat Pytocs.Syntax.Module

getBuiltinModule() public méthode

public getBuiltinModule ( string qname ) : ModuleType
qname string
Résultat ModuleType

getLoadPath() public méthode

public getLoadPath ( ) : List
Résultat List

getLoadedFiles() public méthode

public getLoadedFiles ( ) : List
Résultat List

getReferences() public méthode

public getReferences ( ) : List>.Dictionary
Résultat List>.Dictionary

hasOption() public méthode

public hasOption ( string option ) : bool
option string
Résultat bool

inImportStack() public méthode

public inImportStack ( object f ) : bool
f object
Résultat bool

inStack() public méthode

public inStack ( Exp f ) : bool
f Exp
Résultat bool

locateModule() public méthode

Find the path that contains modname. Used to find the starting point of locating a qname.
public locateModule ( string headName ) : string
headName string first module name segment
Résultat string

msg() public méthode

public msg ( string m ) : void
m string
Résultat void

msg_() public méthode

public msg_ ( string m ) : void
m string
Résultat void

popImportStack() public méthode

public popImportStack ( object f ) : void
f object
Résultat void

popStack() public méthode

public popStack ( Exp f ) : void
f Exp
Résultat void

pushImportStack() public méthode

public pushImportStack ( object f ) : void
f object
Résultat void

pushStack() public méthode

public pushStack ( Exp f ) : void
f Exp
Résultat void

putProblem() public méthode

public putProblem ( Node loc, string msg ) : void
loc Node
msg string
Résultat void

putProblem() public méthode

public putProblem ( string file, int begin, int end, string msg ) : void
file string
begin int
end int
msg string
Résultat void

putRef() public méthode

public putRef ( Node node, Binding b ) : void
node Node
b Binding
Résultat void

putRef() public méthode

public putRef ( Node node, ICollection bs ) : void
node Node
bs ICollection
Résultat void

setCWD() public méthode

public setCWD ( string cd ) : void
cd string
Résultat void

setOption() public méthode

public setOption ( string option ) : void
option string
Résultat void

setPath() public méthode

public setPath ( List path ) : void
path List
Résultat void

Property Details

ModuleTable public_oe property

public State,Pytocs.TypeInference ModuleTable
Résultat State

options public_oe property

public Dictionary options
Résultat object>.Dictionary