示例#1
0
        private int Run(string[] args)
        {
            ArgumentSyntax syntax = ParseCommandLine(args);

            if (_help)
            {
                Help(syntax.GetHelpText());
                return(1);
            }

            if (_inputFilePaths.Count == 0)
            {
                throw new CommandLineException("No input files specified");
            }

            _typeSystemContext = new SimpleTypeSystemContext();
            _typeSystemContext.InputFilePaths     = _inputFilePaths;
            _typeSystemContext.ReferenceFilePaths = _referenceFilePaths;

            _typeSystemContext.SetSystemModule(_typeSystemContext.GetModuleForSimpleName(SystemModuleSimpleName));

            foreach (var inputPath in _inputFilePaths.Values)
            {
                _numErrors = 0;

                VerifyModule(_typeSystemContext.GetModuleFromPath(inputPath));

                if (_numErrors > 0)
                {
                    Console.WriteLine(_numErrors + " Error(s) Verifying " + inputPath);
                }
                else
                {
                    Console.WriteLine("All Classes and Methods in " + inputPath + " Verified.");
                }
            }

            return(0);
        }