/// <summary> gets a Parser object to parse TokenQuoted.</summary> /// <param name="fc">the mapping to map the quoted string to an object returned by the parser. /// </param> /// <returns> the parser /// </returns> public static Parser <T> OnQuotedWord <T>(FromRange <string, string, string, T> fc) { FromToken <T> recognizer = delegate(Tok tok, ref T result) { object obj = tok.Token; if (obj is TokenQuoted) { TokenQuoted quoted = obj as TokenQuoted; result = fc(tok.Index, tok.Length, quoted.Open, quoted.Quoted, quoted.Close); return(true); } else { return(false); } }; return(Parsers.FromToken(recognizer)); }
public bool Equals(TokenQuoted other) { return(open.Equals(other.open) && close.Equals(other.close) && quoted.Equals(other.quoted)); }
/// <summary> creates a Tokenizer instance that can parse a string quoted by open and close.</summary> /// <param name="open">the opening quote /// </param> /// <param name="close">the closeing quote /// </param> /// <returns> the tokenizer. /// </returns> public static Tokenizer ForQuotedString(string open, string close) { return(TokenQuoted.GetTokenizer(open, close)); }
/// <summary> creates a Tokenizer instance that can parse a string quoted by open and close.</summary> /// <param name="open">the open quote /// </param> /// <param name="close">the close quote /// </param> /// <returns> the tokenizer. /// </returns> public static Tokenizer ForQuotedString(char open, char close) { return(TokenQuoted.GetTokenizer(open, close)); }