Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 public object VisitProgramStart(ProgramStart basetype)
 {
     foreach (Declaration item in basetype.declarations)
     {
         item.Accept(this);
     }
     return(basetype);
 }
Esempio n. 3
0
 public string VisitProgramStart(ProgramStart basetype)
 {
     //TODO: Add neccesary c++ code
     string contents = "";
     foreach (Declaration item in basetype.declarations)
     {
         contents += item.Accept(this);
     }
     return contents;
 }
Esempio n. 4
0
 public void Parse()
 {
     Root = CreateProgram();
 }
Esempio n. 5
0
 /// <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;
 }
Esempio n. 6
0
 public string VisitProgramStart(ProgramStart basetype)
 {
     return(Parenthesize("Program", basetype.declarations.ToArray()));
 }