public AnalyzerTests() { this.fs = new Pytocs.TypeInference.FakeFileSystem(); this.logger = new FakeLogger(); this.options = new Dictionary <string, object>(); this.nl = Environment.NewLine; this.an = new AnalyzerImpl(fs, logger, options, DateTime.Now); }
public void Setup() { this.fs = new Pytocs.TypeInference.FakeFileSystem(); this.logger = new FakeLogger(); this.options = new Dictionary<string, object>(); this.nl = Environment.NewLine; this.an = new AnalyzerImpl(fs, logger, options, DateTime.Now); }
static void Main(string[] args) { var fs = new FileSystem(); var logger = new ConsoleLogger(); if (args.Length == 0) { var xlator = new Translator("", "module_name", fs, logger); xlator.Translate("-", Console.In, Console.Out); Console.Out.Flush(); return; } if (args[0].ToLower() == "-d") { // org.yinwang.pysonar.demos.Demo.DemoMain(args); return; } if (args[0].ToLower() == "-r") { #if READY_FOR_TYPES var typeAnalysis = new Pytocs.TypeInference.AnalyzerImpl(fs, logger, new Dictionary <string, object>(), DateTime.Now); typeAnalysis.Analyze("."); TranslateModules(typeAnalysis); #else var walker = new DirectoryWalker("*.py"); walker.Enumerate(); #endif } else { foreach (var fileName in args) { var xlator = new Translator( "", Path.GetFileNameWithoutExtension(fileName), new FileSystem(), new ConsoleLogger()); xlator.TranslateFile(fileName, fileName + ".cs"); } } }
static void Main(string[] args) { var fs = new FileSystem(); var logger = new ConsoleLogger(); if (args.Length == 0) { var xlator = new Translator("", "module_name", fs, logger); xlator.Translate("-", Console.In, Console.Out); Console.Out.Flush(); return; } if (args[0].ToLower() == "-d") { // org.yinwang.pysonar.demos.Demo.DemoMain(args); return; } if (args[0].ToLower() == "-r") { #if READY_FOR_TYPES var typeAnalysis = new Pytocs.TypeInference.AnalyzerImpl(fs, logger, new Dictionary<string, object>(), DateTime.Now); typeAnalysis.Analyze("."); TranslateModules(typeAnalysis); #else var walker = new DirectoryWalker("*.py"); walker.Enumerate(); #endif } else { foreach (var fileName in args) { var xlator = new Translator( "", Path.GetFileNameWithoutExtension(fileName), new FileSystem(), new ConsoleLogger()); xlator.TranslateFile(fileName, fileName + ".cs"); } } }
public Builtins(AnalyzerImpl analyzer) { this.analyzer = analyzer; buildTypes(); }
public DataTypeFactory(AnalyzerImpl analyzer) { this.analyzer = analyzer; }