Lines Matching defs:to
37 #define INT_MAX 123456789 /* easy to flag and big enough for our needs */
61 * Need PREV to check on a '-' within a Character Group. May only be used
69 * macro to flag unimplemented blocks
216 int to;
231 /* knowing states ponting to us can speed things up */
298 int nextbranch; /* the next transition to explore in that state */
411 "failed to compile: %s\n", extra);
423 * @ctxt: the parser context used to build it
467 * Switch to a compact representation
556 * state corresponds to the state type.
574 if ((trans->to == -1) || (trans->atom == NULL))
588 targetno = stateRemap[trans->to];
590 * if the same atom can generate transitions to 2 different
599 printf("Indet: state %d trans %d, atom %d to %d : %d to %d\n",
600 i, j, trans->atom->no, trans->to, atomno, targetno);
601 printf(" previous to is %d\n", prev);
615 printf("State %d trans %d: atom %d to %d : %d to %d\n",
616 i, j, trans->atom->no, trans->to, atomno, targetno);
619 targetno + 1; /* to avoid 0 */
678 * @string: the string to parse
1121 if (trans->to < 0) {
1140 fprintf(output, "epsilon to %d\n", trans->to);
1145 fprintf(output, "atom %d, to %d\n", trans->atom->no, trans->to);
1371 (trans->to == target->no) &&
1375 printf("Ignoring duplicate transition from %d to %d\n",
1404 printf("Add trans from %d to %d ", state->no, target->no);
1418 state->trans[state->nbTrans].to = target->no;
1459 * @to: the target state or NULL for building a new one
1465 xmlRegStatePtr from, xmlRegStatePtr to,
1467 if (to == NULL) {
1468 to = xmlRegNewState(ctxt);
1469 xmlRegStatePush(ctxt, to);
1470 ctxt->state = to;
1473 xmlRegStateAddTrans(ctxt, from, NULL, to, -1, REGEXP_ALL_LAX_COUNTER);
1475 xmlRegStateAddTrans(ctxt, from, NULL, to, -1, REGEXP_ALL_COUNTER);
1482 * @to: the target state or NULL for building a new one
1487 xmlRegStatePtr from, xmlRegStatePtr to) {
1488 if (to == NULL) {
1489 to = xmlRegNewState(ctxt);
1490 xmlRegStatePush(ctxt, to);
1491 ctxt->state = to;
1493 xmlRegStateAddTrans(ctxt, from, NULL, to, -1, -1);
1500 * @to: the target state or NULL for building a new one
1506 xmlRegStatePtr from, xmlRegStatePtr to, int counter) {
1507 if (to == NULL) {
1508 to = xmlRegNewState(ctxt);
1509 xmlRegStatePush(ctxt, to);
1510 ctxt->state = to;
1512 xmlRegStateAddTrans(ctxt, from, NULL, to, counter, -1);
1519 * @to: the target state or NULL for building a new one
1525 xmlRegStatePtr from, xmlRegStatePtr to, int counter) {
1526 if (to == NULL) {
1527 to = xmlRegNewState(ctxt);
1528 xmlRegStatePush(ctxt, to);
1529 ctxt->state = to;
1531 xmlRegStateAddTrans(ctxt, from, NULL, to, -1, counter);
1538 * @to: the target state or NULL for building a new one
1545 xmlRegStatePtr to, xmlRegAtomPtr atom) {
1554 * this is a subexpression handling one should not need to
1560 if ((to != NULL) && (atom->stop != to) &&
1563 * Generate an epsilon transition to link to the target
1565 xmlFAGenerateEpsilonTransition(ctxt, atom->stop, to);
1567 } else if ((to == NULL) && (atom->quant != XML_REGEXP_QUANT_RANGE) &&
1569 to = xmlRegNewState(ctxt);
1570 xmlRegStatePush(ctxt, to);
1571 ctxt->state = to;
1572 xmlFAGenerateEpsilonTransition(ctxt, atom->stop, to);
1579 * transition done to the state after end of atom.
1580 * 1. set transition from atom start to new state
1581 * 2. set transition from atom end to this state.
1583 if (to == NULL) {
1588 xmlFAGenerateEpsilonTransition(ctxt, atom->start, to);
1607 if (to != NULL) {
1608 newstate = to;
1615 * The principle here is to use counted transition
1616 * to avoid explosion in the number of states in the
1623 * duplicate a transition based on atom to count next
1624 * occurences after 1. We cannot loop to atom->start
1625 * directly because we need an epsilon transition to
1657 * is an atom->start0 allowing to easilly plug the
1690 if (to == NULL) {
1691 to = xmlRegNewState(ctxt);
1692 if (to != NULL)
1693 xmlRegStatePush(ctxt, to);
1698 xmlFAGenerateEpsilonTransition(ctxt, from, to);
1699 ctxt->state = to;
1703 if (to == NULL) {
1704 to = xmlRegNewState(ctxt);
1705 if (to != NULL)
1706 xmlRegStatePush(ctxt, to);
1711 end = to;
1716 * it as it is likely to be the shared target of multiple branches.
1727 xmlFAGenerateEpsilonTransition(ctxt, tmp, to);
1728 to = tmp;
1733 xmlRegStateAddTrans(ctxt, from, atom, to, -1, -1);
1738 xmlFAGenerateEpsilonTransition(ctxt, from, to);
1742 xmlFAGenerateEpsilonTransition(ctxt, from, to);
1743 xmlRegStateAddTrans(ctxt, to, atom, to, -1, -1);
1747 xmlRegStateAddTrans(ctxt, to, atom, to, -1, -1);
1752 xmlFAGenerateEpsilonTransition(ctxt, from, to);
1766 * @tonr: the to state
1767 * @counter: should that transition be associated to a counted
1775 xmlRegStatePtr to;
1783 to = ctxt->states[tonr];
1784 if (to == NULL)
1786 to->mark == XML_REGEXP_MARK_START) ||
1787 (to->mark == XML_REGEXP_MARK_VISITED))
1790 to->mark = XML_REGEXP_MARK_VISITED;
1791 if (to->type == XML_REGEXP_FINAL_STATE) {
1797 for (transnr = 0;transnr < to->nbTrans;transnr++) {
1798 if (to->trans[transnr].to < 0)
1800 if (to->trans[transnr].atom == NULL) {
1805 if (to->trans[transnr].to != fromnr) {
1806 if (to->trans[transnr].count >= 0) {
1807 int newto = to->trans[transnr].to;
1811 -1, to->trans[transnr].count);
1814 printf("Found epsilon trans %d from %d to %d\n",
1815 transnr, tonr, to->trans[transnr].to);
1817 if (to->trans[transnr].counter >= 0) {
1819 to->trans[transnr].to,
1820 to->trans[transnr].counter);
1823 to->trans[transnr].to,
1829 int newto = to->trans[transnr].to;
1831 if (to->trans[transnr].counter >= 0) {
1832 xmlRegStateAddTrans(ctxt, from, to->trans[transnr].atom,
1834 to->trans[transnr].counter, -1);
1836 xmlRegStateAddTrans(ctxt, from, to->trans[transnr].atom,
1841 to->mark = XML_REGEXP_MARK_NORMAL;
1849 * algorithm due to the large amount of generated new transitions and
1851 * to separate building blocks when generating the automata this can be
1852 * reduced to state elimination:
1853 * - if there exists an epsilon from X to Y
1857 * target of all transitions to X by transitions to Y.
1874 (state->trans[0].to >= 0) &&
1875 (state->trans[0].to != statenr) &&
1878 newto = state->trans[0].to;
1882 printf("Found simple epsilon trans from start %d to %d\n",
1887 printf("Found simple epsilon trans from %d to %d\n",
1893 if (tmp->trans[j].to == statenr) {
1895 printf("Changed transition %d on %d to go to %d\n",
1898 tmp->trans[j].to = -1;
1951 * Use a marking algorithm to avoid loops
1953 * Process from the latests states backward to the start when
1967 (state->trans[transnr].to >= 0)) {
1968 if (state->trans[transnr].to == statenr) {
1969 state->trans[transnr].to = -1;
1975 int newto = state->trans[transnr].to;
1978 printf("Found epsilon trans %d from %d to %d\n",
1982 state->trans[transnr].to = -2;
2008 (trans->to >= 0)) {
2009 trans->to = -1;
2016 * Use this pass to detect unreachable states too
2033 if ((state->trans[transnr].to >= 0) &&
2036 int newto = state->trans[transnr].to;
2142 * memory too, so let's force the automata to save state
2165 /* same thing to limit complexity */
2243 * Compares two atoms type to check whether they intersect in some ways,
2445 * Compares two atoms to check whether they are the same exactly
2446 * this is used to remove equivalent transitions
2476 /* too hard to do in the general case */
2490 * Compares two atoms to check whether they intersect in some ways,
2545 * need to check that none of the ranges eventually matches
2584 int to, xmlRegAtomPtr atom) {
2610 if (t1->to < 0)
2613 res = xmlFARecurseDeterminism(ctxt, ctxt->states[t1->to],
2614 to, atom);
2622 if (t1->to != to)
2673 * will have to be handled separately
2679 if (t1->to == -1) /* eliminated */
2683 if (t2->to == -1) /* eliminated */
2686 if (t1->to == t2->to) {
2688 * Here we use deep because we want to keep the
2694 t2->to = -1; /* eliminated */
2716 * will have to be handled separately
2721 if (t1->to == -1) /* eliminated */
2725 if (t2->to == -1) /* eliminated */
2729 * But here we don't use deep because we want to
2739 } else if (t1->to != -1) {
2744 ret = xmlFARecurseDeterminism(ctxt, ctxt->states[t1->to],
2745 t2->to, t2->atom);
2766 * from a state since there is no need to set-up rollback
2785 * Routines to check input against transition atoms *
3224 * we don't want to break.
3234 if (trans->to >=0) {
3246 if (trans->to < 0)
3280 xmlRegStatePtr to = comp->states[trans->to];
3287 * maximum limit in which case get to next transition
3313 * Try to progress as much as possible on the input
3334 exec->state = to;
3369 * says that's ok. Setting len to 0 inhibits stepping
3377 /* another spot to match when minOccurs is 0 */
3427 printf("entering state %d\n", trans->to);
3429 exec->state = comp->states[trans->to];
3443 * Failed to find a way out
3482 * Progressive interface to the verifier one atom at a time *
3494 * @data: the context data associated to the callback in this context
3531 * the second half is used to store the data in case of rollback
3559 * Free the structures associated to a regular expression evaulation context.
3629 * @expStr: the string to be evaluated
3682 * @data: data associated to the token to reuse in callbacks
3720 target--; /* to avoid 0 */
3742 * Failed to find an exit transition out from current state for the
3746 printf("failed to find a transition for %s on state %d\n", value, state);
3762 * @exec: a regexp execution context or NULL to indicate the end
3764 * @data: data associated to the token to reuse in callbacks
3802 * and get back to where we were left
3829 if (trans->to < 0)
3933 xmlRegStatePtr to = exec->comp->states[trans->to];
3947 * Try to progress as much as possible on the input
3974 exec->state = to;
4026 printf("entering state %d\n", trans->to);
4028 if ((exec->comp->states[trans->to] != NULL) &&
4029 (exec->comp->states[trans->to]->type ==
4042 exec->state = exec->comp->states[trans->to];
4092 * Failed to find a way out
4122 * @exec: a regexp execution context or NULL to indicate the end
4124 * @data: data associated to the token to reuse in callbacks
4139 * @exec: a regexp execution context or NULL to indicate the end
4142 * @data: data associated to the token to reuse in callbacks
4197 * @nbval: pointer to the number of accepted values IN/OUT
4199 * @values: pointer to the array of acceptable values
4202 * Extract informations from the regexp execution, internal routine to
4282 if (trans->to < 0)
4311 if ((exec->comp != NULL) && (exec->comp->states[trans->to] != NULL) &&
4312 (exec->comp->states[trans->to]->type !=
4326 if (trans->to < 0)
4338 if ((exec->comp->states[trans->to] != NULL) &&
4339 (exec->comp->states[trans->to]->type ==
4356 * @nbval: pointer to the number of accepted values IN/OUT
4358 * @values: pointer to the array of acceptable values
4362 * the parameter @values must point to an array of @nbval string pointers
4365 * returned will be freed with the @exec context and don't need to be
4380 * @nbval: pointer to the number of accepted values IN/OUT
4382 * @values: pointer to the array of acceptable values
4387 * the parameter @values must point to an array of @nbval string pointers
4390 * returned will be freed with the @exec context and don't need to be
4448 if (trans->to < 0)
4475 xmlRegStatePtr to = exec->comp->states[trans->to];
4486 * Try to progress as much as possible on the input
4507 exec->state = to;
4551 printf("entering state %d\n", trans->to);
4553 exec->state = exec->comp->states[trans->to];
4567 * Failed to find a way out
5323 * @to: optional target to the end of the branch
5325 * @to is used to optimize by removing duplicate path in automata
5331 xmlFAParseBranch(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr to) {
5339 (CUR=='|' || CUR==')') ? to : NULL, ctxt->atom) < 0)
5348 (CUR=='|' || CUR==')') ? to : NULL, ctxt->atom) < 0)
5446 * Parses a regular expression conforming to XML Schemas Part 2 Datatype
5495 * @content: the value to check against the regular expression
5690 * @to: the target point of the transition or NULL
5691 * @token: the input string associated to that transition
5692 * @data: data passed to the callback function if the transition is activated
5694 * If @to is NULL, this creates first a new target state in the automata
5695 * and then adds a transition from the @from state to the target state
5702 xmlAutomataStatePtr to, const xmlChar *token,
5714 if (xmlFAGenerateTransitions(am, from, to, atom) < 0) {
5718 if (to == NULL)
5720 return(to);
5727 * @to: the target point of the transition or NULL
5728 * @token: the first input string associated to that transition
5729 * @token2: the second input string associated to that transition
5730 * @data: data passed to the callback function if the transition is activated
5732 * If @to is NULL, this creates first a new target state in the automata
5733 * and then adds a transition from the @from state to the target state
5740 xmlAutomataStatePtr to, const xmlChar *token,
5772 if (xmlFAGenerateTransitions(am, from, to, atom) < 0) {
5776 if (to == NULL)
5778 return(to);
5785 * @to: the target point of the transition or NULL
5786 * @token: the first input string associated to that transition
5787 * @token2: the second input string associated to that transition
5788 * @data: data passed to the callback function if the transition is activated
5790 * If @to is NULL, this creates first a new target state in the automata
5791 * and then adds a transition from the @from state to the target state
5793 * Note that if @token2 is not NULL, then (X, NULL) won't match to follow
5800 xmlAutomataStatePtr to, const xmlChar *token,
5837 if (xmlFAGenerateTransitions(am, from, to, atom) < 0) {
5842 if (to == NULL)
5844 return(to);
5851 * @to: the target point of the transition or NULL
5852 * @token: the input string associated to that transition
5853 * @token2: the second input string associated to that transition
5856 * @data: data associated to the transition
5858 * If @to is NULL, this creates first a new target state in the automata
5859 * and then adds a transition from the @from state to the target state
5867 xmlAutomataStatePtr to, const xmlChar *token,
5911 * associate a counter to the transition.
5917 /* xmlFAGenerateTransitions(am, from, to, atom); */
5918 if (to == NULL) {
5919 to = xmlRegNewState(am);
5920 xmlRegStatePush(am, to);
5922 xmlRegStateAddTrans(am, from, atom, to, counter, -1);
5924 am->state = to;
5926 if (to == NULL)
5927 to = am->state;
5928 if (to == NULL)
5931 xmlFAGenerateEpsilonTransition(am, from, to);
5932 return(to);
5939 * @to: the target point of the transition or NULL
5940 * @token: the input string associated to that transition
5943 * @data: data associated to the transition
5945 * If @to is NULL, this creates first a new target state in the automata
5946 * and then adds a transition from the @from state to the target state
5954 xmlAutomataStatePtr to, const xmlChar *token,
5977 * associate a counter to the transition.
5983 /* xmlFAGenerateTransitions(am, from, to, atom); */
5984 if (to == NULL) {
5985 to = xmlRegNewState(am);
5986 xmlRegStatePush(am, to);
5988 xmlRegStateAddTrans(am, from, atom, to, counter, -1);
5990 am->state = to;
5992 if (to == NULL)
5993 to = am->state;
5994 if (to == NULL)
5997 xmlFAGenerateEpsilonTransition(am, from, to);
5998 return(to);
6005 * @to: the target point of the transition or NULL
6006 * @token: the input string associated to that transition
6007 * @token2: the second input string associated to that transition
6010 * @data: data associated to the transition
6012 * If @to is NULL, this creates first a new target state in the automata
6013 * and then adds a transition from the @from state to the target state
6022 to, const xmlChar *token,
6063 * associate a counter to the transition.
6069 /* xmlFAGenerateTransitions(am, from, to, atom); */
6070 if (to == NULL) {
6071 to = xmlRegNewState(am);
6072 xmlRegStatePush(am, to);
6074 xmlRegStateAddTrans(am, from, atom, to, counter, -1);
6076 am->state = to;
6077 return(to);
6086 * @to: the target point of the transition or NULL
6087 * @token: the input string associated to that transition
6090 * @data: data associated to the transition
6092 * If @to is NULL, this creates first a new target state in the automata
6093 * and then adds a transition from the @from state to the target state
6102 xmlAutomataStatePtr to, const xmlChar *token,
6122 * associate a counter to the transition.
6128 /* xmlFAGenerateTransitions(am, from, to, atom); */
6129 if (to == NULL) {
6130 to = xmlRegNewState(am);
6131 xmlRegStatePush(am, to);
6133 xmlRegStateAddTrans(am, from, atom, to, counter, -1);
6135 am->state = to;
6136 return(to);
6149 xmlAutomataStatePtr to;
6153 to = xmlRegNewState(am);
6154 xmlRegStatePush(am, to);
6155 return(to);
6162 * @to: the target point of the transition or NULL
6164 * If @to is NULL, this creates first a new target state in the automata
6165 * and then adds an epsilon transition from the @from state to the
6172 xmlAutomataStatePtr to) {
6175 xmlFAGenerateEpsilonTransition(am, from, to);
6176 if (to == NULL)
6178 return(to);
6185 * @to: the target point of the transition or NULL
6186 * @lax: allow to transition if not all all transitions have been activated
6188 * If @to is NULL, this creates first a new target state in the automata
6189 * and then adds a an ALL transition from the @from state to the
6197 xmlAutomataStatePtr to, int lax) {
6200 xmlFAGenerateAllTransition(am, from, to, lax);
6201 if (to == NULL)
6203 return(to);
6235 * @to: the target point of the transition or NULL
6236 * @counter: the counter associated to that transition
6238 * If @to is NULL, this creates first a new target state in the automata
6239 * and then adds an epsilon transition from the @from state to the target state
6246 xmlAutomataStatePtr to, int counter) {
6249 xmlFAGenerateCountedEpsilonTransition(am, from, to, counter);
6250 if (to == NULL)
6252 return(to);
6259 * @to: the target point of the transition or NULL
6260 * @counter: the counter associated to that transition
6262 * If @to is NULL, this creates first a new target state in the automata
6263 * and then adds an epsilon transition from the @from state to the target state
6270 xmlAutomataStatePtr to, int counter) {
6273 xmlFAGenerateCountedTransition(am, from, to, counter);
6274 if (to == NULL)
6276 return(to);
6348 * @dict: optional dictionnary to use internally
6407 * Structure associated to an expression node *
6604 /* a | a reduced to a */
6617 /* a | (a | b) and b | (a | b) are reduced to a | b */
6843 * Get the atom associated to this name from that context
6863 * Get the atom associated to the choice @left | @right
6864 * Note that @left and @right are consumed in the operation, to keep
6865 * an handle on them use xmlExpRef() and use xmlExpFree() to release them,
6888 * Get the atom associated to the sequence @left , @right
6889 * Note that @left and @right are consumed in the operation, to keep
6890 * an handle on them use xmlExpRef() and use xmlExpFree() to release them,
6910 * @subset: the expression to be repeated
6914 * Get the atom associated to the range (@subset){@min, @max}
6915 * Note that @subset is consumed in the operation, to keep
6916 * an handle on it use xmlExpRef() and use xmlExpFree() to release it,
6977 * @langList: where to store the tokens
7043 * @tokList: where to store the tokens
7172 printf("deriv count: match to empty => new count\n");
7194 * respect to the input string
7307 * Try to do a step of Brzozowski derivation but at a higher level
7420 /* try to get the sequence consumed only if possible */
7433 * i.e. we won't get to a nillable exp left
7447 /* Try instead to decompose */
7508 * Try to see if the loop is completely subsumed
7570 * TODO: loop here to try to grow if working on finite
7676 printf("Fallback to derivative\n");
7687 * we use the default token based derivation to force one more step
8107 * @buf: a buffer to receive the output
8110 * Serialize the expression as compiled to the buffer