public Tuple <string, string[]> Match(string input) { var value = null as string; var match = null as string; var found = Lexicals. Where ( lexical => { if (((match = lexical.Match(input)) != null) && (match.Length > 0)) { if (lexical.IsLiteral || !Literals.Contains(match)) { value = value ?? match; return(match == value); } } return(false); } ). Select(lexical => lexical.Lhs). ToArray(); return(Tuple.Create(value, found)); }