예제 #1
0
        static void Main(string[] args)
        {
            try
            {
                // instantiate new builder engine
                BuildEngine b = new BuildEngine();

                // if we have cmd line input, then must be a file
                if (args.Length > 0)
                {

                    // check for file extension

                    // construct a string command
                    string cmd = "INCLUDETHIS " + args[0];

                    // send command to be parsed
                    b.Parse(cmd);

                }
                else
                {

                    // feedback for interactive
                    Console.WriteLine("dbb interactive (? for help)");

                    // continuous loop for input
                    while (true)
                    {

                        // input lead in
                        Console.Write("> ");

                        // capture input
                        string input = Console.ReadLine();

                        // send to be parsed
                        b.Parse(input);

                    }
                }

                // clean up any open resources
                b.CleanUp();

            }
            catch (Exception ex)
            {

                // unexpected error
                UI.Feedback("ERROR", ex.Message);
                Environment.Exit(1);

            }
        }
예제 #2
0
        static void Main(string[] args)
        {
            try
            {
                // instantiate new builder engine
                BuildEngine b = new BuildEngine();

                // if we have cmd line input, then must be a file
                if (args.Length > 0)
                {
                    // check for file extension

                    // construct a string command
                    string cmd = "INCLUDETHIS " + args[0];

                    // send command to be parsed
                    b.Parse(cmd);
                }
                else
                {
                    // feedback for interactive
                    Console.WriteLine("dbb interactive (? for help)");

                    // continuous loop for input
                    while (true)
                    {
                        // input lead in
                        Console.Write("> ");

                        // capture input
                        string input = Console.ReadLine();

                        // send to be parsed
                        b.Parse(input);
                    }
                }

                // clean up any open resources
                b.CleanUp();
            }
            catch (Exception ex)
            {
                // unexpected error
                UI.Feedback("ERROR", ex.Message);
                Environment.Exit(1);
            }
        }