int clexp_idx; int entity = (type != OP_CONTEXT_NODE ? node_idx : dfa->nodes[node_idx].opr.ctx_info->entity); if ((type != OP_CONTEXT_NODE || (dfa->nodes[entity].type != OP_BACK_REF)) && (type != OP_BACK_REF)) continue; for (clexp_idx = 0; clexp_idx < init_nodes.nelem; ++clexp_idx) { re_token_t *clexp_node; clexp_node = dfa->nodes + init_nodes.elems[clexp_idx]; if (clexp_node->type == OP_CLOSE_SUBEXP && clexp_node->opr.idx + 1 == dfa->nodes[entity].opr.idx) break; } if (clexp_idx == init_nodes.nelem) continue;
create_initial_state (dfa)     re_dfa_t *dfa;{  int first, i;  reg_errcode_t err;  re_node_set init_nodes;  /* Initial states have the epsilon closure of the node which is     the first node of the regular expression.  */  first = dfa->str_tree->first;  dfa->init_node = first;  err = re_node_set_init_copy (&init_nodes, dfa->eclosures + first);  if (BE (err != REG_NOERROR, 0))    return err;  /* The back-references which are in initial states can epsilon transit,     since in this case all of the subexpressions can be null.     Then we add epsilon closures of the nodes which are the next nodes of     the back-references.  */  if (dfa->nbackref > 0)    for (i = 0; i < init_nodes.nelem; ++i)      {        int node_idx = init_nodes.elems[i];        re_token_type_t type = dfa->nodes[node_idx].type;        if (type == OP_CONTEXT_NODE            && (dfa->nodes[dfa->nodes[node_idx].opr.ctx_info->entity].type                == OP_BACK_REF))          {            int prev_nelem = init_nodes.nelem;            re_node_set_merge (&init_nodes,                           dfa->nodes[node_idx].opr.ctx_info->bkref_eclosure);            if (prev_nelem < init_nodes.nelem)              i = 0;          }        else if (type == OP_BACK_REF)          {            int next_idx = dfa->nexts[node_idx];            if (!re_node_set_contains (&init_nodes, next_idx))              {                re_node_set_merge (&init_nodes, dfa->eclosures + next_idx);                i = 0;              }          }      }  /* It must be the first time to invoke acquire_state.  */  dfa->init_state = re_acquire_state_context (&err, dfa, &init_nodes, 0);  /* We don't check ERR here, since the initial state must not be NULL.  */  if (BE (dfa->init_state == NULL, 0))    return err;  if (dfa->init_state->has_constraint)    {      dfa->init_state_word = re_acquire_state_context (&err, dfa, &init_nodes,                                                       CONTEXT_WORD);      dfa->init_state_nl = re_acquire_state_context (&err, dfa, &init_nodes,                                                     CONTEXT_NEWLINE);      dfa->init_state_begbuf = re_acquire_state_context (&err, dfa,                                                         &init_nodes,                                                         CONTEXT_NEWLINE                                                         | CONTEXT_BEGBUF);      if (BE (dfa->init_state_word == NULL || dfa->init_state_nl == NULL              || dfa->init_state_begbuf == NULL, 0))        return err;    }  else    dfa->init_state_word = dfa->init_state_nl      = dfa->init_state_begbuf = dfa->init_state;  re_node_set_free (&init_nodes);  return REG_NOERROR;}