mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-13 09:01:53 +03:00
fixed a bug reported by Jeff Goff, the determinism was tested before
* xmlregexp.c xmlschemas.c: fixed a bug reported by Jeff Goff, the determinism was tested before eliminating the epsilon transitions :-( Daniel
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
Thu Sep 12 18:01:29 CEST 2002 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* xmlregexp.c xmlschemas.c: fixed a bug reported by Jeff Goff,
|
||||||
|
the determinism was tested before eliminating the epsilon
|
||||||
|
transitions :-(
|
||||||
|
|
||||||
Thu Sep 12 16:57:45 CEST 2002 Daniel Veillard <daniel@veillard.com>
|
Thu Sep 12 16:57:45 CEST 2002 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* python/generator.py python/libxml.c python/libxml.py
|
* python/generator.py python/libxml.c python/libxml.py
|
||||||
|
@ -740,7 +740,6 @@ xmlRegPrintState(FILE *output, xmlRegStatePtr state) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
static void
|
static void
|
||||||
xmlRegPrintCtxt(FILE *output, xmlRegParserCtxtPtr ctxt) {
|
xmlRegPrintCtxt(FILE *output, xmlRegParserCtxtPtr ctxt) {
|
||||||
int i;
|
int i;
|
||||||
@ -780,7 +779,6 @@ xmlRegPrintCtxt(FILE *output, xmlRegParserCtxtPtr ctxt) {
|
|||||||
ctxt->counters[i].max);
|
ctxt->counters[i].max);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* *
|
* *
|
||||||
@ -927,7 +925,7 @@ xmlRegStateAddTrans(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr state,
|
|||||||
printf("Add trans from %d to %d ", state->no, target->no);
|
printf("Add trans from %d to %d ", state->no, target->no);
|
||||||
if (count == REGEXP_ALL_COUNTER)
|
if (count == REGEXP_ALL_COUNTER)
|
||||||
printf("all transition");
|
printf("all transition");
|
||||||
else (count >= 0)
|
else if (count >= 0)
|
||||||
printf("count based %d", count);
|
printf("count based %d", count);
|
||||||
else if (counter >= 0)
|
else if (counter >= 0)
|
||||||
printf("counted %d", counter);
|
printf("counted %d", counter);
|
||||||
@ -1389,6 +1387,10 @@ xmlFAComputesDeterminism(xmlRegParserCtxtPtr ctxt) {
|
|||||||
int i;
|
int i;
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
|
|
||||||
|
#ifdef DEBUG_REGEXP_GRAPH
|
||||||
|
printf("xmlFAComputesDeterminism\n");
|
||||||
|
xmlRegPrintCtxt(stdout, ctxt);
|
||||||
|
#endif
|
||||||
if (ctxt->determinist != -1)
|
if (ctxt->determinist != -1)
|
||||||
return(ctxt->determinist);
|
return(ctxt->determinist);
|
||||||
|
|
||||||
|
@ -3262,20 +3262,20 @@ xmlSchemaBuildContentModel(xmlSchemaElementPtr elem,
|
|||||||
start = ctxt->state = xmlAutomataGetInitState(ctxt->am);
|
start = ctxt->state = xmlAutomataGetInitState(ctxt->am);
|
||||||
xmlSchemaBuildAContentModel(elem->subtypes, ctxt, name);
|
xmlSchemaBuildAContentModel(elem->subtypes, ctxt, name);
|
||||||
xmlAutomataSetFinalState(ctxt->am, ctxt->state);
|
xmlAutomataSetFinalState(ctxt->am, ctxt->state);
|
||||||
|
elem->contModel = xmlAutomataCompile(ctxt->am);
|
||||||
if (!xmlAutomataIsDeterminist(ctxt->am)) {
|
if (!xmlAutomataIsDeterminist(ctxt->am)) {
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
"Content model of %s is not determinist:\n", name);
|
"Content model of %s is not determinist:\n", name);
|
||||||
elem->contModel = xmlAutomataCompile(ctxt->am);
|
|
||||||
ctxt->err = XML_SCHEMAS_ERR_NOTDETERMINIST;
|
ctxt->err = XML_SCHEMAS_ERR_NOTDETERMINIST;
|
||||||
|
ctxt->state = NULL;
|
||||||
} else {
|
} else {
|
||||||
elem->contModel = xmlAutomataCompile(ctxt->am);
|
|
||||||
#ifdef DEBUG_CONTENT
|
#ifdef DEBUG_CONTENT
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
"Content model of %s:\n", name);
|
"Content model of %s:\n", name);
|
||||||
xmlRegexpPrint(stderr, elem->contModel);
|
xmlRegexpPrint(stderr, elem->contModel);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
ctxt->state = NULL;
|
ctxt->state = NULL;
|
||||||
|
}
|
||||||
xmlFreeAutomata(ctxt->am);
|
xmlFreeAutomata(ctxt->am);
|
||||||
ctxt->am = NULL;
|
ctxt->am = NULL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user