xmlrole.c (104349) | xmlrole.c (178848) |
---|---|
1/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 See the file COPYING for copying permission. 3*/ 4 | 1/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 2 See the file COPYING for copying permission. 3*/ 4 |
5#include <stddef.h> 6 |
|
5#ifdef COMPILED_FROM_DSP 6#include "winconfig.h" 7#elif defined(MACOS_CLASSIC) 8#include "macconfig.h" | 7#ifdef COMPILED_FROM_DSP 8#include "winconfig.h" 9#elif defined(MACOS_CLASSIC) 10#include "macconfig.h" |
11#elif defined(__amigaos4__) 12#include "amigaconfig.h" 13#elif defined(__WATCOMC__) 14#include "watcomconfig.h" |
|
9#else | 15#else |
16#ifdef HAVE_EXPAT_CONFIG_H |
|
10#include <expat_config.h> | 17#include <expat_config.h> |
18#endif |
|
11#endif /* ndef COMPILED_FROM_DSP */ 12 | 19#endif /* ndef COMPILED_FROM_DSP */ 20 |
21#include "expat_external.h" |
|
13#include "internal.h" 14#include "xmlrole.h" 15#include "ascii.h" 16 17/* Doesn't check: 18 19 that ,| are not mixed in a model group 20 content of literals --- 20 unchanged lines hidden (view full) --- 41static const char KW_FIXED[] = { 42 ASCII_F, ASCII_I, ASCII_X, ASCII_E, ASCII_D, '\0' }; 43static const char KW_ID[] = { 44 ASCII_I, ASCII_D, '\0' }; 45static const char KW_IDREF[] = { 46 ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, '\0' }; 47static const char KW_IDREFS[] = { 48 ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, ASCII_S, '\0' }; | 22#include "internal.h" 23#include "xmlrole.h" 24#include "ascii.h" 25 26/* Doesn't check: 27 28 that ,| are not mixed in a model group 29 content of literals --- 20 unchanged lines hidden (view full) --- 50static const char KW_FIXED[] = { 51 ASCII_F, ASCII_I, ASCII_X, ASCII_E, ASCII_D, '\0' }; 52static const char KW_ID[] = { 53 ASCII_I, ASCII_D, '\0' }; 54static const char KW_IDREF[] = { 55 ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, '\0' }; 56static const char KW_IDREFS[] = { 57 ASCII_I, ASCII_D, ASCII_R, ASCII_E, ASCII_F, ASCII_S, '\0' }; |
58#ifdef XML_DTD |
|
49static const char KW_IGNORE[] = { 50 ASCII_I, ASCII_G, ASCII_N, ASCII_O, ASCII_R, ASCII_E, '\0' }; | 59static const char KW_IGNORE[] = { 60 ASCII_I, ASCII_G, ASCII_N, ASCII_O, ASCII_R, ASCII_E, '\0' }; |
61#endif |
|
51static const char KW_IMPLIED[] = { 52 ASCII_I, ASCII_M, ASCII_P, ASCII_L, ASCII_I, ASCII_E, ASCII_D, '\0' }; | 62static const char KW_IMPLIED[] = { 63 ASCII_I, ASCII_M, ASCII_P, ASCII_L, ASCII_I, ASCII_E, ASCII_D, '\0' }; |
64#ifdef XML_DTD |
|
53static const char KW_INCLUDE[] = { 54 ASCII_I, ASCII_N, ASCII_C, ASCII_L, ASCII_U, ASCII_D, ASCII_E, '\0' }; | 65static const char KW_INCLUDE[] = { 66 ASCII_I, ASCII_N, ASCII_C, ASCII_L, ASCII_U, ASCII_D, ASCII_E, '\0' }; |
67#endif |
|
55static const char KW_NDATA[] = { 56 ASCII_N, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0' }; 57static const char KW_NMTOKEN[] = { 58 ASCII_N, ASCII_M, ASCII_T, ASCII_O, ASCII_K, ASCII_E, ASCII_N, '\0' }; 59static const char KW_NMTOKENS[] = { 60 ASCII_N, ASCII_M, ASCII_T, ASCII_O, ASCII_K, ASCII_E, ASCII_N, ASCII_S, 61 '\0' }; 62static const char KW_NOTATION[] = --- 17 unchanged lines hidden (view full) --- 80#define setTopLevel(state) \ 81 ((state)->handler = ((state)->documentEntity \ 82 ? internalSubset \ 83 : externalSubset1)) 84#else /* not XML_DTD */ 85#define setTopLevel(state) ((state)->handler = internalSubset) 86#endif /* not XML_DTD */ 87 | 68static const char KW_NDATA[] = { 69 ASCII_N, ASCII_D, ASCII_A, ASCII_T, ASCII_A, '\0' }; 70static const char KW_NMTOKEN[] = { 71 ASCII_N, ASCII_M, ASCII_T, ASCII_O, ASCII_K, ASCII_E, ASCII_N, '\0' }; 72static const char KW_NMTOKENS[] = { 73 ASCII_N, ASCII_M, ASCII_T, ASCII_O, ASCII_K, ASCII_E, ASCII_N, ASCII_S, 74 '\0' }; 75static const char KW_NOTATION[] = --- 17 unchanged lines hidden (view full) --- 93#define setTopLevel(state) \ 94 ((state)->handler = ((state)->documentEntity \ 95 ? internalSubset \ 96 : externalSubset1)) 97#else /* not XML_DTD */ 98#define setTopLevel(state) ((state)->handler = internalSubset) 99#endif /* not XML_DTD */ 100 |
88typedef int FASTCALL PROLOG_HANDLER(PROLOG_STATE *state, 89 int tok, 90 const char *ptr, 91 const char *end, 92 const ENCODING *enc); | 101typedef int PTRCALL PROLOG_HANDLER(PROLOG_STATE *state, 102 int tok, 103 const char *ptr, 104 const char *end, 105 const ENCODING *enc); |
93 94static PROLOG_HANDLER 95 prolog0, prolog1, prolog2, 96 doctype0, doctype1, doctype2, doctype3, doctype4, doctype5, 97 internalSubset, 98 entity0, entity1, entity2, entity3, entity4, entity5, entity6, 99 entity7, entity8, entity9, entity10, 100 notation0, notation1, notation2, notation3, notation4, --- 5 unchanged lines hidden (view full) --- 106 externalSubset0, externalSubset1, 107 condSect0, condSect1, condSect2, 108#endif /* XML_DTD */ 109 declClose, 110 error; 111 112static int FASTCALL common(PROLOG_STATE *state, int tok); 113 | 106 107static PROLOG_HANDLER 108 prolog0, prolog1, prolog2, 109 doctype0, doctype1, doctype2, doctype3, doctype4, doctype5, 110 internalSubset, 111 entity0, entity1, entity2, entity3, entity4, entity5, entity6, 112 entity7, entity8, entity9, entity10, 113 notation0, notation1, notation2, notation3, notation4, --- 5 unchanged lines hidden (view full) --- 119 externalSubset0, externalSubset1, 120 condSect0, condSect1, condSect2, 121#endif /* XML_DTD */ 122 declClose, 123 error; 124 125static int FASTCALL common(PROLOG_STATE *state, int tok); 126 |
114static int FASTCALL | 127static int PTRCALL |
115prolog0(PROLOG_STATE *state, 116 int tok, 117 const char *ptr, 118 const char *end, 119 const ENCODING *enc) 120{ 121 switch (tok) { 122 case XML_TOK_PROLOG_S: --- 20 unchanged lines hidden (view full) --- 143 return XML_ROLE_DOCTYPE_NONE; 144 case XML_TOK_INSTANCE_START: 145 state->handler = error; 146 return XML_ROLE_INSTANCE_START; 147 } 148 return common(state, tok); 149} 150 | 128prolog0(PROLOG_STATE *state, 129 int tok, 130 const char *ptr, 131 const char *end, 132 const ENCODING *enc) 133{ 134 switch (tok) { 135 case XML_TOK_PROLOG_S: --- 20 unchanged lines hidden (view full) --- 156 return XML_ROLE_DOCTYPE_NONE; 157 case XML_TOK_INSTANCE_START: 158 state->handler = error; 159 return XML_ROLE_INSTANCE_START; 160 } 161 return common(state, tok); 162} 163 |
151static int FASTCALL | 164static int PTRCALL |
152prolog1(PROLOG_STATE *state, 153 int tok, 154 const char *ptr, 155 const char *end, 156 const ENCODING *enc) 157{ 158 switch (tok) { 159 case XML_TOK_PROLOG_S: --- 14 unchanged lines hidden (view full) --- 174 return XML_ROLE_DOCTYPE_NONE; 175 case XML_TOK_INSTANCE_START: 176 state->handler = error; 177 return XML_ROLE_INSTANCE_START; 178 } 179 return common(state, tok); 180} 181 | 165prolog1(PROLOG_STATE *state, 166 int tok, 167 const char *ptr, 168 const char *end, 169 const ENCODING *enc) 170{ 171 switch (tok) { 172 case XML_TOK_PROLOG_S: --- 14 unchanged lines hidden (view full) --- 187 return XML_ROLE_DOCTYPE_NONE; 188 case XML_TOK_INSTANCE_START: 189 state->handler = error; 190 return XML_ROLE_INSTANCE_START; 191 } 192 return common(state, tok); 193} 194 |
182static int FASTCALL | 195static int PTRCALL |
183prolog2(PROLOG_STATE *state, 184 int tok, 185 const char *ptr, 186 const char *end, 187 const ENCODING *enc) 188{ 189 switch (tok) { 190 case XML_TOK_PROLOG_S: --- 4 unchanged lines hidden (view full) --- 195 return XML_ROLE_COMMENT; 196 case XML_TOK_INSTANCE_START: 197 state->handler = error; 198 return XML_ROLE_INSTANCE_START; 199 } 200 return common(state, tok); 201} 202 | 196prolog2(PROLOG_STATE *state, 197 int tok, 198 const char *ptr, 199 const char *end, 200 const ENCODING *enc) 201{ 202 switch (tok) { 203 case XML_TOK_PROLOG_S: --- 4 unchanged lines hidden (view full) --- 208 return XML_ROLE_COMMENT; 209 case XML_TOK_INSTANCE_START: 210 state->handler = error; 211 return XML_ROLE_INSTANCE_START; 212 } 213 return common(state, tok); 214} 215 |
203static int FASTCALL | 216static int PTRCALL |
204doctype0(PROLOG_STATE *state, 205 int tok, 206 const char *ptr, 207 const char *end, 208 const ENCODING *enc) 209{ 210 switch (tok) { 211 case XML_TOK_PROLOG_S: 212 return XML_ROLE_DOCTYPE_NONE; 213 case XML_TOK_NAME: 214 case XML_TOK_PREFIXED_NAME: 215 state->handler = doctype1; 216 return XML_ROLE_DOCTYPE_NAME; 217 } 218 return common(state, tok); 219} 220 | 217doctype0(PROLOG_STATE *state, 218 int tok, 219 const char *ptr, 220 const char *end, 221 const ENCODING *enc) 222{ 223 switch (tok) { 224 case XML_TOK_PROLOG_S: 225 return XML_ROLE_DOCTYPE_NONE; 226 case XML_TOK_NAME: 227 case XML_TOK_PREFIXED_NAME: 228 state->handler = doctype1; 229 return XML_ROLE_DOCTYPE_NAME; 230 } 231 return common(state, tok); 232} 233 |
221static int FASTCALL | 234static int PTRCALL |
222doctype1(PROLOG_STATE *state, 223 int tok, 224 const char *ptr, 225 const char *end, 226 const ENCODING *enc) 227{ 228 switch (tok) { 229 case XML_TOK_PROLOG_S: --- 13 unchanged lines hidden (view full) --- 243 state->handler = doctype2; 244 return XML_ROLE_DOCTYPE_NONE; 245 } 246 break; 247 } 248 return common(state, tok); 249} 250 | 235doctype1(PROLOG_STATE *state, 236 int tok, 237 const char *ptr, 238 const char *end, 239 const ENCODING *enc) 240{ 241 switch (tok) { 242 case XML_TOK_PROLOG_S: --- 13 unchanged lines hidden (view full) --- 256 state->handler = doctype2; 257 return XML_ROLE_DOCTYPE_NONE; 258 } 259 break; 260 } 261 return common(state, tok); 262} 263 |
251static int FASTCALL | 264static int PTRCALL |
252doctype2(PROLOG_STATE *state, 253 int tok, 254 const char *ptr, 255 const char *end, 256 const ENCODING *enc) 257{ 258 switch (tok) { 259 case XML_TOK_PROLOG_S: 260 return XML_ROLE_DOCTYPE_NONE; 261 case XML_TOK_LITERAL: 262 state->handler = doctype3; 263 return XML_ROLE_DOCTYPE_PUBLIC_ID; 264 } 265 return common(state, tok); 266} 267 | 265doctype2(PROLOG_STATE *state, 266 int tok, 267 const char *ptr, 268 const char *end, 269 const ENCODING *enc) 270{ 271 switch (tok) { 272 case XML_TOK_PROLOG_S: 273 return XML_ROLE_DOCTYPE_NONE; 274 case XML_TOK_LITERAL: 275 state->handler = doctype3; 276 return XML_ROLE_DOCTYPE_PUBLIC_ID; 277 } 278 return common(state, tok); 279} 280 |
268static int FASTCALL | 281static int PTRCALL |
269doctype3(PROLOG_STATE *state, 270 int tok, 271 const char *ptr, 272 const char *end, 273 const ENCODING *enc) 274{ 275 switch (tok) { 276 case XML_TOK_PROLOG_S: 277 return XML_ROLE_DOCTYPE_NONE; 278 case XML_TOK_LITERAL: 279 state->handler = doctype4; 280 return XML_ROLE_DOCTYPE_SYSTEM_ID; 281 } 282 return common(state, tok); 283} 284 | 282doctype3(PROLOG_STATE *state, 283 int tok, 284 const char *ptr, 285 const char *end, 286 const ENCODING *enc) 287{ 288 switch (tok) { 289 case XML_TOK_PROLOG_S: 290 return XML_ROLE_DOCTYPE_NONE; 291 case XML_TOK_LITERAL: 292 state->handler = doctype4; 293 return XML_ROLE_DOCTYPE_SYSTEM_ID; 294 } 295 return common(state, tok); 296} 297 |
285static int FASTCALL | 298static int PTRCALL |
286doctype4(PROLOG_STATE *state, 287 int tok, 288 const char *ptr, 289 const char *end, 290 const ENCODING *enc) 291{ 292 switch (tok) { 293 case XML_TOK_PROLOG_S: 294 return XML_ROLE_DOCTYPE_NONE; 295 case XML_TOK_OPEN_BRACKET: 296 state->handler = internalSubset; 297 return XML_ROLE_DOCTYPE_INTERNAL_SUBSET; 298 case XML_TOK_DECL_CLOSE: 299 state->handler = prolog2; 300 return XML_ROLE_DOCTYPE_CLOSE; 301 } 302 return common(state, tok); 303} 304 | 299doctype4(PROLOG_STATE *state, 300 int tok, 301 const char *ptr, 302 const char *end, 303 const ENCODING *enc) 304{ 305 switch (tok) { 306 case XML_TOK_PROLOG_S: 307 return XML_ROLE_DOCTYPE_NONE; 308 case XML_TOK_OPEN_BRACKET: 309 state->handler = internalSubset; 310 return XML_ROLE_DOCTYPE_INTERNAL_SUBSET; 311 case XML_TOK_DECL_CLOSE: 312 state->handler = prolog2; 313 return XML_ROLE_DOCTYPE_CLOSE; 314 } 315 return common(state, tok); 316} 317 |
305static int FASTCALL | 318static int PTRCALL |
306doctype5(PROLOG_STATE *state, 307 int tok, 308 const char *ptr, 309 const char *end, 310 const ENCODING *enc) 311{ 312 switch (tok) { 313 case XML_TOK_PROLOG_S: 314 return XML_ROLE_DOCTYPE_NONE; 315 case XML_TOK_DECL_CLOSE: 316 state->handler = prolog2; 317 return XML_ROLE_DOCTYPE_CLOSE; 318 } 319 return common(state, tok); 320} 321 | 319doctype5(PROLOG_STATE *state, 320 int tok, 321 const char *ptr, 322 const char *end, 323 const ENCODING *enc) 324{ 325 switch (tok) { 326 case XML_TOK_PROLOG_S: 327 return XML_ROLE_DOCTYPE_NONE; 328 case XML_TOK_DECL_CLOSE: 329 state->handler = prolog2; 330 return XML_ROLE_DOCTYPE_CLOSE; 331 } 332 return common(state, tok); 333} 334 |
322static int FASTCALL | 335static int PTRCALL |
323internalSubset(PROLOG_STATE *state, 324 int tok, 325 const char *ptr, 326 const char *end, 327 const ENCODING *enc) 328{ 329 switch (tok) { 330 case XML_TOK_PROLOG_S: --- 32 unchanged lines hidden (view full) --- 363 return XML_ROLE_PI; 364 case XML_TOK_COMMENT: 365 return XML_ROLE_COMMENT; 366 case XML_TOK_PARAM_ENTITY_REF: 367 return XML_ROLE_PARAM_ENTITY_REF; 368 case XML_TOK_CLOSE_BRACKET: 369 state->handler = doctype5; 370 return XML_ROLE_DOCTYPE_NONE; | 336internalSubset(PROLOG_STATE *state, 337 int tok, 338 const char *ptr, 339 const char *end, 340 const ENCODING *enc) 341{ 342 switch (tok) { 343 case XML_TOK_PROLOG_S: --- 32 unchanged lines hidden (view full) --- 376 return XML_ROLE_PI; 377 case XML_TOK_COMMENT: 378 return XML_ROLE_COMMENT; 379 case XML_TOK_PARAM_ENTITY_REF: 380 return XML_ROLE_PARAM_ENTITY_REF; 381 case XML_TOK_CLOSE_BRACKET: 382 state->handler = doctype5; 383 return XML_ROLE_DOCTYPE_NONE; |
384 case XML_TOK_NONE: 385 return XML_ROLE_NONE; |
|
371 } 372 return common(state, tok); 373} 374 375#ifdef XML_DTD 376 | 386 } 387 return common(state, tok); 388} 389 390#ifdef XML_DTD 391 |
377static int FASTCALL | 392static int PTRCALL |
378externalSubset0(PROLOG_STATE *state, 379 int tok, 380 const char *ptr, 381 const char *end, 382 const ENCODING *enc) 383{ 384 state->handler = externalSubset1; 385 if (tok == XML_TOK_XML_DECL) 386 return XML_ROLE_TEXT_DECL; 387 return externalSubset1(state, tok, ptr, end, enc); 388} 389 | 393externalSubset0(PROLOG_STATE *state, 394 int tok, 395 const char *ptr, 396 const char *end, 397 const ENCODING *enc) 398{ 399 state->handler = externalSubset1; 400 if (tok == XML_TOK_XML_DECL) 401 return XML_ROLE_TEXT_DECL; 402 return externalSubset1(state, tok, ptr, end, enc); 403} 404 |
390static int FASTCALL | 405static int PTRCALL |
391externalSubset1(PROLOG_STATE *state, 392 int tok, 393 const char *ptr, 394 const char *end, 395 const ENCODING *enc) 396{ 397 switch (tok) { 398 case XML_TOK_COND_SECT_OPEN: --- 15 unchanged lines hidden (view full) --- 414 default: 415 return internalSubset(state, tok, ptr, end, enc); 416 } 417 return common(state, tok); 418} 419 420#endif /* XML_DTD */ 421 | 406externalSubset1(PROLOG_STATE *state, 407 int tok, 408 const char *ptr, 409 const char *end, 410 const ENCODING *enc) 411{ 412 switch (tok) { 413 case XML_TOK_COND_SECT_OPEN: --- 15 unchanged lines hidden (view full) --- 429 default: 430 return internalSubset(state, tok, ptr, end, enc); 431 } 432 return common(state, tok); 433} 434 435#endif /* XML_DTD */ 436 |
422static int FASTCALL | 437static int PTRCALL |
423entity0(PROLOG_STATE *state, 424 int tok, 425 const char *ptr, 426 const char *end, 427 const ENCODING *enc) 428{ 429 switch (tok) { 430 case XML_TOK_PROLOG_S: 431 return XML_ROLE_ENTITY_NONE; 432 case XML_TOK_PERCENT: 433 state->handler = entity1; 434 return XML_ROLE_ENTITY_NONE; 435 case XML_TOK_NAME: 436 state->handler = entity2; 437 return XML_ROLE_GENERAL_ENTITY_NAME; 438 } 439 return common(state, tok); 440} 441 | 438entity0(PROLOG_STATE *state, 439 int tok, 440 const char *ptr, 441 const char *end, 442 const ENCODING *enc) 443{ 444 switch (tok) { 445 case XML_TOK_PROLOG_S: 446 return XML_ROLE_ENTITY_NONE; 447 case XML_TOK_PERCENT: 448 state->handler = entity1; 449 return XML_ROLE_ENTITY_NONE; 450 case XML_TOK_NAME: 451 state->handler = entity2; 452 return XML_ROLE_GENERAL_ENTITY_NAME; 453 } 454 return common(state, tok); 455} 456 |
442static int FASTCALL | 457static int PTRCALL |
443entity1(PROLOG_STATE *state, 444 int tok, 445 const char *ptr, 446 const char *end, 447 const ENCODING *enc) 448{ 449 switch (tok) { 450 case XML_TOK_PROLOG_S: 451 return XML_ROLE_ENTITY_NONE; 452 case XML_TOK_NAME: 453 state->handler = entity7; 454 return XML_ROLE_PARAM_ENTITY_NAME; 455 } 456 return common(state, tok); 457} 458 | 458entity1(PROLOG_STATE *state, 459 int tok, 460 const char *ptr, 461 const char *end, 462 const ENCODING *enc) 463{ 464 switch (tok) { 465 case XML_TOK_PROLOG_S: 466 return XML_ROLE_ENTITY_NONE; 467 case XML_TOK_NAME: 468 state->handler = entity7; 469 return XML_ROLE_PARAM_ENTITY_NAME; 470 } 471 return common(state, tok); 472} 473 |
459static int FASTCALL | 474static int PTRCALL |
460entity2(PROLOG_STATE *state, 461 int tok, 462 const char *ptr, 463 const char *end, 464 const ENCODING *enc) 465{ 466 switch (tok) { 467 case XML_TOK_PROLOG_S: --- 11 unchanged lines hidden (view full) --- 479 case XML_TOK_LITERAL: 480 state->handler = declClose; 481 state->role_none = XML_ROLE_ENTITY_NONE; 482 return XML_ROLE_ENTITY_VALUE; 483 } 484 return common(state, tok); 485} 486 | 475entity2(PROLOG_STATE *state, 476 int tok, 477 const char *ptr, 478 const char *end, 479 const ENCODING *enc) 480{ 481 switch (tok) { 482 case XML_TOK_PROLOG_S: --- 11 unchanged lines hidden (view full) --- 494 case XML_TOK_LITERAL: 495 state->handler = declClose; 496 state->role_none = XML_ROLE_ENTITY_NONE; 497 return XML_ROLE_ENTITY_VALUE; 498 } 499 return common(state, tok); 500} 501 |
487static int FASTCALL | 502static int PTRCALL |
488entity3(PROLOG_STATE *state, 489 int tok, 490 const char *ptr, 491 const char *end, 492 const ENCODING *enc) 493{ 494 switch (tok) { 495 case XML_TOK_PROLOG_S: 496 return XML_ROLE_ENTITY_NONE; 497 case XML_TOK_LITERAL: 498 state->handler = entity4; 499 return XML_ROLE_ENTITY_PUBLIC_ID; 500 } 501 return common(state, tok); 502} 503 | 503entity3(PROLOG_STATE *state, 504 int tok, 505 const char *ptr, 506 const char *end, 507 const ENCODING *enc) 508{ 509 switch (tok) { 510 case XML_TOK_PROLOG_S: 511 return XML_ROLE_ENTITY_NONE; 512 case XML_TOK_LITERAL: 513 state->handler = entity4; 514 return XML_ROLE_ENTITY_PUBLIC_ID; 515 } 516 return common(state, tok); 517} 518 |
504static int FASTCALL | 519static int PTRCALL |
505entity4(PROLOG_STATE *state, 506 int tok, 507 const char *ptr, 508 const char *end, 509 const ENCODING *enc) 510{ 511 switch (tok) { 512 case XML_TOK_PROLOG_S: 513 return XML_ROLE_ENTITY_NONE; 514 case XML_TOK_LITERAL: 515 state->handler = entity5; 516 return XML_ROLE_ENTITY_SYSTEM_ID; 517 } 518 return common(state, tok); 519} 520 | 520entity4(PROLOG_STATE *state, 521 int tok, 522 const char *ptr, 523 const char *end, 524 const ENCODING *enc) 525{ 526 switch (tok) { 527 case XML_TOK_PROLOG_S: 528 return XML_ROLE_ENTITY_NONE; 529 case XML_TOK_LITERAL: 530 state->handler = entity5; 531 return XML_ROLE_ENTITY_SYSTEM_ID; 532 } 533 return common(state, tok); 534} 535 |
521static int FASTCALL | 536static int PTRCALL |
522entity5(PROLOG_STATE *state, 523 int tok, 524 const char *ptr, 525 const char *end, 526 const ENCODING *enc) 527{ 528 switch (tok) { 529 case XML_TOK_PROLOG_S: --- 6 unchanged lines hidden (view full) --- 536 state->handler = entity6; 537 return XML_ROLE_ENTITY_NONE; 538 } 539 break; 540 } 541 return common(state, tok); 542} 543 | 537entity5(PROLOG_STATE *state, 538 int tok, 539 const char *ptr, 540 const char *end, 541 const ENCODING *enc) 542{ 543 switch (tok) { 544 case XML_TOK_PROLOG_S: --- 6 unchanged lines hidden (view full) --- 551 state->handler = entity6; 552 return XML_ROLE_ENTITY_NONE; 553 } 554 break; 555 } 556 return common(state, tok); 557} 558 |
544static int FASTCALL | 559static int PTRCALL |
545entity6(PROLOG_STATE *state, 546 int tok, 547 const char *ptr, 548 const char *end, 549 const ENCODING *enc) 550{ 551 switch (tok) { 552 case XML_TOK_PROLOG_S: 553 return XML_ROLE_ENTITY_NONE; 554 case XML_TOK_NAME: 555 state->handler = declClose; 556 state->role_none = XML_ROLE_ENTITY_NONE; 557 return XML_ROLE_ENTITY_NOTATION_NAME; 558 } 559 return common(state, tok); 560} 561 | 560entity6(PROLOG_STATE *state, 561 int tok, 562 const char *ptr, 563 const char *end, 564 const ENCODING *enc) 565{ 566 switch (tok) { 567 case XML_TOK_PROLOG_S: 568 return XML_ROLE_ENTITY_NONE; 569 case XML_TOK_NAME: 570 state->handler = declClose; 571 state->role_none = XML_ROLE_ENTITY_NONE; 572 return XML_ROLE_ENTITY_NOTATION_NAME; 573 } 574 return common(state, tok); 575} 576 |
562static int FASTCALL | 577static int PTRCALL |
563entity7(PROLOG_STATE *state, 564 int tok, 565 const char *ptr, 566 const char *end, 567 const ENCODING *enc) 568{ 569 switch (tok) { 570 case XML_TOK_PROLOG_S: --- 11 unchanged lines hidden (view full) --- 582 case XML_TOK_LITERAL: 583 state->handler = declClose; 584 state->role_none = XML_ROLE_ENTITY_NONE; 585 return XML_ROLE_ENTITY_VALUE; 586 } 587 return common(state, tok); 588} 589 | 578entity7(PROLOG_STATE *state, 579 int tok, 580 const char *ptr, 581 const char *end, 582 const ENCODING *enc) 583{ 584 switch (tok) { 585 case XML_TOK_PROLOG_S: --- 11 unchanged lines hidden (view full) --- 597 case XML_TOK_LITERAL: 598 state->handler = declClose; 599 state->role_none = XML_ROLE_ENTITY_NONE; 600 return XML_ROLE_ENTITY_VALUE; 601 } 602 return common(state, tok); 603} 604 |
590static int FASTCALL | 605static int PTRCALL |
591entity8(PROLOG_STATE *state, 592 int tok, 593 const char *ptr, 594 const char *end, 595 const ENCODING *enc) 596{ 597 switch (tok) { 598 case XML_TOK_PROLOG_S: 599 return XML_ROLE_ENTITY_NONE; 600 case XML_TOK_LITERAL: 601 state->handler = entity9; 602 return XML_ROLE_ENTITY_PUBLIC_ID; 603 } 604 return common(state, tok); 605} 606 | 606entity8(PROLOG_STATE *state, 607 int tok, 608 const char *ptr, 609 const char *end, 610 const ENCODING *enc) 611{ 612 switch (tok) { 613 case XML_TOK_PROLOG_S: 614 return XML_ROLE_ENTITY_NONE; 615 case XML_TOK_LITERAL: 616 state->handler = entity9; 617 return XML_ROLE_ENTITY_PUBLIC_ID; 618 } 619 return common(state, tok); 620} 621 |
607static int FASTCALL | 622static int PTRCALL |
608entity9(PROLOG_STATE *state, 609 int tok, 610 const char *ptr, 611 const char *end, 612 const ENCODING *enc) 613{ 614 switch (tok) { 615 case XML_TOK_PROLOG_S: 616 return XML_ROLE_ENTITY_NONE; 617 case XML_TOK_LITERAL: 618 state->handler = entity10; 619 return XML_ROLE_ENTITY_SYSTEM_ID; 620 } 621 return common(state, tok); 622} 623 | 623entity9(PROLOG_STATE *state, 624 int tok, 625 const char *ptr, 626 const char *end, 627 const ENCODING *enc) 628{ 629 switch (tok) { 630 case XML_TOK_PROLOG_S: 631 return XML_ROLE_ENTITY_NONE; 632 case XML_TOK_LITERAL: 633 state->handler = entity10; 634 return XML_ROLE_ENTITY_SYSTEM_ID; 635 } 636 return common(state, tok); 637} 638 |
624static int FASTCALL | 639static int PTRCALL |
625entity10(PROLOG_STATE *state, 626 int tok, 627 const char *ptr, 628 const char *end, 629 const ENCODING *enc) 630{ 631 switch (tok) { 632 case XML_TOK_PROLOG_S: 633 return XML_ROLE_ENTITY_NONE; 634 case XML_TOK_DECL_CLOSE: 635 setTopLevel(state); 636 return XML_ROLE_ENTITY_COMPLETE; 637 } 638 return common(state, tok); 639} 640 | 640entity10(PROLOG_STATE *state, 641 int tok, 642 const char *ptr, 643 const char *end, 644 const ENCODING *enc) 645{ 646 switch (tok) { 647 case XML_TOK_PROLOG_S: 648 return XML_ROLE_ENTITY_NONE; 649 case XML_TOK_DECL_CLOSE: 650 setTopLevel(state); 651 return XML_ROLE_ENTITY_COMPLETE; 652 } 653 return common(state, tok); 654} 655 |
641static int FASTCALL | 656static int PTRCALL |
642notation0(PROLOG_STATE *state, 643 int tok, 644 const char *ptr, 645 const char *end, 646 const ENCODING *enc) 647{ 648 switch (tok) { 649 case XML_TOK_PROLOG_S: 650 return XML_ROLE_NOTATION_NONE; 651 case XML_TOK_NAME: 652 state->handler = notation1; 653 return XML_ROLE_NOTATION_NAME; 654 } 655 return common(state, tok); 656} 657 | 657notation0(PROLOG_STATE *state, 658 int tok, 659 const char *ptr, 660 const char *end, 661 const ENCODING *enc) 662{ 663 switch (tok) { 664 case XML_TOK_PROLOG_S: 665 return XML_ROLE_NOTATION_NONE; 666 case XML_TOK_NAME: 667 state->handler = notation1; 668 return XML_ROLE_NOTATION_NAME; 669 } 670 return common(state, tok); 671} 672 |
658static int FASTCALL | 673static int PTRCALL |
659notation1(PROLOG_STATE *state, 660 int tok, 661 const char *ptr, 662 const char *end, 663 const ENCODING *enc) 664{ 665 switch (tok) { 666 case XML_TOK_PROLOG_S: --- 7 unchanged lines hidden (view full) --- 674 state->handler = notation2; 675 return XML_ROLE_NOTATION_NONE; 676 } 677 break; 678 } 679 return common(state, tok); 680} 681 | 674notation1(PROLOG_STATE *state, 675 int tok, 676 const char *ptr, 677 const char *end, 678 const ENCODING *enc) 679{ 680 switch (tok) { 681 case XML_TOK_PROLOG_S: --- 7 unchanged lines hidden (view full) --- 689 state->handler = notation2; 690 return XML_ROLE_NOTATION_NONE; 691 } 692 break; 693 } 694 return common(state, tok); 695} 696 |
682static int FASTCALL | 697static int PTRCALL |
683notation2(PROLOG_STATE *state, 684 int tok, 685 const char *ptr, 686 const char *end, 687 const ENCODING *enc) 688{ 689 switch (tok) { 690 case XML_TOK_PROLOG_S: 691 return XML_ROLE_NOTATION_NONE; 692 case XML_TOK_LITERAL: 693 state->handler = notation4; 694 return XML_ROLE_NOTATION_PUBLIC_ID; 695 } 696 return common(state, tok); 697} 698 | 698notation2(PROLOG_STATE *state, 699 int tok, 700 const char *ptr, 701 const char *end, 702 const ENCODING *enc) 703{ 704 switch (tok) { 705 case XML_TOK_PROLOG_S: 706 return XML_ROLE_NOTATION_NONE; 707 case XML_TOK_LITERAL: 708 state->handler = notation4; 709 return XML_ROLE_NOTATION_PUBLIC_ID; 710 } 711 return common(state, tok); 712} 713 |
699static int FASTCALL | 714static int PTRCALL |
700notation3(PROLOG_STATE *state, 701 int tok, 702 const char *ptr, 703 const char *end, 704 const ENCODING *enc) 705{ 706 switch (tok) { 707 case XML_TOK_PROLOG_S: 708 return XML_ROLE_NOTATION_NONE; 709 case XML_TOK_LITERAL: 710 state->handler = declClose; 711 state->role_none = XML_ROLE_NOTATION_NONE; 712 return XML_ROLE_NOTATION_SYSTEM_ID; 713 } 714 return common(state, tok); 715} 716 | 715notation3(PROLOG_STATE *state, 716 int tok, 717 const char *ptr, 718 const char *end, 719 const ENCODING *enc) 720{ 721 switch (tok) { 722 case XML_TOK_PROLOG_S: 723 return XML_ROLE_NOTATION_NONE; 724 case XML_TOK_LITERAL: 725 state->handler = declClose; 726 state->role_none = XML_ROLE_NOTATION_NONE; 727 return XML_ROLE_NOTATION_SYSTEM_ID; 728 } 729 return common(state, tok); 730} 731 |
717static int FASTCALL | 732static int PTRCALL |
718notation4(PROLOG_STATE *state, 719 int tok, 720 const char *ptr, 721 const char *end, 722 const ENCODING *enc) 723{ 724 switch (tok) { 725 case XML_TOK_PROLOG_S: --- 4 unchanged lines hidden (view full) --- 730 return XML_ROLE_NOTATION_SYSTEM_ID; 731 case XML_TOK_DECL_CLOSE: 732 setTopLevel(state); 733 return XML_ROLE_NOTATION_NO_SYSTEM_ID; 734 } 735 return common(state, tok); 736} 737 | 733notation4(PROLOG_STATE *state, 734 int tok, 735 const char *ptr, 736 const char *end, 737 const ENCODING *enc) 738{ 739 switch (tok) { 740 case XML_TOK_PROLOG_S: --- 4 unchanged lines hidden (view full) --- 745 return XML_ROLE_NOTATION_SYSTEM_ID; 746 case XML_TOK_DECL_CLOSE: 747 setTopLevel(state); 748 return XML_ROLE_NOTATION_NO_SYSTEM_ID; 749 } 750 return common(state, tok); 751} 752 |
738static int FASTCALL | 753static int PTRCALL |
739attlist0(PROLOG_STATE *state, 740 int tok, 741 const char *ptr, 742 const char *end, 743 const ENCODING *enc) 744{ 745 switch (tok) { 746 case XML_TOK_PROLOG_S: 747 return XML_ROLE_ATTLIST_NONE; 748 case XML_TOK_NAME: 749 case XML_TOK_PREFIXED_NAME: 750 state->handler = attlist1; 751 return XML_ROLE_ATTLIST_ELEMENT_NAME; 752 } 753 return common(state, tok); 754} 755 | 754attlist0(PROLOG_STATE *state, 755 int tok, 756 const char *ptr, 757 const char *end, 758 const ENCODING *enc) 759{ 760 switch (tok) { 761 case XML_TOK_PROLOG_S: 762 return XML_ROLE_ATTLIST_NONE; 763 case XML_TOK_NAME: 764 case XML_TOK_PREFIXED_NAME: 765 state->handler = attlist1; 766 return XML_ROLE_ATTLIST_ELEMENT_NAME; 767 } 768 return common(state, tok); 769} 770 |
756static int FASTCALL | 771static int PTRCALL |
757attlist1(PROLOG_STATE *state, 758 int tok, 759 const char *ptr, 760 const char *end, 761 const ENCODING *enc) 762{ 763 switch (tok) { 764 case XML_TOK_PROLOG_S: --- 4 unchanged lines hidden (view full) --- 769 case XML_TOK_NAME: 770 case XML_TOK_PREFIXED_NAME: 771 state->handler = attlist2; 772 return XML_ROLE_ATTRIBUTE_NAME; 773 } 774 return common(state, tok); 775} 776 | 772attlist1(PROLOG_STATE *state, 773 int tok, 774 const char *ptr, 775 const char *end, 776 const ENCODING *enc) 777{ 778 switch (tok) { 779 case XML_TOK_PROLOG_S: --- 4 unchanged lines hidden (view full) --- 784 case XML_TOK_NAME: 785 case XML_TOK_PREFIXED_NAME: 786 state->handler = attlist2; 787 return XML_ROLE_ATTRIBUTE_NAME; 788 } 789 return common(state, tok); 790} 791 |
777static int FASTCALL | 792static int PTRCALL |
778attlist2(PROLOG_STATE *state, 779 int tok, 780 const char *ptr, 781 const char *end, 782 const ENCODING *enc) 783{ 784 switch (tok) { 785 case XML_TOK_PROLOG_S: 786 return XML_ROLE_ATTLIST_NONE; 787 case XML_TOK_NAME: 788 { | 793attlist2(PROLOG_STATE *state, 794 int tok, 795 const char *ptr, 796 const char *end, 797 const ENCODING *enc) 798{ 799 switch (tok) { 800 case XML_TOK_PROLOG_S: 801 return XML_ROLE_ATTLIST_NONE; 802 case XML_TOK_NAME: 803 { |
789 static const char *types[] = { | 804 static const char * const types[] = { |
790 KW_CDATA, 791 KW_ID, 792 KW_IDREF, 793 KW_IDREFS, 794 KW_ENTITY, 795 KW_ENTITIES, 796 KW_NMTOKEN, 797 KW_NMTOKENS, --- 12 unchanged lines hidden (view full) --- 810 break; 811 case XML_TOK_OPEN_PAREN: 812 state->handler = attlist3; 813 return XML_ROLE_ATTLIST_NONE; 814 } 815 return common(state, tok); 816} 817 | 805 KW_CDATA, 806 KW_ID, 807 KW_IDREF, 808 KW_IDREFS, 809 KW_ENTITY, 810 KW_ENTITIES, 811 KW_NMTOKEN, 812 KW_NMTOKENS, --- 12 unchanged lines hidden (view full) --- 825 break; 826 case XML_TOK_OPEN_PAREN: 827 state->handler = attlist3; 828 return XML_ROLE_ATTLIST_NONE; 829 } 830 return common(state, tok); 831} 832 |
818static int FASTCALL | 833static int PTRCALL |
819attlist3(PROLOG_STATE *state, 820 int tok, 821 const char *ptr, 822 const char *end, 823 const ENCODING *enc) 824{ 825 switch (tok) { 826 case XML_TOK_PROLOG_S: 827 return XML_ROLE_ATTLIST_NONE; 828 case XML_TOK_NMTOKEN: 829 case XML_TOK_NAME: 830 case XML_TOK_PREFIXED_NAME: 831 state->handler = attlist4; 832 return XML_ROLE_ATTRIBUTE_ENUM_VALUE; 833 } 834 return common(state, tok); 835} 836 | 834attlist3(PROLOG_STATE *state, 835 int tok, 836 const char *ptr, 837 const char *end, 838 const ENCODING *enc) 839{ 840 switch (tok) { 841 case XML_TOK_PROLOG_S: 842 return XML_ROLE_ATTLIST_NONE; 843 case XML_TOK_NMTOKEN: 844 case XML_TOK_NAME: 845 case XML_TOK_PREFIXED_NAME: 846 state->handler = attlist4; 847 return XML_ROLE_ATTRIBUTE_ENUM_VALUE; 848 } 849 return common(state, tok); 850} 851 |
837static int FASTCALL | 852static int PTRCALL |
838attlist4(PROLOG_STATE *state, 839 int tok, 840 const char *ptr, 841 const char *end, 842 const ENCODING *enc) 843{ 844 switch (tok) { 845 case XML_TOK_PROLOG_S: 846 return XML_ROLE_ATTLIST_NONE; 847 case XML_TOK_CLOSE_PAREN: 848 state->handler = attlist8; 849 return XML_ROLE_ATTLIST_NONE; 850 case XML_TOK_OR: 851 state->handler = attlist3; 852 return XML_ROLE_ATTLIST_NONE; 853 } 854 return common(state, tok); 855} 856 | 853attlist4(PROLOG_STATE *state, 854 int tok, 855 const char *ptr, 856 const char *end, 857 const ENCODING *enc) 858{ 859 switch (tok) { 860 case XML_TOK_PROLOG_S: 861 return XML_ROLE_ATTLIST_NONE; 862 case XML_TOK_CLOSE_PAREN: 863 state->handler = attlist8; 864 return XML_ROLE_ATTLIST_NONE; 865 case XML_TOK_OR: 866 state->handler = attlist3; 867 return XML_ROLE_ATTLIST_NONE; 868 } 869 return common(state, tok); 870} 871 |
857static int FASTCALL | 872static int PTRCALL |
858attlist5(PROLOG_STATE *state, 859 int tok, 860 const char *ptr, 861 const char *end, 862 const ENCODING *enc) 863{ 864 switch (tok) { 865 case XML_TOK_PROLOG_S: 866 return XML_ROLE_ATTLIST_NONE; 867 case XML_TOK_OPEN_PAREN: 868 state->handler = attlist6; 869 return XML_ROLE_ATTLIST_NONE; 870 } 871 return common(state, tok); 872} 873 | 873attlist5(PROLOG_STATE *state, 874 int tok, 875 const char *ptr, 876 const char *end, 877 const ENCODING *enc) 878{ 879 switch (tok) { 880 case XML_TOK_PROLOG_S: 881 return XML_ROLE_ATTLIST_NONE; 882 case XML_TOK_OPEN_PAREN: 883 state->handler = attlist6; 884 return XML_ROLE_ATTLIST_NONE; 885 } 886 return common(state, tok); 887} 888 |
874static int FASTCALL | 889static int PTRCALL |
875attlist6(PROLOG_STATE *state, 876 int tok, 877 const char *ptr, 878 const char *end, 879 const ENCODING *enc) 880{ 881 switch (tok) { 882 case XML_TOK_PROLOG_S: 883 return XML_ROLE_ATTLIST_NONE; 884 case XML_TOK_NAME: 885 state->handler = attlist7; 886 return XML_ROLE_ATTRIBUTE_NOTATION_VALUE; 887 } 888 return common(state, tok); 889} 890 | 890attlist6(PROLOG_STATE *state, 891 int tok, 892 const char *ptr, 893 const char *end, 894 const ENCODING *enc) 895{ 896 switch (tok) { 897 case XML_TOK_PROLOG_S: 898 return XML_ROLE_ATTLIST_NONE; 899 case XML_TOK_NAME: 900 state->handler = attlist7; 901 return XML_ROLE_ATTRIBUTE_NOTATION_VALUE; 902 } 903 return common(state, tok); 904} 905 |
891static int FASTCALL | 906static int PTRCALL |
892attlist7(PROLOG_STATE *state, 893 int tok, 894 const char *ptr, 895 const char *end, 896 const ENCODING *enc) 897{ 898 switch (tok) { 899 case XML_TOK_PROLOG_S: --- 4 unchanged lines hidden (view full) --- 904 case XML_TOK_OR: 905 state->handler = attlist6; 906 return XML_ROLE_ATTLIST_NONE; 907 } 908 return common(state, tok); 909} 910 911/* default value */ | 907attlist7(PROLOG_STATE *state, 908 int tok, 909 const char *ptr, 910 const char *end, 911 const ENCODING *enc) 912{ 913 switch (tok) { 914 case XML_TOK_PROLOG_S: --- 4 unchanged lines hidden (view full) --- 919 case XML_TOK_OR: 920 state->handler = attlist6; 921 return XML_ROLE_ATTLIST_NONE; 922 } 923 return common(state, tok); 924} 925 926/* default value */ |
912static int FASTCALL | 927static int PTRCALL |
913attlist8(PROLOG_STATE *state, 914 int tok, 915 const char *ptr, 916 const char *end, 917 const ENCODING *enc) 918{ 919 switch (tok) { 920 case XML_TOK_PROLOG_S: --- 23 unchanged lines hidden (view full) --- 944 break; 945 case XML_TOK_LITERAL: 946 state->handler = attlist1; 947 return XML_ROLE_DEFAULT_ATTRIBUTE_VALUE; 948 } 949 return common(state, tok); 950} 951 | 928attlist8(PROLOG_STATE *state, 929 int tok, 930 const char *ptr, 931 const char *end, 932 const ENCODING *enc) 933{ 934 switch (tok) { 935 case XML_TOK_PROLOG_S: --- 23 unchanged lines hidden (view full) --- 959 break; 960 case XML_TOK_LITERAL: 961 state->handler = attlist1; 962 return XML_ROLE_DEFAULT_ATTRIBUTE_VALUE; 963 } 964 return common(state, tok); 965} 966 |
952static int FASTCALL | 967static int PTRCALL |
953attlist9(PROLOG_STATE *state, 954 int tok, 955 const char *ptr, 956 const char *end, 957 const ENCODING *enc) 958{ 959 switch (tok) { 960 case XML_TOK_PROLOG_S: 961 return XML_ROLE_ATTLIST_NONE; 962 case XML_TOK_LITERAL: 963 state->handler = attlist1; 964 return XML_ROLE_FIXED_ATTRIBUTE_VALUE; 965 } 966 return common(state, tok); 967} 968 | 968attlist9(PROLOG_STATE *state, 969 int tok, 970 const char *ptr, 971 const char *end, 972 const ENCODING *enc) 973{ 974 switch (tok) { 975 case XML_TOK_PROLOG_S: 976 return XML_ROLE_ATTLIST_NONE; 977 case XML_TOK_LITERAL: 978 state->handler = attlist1; 979 return XML_ROLE_FIXED_ATTRIBUTE_VALUE; 980 } 981 return common(state, tok); 982} 983 |
969static int FASTCALL | 984static int PTRCALL |
970element0(PROLOG_STATE *state, 971 int tok, 972 const char *ptr, 973 const char *end, 974 const ENCODING *enc) 975{ 976 switch (tok) { 977 case XML_TOK_PROLOG_S: 978 return XML_ROLE_ELEMENT_NONE; 979 case XML_TOK_NAME: 980 case XML_TOK_PREFIXED_NAME: 981 state->handler = element1; 982 return XML_ROLE_ELEMENT_NAME; 983 } 984 return common(state, tok); 985} 986 | 985element0(PROLOG_STATE *state, 986 int tok, 987 const char *ptr, 988 const char *end, 989 const ENCODING *enc) 990{ 991 switch (tok) { 992 case XML_TOK_PROLOG_S: 993 return XML_ROLE_ELEMENT_NONE; 994 case XML_TOK_NAME: 995 case XML_TOK_PREFIXED_NAME: 996 state->handler = element1; 997 return XML_ROLE_ELEMENT_NAME; 998 } 999 return common(state, tok); 1000} 1001 |
987static int FASTCALL | 1002static int PTRCALL |
988element1(PROLOG_STATE *state, 989 int tok, 990 const char *ptr, 991 const char *end, 992 const ENCODING *enc) 993{ 994 switch (tok) { 995 case XML_TOK_PROLOG_S: --- 13 unchanged lines hidden (view full) --- 1009 case XML_TOK_OPEN_PAREN: 1010 state->handler = element2; 1011 state->level = 1; 1012 return XML_ROLE_GROUP_OPEN; 1013 } 1014 return common(state, tok); 1015} 1016 | 1003element1(PROLOG_STATE *state, 1004 int tok, 1005 const char *ptr, 1006 const char *end, 1007 const ENCODING *enc) 1008{ 1009 switch (tok) { 1010 case XML_TOK_PROLOG_S: --- 13 unchanged lines hidden (view full) --- 1024 case XML_TOK_OPEN_PAREN: 1025 state->handler = element2; 1026 state->level = 1; 1027 return XML_ROLE_GROUP_OPEN; 1028 } 1029 return common(state, tok); 1030} 1031 |
1017static int FASTCALL | 1032static int PTRCALL |
1018element2(PROLOG_STATE *state, 1019 int tok, 1020 const char *ptr, 1021 const char *end, 1022 const ENCODING *enc) 1023{ 1024 switch (tok) { 1025 case XML_TOK_PROLOG_S: --- 23 unchanged lines hidden (view full) --- 1049 return XML_ROLE_CONTENT_ELEMENT_REP; 1050 case XML_TOK_NAME_PLUS: 1051 state->handler = element7; 1052 return XML_ROLE_CONTENT_ELEMENT_PLUS; 1053 } 1054 return common(state, tok); 1055} 1056 | 1033element2(PROLOG_STATE *state, 1034 int tok, 1035 const char *ptr, 1036 const char *end, 1037 const ENCODING *enc) 1038{ 1039 switch (tok) { 1040 case XML_TOK_PROLOG_S: --- 23 unchanged lines hidden (view full) --- 1064 return XML_ROLE_CONTENT_ELEMENT_REP; 1065 case XML_TOK_NAME_PLUS: 1066 state->handler = element7; 1067 return XML_ROLE_CONTENT_ELEMENT_PLUS; 1068 } 1069 return common(state, tok); 1070} 1071 |
1057static int FASTCALL | 1072static int PTRCALL |
1058element3(PROLOG_STATE *state, 1059 int tok, 1060 const char *ptr, 1061 const char *end, 1062 const ENCODING *enc) 1063{ 1064 switch (tok) { 1065 case XML_TOK_PROLOG_S: --- 8 unchanged lines hidden (view full) --- 1074 return XML_ROLE_GROUP_CLOSE_REP; 1075 case XML_TOK_OR: 1076 state->handler = element4; 1077 return XML_ROLE_ELEMENT_NONE; 1078 } 1079 return common(state, tok); 1080} 1081 | 1073element3(PROLOG_STATE *state, 1074 int tok, 1075 const char *ptr, 1076 const char *end, 1077 const ENCODING *enc) 1078{ 1079 switch (tok) { 1080 case XML_TOK_PROLOG_S: --- 8 unchanged lines hidden (view full) --- 1089 return XML_ROLE_GROUP_CLOSE_REP; 1090 case XML_TOK_OR: 1091 state->handler = element4; 1092 return XML_ROLE_ELEMENT_NONE; 1093 } 1094 return common(state, tok); 1095} 1096 |
1082static int FASTCALL | 1097static int PTRCALL |
1083element4(PROLOG_STATE *state, 1084 int tok, 1085 const char *ptr, 1086 const char *end, 1087 const ENCODING *enc) 1088{ 1089 switch (tok) { 1090 case XML_TOK_PROLOG_S: 1091 return XML_ROLE_ELEMENT_NONE; 1092 case XML_TOK_NAME: 1093 case XML_TOK_PREFIXED_NAME: 1094 state->handler = element5; 1095 return XML_ROLE_CONTENT_ELEMENT; 1096 } 1097 return common(state, tok); 1098} 1099 | 1098element4(PROLOG_STATE *state, 1099 int tok, 1100 const char *ptr, 1101 const char *end, 1102 const ENCODING *enc) 1103{ 1104 switch (tok) { 1105 case XML_TOK_PROLOG_S: 1106 return XML_ROLE_ELEMENT_NONE; 1107 case XML_TOK_NAME: 1108 case XML_TOK_PREFIXED_NAME: 1109 state->handler = element5; 1110 return XML_ROLE_CONTENT_ELEMENT; 1111 } 1112 return common(state, tok); 1113} 1114 |
1100static int FASTCALL | 1115static int PTRCALL |
1101element5(PROLOG_STATE *state, 1102 int tok, 1103 const char *ptr, 1104 const char *end, 1105 const ENCODING *enc) 1106{ 1107 switch (tok) { 1108 case XML_TOK_PROLOG_S: --- 4 unchanged lines hidden (view full) --- 1113 return XML_ROLE_GROUP_CLOSE_REP; 1114 case XML_TOK_OR: 1115 state->handler = element4; 1116 return XML_ROLE_ELEMENT_NONE; 1117 } 1118 return common(state, tok); 1119} 1120 | 1116element5(PROLOG_STATE *state, 1117 int tok, 1118 const char *ptr, 1119 const char *end, 1120 const ENCODING *enc) 1121{ 1122 switch (tok) { 1123 case XML_TOK_PROLOG_S: --- 4 unchanged lines hidden (view full) --- 1128 return XML_ROLE_GROUP_CLOSE_REP; 1129 case XML_TOK_OR: 1130 state->handler = element4; 1131 return XML_ROLE_ELEMENT_NONE; 1132 } 1133 return common(state, tok); 1134} 1135 |
1121static int FASTCALL | 1136static int PTRCALL |
1122element6(PROLOG_STATE *state, 1123 int tok, 1124 const char *ptr, 1125 const char *end, 1126 const ENCODING *enc) 1127{ 1128 switch (tok) { 1129 case XML_TOK_PROLOG_S: --- 13 unchanged lines hidden (view full) --- 1143 return XML_ROLE_CONTENT_ELEMENT_REP; 1144 case XML_TOK_NAME_PLUS: 1145 state->handler = element7; 1146 return XML_ROLE_CONTENT_ELEMENT_PLUS; 1147 } 1148 return common(state, tok); 1149} 1150 | 1137element6(PROLOG_STATE *state, 1138 int tok, 1139 const char *ptr, 1140 const char *end, 1141 const ENCODING *enc) 1142{ 1143 switch (tok) { 1144 case XML_TOK_PROLOG_S: --- 13 unchanged lines hidden (view full) --- 1158 return XML_ROLE_CONTENT_ELEMENT_REP; 1159 case XML_TOK_NAME_PLUS: 1160 state->handler = element7; 1161 return XML_ROLE_CONTENT_ELEMENT_PLUS; 1162 } 1163 return common(state, tok); 1164} 1165 |
1151static int FASTCALL | 1166static int PTRCALL |
1152element7(PROLOG_STATE *state, 1153 int tok, 1154 const char *ptr, 1155 const char *end, 1156 const ENCODING *enc) 1157{ 1158 switch (tok) { 1159 case XML_TOK_PROLOG_S: --- 33 unchanged lines hidden (view full) --- 1193 state->handler = element6; 1194 return XML_ROLE_GROUP_CHOICE; 1195 } 1196 return common(state, tok); 1197} 1198 1199#ifdef XML_DTD 1200 | 1167element7(PROLOG_STATE *state, 1168 int tok, 1169 const char *ptr, 1170 const char *end, 1171 const ENCODING *enc) 1172{ 1173 switch (tok) { 1174 case XML_TOK_PROLOG_S: --- 33 unchanged lines hidden (view full) --- 1208 state->handler = element6; 1209 return XML_ROLE_GROUP_CHOICE; 1210 } 1211 return common(state, tok); 1212} 1213 1214#ifdef XML_DTD 1215 |
1201static int FASTCALL | 1216static int PTRCALL |
1202condSect0(PROLOG_STATE *state, 1203 int tok, 1204 const char *ptr, 1205 const char *end, 1206 const ENCODING *enc) 1207{ 1208 switch (tok) { 1209 case XML_TOK_PROLOG_S: --- 7 unchanged lines hidden (view full) --- 1217 state->handler = condSect2; 1218 return XML_ROLE_NONE; 1219 } 1220 break; 1221 } 1222 return common(state, tok); 1223} 1224 | 1217condSect0(PROLOG_STATE *state, 1218 int tok, 1219 const char *ptr, 1220 const char *end, 1221 const ENCODING *enc) 1222{ 1223 switch (tok) { 1224 case XML_TOK_PROLOG_S: --- 7 unchanged lines hidden (view full) --- 1232 state->handler = condSect2; 1233 return XML_ROLE_NONE; 1234 } 1235 break; 1236 } 1237 return common(state, tok); 1238} 1239 |
1225static int FASTCALL | 1240static int PTRCALL |
1226condSect1(PROLOG_STATE *state, 1227 int tok, 1228 const char *ptr, 1229 const char *end, 1230 const ENCODING *enc) 1231{ 1232 switch (tok) { 1233 case XML_TOK_PROLOG_S: 1234 return XML_ROLE_NONE; 1235 case XML_TOK_OPEN_BRACKET: 1236 state->handler = externalSubset1; 1237 state->includeLevel += 1; 1238 return XML_ROLE_NONE; 1239 } 1240 return common(state, tok); 1241} 1242 | 1241condSect1(PROLOG_STATE *state, 1242 int tok, 1243 const char *ptr, 1244 const char *end, 1245 const ENCODING *enc) 1246{ 1247 switch (tok) { 1248 case XML_TOK_PROLOG_S: 1249 return XML_ROLE_NONE; 1250 case XML_TOK_OPEN_BRACKET: 1251 state->handler = externalSubset1; 1252 state->includeLevel += 1; 1253 return XML_ROLE_NONE; 1254 } 1255 return common(state, tok); 1256} 1257 |
1243static int FASTCALL | 1258static int PTRCALL |
1244condSect2(PROLOG_STATE *state, 1245 int tok, 1246 const char *ptr, 1247 const char *end, 1248 const ENCODING *enc) 1249{ 1250 switch (tok) { 1251 case XML_TOK_PROLOG_S: 1252 return XML_ROLE_NONE; 1253 case XML_TOK_OPEN_BRACKET: 1254 state->handler = externalSubset1; 1255 return XML_ROLE_IGNORE_SECT; 1256 } 1257 return common(state, tok); 1258} 1259 1260#endif /* XML_DTD */ 1261 | 1259condSect2(PROLOG_STATE *state, 1260 int tok, 1261 const char *ptr, 1262 const char *end, 1263 const ENCODING *enc) 1264{ 1265 switch (tok) { 1266 case XML_TOK_PROLOG_S: 1267 return XML_ROLE_NONE; 1268 case XML_TOK_OPEN_BRACKET: 1269 state->handler = externalSubset1; 1270 return XML_ROLE_IGNORE_SECT; 1271 } 1272 return common(state, tok); 1273} 1274 1275#endif /* XML_DTD */ 1276 |
1262static int FASTCALL | 1277static int PTRCALL |
1263declClose(PROLOG_STATE *state, 1264 int tok, 1265 const char *ptr, 1266 const char *end, 1267 const ENCODING *enc) 1268{ 1269 switch (tok) { 1270 case XML_TOK_PROLOG_S: 1271 return state->role_none; 1272 case XML_TOK_DECL_CLOSE: 1273 setTopLevel(state); 1274 return state->role_none; 1275 } 1276 return common(state, tok); 1277} 1278 | 1278declClose(PROLOG_STATE *state, 1279 int tok, 1280 const char *ptr, 1281 const char *end, 1282 const ENCODING *enc) 1283{ 1284 switch (tok) { 1285 case XML_TOK_PROLOG_S: 1286 return state->role_none; 1287 case XML_TOK_DECL_CLOSE: 1288 setTopLevel(state); 1289 return state->role_none; 1290 } 1291 return common(state, tok); 1292} 1293 |
1279static int FASTCALL | 1294static int PTRCALL |
1280error(PROLOG_STATE *state, 1281 int tok, 1282 const char *ptr, 1283 const char *end, 1284 const ENCODING *enc) 1285{ 1286 return XML_ROLE_NONE; 1287} --- 34 unchanged lines hidden --- | 1295error(PROLOG_STATE *state, 1296 int tok, 1297 const char *ptr, 1298 const char *end, 1299 const ENCODING *enc) 1300{ 1301 return XML_ROLE_NONE; 1302} --- 34 unchanged lines hidden --- |