Analyze() public method

Main entry to the analyzer
public Analyze ( string path ) : void
path string
return void
Esempio n. 1
0
        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");
                }
            }
        }
Esempio n. 2
0
        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");
                }
            }
        }
Esempio n. 3
0
 public void TypeAn_Empty()
 {
     an.Analyze("\\foo");
 }
Esempio n. 4
0
 public void Empty()
 {
     an.Analyze("\\foo");
 }