Program.cs 916 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using System.IO;
  3. namespace NTERA.Compiler
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string path = args.Length > 0
  10. ? Path.GetFullPath(args[0])
  11. : Environment.CurrentDirectory;
  12. string outputPath = Path.Combine(path, "output");
  13. int threads = 8;
  14. if (!Directory.Exists(outputPath))
  15. Directory.CreateDirectory(outputPath);
  16. Console.WriteLine($"NTERA {typeof(Program).Assembly.GetName().Version}");
  17. Console.WriteLine("-------------------------");
  18. Console.WriteLine($"Compiling '{path}' to '{outputPath}'");
  19. Console.WriteLine($"Using {threads} threads");
  20. Compiler compiler = new Compiler(path, threads);
  21. compiler.Compile(outputPath);
  22. Console.WriteLine();
  23. Console.WriteLine($"{compiler.DeclaredProcedures.Count} total functions");
  24. Console.WriteLine($"{compiler.Errors.Count} errors");
  25. Console.WriteLine("Report written");
  26. }
  27. }
  28. }