Commit 23e73571 authored by Daniel Veillard's avatar Daniel Veillard

made configuring with regexps/automata/unicode the default but without

* Makefile.am configure.in include/libxml/xmlversion.h.in:
  made configuring with regexps/automata/unicode the default
  but without schemas ATM
* testRegexp.c valid.c xmlregexp.c include/libxml/xmlregexp.h:
  fixed the regexp based DTD validation performance and memory
  problem by switching to a compact form for determinist regexps
  and detecting the determinism property in the process. Seems
  as fast as the old DTD validation specific engine :-) despite
  the regexp built and compaction process.
Daniel
parent 5acfd6b5
Thu Sep 19 21:46:53 CEST 2002 Daniel Veillard <daniel@veillard.com>
* Makefile.am configure.in include/libxml/xmlversion.h.in:
made configuring with regexps/automata/unicode the default
but without schemas ATM
* testRegexp.c valid.c xmlregexp.c include/libxml/xmlregexp.h:
fixed the regexp based DTD validation performance and memory
problem by switching to a compact form for determinist regexps
and detecting the determinism property in the process. Seems
as fast as the old DTD validation specific engine :-) despite
the regexp built and compaction process.
Wed Sep 18 18:27:26 CEST 2002 Daniel Veillard <daniel@veillard.com>
* valid.c: determinism is debugged, new DTD checking code now works
......
......@@ -106,7 +106,7 @@ check-local: tests
testall : tests SVGtests SAXtests
tests: XMLtests XMLenttests HTMLtests Validtests URItests XPathtests XPtrtests XIncludetests C14Ntests Scripttests Catatests @TEST_SCHEMAS@ @TEST_THREADS@
tests: XMLtests XMLenttests HTMLtests Validtests URItests XPathtests XPtrtests XIncludetests C14Ntests Scripttests Catatests @TEST_REGEXPS@ @TEST_SCHEMAS@ @TEST_THREADS@
@(cd python ; $(MAKE) tests)
valgrind:
......
......@@ -525,7 +525,8 @@ AC_ARG_WITH(schemas, [ --with-schemas Add experimental Schemas sup
if test "$with_schemas" = "yes" ; then
echo Enabling Schemas support
WITH_SCHEMAS=1
TEST_SCHEMAS="Regexptests Automatatests Schemastests"
TEST_SCHEMAS="Schemastests"
with_regexps=yes
else
WITH_SCHEMAS=0
TEST_SCHEMAS=
......@@ -533,6 +534,18 @@ fi
AC_SUBST(WITH_SCHEMAS)
AC_SUBST(TEST_SCHEMAS)
AC_ARG_WITH(regexps, [ --with-regexps Add Regular Expressions support (on)])
if test "$with_regexps" = "no" ; then
echo Disabling Regexps support
WITH_REGEXPS=0
TEST_REGEXPS=
else
WITH_REGEXPS=1
TEST_REGEXPS="Regexptests Automatatests"
fi
AC_SUBST(WITH_REGEXPS)
AC_SUBST(TEST_REGEXPS)
AC_ARG_WITH(debug, [ --with-debug Add the debugging module (on)])
if test "$with_debug" = "no" ; then
echo Disabling DEBUG support
......
......@@ -55,6 +55,7 @@ int xmlRegexpExec (xmlRegexpPtr comp,
const xmlChar *value);
void xmlRegexpPrint (FILE *output,
xmlRegexpPtr regexp);
int xmlRegexpIsDeterminist(xmlRegexpPtr comp);
/*
* Callback function when doing a transition in the automata
......
......@@ -194,7 +194,7 @@ extern void xmlCheckVersion(int version);
*
* Whether the Unicode related interfaces are compiled in
*/
#if @WITH_SCHEMAS@
#if @WITH_REGEXPS@
#define LIBXML_UNICODE_ENABLED
#endif
......@@ -203,7 +203,7 @@ extern void xmlCheckVersion(int version);
*
* Whether the regular expressions interfaces are compiled in
*/
#if @WITH_SCHEMAS@
#if @WITH_REGEXPS@
#define LIBXML_REGEXP_ENABLED
#endif
......@@ -212,7 +212,7 @@ extern void xmlCheckVersion(int version);
*
* Whether the automata interfaces are compiled in
*/
#if @WITH_SCHEMAS@
#if @WITH_REGEXPS@
#define LIBXML_AUTOMATA_ENABLED
#endif
......
......@@ -140,11 +140,12 @@ int main(int argc, char **argv) {
}
}
}
xmlMemoryDump();
if (comp != NULL)
xmlRegFreeRegexp(comp);
}
xmlCleanupParser();
xmlMemoryDump();
/* xmlMemoryDump(); */
return(0);
}
......
......@@ -553,7 +553,7 @@ xmlValidBuildContentModel(xmlValidCtxtPtr ctxt, xmlElementPtr elem) {
xmlValidBuildAContentModel(elem->content, ctxt, elem->name);
xmlAutomataSetFinalState(ctxt->am, ctxt->state);
elem->contModel = xmlAutomataCompile(ctxt->am);
if (!xmlAutomataIsDeterminist(ctxt->am)) {
if (!xmlRegexpIsDeterminist(elem->contModel)) {
char expr[5000];
expr[0] = 0;
xmlSnprintfElementContent(expr, 5000, elem->content, 1);
......@@ -3849,6 +3849,7 @@ xmlValidateSkipIgnorable(xmlNodePtr child) {
return(child);
}
#ifndef LIBXML_REGEXP_ENABLED
/**
* xmlValidateElementType:
* @ctxt: the validation context
......@@ -4217,6 +4218,7 @@ analyze:
}
return(determinist);
}
#endif
/**
* xmlSnprintfElements:
......@@ -4319,7 +4321,10 @@ static int
xmlValidateElementContent(xmlValidCtxtPtr ctxt, xmlNodePtr child,
xmlElementPtr elemDecl, int warn, xmlNodePtr parent) {
int ret = 1;
xmlNodePtr repl = NULL, last = NULL, cur, tmp;
#ifndef LIBXML_REGEXP_ENABLED
xmlNodePtr last = NULL;
#endif
xmlNodePtr repl = NULL, cur, tmp;
xmlElementContentPtr cont;
const xmlChar *name;
......@@ -4561,7 +4566,9 @@ fail:
if (ret == -3)
ret = 1;
#ifndef LIBXML_REGEXP_ENABLED
done:
#endif
/*
* Deallocate the copy if done, and free up the validation stack
*/
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment