Lines Matching defs:am
5494 xmlAutomataPtr am;
5502 am = xmlNewAutomata();
5503 if (am->states != NULL) {
5506 for (i = 0;i < am->nbStates;i++)
5507 xmlRegFreeState(am->states[i]);
5508 xmlFree(am->states);
5510 am->nbAtoms = comp->nbAtoms;
5511 am->atoms = comp->atoms;
5512 am->nbStates = comp->nbStates;
5513 am->states = comp->states;
5514 am->determinist = -1;
5515 ret = xmlFAComputesDeterminism(am);
5516 am->atoms = NULL;
5517 am->states = NULL;
5518 xmlFreeAutomata(am);
5602 * @am: an automata
5607 xmlFreeAutomata(xmlAutomataPtr am) {
5608 if (am == NULL)
5610 xmlRegFreeParserCtxt(am);
5615 * @am: an automata
5622 xmlAutomataGetInitState(xmlAutomataPtr am) {
5623 if (am == NULL)
5625 return(am->start);
5630 * @am: an automata
5638 xmlAutomataSetFinalState(xmlAutomataPtr am, xmlAutomataStatePtr state) {
5639 if ((am == NULL) || (state == NULL))
5647 * @am: an automata
5660 xmlAutomataNewTransition(xmlAutomataPtr am, xmlAutomataStatePtr from,
5665 if ((am == NULL) || (from == NULL) || (token == NULL))
5667 atom = xmlRegNewAtom(am, XML_REGEXP_STRING);
5675 if (xmlFAGenerateTransitions(am, from, to, atom) < 0) {
5680 return(am->state);
5686 * @am: an automata
5700 xmlAutomataNewTransition2(xmlAutomataPtr am, xmlAutomataStatePtr from,
5705 if ((am == NULL) || (from == NULL) || (token == NULL))
5707 atom = xmlRegNewAtom(am, XML_REGEXP_STRING);
5733 if (xmlFAGenerateTransitions(am, from, to, atom) < 0) {
5738 return(am->state);
5744 * @am: an automata
5760 xmlAutomataNewNegTrans(xmlAutomataPtr am, xmlAutomataStatePtr from,
5766 if ((am == NULL) || (from == NULL) || (token == NULL))
5768 atom = xmlRegNewAtom(am, XML_REGEXP_STRING);
5798 if (xmlFAGenerateTransitions(am, from, to, atom) < 0) {
5802 am->negs++;
5804 return(am->state);
5810 * @am: an automata
5827 xmlAutomataNewCountTrans2(xmlAutomataPtr am, xmlAutomataStatePtr from,
5834 if ((am == NULL) || (from == NULL) || (token == NULL))
5840 atom = xmlRegNewAtom(am, XML_REGEXP_STRING);
5874 counter = xmlRegGetCounter(am);
5875 am->counters[counter].min = min;
5876 am->counters[counter].max = max;
5878 /* xmlFAGenerateTransitions(am, from, to, atom); */
5880 to = xmlRegNewState(am);
5881 xmlRegStatePush(am, to);
5883 xmlRegStateAddTrans(am, from, atom, to, counter, -1);
5884 xmlRegAtomPush(am, atom);
5885 am->state = to;
5888 to = am->state;
5892 xmlFAGenerateEpsilonTransition(am, from, to);
5898 * @am: an automata
5914 xmlAutomataNewCountTrans(xmlAutomataPtr am, xmlAutomataStatePtr from,
5920 if ((am == NULL) || (from == NULL) || (token == NULL))
5926 atom = xmlRegNewAtom(am, XML_REGEXP_STRING);
5940 counter = xmlRegGetCounter(am);
5941 am->counters[counter].min = min;
5942 am->counters[counter].max = max;
5944 /* xmlFAGenerateTransitions(am, from, to, atom); */
5946 to = xmlRegNewState(am);
5947 xmlRegStatePush(am, to);
5949 xmlRegStateAddTrans(am, from, atom, to, counter, -1);
5950 xmlRegAtomPush(am, atom);
5951 am->state = to;
5954 to = am->state;
5958 xmlFAGenerateEpsilonTransition(am, from, to);
5964 * @am: an automata
5982 xmlAutomataNewOnceTrans2(xmlAutomataPtr am, xmlAutomataStatePtr from,
5989 if ((am == NULL) || (from == NULL) || (token == NULL))
5995 atom = xmlRegNewAtom(am, XML_REGEXP_STRING);
6026 counter = xmlRegGetCounter(am);
6027 am->counters[counter].min = 1;
6028 am->counters[counter].max = 1;
6030 /* xmlFAGenerateTransitions(am, from, to, atom); */
6032 to = xmlRegNewState(am);
6033 xmlRegStatePush(am, to);
6035 xmlRegStateAddTrans(am, from, atom, to, counter, -1);
6036 xmlRegAtomPush(am, atom);
6037 am->state = to;
6045 * @am: an automata
6062 xmlAutomataNewOnceTrans(xmlAutomataPtr am, xmlAutomataStatePtr from,
6068 if ((am == NULL) || (from == NULL) || (token == NULL))
6074 atom = xmlRegNewAtom(am, XML_REGEXP_STRING);
6085 counter = xmlRegGetCounter(am);
6086 am->counters[counter].min = 1;
6087 am->counters[counter].max = 1;
6089 /* xmlFAGenerateTransitions(am, from, to, atom); */
6091 to = xmlRegNewState(am);
6092 xmlRegStatePush(am, to);
6094 xmlRegStateAddTrans(am, from, atom, to, counter, -1);
6095 xmlRegAtomPush(am, atom);
6096 am->state = to;
6102 * @am: an automata
6109 xmlAutomataNewState(xmlAutomataPtr am) {
6112 if (am == NULL)
6114 to = xmlRegNewState(am);
6115 xmlRegStatePush(am, to);
6121 * @am: an automata
6132 xmlAutomataNewEpsilon(xmlAutomataPtr am, xmlAutomataStatePtr from,
6134 if ((am == NULL) || (from == NULL))
6136 xmlFAGenerateEpsilonTransition(am, from, to);
6138 return(am->state);
6144 * @am: an automata
6157 xmlAutomataNewAllTrans(xmlAutomataPtr am, xmlAutomataStatePtr from,
6159 if ((am == NULL) || (from == NULL))
6161 xmlFAGenerateAllTransition(am, from, to, lax);
6163 return(am->state);
6169 * @am: an automata
6178 xmlAutomataNewCounter(xmlAutomataPtr am, int min, int max) {
6181 if (am == NULL)
6184 ret = xmlRegGetCounter(am);
6187 am->counters[ret].min = min;
6188 am->counters[ret].max = max;
6194 * @am: an automata
6206 xmlAutomataNewCountedTrans(xmlAutomataPtr am, xmlAutomataStatePtr from,
6208 if ((am == NULL) || (from == NULL) || (counter < 0))
6210 xmlFAGenerateCountedEpsilonTransition(am, from, to, counter);
6212 return(am->state);
6218 * @am: an automata
6230 xmlAutomataNewCounterTrans(xmlAutomataPtr am, xmlAutomataStatePtr from,
6232 if ((am == NULL) || (from == NULL) || (counter < 0))
6234 xmlFAGenerateCountedTransition(am, from, to, counter);
6236 return(am->state);
6242 * @am: an automata
6250 xmlAutomataCompile(xmlAutomataPtr am) {
6253 if ((am == NULL) || (am->error != 0)) return(NULL);
6254 xmlFAEliminateEpsilonTransitions(am);
6255 /* xmlFAComputesDeterminism(am); */
6256 ret = xmlRegEpxFromParse(am);
6263 * @am: an automata
6270 xmlAutomataIsDeterminist(xmlAutomataPtr am) {
6273 if (am == NULL)
6276 ret = xmlFAComputesDeterminism(am);