#include #include #include #include #include //List of Return Value Codes: //2 => O/P File Error. //3 => I/P File Error. //4 => Too Few Arguments. //List of Vector Error Strinds: //1 => Unexpected End of File Encountered. typedef int (*Action)(FILE*&); std::vector fsm_vec; std::vector _evec; FILE* _dest; class RAII_File { FILE*& _pfile; RAII_File (RAII_File const&); RAII_File& operator= (RAII_File const&); public: RAII_File (FILE*& _pf) : _pfile(_pf) { } ~RAII_File () { fclose (_pfile); } }; int Find_Comment_Start (FILE*&); int Comment_Double_Shash_End (FILE*&); int Comment_Star_Slash_End (FILE*&); //The first element of the pair is the Error Number and the second one //is the Line Number on which the error was found. void Handle_Error (std::pair Error_Data) { //We use the previously set up Vector of errors to get the Error //String. std::cout<<"On line: "<& _evec_str) { _evec_str.clear (); _evec_str.push_back (""); _evec_str.push_back ("Unexpected End of File Encountered."); } void Map_FSM_Vector (std::vector& _avec) { _avec.clear (); _avec.push_back (&Comment_Double_Shash_End); _avec.push_back (&Comment_Star_Slash_End); _avec.push_back (&Eat_Double_Quote); } int main (int arg_num, char *args[]) { if (arg_num < 3) { std::cerr<<"Too Few Arguments."<