Пример #1
0
        public static void Main(string[] args)
        {
            if (args.Length < 1)
            {
                Error("The file to run is the one and only file that should be passed as an argument.");
            }

            if (args[0].StartsWith("-"))
            {
                Error("Invalid filename. Cannot start with \"-\".");
            }

            string code = "";

            try
            {
                code = System.IO.File.ReadAllText(args[0]);
            }
            catch (FileNotFoundException)
            {
                Error("The file you specified does not exist.");
            }

            LoadAssemblies();

            // TODO: add other options to commandline arguments
            ParsingApi.SetDialect(new DefaultDialect());

            Api.Program p = GS.CreateProgram(code);
            GS.Run(p);
        }