Lines Matching refs:token
59 const xmlChar *token;
92 tokenPtr token;
244 * Scan the schema to get the next token
252 tokenPtr token;
256 token = &(ctxt->tokens[(ctxt->firstToken + ctxt->nbTokens) % MAX_TOKEN]);
257 token->toktype = CRNG_NONE;
291 token->toklen = cur - ctxt->cur;
292 token->token = xmlDictLookup(ctxt->dict, ctxt->cur, token->toklen);
293 token->toktype = CRNG_LITERAL_SEGMENT;
294 token->prefix = NULL;
308 token->toklen = 2;
310 token->toklen = 1;
312 token->token = xmlDictLookup(ctxt->dict, ctxt->cur, token->toklen);
313 token->toktype = CRNG_OP;
314 token->prefix = NULL;
315 ctxt->cur += token->toklen;
328 token->toklen = cur - ctxt->cur;
329 token->token = xmlDictLookup(ctxt->dict, ctxt->cur, token->toklen);
330 token->prefix = NULL;
332 if ((escape == 0) && (xmlCRNGIsKeyword(ctxt, token->token)))
333 token->toktype = CRNG_KEYWORD;
335 token->toktype = CRNG_IDENTIFIER;
341 token->toktype = CRNG_NSNAME;
346 token->prefix = token->token;
347 token->toklen = cur - ctxt->cur;
348 token->token = xmlDictLookup(ctxt->dict, ctxt->cur,
349 token->toklen);
351 if (xmlValidateNCName(token->token, 0) == 0)
352 token->toktype = CRNG_QNAME;
355 token->toktype = CRNG_IDENTIFIER;
371 * @no: the number of the token from 1 for the first one
374 * Token reading interface
376 * returns a pointer to the new token, or NULL in case of error or EOF
397 * @nr: the number of token marked as read
399 * mark a number of token as read and consumed.
420 tokenPtr token;
422 token = xmlParseCRNGGetToken(ctxt, 1);
423 while (token != NULL) {
424 switch (token->toktype) {
435 printf(":%s\n", token->token);
437 token = xmlParseCRNGGetToken(ctxt, 1);
670 tokenPtr token;
673 token = xmlParseCRNGGetToken(ctxt, 1);
674 if ((token->toktype == CRNG_OP) &&
675 (token->token[0] == '-') && (token->token[1] == 0)) {
699 tokenPtr token;
702 token = xmlParseCRNGGetToken(ctxt, 1);
703 if (token->toktype == CRNG_OP) {
704 if ((token->token[0] == '(') && (token->token[1] == 0)) {
707 token = xmlParseCRNGGetToken(ctxt, 1);
708 if ((token->toktype != CRNG_OP) ||
709 (token->token[0] != ')') || (token->token[1] != 0)) {
713 } else if ((token->token[0] == '*') && (token->token[1] == 0)) {
724 } else if ((token->toktype == CRNG_IDENTIFIER) ||
725 (token->toktype == CRNG_KEYWORD)) {
734 xmlNodeAddContent(cur, token->token);
739 } else if (token->toktype == CRNG_CNAME) {
741 } else if (token->toktype == CRNG_NSNAME) {
745 xmlParseCRNG_lookupPrefix(ctxt, token->token));
769 tokenPtr token;
775 token = xmlParseCRNGGetToken(ctxt, 1);
776 while ((token->toktype == CRNG_OP) &&
777 (token->token[0] == '|') && (token->token[1] == 0)) {
786 token = xmlParseCRNGGetToken(ctxt, 1);
805 tokenPtr token;
807 token = xmlParseCRNGGetToken(ctxt, 1);
808 if ((token->toktype != CRNG_OP) ||
809 (token->token[0] != '{') || (token->token[1] != 0)) {
814 token = xmlParseCRNGGetToken(ctxt, 1);
815 if ((token->toktype != CRNG_OP) ||
816 (token->token[0] != '}') || (token->token[1] != 0)) {
834 tokenPtr token;
837 token = xmlParseCRNGGetToken(ctxt, 1);
838 if (token->toktype == CRNG_KEYWORD) {
839 if (token->token == ctxt->key_string) {
841 token->token);
843 } else if (token->token == ctxt->key_token) {
845 token->token);
850 } else if (token->toktype == CRNG_LITERAL_SEGMENT) {
854 xmlNodeAddContent(ctxt->insert, token->token);
855 } else if (token->toktype == CRNG_QNAME) {
857 xmlParseCRNG_lookupDatatypePrefix(ctxt, token->prefix),
858 token->token);
863 token = xmlParseCRNGGetToken(ctxt, 1);
864 if (token->toktype == CRNG_LITERAL_SEGMENT) {
872 xmlNodeAddContent(ctxt->insert, token->token);
873 } else if ((token->toktype == CRNG_OP) &&
874 (token->token[0] == '{') && (token->token[0] == 0)) {
891 xmlNodeAddContent(ctxt->insert, token->token);
908 tokenPtr token;
910 token = xmlParseCRNGGetToken(ctxt, 1);
911 if (token == NULL)
913 if (token->toktype == CRNG_KEYWORD) {
914 if (token->token == ctxt->key_element) {
915 ctxt->insert = xmlNewNodeEatName(NULL, (xmlChar *) token->token);
921 } else if (token->token == ctxt->key_attribute) {
922 ctxt->insert = xmlNewNodeEatName(NULL, (xmlChar *) token->token);
928 } else if (token->token == ctxt->key_mixed) {
929 ctxt->insert = xmlNewNodeEatName(NULL, (xmlChar *) token->token);
933 } else if (token->token == ctxt->key_list) {
934 ctxt->insert = xmlNewNodeEatName(NULL, (xmlChar *) token->token);
938 } else if (token->token == ctxt->key_empty) {
939 ctxt->insert = xmlNewNodeEatName(NULL, (xmlChar *) token->token);
942 } else if (token->token == ctxt->key_notAllowed) {
943 ctxt->insert = xmlNewNodeEatName(NULL, (xmlChar *) token->token);
946 } else if (token->token == ctxt->key_text) {
947 ctxt->insert = xmlNewNodeEatName(NULL, (xmlChar *) token->token);
950 } else if (token->token == ctxt->key_parent) {
951 ctxt->insert = xmlNewNodeEatName(NULL, (xmlChar *) token->token);
955 } else if (token->token == ctxt->key_grammar) {
956 ctxt->insert = xmlNewNodeEatName(NULL, (xmlChar *) token->token);
960 } else if (token->token == ctxt->key_external) {
968 } else if (token->toktype == CRNG_IDENTIFIER) {
971 xmlSetProp(ctxt->insert, BAD_CAST "name", token->token);
973 } else if (token->toktype == CRNG_QNAME) {
975 } else if (token->toktype == CRNG_LITERAL_SEGMENT) {
977 } else if ((token->toktype == CRNG_OP) &&
978 (token->token[0] == '(') && (token->token[1] == 0)) {
981 token = xmlParseCRNGGetToken(ctxt, 1);
982 if ((token->toktype != CRNG_OP) ||
983 (token->token[0] != ')') || (token->token[1] != 0)) {
1002 tokenPtr token;
1008 token = xmlParseCRNGGetToken(ctxt, 1);
1009 if ((token != NULL) && (token->toktype == CRNG_OP)) {
1010 if ((token->token[0] == '*') && (token->token[1] == 0)) {
1013 } else if ((token->token[0] == '+') && (token->token[1] == 0)) {
1016 } else if ((token->token[0] == '?') && (token->token[1] == 0)) {
1045 tokenPtr token;
1051 token = xmlParseCRNGGetToken(ctxt, 1);
1052 while ((prev != NULL) && (token != NULL) && (token->toktype == CRNG_OP)) {
1053 if (token->token == ctxt->key_or) {
1056 } else if (token->token == ctxt->key_and) {
1059 } else if (token->token == ctxt->key_comma) {
1070 token = xmlParseCRNGGetToken(ctxt, 1);
1093 tokenPtr token, tok2;
1096 token = xmlParseCRNGGetToken(ctxt, 1);
1097 if (token == NULL)
1099 if (token->toktype == CRNG_KEYWORD) {
1100 if (token->token == ctxt->key_start) {
1109 token = xmlParseCRNGGetToken(ctxt, 1);
1111 if ((token->toktype == CRNG_OP) &&
1112 (token->token == ctxt->key_equal)) {
1113 } else if ((token->toktype == CRNG_OP) &&
1114 (token->token == ctxt->key_orequal)) {
1117 } else if ((token->toktype == CRNG_OP) &&
1118 (token->token == ctxt->key_andequal)) {
1130 } else if (token->token == ctxt->key_include) {
1132 } else if (token->token == ctxt->key_div) {
1137 } else if (token->toktype == CRNG_IDENTIFIER) {
1141 identifier = token->token;
1144 (tok2->token == ctxt->key_equal)) {
1146 (tok2->token == ctxt->key_orequal)) {
1150 (tok2->token == ctxt->key_andequal)) {
1186 tokenPtr token;
1189 token = xmlParseCRNGGetToken(ctxt, 1);
1190 while (token != NULL) {
1194 token = xmlParseCRNGGetToken(ctxt, 1);
1210 tokenPtr token, tok2;
1212 token = xmlParseCRNGGetToken(ctxt, 1);
1213 if (token->toktype == CRNG_KEYWORD) {
1214 if ((token->token == ctxt->key_start) ||
1215 (token->token == ctxt->key_include) ||
1216 (token->token == ctxt->key_div)) {
1231 ((tok2->token == ctxt->key_equal) ||
1232 (tok2->token == ctxt->key_orequal) ||
1233 (tok2->token == ctxt->key_andequal))) {
1260 tokenPtr token;
1263 token = xmlParseCRNGGetToken(ctxt, 1);
1264 if (token->toktype == CRNG_IDENTIFIER) {
1265 prefix = token->token;
1266 } else if (token->toktype == CRNG_OP) {
1267 if ((token->token[0] == '=') && (token->token[1] == 0))
1269 prefix = token->token;
1295 tokenPtr token;
1297 token = xmlParseCRNGGetToken(ctxt, 1);
1298 if (token->toktype != CRNG_KEYWORD) return(-1);
1299 if (token->token == ctxt->key_default) {
1301 token = xmlParseCRNGGetToken(ctxt, 1);
1302 if ((token->toktype != CRNG_KEYWORD) ||
1303 (token->token != ctxt->key_namespace)) {
1308 token = xmlParseCRNGGetToken(ctxt, 1);
1309 if ((token->toktype != CRNG_OP) ||
1310 (token->token[0] != '=') || (token->token[1] != 0)) {
1314 token = xmlParseCRNGGetToken(ctxt, 1);
1315 if ((token->toktype == CRNG_KEYWORD) &&
1316 (token->token == ctxt->key_inherit)) {
1318 } else if (token->toktype == CRNG_LITERAL_SEGMENT) {
1319 namespace = token->token;
1329 } else if (token->token == ctxt->key_namespace) {
1332 token = xmlParseCRNGGetToken(ctxt, 1);
1333 if ((token->toktype != CRNG_OP) ||
1334 (token->token[0] != '=') || (token->token[1] != 0)) {
1338 token = xmlParseCRNGGetToken(ctxt, 1);
1339 if ((token->toktype == CRNG_KEYWORD) &&
1340 (token->token == ctxt->key_inherit)) {
1342 } else if (token->toktype == CRNG_LITERAL_SEGMENT) {
1343 namespace = token->token;
1350 } else if (token->token == ctxt->key_datatypes) {
1353 token = xmlParseCRNGGetToken(ctxt, 1);
1354 if ((token->toktype != CRNG_KEYWORD) &&
1355 (token->toktype != CRNG_IDENTIFIER)) {
1358 prefix = token->token;
1360 token = xmlParseCRNGGetToken(ctxt, 1);
1361 if ((token->toktype != CRNG_OP) ||
1362 (token->token[0] != '=') || (token->token[1] != 0)) {
1366 token = xmlParseCRNGGetToken(ctxt, 1);
1367 if (token->toktype == CRNG_LITERAL_SEGMENT) {
1368 namespace = token->token;
1391 tokenPtr token;
1393 token = xmlParseCRNGGetToken(ctxt, 1);
1394 while (token != NULL) {
1395 if (token == NULL) return(-1);
1396 if ((token->toktype == CRNG_KEYWORD) &&
1397 ((token->token == ctxt->key_default) ||
1398 (token->token == ctxt->key_namespace) ||
1399 (token->token == ctxt->key_datatypes))) {
1403 token = xmlParseCRNGGetToken(ctxt, 1);
1479 ctxt.key_token = xmlDictLookup(ctxt.dict, BAD_CAST "token", -1);