public void Compile(string filePath, ProgramStart programStart) { Root = programStart; string contents = VisitProgramStart(Root); File.WriteAllText(filePath, contents); System.Diagnostics.Process.Start("code", filePath); Console.WriteLine("File Created: " + filePath); }
public object VisitProgramStart(ProgramStart basetype) { foreach (Declaration item in basetype.declarations) { item.Accept(this); } return(basetype); }
public string VisitProgramStart(ProgramStart basetype) { //TODO: Add neccesary c++ code string contents = ""; foreach (Declaration item in basetype.declarations) { contents += item.Accept(this); } return contents; }
public void Parse() { Root = CreateProgram(); }
/// <summary> /// The constructor of the interpreter /// </summary> /// <param name="root">The place to start interpreting from</param> public Interpreter(ProgramStart root) { Root = root; CurrentClass = null; CurrentMethod = null; }
public string VisitProgramStart(ProgramStart basetype) { return(Parenthesize("Program", basetype.declarations.ToArray())); }