Example #1
0
void turing_t::input()
{
  vstr v;
  string line;

  v = split( readline(), "," );
  for ( vit it = v.begin(); it != v.end(); ++it ) {
    Q.insert( *it );
  }

  v = split( readline(), "," );
  for ( vit it = v.begin(); it != v.end(); ++it ) {
    sigma.insert( *it );
  }

  v = split( readline(), "," );
  for ( vit it = v.begin(); it != v.end(); ++it ) {
    theta.insert( *it );
  }

  prazanZnak = readline();

  line = readline();
  for (int i = 0; i < line.length(); i++) {
    traka.push_back( line.substr( i, 1 ) );
  }
  
  v = split( readline(), "," );
  for ( vit it = v.begin(); it != v.end(); ++it ) {
    F.insert( *it );
  }

  Q0 = readline();

  line = readline();  sscanf( line.c_str(), "%d", &head );

  while (1) {
    line = readline();
    if (line.length() <= 0) { break; }

    v = split( line, "->" );
    string RHS = v[1], LHS = v[0];

    tuple a;  triple b;

    v = split( LHS, "," );
    a.first = v[0]; a.second = v[1];

    v = split( RHS, "," );
    b.first = v[0]; b.second = v[1]; b.third = v[2];

    delta[a] = b;

  }

  return;
}
Example #2
0
File: stbgen.cpp Project: mazonka/w
void readNames(std::istream &is, vstr &x)
{	
	while(1)
	{
		string s;
		is>>s;
		if( !is ) break;
		x.push_back(s);
	}
}