62static const char KW_ATTLIST[]
64static const char KW_CDATA[]
66static const char KW_DOCTYPE[]
68static const char KW_ELEMENT[]
70static const char KW_EMPTY[]
74static const char KW_ENTITY[]
76static const char KW_FIXED[]
79static const char KW_IDREF[]
81static const char KW_IDREFS[]
84static const char KW_IGNORE[]
87static const char KW_IMPLIED[]
90static const char KW_INCLUDE[]
93static const char KW_NDATA[]
95static const char KW_NMTOKEN[]
101static const char KW_PCDATA[]
103static const char KW_PUBLIC[]
107static const char KW_SYSTEM[]
110#ifndef MIN_BYTES_PER_CHAR
111# define MIN_BYTES_PER_CHAR(enc) ((enc)->minBytesPerChar)
115# define setTopLevel(state) \
117 = ((state)->documentEntity ? internalSubset : externalSubset1))
119# define setTopLevel(state) ((state)->handler = internalSubset)
123 const char *ptr,
const char *end,
126static PROLOG_HANDLER prolog0, prolog1, prolog2, doctype0, doctype1, doctype2,
127 doctype3, doctype4, doctype5, internalSubset, entity0, entity1, entity2,
128 entity3, entity4, entity5, entity6, entity7, entity8, entity9, entity10,
129 notation0, notation1, notation2, notation3, notation4, attlist0, attlist1,
130 attlist2, attlist3, attlist4, attlist5, attlist6, attlist7, attlist8,
131 attlist9, element0, element1, element2, element3, element4, element5,
134 externalSubset0, externalSubset1, condSect0, condSect1, condSect2,
141prolog0(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
145 state->handler = prolog1;
148 state->handler = prolog1;
151 state->handler = prolog1;
154 state->handler = prolog1;
162 state->handler = doctype0;
165 state->handler = error;
168 return common(state, tok);
172prolog1(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
194 state->handler = doctype0;
197 state->handler = error;
200 return common(state, tok);
204prolog2(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
217 state->handler = error;
220 return common(state, tok);
224doctype0(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
234 state->handler = doctype1;
237 return common(state, tok);
241doctype1(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
247 state->handler = internalSubset;
250 state->handler = prolog2;
254 state->handler = doctype3;
258 state->handler = doctype2;
263 return common(state, tok);
267doctype2(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
276 state->handler = doctype3;
279 return common(state, tok);
283doctype3(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
292 state->handler = doctype4;
295 return common(state, tok);
299doctype4(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
308 state->handler = internalSubset;
311 state->handler = prolog2;
314 return common(state, tok);
318doctype5(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
327 state->handler = prolog2;
330 return common(state, tok);
334internalSubset(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
342 state->handler = entity0;
347 state->handler = attlist0;
352 state->handler = element0;
357 state->handler = notation0;
368 state->handler = doctype5;
373 return common(state, tok);
379externalSubset0(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
381 state->handler = externalSubset1;
383 return XML_ROLE_TEXT_DECL;
384 return externalSubset1(state, tok, ptr, end, enc);
388externalSubset1(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
392 state->handler = condSect0;
395 if (state->includeLevel == 0)
397 state->includeLevel -= 1;
404 if (state->includeLevel)
408 return internalSubset(state, tok, ptr, end, enc);
410 return common(state, tok);
416entity0(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
425 state->handler = entity1;
428 state->handler = entity2;
431 return common(state, tok);
435entity1(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
444 state->handler = entity7;
447 return common(state, tok);
451entity2(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
458 state->handler = entity4;
462 state->handler = entity3;
467 state->handler = declClose;
471 return common(state, tok);
475entity3(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
484 state->handler = entity4;
487 return common(state, tok);
491entity4(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
500 state->handler = entity5;
503 return common(state, tok);
507entity5(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
517 state->handler = entity6;
522 return common(state, tok);
526entity6(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
535 state->handler = declClose;
539 return common(state, tok);
543entity7(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
550 state->handler = entity9;
554 state->handler = entity8;
559 state->handler = declClose;
563 return common(state, tok);
567entity8(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
576 state->handler = entity9;
579 return common(state, tok);
583entity9(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
592 state->handler = entity10;
595 return common(state, tok);
599entity10(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
611 return common(state, tok);
615notation0(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
624 state->handler = notation1;
627 return common(state, tok);
631notation1(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
638 state->handler = notation3;
642 state->handler = notation2;
647 return common(state, tok);
651notation2(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
660 state->handler = notation4;
663 return common(state, tok);
667notation3(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
676 state->handler = declClose;
680 return common(state, tok);
684notation4(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
693 state->handler = declClose;
700 return common(state, tok);
704attlist0(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
714 state->handler = attlist1;
717 return common(state, tok);
721attlist1(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
734 state->handler = attlist2;
737 return common(state, tok);
741attlist2(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
747 static const char *
const types[] = {
748 KW_CDATA, KW_ID, KW_IDREF, KW_IDREFS,
749 KW_ENTITY, KW_ENTITIES, KW_NMTOKEN, KW_NMTOKENS,
752 for (i = 0; i < (int)(
sizeof(types) /
sizeof(types[0])); i++)
754 state->handler = attlist8;
759 state->handler = attlist5;
764 state->handler = attlist3;
767 return common(state, tok);
771attlist3(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
782 state->handler = attlist4;
785 return common(state, tok);
789attlist4(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
798 state->handler = attlist8;
801 state->handler = attlist3;
804 return common(state, tok);
808attlist5(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
817 state->handler = attlist6;
820 return common(state, tok);
824attlist6(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
833 state->handler = attlist7;
836 return common(state, tok);
840attlist7(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
849 state->handler = attlist8;
852 state->handler = attlist6;
855 return common(state, tok);
860attlist8(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
868 state->handler = attlist1;
873 state->handler = attlist1;
878 state->handler = attlist9;
883 state->handler = attlist1;
886 return common(state, tok);
890attlist9(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
899 state->handler = attlist1;
902 return common(state, tok);
906element0(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
916 state->handler = element1;
919 return common(state, tok);
923element1(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
930 state->handler = declClose;
935 state->handler = declClose;
941 state->handler = element2;
945 return common(state, tok);
949element2(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
957 state->handler = element3;
963 state->handler = element6;
967 state->handler = element7;
970 state->handler = element7;
973 state->handler = element7;
976 state->handler = element7;
979 return common(state, tok);
983element3(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
992 state->handler = declClose;
996 state->handler = declClose;
1000 state->handler = element4;
1003 return common(state, tok);
1007element4(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
1017 state->handler = element5;
1020 return common(state, tok);
1024element5(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
1033 state->handler = declClose;
1037 state->handler = element4;
1040 return common(state, tok);
1044element6(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
1057 state->handler = element7;
1060 state->handler = element7;
1063 state->handler = element7;
1066 state->handler = element7;
1069 return common(state, tok);
1073element7(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
1083 if (state->
level == 0) {
1084 state->handler = declClose;
1090 if (state->
level == 0) {
1091 state->handler = declClose;
1097 if (state->
level == 0) {
1098 state->handler = declClose;
1104 if (state->
level == 0) {
1105 state->handler = declClose;
1110 state->handler = element6;
1113 state->handler = element6;
1116 return common(state, tok);
1122condSect0(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
1129 state->handler = condSect1;
1133 state->handler = condSect2;
1138 return common(state, tok);
1142condSect1(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
1151 state->handler = externalSubset1;
1152 state->includeLevel += 1;
1155 return common(state, tok);
1159condSect2(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
1168 state->handler = externalSubset1;
1169 return XML_ROLE_IGNORE_SECT;
1171 return common(state, tok);
1177declClose(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
1189 return common(state, tok);
1213error(
PROLOG_STATE *state,
int tok,
const char *ptr,
const char *end,
1228 return XML_ROLE_INNER_PARAM_ENTITY_REF;
1232 state->handler = error;
1238 state->handler = prolog0;
1240 state->documentEntity = 1;
1241 state->includeLevel = 0;
1242 state->inEntityValue = 0;
1250 state->handler = externalSubset0;
1251 state->documentEntity = 0;
1252 state->includeLevel = 0;
#define setTopLevel(state)
int PTRCALL PROLOG_HANDLER(PROLOG_STATE *state, int tok, const char *ptr, const char *end, const ENCODING *enc)
void XmlPrologStateInit(PROLOG_STATE *state)
#define MIN_BYTES_PER_CHAR(enc)
@ XML_ROLE_NOTATION_PUBLIC_ID
@ XML_ROLE_GROUP_CLOSE_REP
@ XML_ROLE_CONTENT_PCDATA
@ XML_ROLE_CONTENT_ELEMENT_REP
@ XML_ROLE_ENTITY_COMPLETE
@ XML_ROLE_DOCTYPE_INTERNAL_SUBSET
@ XML_ROLE_NOTATION_NO_SYSTEM_ID
@ XML_ROLE_PARAM_ENTITY_REF
@ XML_ROLE_ENTITY_NOTATION_NAME
@ XML_ROLE_GROUP_SEQUENCE
@ XML_ROLE_ATTLIST_ELEMENT_NAME
@ XML_ROLE_GROUP_CLOSE_OPT
@ XML_ROLE_IMPLIED_ATTRIBUTE_VALUE
@ XML_ROLE_ATTRIBUTE_TYPE_CDATA
@ XML_ROLE_ATTRIBUTE_ENUM_VALUE
@ XML_ROLE_ENTITY_SYSTEM_ID
@ XML_ROLE_CONTENT_ELEMENT
@ XML_ROLE_ATTRIBUTE_NOTATION_VALUE
@ XML_ROLE_DOCTYPE_SYSTEM_ID
@ XML_ROLE_NOTATION_SYSTEM_ID
@ XML_ROLE_ATTRIBUTE_NAME
@ XML_ROLE_ENTITY_PUBLIC_ID
@ XML_ROLE_INSTANCE_START
@ XML_ROLE_CONTENT_ELEMENT_PLUS
@ XML_ROLE_GENERAL_ENTITY_NAME
@ XML_ROLE_PARAM_ENTITY_NAME
@ XML_ROLE_DEFAULT_ATTRIBUTE_VALUE
@ XML_ROLE_GROUP_CLOSE_PLUS
@ XML_ROLE_REQUIRED_ATTRIBUTE_VALUE
@ XML_ROLE_FIXED_ATTRIBUTE_VALUE
@ XML_ROLE_CONTENT_ELEMENT_OPT
@ XML_ROLE_DOCTYPE_PUBLIC_ID
#define XML_TOK_CLOSE_PAREN_ASTERISK
#define XML_TOK_DECL_OPEN
#define XML_TOK_PREFIXED_NAME
#define XML_TOK_OPEN_PAREN
#define XML_TOK_OPEN_BRACKET
#define XML_TOK_CLOSE_PAREN_PLUS
#define XML_TOK_CLOSE_PAREN
#define XML_TOK_NAME_ASTERISK
#define XML_TOK_DECL_CLOSE
#define XML_TOK_NAME_PLUS
#define XML_TOK_NAME_QUESTION
#define XML_TOK_COND_SECT_CLOSE
#define XML_TOK_COND_SECT_OPEN
#define XML_TOK_POUND_NAME
#define XML_TOK_PARAM_ENTITY_REF
#define XML_TOK_CLOSE_BRACKET
#define XmlNameMatchesAscii(enc, ptr1, end1, ptr2)
#define XML_TOK_INSTANCE_START
#define XML_TOK_CLOSE_PAREN_QUESTION