public static void Main(string[] args) { string path = ""; if (args.Length > 0) { if (args[0].Contains(":")) { path = args[0]; } else { path = Directory.GetCurrentDirectory() + "\\" + args[0]; } } else { Console.WriteLine("Choose file to run: "); string line = Console.ReadLine(); if (line.Contains(":")) { path = line; } else { path = Directory.GetCurrentDirectory() + "\\" + line; } } //path = Directory.GetCurrentDirectory()+"\\test.~-"; string inputText = ""; try{ inputText = File.ReadAllText(path); } catch { Console.WriteLine("File not found."); return; } PolyglosProgram prog = new PolyglosProgram(inputText); prog.RunProgram(); /*Glos cGlos = new Glos("pes", GlosLang.C, "#include <stdio.h>\nint main(int argc,char *argv[]){printf(\"Hello!\");}"); * cGlos.CreateFile(); * cGlos.RunFile(); * cGlos.ReadOutput();*/ }
public PolyglosProgram(string program) { curr = this; this.program = program; }