System\Xml\Schema\DtdParser.cs (243)
208Debug.Assert((int)Token.CDATA == (int)XmlTokenizedType.CDATA && (int)XmlTokenizedType.CDATA == 0);
209Debug.Assert((int)Token.ID == (int)XmlTokenizedType.ID && (int)XmlTokenizedType.ID == 1);
210Debug.Assert((int)Token.IDREF == (int)XmlTokenizedType.IDREF && (int)XmlTokenizedType.IDREF == 2);
211Debug.Assert((int)Token.IDREFS == (int)XmlTokenizedType.IDREFS && (int)XmlTokenizedType.IDREFS == 3);
212Debug.Assert((int)Token.ENTITY == (int)XmlTokenizedType.ENTITY && (int)XmlTokenizedType.ENTITY == 4);
213Debug.Assert((int)Token.ENTITIES == (int)XmlTokenizedType.ENTITIES && (int)XmlTokenizedType.ENTITIES == 5);
214Debug.Assert((int)Token.NMTOKEN == (int)XmlTokenizedType.NMTOKEN && (int)XmlTokenizedType.NMTOKEN == 6);
215Debug.Assert((int)Token.NMTOKENS == (int)XmlTokenizedType.NMTOKENS && (int)XmlTokenizedType.NMTOKENS == 7);
216Debug.Assert((int)Token.NOTATION == (int)XmlTokenizedType.NOTATION && (int)XmlTokenizedType.NOTATION == 8);
436if (GetToken(false) != Token.QName)
443Token token = GetToken(false);
444if (token == Token.SYSTEM || token == Token.PUBLIC)
446ParseExternalId(token, Token.DOCTYPE, out _publicId, out _systemId);
453case Token.LeftBracket:
461case Token.GreaterThan:
529Token token = GetToken(false);
533case Token.AttlistDecl:
537case Token.ElementDecl:
541case Token.EntityDecl:
545case Token.NotationDecl:
549case Token.Comment:
553case Token.PI:
557case Token.CondSectionStart:
565case Token.CondSectionEnd:
579case Token.RightBracket:
595if (GetToken(false) != Token.GreaterThan)
610case Token.Eof:
646if (GetToken(true) != Token.QName)
668case Token.QName:
675case Token.GreaterThan:
754Token token = GetToken(true);
756if (token != Token.CDATA)
768case Token.NOTATION:
770case Token.ID:
803if (GetToken(true) != Token.LeftParen)
809if (GetToken(false) != Token.Name)
828case Token.Or:
829if (GetToken(false) != Token.Name)
834case Token.RightParen:
841else if (token == Token.LeftParen)
847if (GetToken(false) != Token.Nmtoken)
855case Token.Or:
856if (GetToken(false) != Token.Nmtoken)
865case Token.RightParen:
885case Token.REQUIRED:
888case Token.IMPLIED:
891case Token.FIXED:
893if (GetToken(true) != Token.Literal)
898case Token.Literal:
931if (GetToken(true) != Token.QName)
964case Token.EMPTY:
967case Token.ANY:
970case Token.LeftParen:
974case Token.PCDATA:
985case Token.None:
1005if (GetToken(false) != Token.GreaterThan)
1020parsingSchema = Token.None;
1025public Token parsingSchema;
1039case Token.QName:
1043case Token.LeftParen:
1058case Token.GreaterThan:
1068case Token.Comma:
1069if (currentFrame.parsingSchema == Token.Or)
1074currentFrame.parsingSchema = Token.Comma;
1076case Token.Or:
1077if (currentFrame.parsingSchema == Token.Comma)
1082currentFrame.parsingSchema = Token.Or;
1084case Token.RightParen:
1092case Token.GreaterThan:
1122case Token.Star:
1125case Token.QMark:
1128case Token.Plus:
1146case Token.RightParen:
1152if (GetToken(false) == Token.Star && hasNames)
1161case Token.Or:
1179if (GetToken(false) != Token.QName)
1215case Token.Percent:
1217if (GetToken(true) != Token.Name)
1221goto case Token.Name;
1222case Token.Name:
1245Token token = GetToken(true);
1248case Token.PUBLIC:
1249case Token.SYSTEM:
1253ParseExternalId(token, Token.EntityDecl, out publicId, out systemId);
1259if (GetToken(false) == Token.NData)
1270if (GetToken(true) != Token.Name)
1283case Token.Literal:
1292if (GetToken(false) == Token.GreaterThan)
1305if (GetToken(true) != Token.Name)
1328Token token = GetToken(true);
1329if (token == Token.SYSTEM || token == Token.PUBLIC)
1333ParseExternalId(token, Token.NOTATION, out notationPublicId, out notationSystemId);
1346if (GetToken(false) != Token.GreaterThan)
1416case Token.INCLUDE:
1417if (GetToken(false) != Token.LeftBracket)
1441case Token.IGNORE:
1442if (GetToken(false) != Token.LeftBracket)
1451if (GetToken(false) != Token.CondSectionEnd)
1466private void ParseExternalId(Token idTokenType, Token declType, out string? publicId, out string? systemId)
1472if (GetToken(true) != Token.Literal)
1477if (idTokenType == Token.SYSTEM)
1486if (declType == Token.DOCTYPE && !_freeFloatingDtd)
1494Debug.Assert(idTokenType == Token.PUBLIC);
1504if (declType == Token.DOCTYPE && !_freeFloatingDtd)
1509if (GetToken(false) == Token.Literal)
1526if (GetToken(false) == Token.Literal)
1534else if (declType != Token.NOTATION)
1544private Token GetToken(bool needWhiteSpace)
1657return Token.None;
1669return Token.Eof;
1679private Token ScanSubsetContent()
1707return Token.ElementDecl;
1722return Token.EntityDecl;
1731return Token.None;
1748return Token.AttlistDecl;
1765return Token.NotationDecl;
1770return Token.CondSectionStart;
1775return Token.Comment;
1797return Token.PI;
1804return Token.None;
1816return Token.RightBracket;
1825return Token.CondSectionEnd;
1844private Token ScanNameExpected()
1848return Token.Name;
1851private Token ScanQNameExpected()
1855return Token.QName;
1858private Token ScanNmtokenExpected()
1862return Token.Nmtoken;
1865private Token ScanDoctype1()
1876return Token.PUBLIC;
1884return Token.SYSTEM;
1888return Token.LeftBracket;
1892return Token.GreaterThan;
1895return Token.None;
1899private Token ScanDoctype2()
1906return Token.LeftBracket;
1910return Token.GreaterThan;
1913return Token.None;
1917private Token ScanClosingTag()
1925return Token.GreaterThan;
1928private Token ScanElement1()
1937return Token.LeftParen;
1948return Token.EMPTY;
1960return Token.ANY;
1975private Token ScanElement2()
1991return Token.PCDATA;
2000return Token.None;
2003private Token ScanElement3()
2009return Token.LeftParen;
2013return Token.GreaterThan;
2017return Token.QName;
2021private Token ScanElement4()
2025Token t;
2029t = Token.Star;
2032t = Token.QMark;
2035t = Token.Plus;
2038return Token.None;
2048private Token ScanElement5()
2055return Token.Comma;
2059return Token.Or;
2063return Token.RightParen;
2067return Token.GreaterThan;
2070return Token.None;
2074private Token ScanElement6()
2081return Token.RightParen;
2086return Token.Or;
2089return Token.None;
2093private Token ScanElement7()
2099return Token.Star;
2101return Token.None;
2104private Token ScanAttlist1()
2111return Token.GreaterThan;
2119return Token.QName;
2123private Token ScanAttlist2()
2133return Token.LeftParen;
2144return Token.CDATA;
2162return Token.ENTITIES;
2165return Token.ENTITY;
2183return Token.ID;
2194return Token.IDREF;
2199return Token.IDREFS;
2217return Token.NOTATION;
2230return Token.NMTOKENS;
2235return Token.NMTOKEN;
2255private Token ScanAttlist3()
2262return Token.LeftParen;
2267return Token.None;
2271private Token ScanAttlist4()
2278return Token.RightParen;
2283return Token.Or;
2286return Token.None;
2290private Token ScanAttlist5()
2297return Token.RightParen;
2302return Token.Or;
2305return Token.None;
2309private Token ScanAttlist6()
2319return Token.Literal;
2337return Token.REQUIRED;
2349return Token.IMPLIED;
2358return Token.FIXED;
2376private Token ScanAttlist7()
2384return Token.Literal;
2387return Token.None;
2391private Token ScanLiteral(LiteralType literalType)
2421return Token.Literal;
2604return Token.None;
2644private Token ScanNotation1()
2655return Token.PUBLIC;
2663return Token.SYSTEM;
2666return Token.None;
2670private Token ScanSystemId()
2680return Token.Literal;
2683private Token ScanEntity1()
2690return Token.Percent;
2696return Token.Name;
2700private Token ScanEntity2()
2711return Token.PUBLIC;
2719return Token.SYSTEM;
2725return Token.Literal;
2728return Token.None;
2732private Token ScanEntity3()
2749return Token.NData;
2754return Token.None;
2757private Token ScanPublicId1()
2767return Token.Literal;
2770private Token ScanPublicId2()
2775return Token.None;
2781return Token.Literal;
2784private Token ScanCondSection1()
2814return Token.INCLUDE;
2825return Token.IGNORE;
2828return Token.None;
2838private Token ScanCondSection2()
2846return Token.LeftBracket;
2849private Token ScanCondSection3()
2922return Token.CondSectionEnd;
2948return Token.None;
3415private static bool IsAttributeValueType(Token token)
3417return (int)token >= (int)Token.CDATA && (int)token <= (int)Token.NOTATION;