Provides a factory for python source ASTs. Maintains configurable on-disk and in-memory caches to avoid re-parsing files during analysis.
Exemplo n.º 1
0
        public AnalyzerImpl(IFileSystem fs, ILogger logger, Dictionary <string, object> options, DateTime startTime)
        {
            this.FileSystem  = fs;
            this.logger      = logger;
            this.TypeFactory = new DataTypeFactory(this);
            this.GlobalTable = new State(null, State.StateType.GLOBAL);
            this.Resolved    = new HashSet <Name>();
            this.Unresolved  = new HashSet <Name>();
            this.References  = new Dictionary <Node, List <Binding> >();

            if (options != null)
            {
                this.options = options;
            }
            else
            {
                this.options = new Dictionary <string, object>();
            }
            this.startTime = startTime;
            this.suffix    = ".py";
            this.Builtins  = new Builtins(this);
            this.Builtins.Initialize();
            AddPythonPath();
            CopyModels();
            CreateCacheDirectory();
            if (astCache == null)
            {
                astCache = new AstCache(this, FileSystem, logger, cacheDir);
            }
        }
Exemplo n.º 2
0
 private AstCache GetAstCache()
 {
     if (astCache == null)
     {
         astCache = new AstCache(this, FileSystem, logger, cacheDir);
     }
     return(astCache);
 }
Exemplo n.º 3
0
 private AstCache GetAstCache()
 {
     if (astCache == null)
         astCache = new AstCache(this, FileSystem, logger, cacheDir);
     return astCache;
 }