예제 #1
0
파일: CommandLine.cs 프로젝트: sebgod/hime
        /// <summary>
        /// Parses the command line arguments
        /// </summary>
        /// <param name="args">The command line arguments</param>
        /// <returns>The parsed line as an AST, or null if the parsing failed</returns>
        public static ParseResult ParseArguments(string[] args)
        {
            StringBuilder builder = new StringBuilder();

            foreach (string arg in args)
            {
                builder.Append(" ");
                builder.Append(arg);
            }
            CommandLineLexer  lexer  = new CommandLineLexer(builder.ToString());
            CommandLineParser parser = new CommandLineParser(lexer);
            ParseResult       result = parser.Parse();

            return(result);
        }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the parser
 /// </summary>
 /// <param name="lexer">The input lexer</param>
 public CommandLineParser(CommandLineLexer lexer) : base(commonAutomaton, variables, virtuals, null, lexer)
 {
 }