// proj10.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "MyOb.h" #include "vector" #include "string" #include "iostream" #include #include #include #include using namespace std; #define _SIZE_OPER_ 6 #define _MAX_LEN_ 9 #define _or_ 3 void error(ifstream &fs); int _tmain(int argc, _TCHAR* argv[]){ ifstream fin("oper.ini"); if (!fin){cerr<<"ERROR: No operation file found"< set_oper; int sz(0); while(fin>>tmp) { set_oper.insert(tmp); sz++; } fin.close(); if (set_oper.size()==0){cerr<<"ERROR: No operation has been read"<::iterator it=set_oper.begin(); it!=set_oper.end(); it++) { cout.width(19); cout.setf(ios::right); cout.fill('-'); cout<<*it< reg; char r1,r2; while(ifop>>c) { if(!isspace(c)){ if(isalpha(c)||isdigit(c))tmp.append(&c); else{ if(tmp.empty()||!isalpha(tmp[0])||c!=';')error(ifop); r1=tmp[0];//a in; a out; axorb; a in; a set 123; if(tmp.length()>_MAX_LEN_)error(ifop); string op(""); for(string::iterator it=tmp.begin()+1; it!=tmp.end(); it++) { if(isalpha(*it))op.append((char*)*it); else break; } if(op.empty())error(ifop); int i(0), k(0); set::iterator iter; for(iter=set_oper.begin(); iter!=set_oper.end();iter++){ k++; if(i=op.find(*iter))break; if(iter==--set_oper.end())error(ifop); } if(i!=1)error(ifop); if(k<2){ if(op.length()!=(*iter).length())error(ifop); } else{ if(k+1