Lines Matching full:ctxt
323 * @ctxt: an XSLT parser context
325 * Free up the memory allocated by @ctxt
328 xmlFreePatParserContext(xmlPatParserContextPtr ctxt) {
329 if (ctxt == NULL)
331 memset(ctxt, -1, sizeof(xmlPatParserContext));
332 xmlFree(ctxt);
347 xmlPatternAdd(xmlPatParserContextPtr ctxt ATTRIBUTE_UNUSED,
356 ERROR(ctxt, NULL, NULL,
427 ERROR(ctxt, NULL, NULL,
716 #define CUR (*ctxt->cur)
717 #define SKIP(val) ctxt->cur += (val)
718 #define NXT(val) ctxt->cur[(val)]
719 #define PEEKPREV(val) ctxt->cur[-(val)]
720 #define CUR_PTR ctxt->cur
725 #define CURRENT (*ctxt->cur)
726 #define NEXT ((*ctxt->cur) ? ctxt->cur++: ctxt->cur)
730 if (xmlPatternAdd(ctxt, ctxt->comp, (op), (val), (val2))) goto error;
733 { xsltError(ctxt, __FILE__, __LINE__, X); \
734 ctxt->error = (X); return; }
737 { xsltError(ctxt, __FILE__, __LINE__, X); \
738 ctxt->error = (X); return(0); }
743 * @ctxt: the XPath Parser context
754 xmlPatScanLiteral(xmlPatParserContextPtr ctxt) {
769 ctxt->error = 1;
772 if (ctxt->dict)
773 ret = (xmlChar *) xmlDictLookup(ctxt->dict, q, cur - q);
788 ctxt->error = 1;
791 if (ctxt->dict)
792 ret = (xmlChar *) xmlDictLookup(ctxt->dict, q, cur - q);
800 ctxt->error = 1;
809 * @ctxt: the XPath Parser context
822 xmlPatScanName(xmlPatParserContextPtr ctxt) {
842 if (ctxt->dict)
843 ret = (xmlChar *) xmlDictLookup(ctxt->dict, q, cur - q);
852 * @ctxt: the XPath Parser context
860 xmlPatScanNCName(xmlPatParserContextPtr ctxt) {
880 if (ctxt->dict)
881 ret = (xmlChar *) xmlDictLookup(ctxt->dict, q, cur - q);
891 * @ctxt: the XPath Parser context
900 xmlPatScanQName(xmlPatParserContextPtr ctxt, xmlChar **prefix) {
904 ret = xmlPatScanNCName(ctxt);
908 ret = xmlPatScanNCName(ctxt);
916 * @ctxt: the compilation context
921 xmlCompileAttributeTest(xmlPatParserContextPtr ctxt) {
927 name = xmlPatScanNCName(ctxt);
935 ctxt->error = 1;
947 XML_PAT_FREE_STRING(ctxt, prefix);
948 ctxt->error = 1;
954 token = xmlPatScanName(ctxt);
960 XML_PAT_COPY_NSNAME(ctxt, URL, XML_XML_NAMESPACE);
962 for (i = 0;i < ctxt->nb_namespaces;i++) {
963 if (xmlStrEqual(ctxt->namespaces[2 * i + 1], prefix)) {
964 XML_PAT_COPY_NSNAME(ctxt, URL, ctxt->namespaces[2 * i])
968 if (i >= ctxt->nb_namespaces) {
972 XML_PAT_FREE_STRING(ctxt, prefix);
973 ctxt->error = 1;
977 XML_PAT_FREE_STRING(ctxt, prefix);
985 ctxt->error = 1;
997 XML_PAT_FREE_STRING(ctxt, URL)
999 XML_PAT_FREE_STRING(ctxt, token);
1004 * @ctxt: the compilation context
1014 xmlCompileStepPattern(xmlPatParserContextPtr ctxt) {
1033 if (XML_STREAM_XS_IDC_SEL(ctxt->comp)) {
1035 "Unexpected attribute axis in '%s'.\n", ctxt->base);
1036 ctxt->error = 1;
1040 xmlCompileAttributeTest(ctxt);
1041 if (ctxt->error != 0)
1045 name = xmlPatScanNCName(ctxt);
1054 ctxt->error = 1;
1070 ctxt->error = 1;
1076 token = xmlPatScanName(ctxt);
1082 XML_PAT_COPY_NSNAME(ctxt, URL, XML_XML_NAMESPACE)
1084 for (i = 0;i < ctxt->nb_namespaces;i++) {
1085 if (xmlStrEqual(ctxt->namespaces[2 * i + 1], prefix)) {
1086 XML_PAT_COPY_NSNAME(ctxt, URL, ctxt->namespaces[2 * i])
1090 if (i >= ctxt->nb_namespaces) {
1094 ctxt->error = 1;
1098 XML_PAT_FREE_STRING(ctxt, prefix);
1107 ctxt->error = 1;
1116 XML_PAT_FREE_STRING(ctxt, name);
1117 name = xmlPatScanName(ctxt);
1126 ctxt->error = 1;
1137 ctxt->error = 1;
1143 token = xmlPatScanName(ctxt);
1149 XML_PAT_COPY_NSNAME(ctxt, URL, XML_XML_NAMESPACE)
1151 for (i = 0;i < ctxt->nb_namespaces;i++) {
1152 if (xmlStrEqual(ctxt->namespaces[2 * i + 1], prefix)) {
1153 XML_PAT_COPY_NSNAME(ctxt, URL, ctxt->namespaces[2 * i])
1157 if (i >= ctxt->nb_namespaces) {
1161 ctxt->error = 1;
1165 XML_PAT_FREE_STRING(ctxt, prefix);
1174 ctxt->error = 1;
1184 XML_PAT_FREE_STRING(ctxt, name)
1186 if (XML_STREAM_XS_IDC_SEL(ctxt->comp)) {
1188 "Unexpected attribute axis in '%s'.\n", ctxt->base);
1189 ctxt->error = 1;
1192 xmlCompileAttributeTest(ctxt);
1193 if (ctxt->error != 0)
1199 ctxt->error = 1;
1205 ctxt->error = 1;
1216 XML_PAT_FREE_STRING(ctxt, URL)
1218 XML_PAT_FREE_STRING(ctxt, token)
1220 XML_PAT_FREE_STRING(ctxt, name)
1225 * @ctxt: the compilation context
1233 xmlCompilePathPattern(xmlPatParserContextPtr ctxt) {
1236 ctxt->comp->flags |= PAT_FROM_ROOT;
1237 } else if ((CUR == '.') || (ctxt->comp->flags & XML_PATTERN_NOTPATTERN)) {
1238 ctxt->comp->flags |= PAT_FROM_CUR;
1254 "Incomplete expression '%s'.\n", ctxt->base);
1255 ctxt->error = 1;
1261 xmlCompileAttributeTest(ctxt);
1265 xmlCompileStepPattern(ctxt);
1266 if (ctxt->error != 0)
1277 "Incomplete expression '%s'.\n", ctxt->base);
1278 ctxt->error = 1;
1282 xmlCompileStepPattern(ctxt);
1283 if (ctxt->error != 0)
1292 xmlCompileStepPattern(ctxt);
1293 if (ctxt->error != 0)
1301 "Incomplete expression '%s'.\n", ctxt->base);
1302 ctxt->error = 1;
1305 xmlCompileStepPattern(ctxt);
1306 if (ctxt->error != 0)
1313 "Failed to compile pattern %s\n", ctxt->base);
1314 ctxt->error = 1;
1322 * @ctxt: the compilation context
1330 xmlCompileIDCXPathPath(xmlPatParserContextPtr ctxt) {
1335 ctxt->base);
1338 ctxt->comp->flags |= PAT_FROM_CUR;
1354 "Unexpected token after '.' in '%s'.\n", ctxt->base);
1366 "Unexpected '/' token in '%s'.\n", ctxt->base);
1381 xmlCompileStepPattern(ctxt);
1382 if (ctxt->error != 0)
1396 ctxt->base);
1406 "Failed to compile expression '%s'.\n", ctxt->base);
1407 ctxt->error = 1;
1411 ctxt->error = 1;
1415 ctxt->error = 1;
1417 "Unfinished expression '%s'.\n", ctxt->base);
1456 xmlDebugStreamCtxt(xmlStreamCtxtPtr ctxt, int match) {
1459 if (ctxt == NULL) {
1463 printf("Stream: level %d, %d states: ", ctxt->level, ctxt->nbState);
1468 for (i = 0;i < ctxt->nbState;i++) {
1469 if (ctxt->states[2 * i] < 0)
1472 printf(" %d: step %d, level %d", i, ctxt->states[2 * i],
1473 ctxt->states[(2 * i) + 1]);
1474 if (ctxt->comp->steps[ctxt->states[2 * i]].flags &
2362 xmlPatParserContextPtr ctxt = NULL;
2377 ctxt = xmlNewPatParserContext(start, dict, namespaces);
2381 ctxt = xmlNewPatParserContext(tmp, dict, namespaces);
2385 if (ctxt == NULL) goto error;
2402 ctxt->comp = cur;
2405 xmlCompileIDCXPathPath(ctxt);
2407 xmlCompilePathPattern(ctxt);
2408 if (ctxt->error != 0)
2410 xmlFreePatParserContext(ctxt);
2411 ctxt = NULL;
2448 if (ctxt != NULL) xmlFreePatParserContext(ctxt);