/// <summary> /// Parses the first matching item. /// </summary> public static TParser ParseFirst <TParser>(this Parser <LexicalToken, TParser> parser, string text, bool alwaysProduceEOF = false) { return(ParseFirst(parser, TokenParser.ParseTokens(text, alwaysProduceEOF))); }
/// <summary> /// Scans the first matching item. /// </summary> public static int ScanFirst(this Parser <LexicalToken> parser, string text, bool alwaysProduceEOF = false) { var source = new ArraySource <LexicalToken>(TokenParser.ParseTokens(text, alwaysProduceEOF)); return(parser.Scan(source, 0)); }
/// <summary> /// Repeatedly parses all matching items. /// </summary> public static IEnumerable <TParser> ParseAll <TParser>(this Parser <LexicalToken, TParser> parser, string text, bool alwaysProduceEndToken = false) { return(ParseAll(parser, TokenParser.ParseTokens(text, alwaysProduceEndToken))); }