Lines Matching defs:state

171  * Structure to hold a single state.
1187 * reduce to a DFA. The starting state for the reduction will be returned.
1192 ucs2_t c, state, top, sym, *sp, *ep;
1195 state = _URE_NOOP;
1219 state = _ure_make_expr(_ure_pop(b), _ure_pop(b), state, b);
1227 state = _ure_make_expr(_URE_STAR, state, _URE_NOOP, b);
1230 state = _ure_make_expr(_URE_PLUS, state, _URE_NOOP, b);
1233 state = _ure_make_expr(_URE_QUEST, state, _URE_NOOP, b);
1241 state = _ure_make_expr(_ure_pop(b), _ure_pop(b), state, b);
1243 _ure_push(state, b);
1250 state = _ure_make_expr(_URE_SYMBOL, sym, _URE_NOOP, b);
1256 _ure_push(state, b);
1265 state = _ure_make_expr(_ure_pop(b), _ure_pop(b), state, b);
1270 return (b->error == _URE_OK) ? state : _URE_NOOP;
1274 _ure_add_symstate(ucs2_t sym, ucs2_t state, _ure_buffer_t *b)
1280 * Locate the symbol in the symbol table so the state can be added.
1287 * Now find out if the state exists in the symbol's state list.
1290 i < sp->states.slist_used && state > *stp; i++, stp++) ;
1292 if (i == sp->states.slist_used || state < *stp) {
1294 * Need to add the state in order.
1309 sp->states.slist[i] = state;
1329 * Need to add a new DFA state (set of NFA states).
1363 * Return the ID of the DFA state representing a group of NFA states.
1371 ucs2_t i, j, state, eval, syms, rhs;
1379 * Add the starting state for the reduction.
1399 state = b->stack.slist[j];
1407 switch (b->expr[state].type) {
1410 _ure_add_symstate(b->expr[state].lhs, ns1, b);
1419 s1 = b->expr[state].lhs;
1421 state = _ure_make_expr(_URE_OR, ns1, s1, b);
1424 s1 = b->expr[state].lhs;
1426 state = _ure_make_expr(_URE_AND, s1, ns1, b);
1429 s1 = b->expr[state].lhs;
1432 state = _ure_make_expr(_URE_OR, ns1, ns2, b);
1435 s1 = b->expr[state].lhs;
1436 s2 = b->expr[state].rhs;
1442 s1 = b->expr[state].lhs;
1443 s2 = b->expr[state].rhs;
1451 state = s2;
1456 state = _ure_make_expr(_URE_OR, s2, ns2, b);
1460 ns2 = _ure_make_expr(_URE_OR, s2, state, b);
1461 state = _ure_make_expr(_URE_AND, ns1, ns2, b);
1465 ns2 = _ure_make_expr(_URE_AND, ns1, state, b);
1466 state = _ure_make_expr(_URE_OR, s2, ns2, b);
1473 state = _ure_make_expr(_URE_OR, ns1, ns2, b);
1479 state = _ure_make_expr(_URE_AND, ns1, ns2, b);
1487 * Clear the state stack.
1492 * Reset the state pointer because the reduction may have moved it
1513 * Go through the symbol table and generate the DFA state transitions
1524 * Reset the state pointer in case the reallocation moves it
1694 ucs2_t i, j, state;
1728 if ((state = _ure_re2nfa(re, relen, buf)) == _URE_NOOP)
1734 _ure_reduce(state, buf);
1750 * Free up the NFA state groups and transfer the symbols from the buffer
1765 for (i = state = 0, sp = buf->states.states; i < buf->states.states_used;
1767 if (sp->id == state) {
1770 state++;
1786 for (i = state = 0, sp = buf->states.states; i < buf->states.states_used;
1788 if (sp->id == state) {
1794 * Add the transitions for the state.
1802 state++;
2089 * If the last state was not accepting, then reset
2096 * The last state was accepting, so terminate the matching