
std::istream& Poli::Read(std::istream& is)
{
	string str;
	int    c;
	while ( (c= is.get()) !=EOF && c!=';')
		str+= char(c);
	if (c==EOF)
		str+= ';';
	Del();
	Parser Par(str);

    double sign= 1;
    if (Par.Tok()=='+')
       Par.Lex();
    else
      if (Par.Tok()=='-')
         {
          sign= -1;
          Par.Lex();
         }
   
    double co;
    int    ex;
    Par.ReadTerm(co,ex);
    *this+= Term(sign*co,ex);

    while (Par.Tok()=='+' || Par.Tok()=='-')
       {
        if (Par.Tok()== '+')
           sign= 1;
        else
           sign= -1;
        Par.Lex();
        Par.ReadTerm(co,ex);
        *this+= Term(sign*co,ex);
       } 

    if (Par.Tok()!=';') {
    	cerr << "ERROR - polinomio mal escrito\n";
		Del();
	}
    return is;
}
