17 using System.Collections.Generic;
18 using ErrorManagement;
19 using System.Windows.Forms;
20 using TargetPlatforms;
22 namespace Inference.Core {
26 static void Main(
string[] args) {
28 long startTime = DateTime.Now.Ticks;
29 ConsoleColor previousColor;
34 if (args.Length > 0) {
36 previousColor = Console.ForegroundColor;
37 Console.ForegroundColor = ConsoleColor.DarkGray;
38 Console.Error.WriteLine(
"Compiling...");
39 Console.ForegroundColor = previousColor;
43 IDictionary<string, string> directories =
new Dictionary<string, string>();
46 for (
int i = 0; i < args.Length; i++) {
47 if ((File.Exists(args[i])) || (Directory.Exists(args[i])))
48 initApp.LoadFile(
new FileInfo(args[i]), directories);
56 initApp.Run(directories, null, Application.StartupPath+
"\\Tests\\",
57 "ilasm.exe",
"TypeTable.txt", TargetPlatform.CLR,
false,
false);
61 }
catch (System.Exception e) {
62 Console.Error.WriteLine(
"Exception: " + e);
63 Console.Error.WriteLine(e.StackTrace);
66 double elapsedTime = ((DateTime.Now.Ticks - startTime) / TimeSpan.TicksPerMillisecond) / 1000.0;
67 previousColor = Console.ForegroundColor;
68 Console.ForegroundColor = ConsoleColor.DarkGray;
69 System.Console.Out.WriteLine(
"\n\nTotal compilation time was {0} seconds.", elapsedTime);
70 Console.ForegroundColor = previousColor;
Represents the error occurred when the command line arguments specified are incorrect.
System.IO.FileInfo FileInfo
Represents the error occurred when the file specified does not exist.