16 using System.Collections.Generic;
17 using DynVarManagement;
18 using ErrorManagement;
20 using TargetPlatforms;
22 namespace Inference.Core {
37 public static void Parse(
string[] files,
string outputFileName,
TargetPlatform targetPlatform,
string debugFilePath,
string ilasmFileName,
string typeTableFileName,
bool run,
bool serverOptimization =
false)
42 ConsoleColor previousColor = Console.ForegroundColor;
43 Console.ForegroundColor = ConsoleColor.DarkGray;
44 Console.Error.WriteLine(
"Compiling...");
45 Console.ForegroundColor = previousColor;
46 long startTime = DateTime.Now.Ticks;
50 if (files.Length > 0) {
51 ErrorManager.Instance.ShowInConsole =
true;
54 IDictionary<string, string> directories =
new Dictionary<string, string>();
57 for (
int i = 0; i < files.Length; i++) {
58 if ((File.Exists(files[i])) || (Directory.Exists(files[i])))
59 initApp.LoadFile(
new FileInfo(files[i]), directories);
66 initApp.Run(directories, outputFileName, debugFilePath, ilasmFileName, typeTableFileName, targetPlatform, run, serverOptimization);
71 }
catch (System.Exception e) {
72 Program.ClearMemory();
73 Console.Error.WriteLine(
"Exception: " + e);
74 Console.Error.WriteLine(e.StackTrace);
77 double elapsedTime = ((DateTime.Now.Ticks - startTime) / TimeSpan.TicksPerMillisecond) / 1000.0;
78 previousColor = Console.ForegroundColor;
79 Console.ForegroundColor = ConsoleColor.DarkGray;
80 System.Console.Out.WriteLine(
"Total compilation time: {0} seconds.", elapsedTime);
81 Console.ForegroundColor = previousColor;
Represents the error occurred when the command line arguments specified are incorrect.
static void Parse(string[] files, string outputFileName, TargetPlatform targetPlatform, string debugFilePath, string ilasmFileName, string typeTableFileName, bool run, bool serverOptimization=false)
Compiles a project
System.IO.FileInfo FileInfo
Parsing of a set of files
Represents the error occurred when the file specified does not exist.