Exemple #1
0
            /// <summary>
            /// Returns an instance of <see cref="HttpHeaderValueLexer"/> to parse the rest of the items on the header value.
            /// Parsing is based on this grammar:
            ///     header     = "header-name" ":" 1#element
            ///     element    = token [ BWS "=" BWS (token | quoted-string) ]
            ///                  *( OWS ";" [ OWS parameter ] )
            ///     parameter  = token [ BWS "=" BWS (token | quoted-string) ]
            /// </summary>
            /// <returns>Returns an instance of <see cref="HttpHeaderValueLexer"/> to parse the rest of the items on the header value.</returns>
            internal override HttpHeaderValueLexer ReadNext()
            {
                DebugUtils.CheckNoExternalCallers();
                if (this.EndOfHeaderValue())
                {
                    return(HttpHeaderEnd.Instance);
                }

                HttpHeaderSeparator separator = this.ReadNextSeparator();

                // ',' and ';' can come after a quoted-string.
                if (separator.Value == ElementSeparator || separator.Value == ParameterSeparator)
                {
                    return(separator);
                }

                throw new ODataException(Strings.HttpHeaderValueLexer_InvalidSeparatorAfterQuotedString(this.httpHeaderName, this.httpHeaderValue, this.startIndexOfNextItem, separator.Value));
            }