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

void Transducer::joinFinals ( int const   epsilon_tag = 0  ) 

Join all finals in one using epsilon transductions

Parameters:
epsilon_tag the tag to take as epsilon

Definition at line 235 of file Transducer.C.

References finals, linkStates(), and newState().

Referenced by RegExpCompiler::Esp(), insertTransducer(), oneOrMore(), optional(), and reverse().

{
  if(finals.size() > 1)
  {
    int state = newState();

    for(set<int>::iterator it = finals.begin(), limit = finals.end(); 
        it != limit; it++)
    {
      linkStates(*it, state, epsilon_tag);
    } 

    finals.clear();
    finals.insert(state); 
  }
  else if(finals.size() == 0)
  {
    cerr << "Error: empty set of final states" <<endl;
    exit(EXIT_FAILURE);
  }
}


Generated by  Doxygen 1.6.0   Back to index