/// <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); }
/// <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) { }