/*
* testRegexp.c: simple module for testing regular expressions
*
* See Copyright for the status of this software.
*
* Daniel Veillard <veillard@redhat.com>
*/
#include "libxml.h"
#ifdef LIBXML_REGEXP_ENABLED
#include <string.h>
#include <libxml/xmlregexp.h>
static int repeat = 0;
static int debug = 0;
int ret;
if (ret == 1)
else if (ret == 0)
else
if (repeat) {
int j;
for (j = 0;j < 999999;j++)
}
}
static void
int len;
"Cannot open %s for reading\n", filename);
return;
}
len--;
while ((len >= 0) &&
if (len >= 0) {
if (expression[0] == '#')
continue;
}
printf(" failed to compile\n");
break;
}
printf(" failed to compile\n");
break;
}
}
}
}
}
#ifdef LIBXML_EXPR_ENABLED
static void
int len;
"Cannot open %s for reading\n", filename);
return;
}
len--;
while ((len >= 0) &&
if (len >= 0) {
if (expression[0] == '#')
continue;
if (xmlExpCtxtNbNodes(ctxt) != 0)
}
printf(" parsing Failed\n");
break;
}
if (expression[0] == '0')
expect = 0;
if (expression[0] == '1')
expect = 1;
printf(" parsing Failed\n");
break;
} else {
int ret;
printf(" => accept, Ok\n");
printf(" => reject, Ok\n");
printf(" => reject, Failed\n");
printf(" => accept, Failed\n");
} else {
printf(" => fail internally\n");
}
printf(" Subsume leaked %d\n",
}
}
}
}
}
}
if (xmlExpCtxtNbNodes(ctxt) != 0)
}
}
static void
xmlExpBuf = xmlBufferCreate();
return;
}
printf("Subset parsed as: %s\n",
(const char *) xmlBufferContent(xmlExpBuf));
printf("Derivation led to an internal error, report this !\n");
return;
} else {
if (xmlExpIsNillable(deriv))
printf("Resulting nillable derivation: %s\n",
(const char *) xmlBufferContent(xmlExpBuf));
else
printf("Resulting derivation: %s\n",
(const char *) xmlBufferContent(xmlExpBuf));
}
}
static void
int ret;
xmlExpBuf = xmlBufferCreate();
printf("Failed to parse\n");
return;
}
printf("Is nillable\n");
if (ret < 0)
else {
int i;
for (i = 0;i < ret;i++) {
} else {
(const char *) xmlBufferContent(xmlExpBuf));
}
}
}
}
#endif
#ifdef LIBXML_EXPR_ENABLED
#endif
}
#ifdef LIBXML_EXPR_ENABLED
int use_exp = 0;
#endif
int i;
if (argc <= 1) {
return(1);
}
for (i = 1; i < argc ; i++) {
break;
if (argv[i][0] != '-')
continue;
debug++;
repeat++;
#ifdef LIBXML_EXPR_ENABLED
use_exp++;
#endif
else {
}
}
#ifdef LIBXML_EXPR_ENABLED
if (use_exp)
#endif
#ifdef LIBXML_EXPR_ENABLED
if (use_exp)
else
#endif
} else {
#ifdef LIBXML_EXPR_ENABLED
if (use_exp) {
for (i = 1; i < argc ; i++) {
printf(" failed to compile\n");
break;
}
if (debug) {
}
} else {
}
}
}
} else
#endif
{
for (i = 1; i < argc ; i++) {
printf(" failed to compile\n");
break;
}
if (debug)
} else {
}
}
}
}
}
#ifdef LIBXML_EXPR_ENABLED
printf("Ops: %d nodes, %d cons\n",
}
#endif
return(0);
}
#else
#include <stdio.h>
return(0);
}
#endif /* LIBXML_REGEXP_ENABLED */