/*

//[diagram:AL-IV_compiler.dia]

CLASS {AL4_compiler|_main}, UNTESTED :

IMPORT: {Compiler}, {Console}, {Localize_str}, 
		{System_functions}, {String_functions} ;
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AL4Compiler
{
    class Program
    {
        /*
        
        FUNCTION Main|_compiler :
			//DEBUG: << "run compiler"#NL ;
            c|ompiler_temp = {Compiler}
            c.Compile
            CASE c.Ok2 ? ==> ;
            Console_colors({colors}.'WHITE', {colors}.'GREEN')
            CASE ?
            [c.Errors_count > 0] ?
                 Console_colors({colors}.'YELLOW', {colors}.'RED')
                 STR mes|sage_may_be_localized
                 mes = "FAILED - press ENTER (twice)..."._Mfail2ce
                 << mes repeat(" ", 80 - mes.Len) >>
                 CASE "linux" !IN Platform_info.Lower ? >> ;
            ELSE 
            	 mes = "OK! press ENTER..."._Mok
            	 << mes repeat(" ", 80 - mes.Len)
                 CASE !c.Ok ? >> ;
            ;
            Console_colors({colors}.'SILVER', {colors}.'BLACK') .
            
   		FUN repeat|_symbols(STR S|ymbol_to_repeat, INT Count|_repeat) ==> STR:
			FOR i|dummy IN [1 TO Count]: RESULT = RESULT S ; .
        */
        static void Main(string[] args)
        {
            try
            {
                Compiler C = new Compiler();
                C.Compile();
                if (C.Errors_count > 0)
                {
                    Console.Write("press ENTER...");
                    Console.ReadLine();
                }
                else
                {
                    Console.Write("OK! press ENTER...");
                    if  (!C.Ok_warn)
                        Console.ReadLine();
                }
            }
            catch (Compiler.STOP s)
            {
                Console.WriteLine("STOPPED: " + s.Stop_message);
                Console.ReadLine();
            }
        }

    }
}
/*
END
*/


