示例#1
0
        public static void Main(string[] args)
        {
            //parse the args and catch errors
            try
            {
                ParseArgsResult parseArgsResult = ParseArgs(args);

                //run the interpreter and catch errors
                try
                {
                    var interpreter = new BlueprintInterpreter(parseArgsResult.langFactory);
                    interpreter.InterpretBlueprint(parseArgsResult.inFile, parseArgsResult.outDir);
                }
                catch (BlueprintInterpreter.InterpreterParseException e)
                {
                    Console.WriteLine("Interpreter Parse Error: " + e.Message);
                }
                catch (BlueprintInterpreter.BlueprintSchemaValidationException e)
                {
                    Console.WriteLine("Blueprint Schema Validation Error: " + e.Message);
                }

                Console.WriteLine("Completed Successfully. Output files in " + parseArgsResult.outDir);
            }
            catch (ParseArgsException e)
            {
                Console.WriteLine("Command Line Argument Error: " + e.Message);
            }

            //wait for user to exit program
            Console.WriteLine();
            Console.WriteLine("Press enter to exit...");
            Console.ReadLine();
        }
示例#2
0
        protected AccessModifier GetAccessModifierFromExtraParams(
            Dictionary <string, string> extraParams, AccessModifier defaultValue)
        {
            string accessModifierStr;

            if (!extraParams.TryGetValue("accessModifier", out accessModifierStr))
            {
                return(defaultValue);
            }

            return(BlueprintInterpreter.ParseAccessModifier(accessModifierStr));
        }