|
| 1 | +namespace EZCodeLanguage |
| 2 | +{ |
| 3 | + public class EZCode |
| 4 | + { |
| 5 | + public static string Version = "3.0.0-beta"; |
| 6 | + public static void RunFileWithMain(string file) |
| 7 | + { |
| 8 | + Parser parser = new Parser(new FileInfo(Path.GetFullPath(file))); |
| 9 | + parser = Package.ReturnParserWithPackages(parser, ["main"]); |
| 10 | + Interpreter interpreter = new Interpreter(parser); |
| 11 | + interpreter.Interperate(); |
| 12 | + } |
| 13 | + public static void RunFile(string file) |
| 14 | + { |
| 15 | + Parser parser = new Parser(new FileInfo(Path.GetFullPath(file))); |
| 16 | + parser.Parse(); |
| 17 | + Interpreter interpreter = new Interpreter(parser); |
| 18 | + interpreter.Interperate(); |
| 19 | + } |
| 20 | + public static void DebugFile(Debug.Breakpoint[] breakpoints, string file) |
| 21 | + { |
| 22 | + Parser parser = new Parser(new FileInfo(Path.GetFullPath(file))); |
| 23 | + parser.Parse(); |
| 24 | + Interpreter interpreter = new Interpreter(parser, breakpoints); |
| 25 | + interpreter.Interperate(); |
| 26 | + } |
| 27 | + public static void RunCode(string code, string path = "Running from inside program") |
| 28 | + { |
| 29 | + Parser parser = new Parser(code, path); |
| 30 | + parser.Parse(); |
| 31 | + Interpreter interpreter = new Interpreter(parser); |
| 32 | + interpreter.Interperate(); |
| 33 | + } |
| 34 | + public static void RunCodeWithMain(string code, string path = "Running from inside program") |
| 35 | + { |
| 36 | + Parser parser = new Parser(code, path); |
| 37 | + parser = Package.ReturnParserWithPackages(parser, ["main"]); |
| 38 | + Interpreter interpreter = new Interpreter(parser); |
| 39 | + interpreter.Interperate(); |
| 40 | + } |
| 41 | + public static void DebugCodeWithMain(Debug.Breakpoint[] breakpoints, string code, string path = "Running from inside program") |
| 42 | + { |
| 43 | + Parser parser = new Parser(code, path); |
| 44 | + parser = Package.ReturnParserWithPackages(parser, ["main"]); |
| 45 | + Interpreter interpreter = new Interpreter(parser, breakpoints); |
| 46 | + interpreter.Interperate(); |
| 47 | + } |
| 48 | + public static void RunProject(string path) |
| 49 | + { |
| 50 | + ProjectClass project = Project.GetProjectFromPath(path); |
| 51 | + Project.Run(project); |
| 52 | + } |
| 53 | + public static void DebugProject(Debug.Breakpoint[] breakpoints, string path) |
| 54 | + { |
| 55 | + ProjectClass project = Project.GetProjectFromPath(path); |
| 56 | + Parser par = Project.GetParserFromProject(project); |
| 57 | + Interpreter interpreter = new Interpreter(par, breakpoints); |
| 58 | + interpreter.Interperate(); |
| 59 | + } |
| 60 | + } |
| 61 | +} |
0 commit comments