You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
788 B

  1. using System;
  2. using System.IO;
  3. namespace SuperBASIC
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. try
  10. {
  11. Library lib = new Library();
  12. lib.AddFunction(new Functions.MemoryLoad(), 1, "MEMLOAD");
  13. lib.AddFunction(new Functions.MemoryStore(), 2, "MEMSTORE");
  14. lib.AddFunction(new Functions.Print(), 1, "PRINT");
  15. lib.AddFunction(new Functions.Multiply(), 2, "MULTIPLY");
  16. lib.AddFunction(new Functions.Compare(), 2, "COMPARE");
  17. lib.AddFunction(new Functions.Pi(), 0, "PI");
  18. lib.AddFunction(new Functions.Euler(), 0, "EULER");
  19. Runtime r = new Runtime(lib);
  20. r.OpenFile(Directory.GetCurrentDirectory() + "\\Test.basic");
  21. r.Run();
  22. } catch (Parser.ParseException e)
  23. {
  24. Console.WriteLine($"Parsing failed:\n{e}");
  25. }
  26. }
  27. }
  28. }