Logo Search packages:      
Sourcecode: lttoolbox version File versions  Download package

void State::apply ( unsigned short const   input  )  [private]

Make a transition, version for lowercase letters and symbols

Parameters:
input the input symbol

Definition at line 106 of file State.C.

References Pool< T >::get(), pool, Pool< T >::release(), and state.

Referenced by step().

{
  multimap<Node *, vector<unsigned short> *> new_state;

  multimap<Node *, vector<unsigned short> *>::iterator s_it;

  for(multimap<Node *, vector<unsigned short> *>::iterator s_it = state.begin(),
                                                           s_limit = state.end();
      s_it != s_limit;  s_it++)
  {
    map<unsigned short, Dest>::const_iterator it;
    it = s_it->first->transitions.find(input);
    if(it != s_it->first->transitions.end())
    {
      for(int i = 0; i != it->second.size; i++)
      {
        vector<unsigned short> *new_v = pool.get();
        *new_v = *(s_it->second);

        if(it->first != 0)
      {
          new_v->push_back(it->second.out_tag[i]);
        }

        new_state.insert(pair<Node *, vector<unsigned short> *>(it->second.dest[i], new_v));
      }
    }
    pool.release(s_it->second);
  }

  state = new_state;
}


Generated by  Doxygen 1.6.0   Back to index