/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-EncodingDecl. /// </summary> /// <param name="c">The next input character.</param> /// <param name="decl">The current declaration token.</param> XmlToken DeclarationEncodingAfterName(Char c, XmlDeclarationToken decl) { while (c.IsSpaceCharacter()) c = GetNext(); if (c == Symbols.Equality) return DeclarationEncodingBeforeValue(GetNext(), decl); throw XmlParseError.XmlDeclarationInvalid.At(GetCurrentPosition()); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-VersionInfo. /// </summary> /// <param name="c">The next input character.</param> /// <param name="decl">The current declaration token.</param> XmlToken DeclarationVersionBeforeValue(Char c, XmlDeclarationToken decl) { while (c.IsSpaceCharacter()) c = GetNext(); if (c == Symbols.DoubleQuote || c == Symbols.SingleQuote) return DeclarationVersionValue(GetNext(), c, decl); throw XmlParseError.XmlDeclarationInvalid.At(GetCurrentPosition()); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-SDDecl. /// </summary> /// <param name="decl">The current declaration token.</param> XmlToken DeclarationStandaloneAfterName(XmlDeclarationToken decl) { var c = SkipSpaces(); if (c != Symbols.Equality) { throw XmlParseError.XmlDeclarationInvalid.At(GetCurrentPosition()); } return(DeclarationStandaloneBeforeValue(decl)); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-SDDecl. /// </summary> /// <param name="decl">The current declaration token.</param> XmlToken DeclarationStandaloneBeforeValue(XmlDeclarationToken decl) { var c = SkipSpaces(); if (c != Symbols.DoubleQuote && c != Symbols.SingleQuote) { throw XmlParseError.XmlDeclarationInvalid.At(GetCurrentPosition()); } return(DeclarationStandaloneValue(decl, c)); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-SDDecl. /// </summary> /// <param name="decl">The current declaration token.</param> XmlToken DeclarationAfterEncoding(XmlDeclarationToken decl) { var c = SkipSpaces(); if (ContinuesWithSensitive(AttributeNames.Standalone)) { Advance(9); return(DeclarationStandaloneAfterName(decl)); } return(DeclarationEnd(c, decl)); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-SDDecl. /// </summary> /// <param name="c">The next input character.</param> /// <param name="decl">The current declaration token.</param> XmlToken DeclarationAfterEncoding(Char c, XmlDeclarationToken decl) { while (c.IsSpaceCharacter()) c = GetNext(); if (ContinuesWith(AttributeNames.Standalone, false)) { Advance(9); return DeclarationStandaloneAfterName(GetNext(), decl); } return DeclarationEnd(c, decl); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-SDDecl. /// </summary> /// <param name="c">The next input character.</param> /// <param name="decl">The current declaration token.</param> XmlToken DeclarationStandaloneBeforeValue(Char c, XmlDeclarationToken decl) { while (c.IsSpaceCharacter()) { c = GetNext(); } if (c == Symbols.DoubleQuote || c == Symbols.SingleQuote) { return(DeclarationStandaloneValue(GetNext(), c, decl)); } throw XmlParseError.XmlDeclarationInvalid.At(GetCurrentPosition()); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-SDDecl. /// </summary> /// <param name="c">The next input character.</param> /// <param name="decl">The current declaration token.</param> XmlToken DeclarationStandaloneAfterName(Char c, XmlDeclarationToken decl) { while (c.IsSpaceCharacter()) { c = GetNext(); } if (c == Symbols.Equality) { return(DeclarationStandaloneBeforeValue(GetNext(), decl)); } throw XmlParseError.XmlDeclarationInvalid.At(GetCurrentPosition()); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-XMLDecl. /// </summary> /// <param name="c">The next input character.</param> /// <param name="decl">The current declaration token.</param> XmlDeclarationToken DeclarationEnd(Char c, XmlDeclarationToken decl) { while (c.IsSpaceCharacter()) { c = GetNext(); } if (c != Symbols.QuestionMark || GetNext() != Symbols.GreaterThan) { throw XmlParseError.XmlDeclarationInvalid.At(GetCurrentPosition()); } return(decl); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-EncodingDecl. /// </summary> /// <param name="c">The next input character.</param> /// <param name="decl">The current declaration token.</param> XmlToken DeclarationEncodingBeforeValue(Char c, XmlDeclarationToken decl) { while (c.IsSpaceCharacter()) c = GetNext(); if (c == Symbols.DoubleQuote || c == Symbols.SingleQuote) { var q = c; c = GetNext(); if (c.IsLetter()) return DeclarationEncodingValue(c, q, decl); } throw XmlParseError.XmlDeclarationInvalid.At(GetCurrentPosition()); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-EncodingDecl. /// </summary> /// <param name="decl">The current declaration token.</param> XmlToken DeclarationEncodingBeforeValue(XmlDeclarationToken decl) { var c = SkipSpaces(); if (c == Symbols.DoubleQuote || c == Symbols.SingleQuote) { var q = c; c = GetNext(); if (c.IsLetter()) { StringBuffer.Append(c); return(DeclarationEncodingValue(decl, q)); } } throw XmlParseError.XmlDeclarationInvalid.At(GetCurrentPosition()); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-VersionInfo. /// </summary> /// <param name="c">The next input character.</param> /// <param name="q">The quote character.</param> /// <param name="decl">The current declaration token.</param> XmlToken DeclarationVersionValue(Char c, Char q, XmlDeclarationToken decl) { while (c != q) { if (c == Symbols.EndOfFile) throw XmlParseError.EOF.At(GetCurrentPosition()); _stringBuffer.Append(c); c = GetNext(); } decl.Version = FlushBuffer(); c = GetNext(); if (c.IsSpaceCharacter()) return DeclarationAfterVersion(c, decl); return DeclarationEnd(c, decl); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-VersionNum. /// </summary> /// <param name="c">The next input character.</param> /// <param name="decl">The current declaration token.</param> XmlToken DeclarationAfterVersion(Char c, XmlDeclarationToken decl) { while (c.IsSpaceCharacter()) { c = GetNext(); } if (ContinuesWithSensitive(AttributeNames.Encoding)) { Advance(7); return(DeclarationEncodingAfterName(GetNext(), decl)); } else if (ContinuesWithSensitive(AttributeNames.Standalone)) { Advance(9); return(DeclarationStandaloneAfterName(GetNext(), decl)); } return(DeclarationEnd(c, decl)); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-SDDecl. /// </summary> /// <param name="c">The next input character.</param> /// <param name="q">The quote character.</param> /// <param name="decl">The current declaration token.</param> XmlToken DeclarationStandaloneValue(Char c, Char q, XmlDeclarationToken decl) { while (c != q) { if (c == Symbols.EndOfFile) throw XmlParseError.EOF.At(GetCurrentPosition()); _stringBuffer.Append(c); c = GetNext(); } var s = FlushBuffer(); if (s.Equals(YesIdentifier)) decl.Standalone = true; else if (s.Equals(NoIdentifier)) decl.Standalone = false; else throw XmlParseError.XmlDeclarationInvalid.At(GetCurrentPosition()); return DeclarationEnd(GetNext(), decl); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-EncodingDecl. /// </summary> /// <param name="c">The next input character.</param> /// <param name="q">The quote character.</param> /// <param name="decl">The current declaration token.</param> XmlToken DeclarationEncodingValue(Char c, Char q, XmlDeclarationToken decl) { do { if (c.IsAlphanumericAscii() || c == Symbols.Dot || c == Symbols.Underscore || c == Symbols.Minus) { _stringBuffer.Append(c); c = GetNext(); } else throw XmlParseError.XmlDeclarationInvalid.At(GetCurrentPosition()); } while (c != q); decl.Encoding = FlushBuffer(); c = GetNext(); if (c.IsSpaceCharacter()) return DeclarationAfterEncoding(c, decl); return DeclarationEnd(c, decl); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-VersionInfo. /// </summary> /// <param name="decl">The current declaration token.</param> /// <param name="quote">The quote character.</param> private XmlToken DeclarationVersionValue(XmlDeclarationToken decl, Char quote) { var c = GetNext(); while (c != quote) { if (c == Symbols.EndOfFile) throw XmlParseError.EOF.At(GetCurrentPosition()); StringBuffer.Append(c); c = GetNext(); } decl.Version = FlushBuffer(); c = GetNext(); if (c.IsSpaceCharacter()) { return DeclarationAfterVersion(decl); } return DeclarationEnd(c, decl); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-VersionNum. /// </summary> /// <param name="c">The next input character.</param> /// <param name="decl">The current declaration token.</param> XmlToken DeclarationAfterVersion(Char c, XmlDeclarationToken decl) { while (c.IsSpaceCharacter()) c = GetNext(); if (ContinuesWith(AttributeNames.Encoding, false)) { Advance(7); return DeclarationEncodingAfterName(GetNext(), decl); } else if (ContinuesWith(AttributeNames.Standalone, false)) { Advance(9); return DeclarationStandaloneAfterName(GetNext(), decl); } return DeclarationEnd(c, decl); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-SDDecl. /// </summary> /// <param name="decl">The current declaration token.</param> /// <param name="quote">The quote character.</param> private XmlToken DeclarationStandaloneValue(XmlDeclarationToken decl, Char quote) { var c = GetNext(); while (c != quote) { if (c == Symbols.EndOfFile) throw XmlParseError.EOF.At(GetCurrentPosition()); StringBuffer.Append(c); c = GetNext(); } var s = FlushBuffer(); if (s.Is(Keywords.Yes)) { decl.Standalone = true; } else if (s.Is(Keywords.No)) { decl.Standalone = false; } else { throw XmlParseError.XmlDeclarationInvalid.At(GetCurrentPosition()); } return DeclarationEnd(GetNext(), decl); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-SDDecl. /// </summary> /// <param name="decl">The current declaration token.</param> private XmlToken DeclarationStandaloneBeforeValue(XmlDeclarationToken decl) { var c = SkipSpaces(); if (c != Symbols.DoubleQuote && c != Symbols.SingleQuote) throw XmlParseError.XmlDeclarationInvalid.At(GetCurrentPosition()); return DeclarationStandaloneValue(decl, c); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-SDDecl. /// </summary> /// <param name="c">The next input character.</param> /// <param name="q">The quote character.</param> /// <param name="decl">The current declaration token.</param> XmlToken DeclarationStandaloneValue(Char c, Char q, XmlDeclarationToken decl) { while (c != q) { if (c == Symbols.EndOfFile) throw XmlParseError.EOF.At(GetCurrentPosition()); _stringBuffer.Append(c); c = GetNext(); } var s = FlushBuffer(); if (s.Is(Keywords.Yes)) decl.Standalone = true; else if (s.Is(Keywords.No)) decl.Standalone = false; else throw XmlParseError.XmlDeclarationInvalid.At(GetCurrentPosition()); return DeclarationEnd(GetNext(), decl); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-SDDecl. /// </summary> /// <param name="c">The next input character.</param> /// <param name="decl">The current declaration token.</param> XmlToken DeclarationStandaloneAfterName(Char c, XmlDeclarationToken decl) { while (c.IsSpaceCharacter()) c = GetNext(); if (c == Symbols.Equality) return DeclarationStandaloneBeforeValue(GetNext(), decl); throw XmlParseError.XmlDeclarationInvalid.At(GetCurrentPosition()); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-EncodingDecl. /// </summary> /// <param name="decl">The current declaration token.</param> private XmlToken DeclarationEncodingBeforeValue(XmlDeclarationToken decl) { var c = SkipSpaces(); if (c == Symbols.DoubleQuote || c == Symbols.SingleQuote) { var q = c; c = GetNext(); if (c.IsLetter()) { StringBuffer.Append(c); return DeclarationEncodingValue(decl, q); } } throw XmlParseError.XmlDeclarationInvalid.At(GetCurrentPosition()); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-SDDecl. /// </summary> /// <param name="c">The next input character.</param> /// <param name="decl">The current declaration token.</param> XmlToken DeclarationAfterEncoding(Char c, XmlDeclarationToken decl) { while (c.IsSpaceCharacter()) c = GetNext(); if (ContinuesWithSensitive(AttributeNames.Standalone)) { Advance(9); return DeclarationStandaloneAfterName(GetNext(), decl); } return DeclarationEnd(c, decl); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-EncodingDecl. /// </summary> /// <param name="decl">The current declaration token.</param> /// <param name="quote">The quote character.</param> private XmlToken DeclarationEncodingValue(XmlDeclarationToken decl, Char quote) { var c = GetNext(); while (c != quote) { if (!c.IsAlphanumericAscii() && c != Symbols.Dot && c != Symbols.Underscore && c != Symbols.Minus) throw XmlParseError.XmlDeclarationInvalid.At(GetCurrentPosition()); StringBuffer.Append(c); c = GetNext(); } decl.Encoding = FlushBuffer(); c = GetNext(); if (c.IsSpaceCharacter()) { return DeclarationAfterEncoding(decl); } return DeclarationEnd(c, decl); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-SDDecl. /// </summary> /// <param name="c">The next input character.</param> /// <param name="decl">The current declaration token.</param> XmlToken DeclarationStandaloneBeforeValue(Char c, XmlDeclarationToken decl) { while (c.IsSpaceCharacter()) c = GetNext(); if (c == Symbols.DoubleQuote || c == Symbols.SingleQuote) return DeclarationStandaloneValue(GetNext(), c, decl); throw XmlParseError.XmlDeclarationInvalid.At(GetCurrentPosition()); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-SDDecl. /// </summary> /// <param name="decl">The current declaration token.</param> private XmlToken DeclarationAfterEncoding(XmlDeclarationToken decl) { var c = SkipSpaces(); if (ContinuesWithSensitive(AttributeNames.Standalone)) { Advance(9); return DeclarationStandaloneAfterName(decl); } return DeclarationEnd(c, decl); }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-XMLDecl. /// </summary> /// <param name="c">The next input character.</param> /// <param name="decl">The current declaration token.</param> XmlDeclarationToken DeclarationEnd(Char c, XmlDeclarationToken decl) { while (c.IsSpaceCharacter()) c = GetNext(); if (c != Symbols.QuestionMark || GetNext() != Symbols.GreaterThan) throw XmlParseError.XmlDeclarationInvalid.At(GetCurrentPosition()); return decl; }
/// <summary> /// More http://www.w3.org/TR/REC-xml/#NT-SDDecl. /// </summary> /// <param name="decl">The current declaration token.</param> private XmlToken DeclarationStandaloneAfterName(XmlDeclarationToken decl) { var c = SkipSpaces(); if (c != Symbols.Equality) throw XmlParseError.XmlDeclarationInvalid.At(GetCurrentPosition()); return DeclarationStandaloneBeforeValue(decl); }