FrameworkFork\Microsoft.Xml\Xml\schema\DtdParser.cs (243)
217Debug.Assert((int)Token.CDATA == (int)XmlTokenizedType.CDATA && (int)XmlTokenizedType.CDATA == 0);
218Debug.Assert((int)Token.ID == (int)XmlTokenizedType.ID && (int)XmlTokenizedType.ID == 1);
219Debug.Assert((int)Token.IDREF == (int)XmlTokenizedType.IDREF && (int)XmlTokenizedType.IDREF == 2);
220Debug.Assert((int)Token.IDREFS == (int)XmlTokenizedType.IDREFS && (int)XmlTokenizedType.IDREFS == 3);
221Debug.Assert((int)Token.ENTITY == (int)XmlTokenizedType.ENTITY && (int)XmlTokenizedType.ENTITY == 4);
222Debug.Assert((int)Token.ENTITIES == (int)XmlTokenizedType.ENTITIES && (int)XmlTokenizedType.ENTITIES == 5);
223Debug.Assert((int)Token.NMTOKEN == (int)XmlTokenizedType.NMTOKEN && (int)XmlTokenizedType.NMTOKEN == 6);
224Debug.Assert((int)Token.NMTOKENS == (int)XmlTokenizedType.NMTOKENS && (int)XmlTokenizedType.NMTOKENS == 7);
225Debug.Assert((int)Token.NOTATION == (int)XmlTokenizedType.NOTATION && (int)XmlTokenizedType.NOTATION == 8);
448if (GetToken(false) != Token.QName)
455Token token = GetToken(false);
456if (token == Token.SYSTEM || token == Token.PUBLIC)
458ParseExternalId(token, Token.DOCTYPE, out _publicId, out _systemId);
465case Token.LeftBracket:
473case Token.GreaterThan:
541Token token = GetToken(false);
545case Token.AttlistDecl:
549case Token.ElementDecl:
553case Token.EntityDecl:
557case Token.NotationDecl:
561case Token.Comment:
565case Token.PI:
569case Token.CondSectionStart:
577case Token.CondSectionEnd:
591case Token.RightBracket:
607if (GetToken(false) != Token.GreaterThan)
622case Token.Eof:
658if (GetToken(true) != Token.QName)
680case Token.QName:
687case Token.GreaterThan:
766Token token = GetToken(true);
768if (token != Token.CDATA)
780case Token.NOTATION:
782case Token.ID:
815if (GetToken(true) != Token.LeftParen)
821if (GetToken(false) != Token.Name)
840case Token.Or:
841if (GetToken(false) != Token.Name)
846case Token.RightParen:
853else if (token == Token.LeftParen)
859if (GetToken(false) != Token.Nmtoken)
867case Token.Or:
868if (GetToken(false) != Token.Nmtoken)
877case Token.RightParen:
897case Token.REQUIRED:
900case Token.IMPLIED:
903case Token.FIXED:
905if (GetToken(true) != Token.Literal)
910case Token.Literal:
943if (GetToken(true) != Token.QName)
976case Token.EMPTY:
979case Token.ANY:
982case Token.LeftParen:
986case Token.PCDATA:
997case Token.None:
1016if (GetToken(false) != Token.GreaterThan)
1032parsingSchema = Token.None;
1037public Token parsingSchema;
1051case Token.QName:
1055case Token.LeftParen:
1070case Token.GreaterThan:
1080case Token.Comma:
1081if (currentFrame.parsingSchema == Token.Or)
1086currentFrame.parsingSchema = Token.Comma;
1088case Token.Or:
1089if (currentFrame.parsingSchema == Token.Comma)
1094currentFrame.parsingSchema = Token.Or;
1096case Token.RightParen:
1104case Token.GreaterThan:
1134case Token.Star:
1137case Token.QMark:
1140case Token.Plus:
1158case Token.RightParen:
1164if (GetToken(false) == Token.Star && hasNames)
1173case Token.Or:
1191if (GetToken(false) != Token.QName)
1227case Token.Percent:
1229if (GetToken(true) != Token.Name)
1233goto case Token.Name;
1234case Token.Name:
1263Token token = GetToken(true);
1266case Token.PUBLIC:
1267case Token.SYSTEM:
1271ParseExternalId(token, Token.EntityDecl, out publicId, out systemId);
1277if (GetToken(false) == Token.NData)
1288if (GetToken(true) != Token.Name)
1301case Token.Literal:
1310if (GetToken(false) == Token.GreaterThan)
1323if (GetToken(true) != Token.Name)
1349Token token = GetToken(true);
1350if (token == Token.SYSTEM || token == Token.PUBLIC)
1354ParseExternalId(token, Token.NOTATION, out notationPublicId, out notationSystemId);
1367if (GetToken(false) != Token.GreaterThan)
1440case Token.INCLUDE:
1441if (GetToken(false) != Token.LeftBracket)
1465case Token.IGNORE:
1466if (GetToken(false) != Token.LeftBracket)
1475if (GetToken(false) != Token.CondSectionEnd)
1490private void ParseExternalId(Token idTokenType, Token declType, out string publicId, out string systemId)
1496if (GetToken(true) != Token.Literal)
1501if (idTokenType == Token.SYSTEM)
1510if (declType == Token.DOCTYPE && !_freeFloatingDtd)
1518Debug.Assert(idTokenType == Token.PUBLIC);
1528if (declType == Token.DOCTYPE && !_freeFloatingDtd)
1533if (GetToken(false) == Token.Literal)
1550if (GetToken(false) == Token.Literal)
1558else if (declType != Token.NOTATION)
1568private Token GetToken(bool needWhiteSpace)
1681return Token.None;
1693return Token.Eof;
1703private Token ScanSubsetContent()
1731return Token.ElementDecl;
1746return Token.EntityDecl;
1755return Token.None;
1772return Token.AttlistDecl;
1789return Token.NotationDecl;
1794return Token.CondSectionStart;
1799return Token.Comment;
1821return Token.PI;
1828return Token.None;
1840return Token.RightBracket;
1849return Token.CondSectionEnd;
1868private Token ScanNameExpected()
1872return Token.Name;
1875private Token ScanQNameExpected()
1879return Token.QName;
1882private Token ScanNmtokenExpected()
1886return Token.Nmtoken;
1889private Token ScanDoctype1()
1900return Token.PUBLIC;
1908return Token.SYSTEM;
1912return Token.LeftBracket;
1916return Token.GreaterThan;
1919return Token.None;
1923private Token ScanDoctype2()
1930return Token.LeftBracket;
1934return Token.GreaterThan;
1937return Token.None;
1941private Token ScanClosingTag()
1949return Token.GreaterThan;
1952private Token ScanElement1()
1961return Token.LeftParen;
1972return Token.EMPTY;
1984return Token.ANY;
1999private Token ScanElement2()
2016return Token.PCDATA;
2025return Token.None;
2028private Token ScanElement3()
2034return Token.LeftParen;
2038return Token.GreaterThan;
2042return Token.QName;
2046private Token ScanElement4()
2050Token t;
2054t = Token.Star;
2057t = Token.QMark;
2060t = Token.Plus;
2063return Token.None;
2073private Token ScanElement5()
2080return Token.Comma;
2084return Token.Or;
2088return Token.RightParen;
2092return Token.GreaterThan;
2095return Token.None;
2099private Token ScanElement6()
2106return Token.RightParen;
2111return Token.Or;
2114return Token.None;
2118private Token ScanElement7()
2124return Token.Star;
2126return Token.None;
2129private Token ScanAttlist1()
2136return Token.GreaterThan;
2144return Token.QName;
2148private Token ScanAttlist2()
2158return Token.LeftParen;
2169return Token.CDATA;
2187return Token.ENTITIES;
2190return Token.ENTITY;
2208return Token.ID;
2219return Token.IDREF;
2224return Token.IDREFS;
2242return Token.NOTATION;
2255return Token.NMTOKENS;
2260return Token.NMTOKEN;
2280private Token ScanAttlist3()
2287return Token.LeftParen;
2292return Token.None;
2296private Token ScanAttlist4()
2303return Token.RightParen;
2308return Token.Or;
2311return Token.None;
2315private Token ScanAttlist5()
2322return Token.RightParen;
2327return Token.Or;
2330return Token.None;
2334private Token ScanAttlist6()
2344return Token.Literal;
2362return Token.REQUIRED;
2374return Token.IMPLIED;
2383return Token.FIXED;
2401private Token ScanAttlist7()
2409return Token.Literal;
2412return Token.None;
2416private Token ScanLiteral(LiteralType literalType)
2449return Token.Literal;
2632return Token.None;
2672private Token ScanNotation1()
2683return Token.PUBLIC;
2691return Token.SYSTEM;
2694return Token.None;
2698private Token ScanSystemId()
2708return Token.Literal;
2711private Token ScanEntity1()
2718return Token.Percent;
2724return Token.Name;
2728private Token ScanEntity2()
2739return Token.PUBLIC;
2747return Token.SYSTEM;
2753return Token.Literal;
2756return Token.None;
2760private Token ScanEntity3()
2777return Token.NData;
2782return Token.None;
2785private Token ScanPublicId1()
2795return Token.Literal;
2798private Token ScanPublicId2()
2803return Token.None;
2809return Token.Literal;
2812private Token ScanCondSection1()
2846return Token.INCLUDE;
2861return Token.IGNORE;
2864return Token.None;
2874private Token ScanCondSection2()
2882return Token.LeftBracket;
2885private Token ScanCondSection3()
2961return Token.CondSectionEnd;
2987return Token.None;
3494private bool IsAttributeValueType(Token token)
3496return (int)token >= (int)Token.CDATA && (int)token <= (int)Token.NOTATION;