internal static bool TryParse (string input, int minimalCount, out List<ProductInfoHeaderValue> result)
{
var list = new List<ProductInfoHeaderValue> ();
var lexer = new Lexer (input);
result = null;
while (true) {
ProductInfoHeaderValue element;
if (!TryParseElement (lexer, out element))
return false;
if (element == null) {
if (list != null && minimalCount <= list.Count) {
result = list;
return true;
}
return false;
}
list.Add (element);
// Separator parsing
switch (lexer.PeekChar ()) {
case ' ':
case '\t':
lexer.EatChar ();
continue;
case -1:
if (minimalCount <= list.Count) {
result = list;
return true;
}
break;
}
return false;
}
}