Beispiel #1
0
        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;
            }
        }
Beispiel #2
0
    //--- 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.