Provides a factory for python source ASTs. Maintains configurable on-disk and in-memory caches to avoid re-parsing files during analysis.
Пример #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);
            }
        }
Пример #2
0
 private AstCache GetAstCache()
 {
     if (astCache == null)
     {
         astCache = new AstCache(this, FileSystem, logger, cacheDir);
     }
     return(astCache);
 }
Пример #3
0
 private AstCache GetAstCache()
 {
     if (astCache == null)
         astCache = new AstCache(this, FileSystem, logger, cacheDir);
     return astCache;
 }