public void Execute(string sourceLocation) { //--- Open the input source file. StreamReader infile; try { infile = new StreamReader(sourceLocation); //--- Do what you gotta do! PALParser parser = new PALParser(new PALScanner()); parser.Parse(infile); foreach (ICompilerError err in parser.Errors) { ErrorsForTests.Add(err.ToString()); Console.WriteLine(err); } infile.Close(); } catch (IOException e) { Console.WriteLine(e.Message); return; } }
//--- The Compiler body. private void start() { PALParser parser = new PALParser(); parser.Parse(source); foreach (ICompilerError err in parser.Errors) { Console.WriteLine(err); } } // end start method.