Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Verify"/> class.
 /// </summary>
 /// <param name="options">The options.</param>
 public VerifyAssembly(Verify verify, VerificationOptions options, IMetadataModule module)
 {
     this.Verify = verify;
     this.Options = options;
     this.Module = module;
     this.Metadata = Module.Metadata;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Verify"/> class.
        /// </summary>
        /// <param name="options">The options.</param>
        public Verify(VerificationOptions options)
        {
            this.options = options;
            assemblyLoader = new AssemblyLoader();

            assemblyLoader.AddPrivatePath(Path.GetDirectoryName(options.InputFile));
            assemblyLoader.InitializePrivatePaths(options.Paths);
            assemblyLoader.LoadModule(options.InputFile);

            HasError = false;
        }
Ejemplo n.º 3
0
 public static bool Parse(VerificationOptions options, string[] args)
 {
     foreach (string arg in args)
     {
         switch (arg.ToLower())
         {
             case "/ml":
                 options.MetadataValidation = true; break;
             case "/il":
                 options.ILValidation = true; break;
             case "/warnings":
             case "/w":
                 options.IncludingWarnings = true; break;
             default:
                 options.InputFile = arg; break;
         }
     }
     return true;
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Main entry point for the compiler.
        /// </summary>
        /// <param name="args">The command line arguments.</param>
        internal static int Main(string[] args)
        {
            Console.WriteLine();
            Console.WriteLine("Verifier v0.1 [www.mosa-project.org]");
            Console.WriteLine("Copyright 2011. New BSD License.");
            Console.WriteLine("Written by Philipp Garcia ([email protected])");
            Console.WriteLine();

            VerificationOptions options = new VerificationOptions();

            bool valid = ParseOptions.Parse(options, args);

            if (!valid)
            {
                Console.WriteLine("Usage: Verifier <options: /il /ml> <assembly>");
                Console.WriteLine("ERROR: Incorrect arguments");
                return -1;
            }

            Console.WriteLine("Verifying assembly...");

            Verify verify = new Verify(options);
            verify.Run();

            if (!verify.HasError)
                return 0;

            Console.WriteLine();
            Console.WriteLine("Errors:");
            Console.WriteLine();

            foreach (VerificationEntry entry in verify.Entries)
                Console.WriteLine(entry.ToString());

            return -1;
        }