
/**************************************************************************************************/
/*                                                                                                */
/*  Name:  DarC KonQuesT                                                                          */
/*  Program:  #4                                                                                  */
/*  Date:  2005.3.15                                                                              */
/*  Purpose:                                                                                      */
/*    Main driver program for use with expression class and newly implemented stacks and queues   */
/*    (STL clones)                                                                                */
/*                                                                                                */
/*                                                                                                */
/**************************************************************************************************/

#include <iostream>
#include <string>
#include <fstream>
#include "expression.h"

using namespace std;


/*  Name: main(int, char)                                                                                             */ 
/*  Purpose:  Use commandline input as arguments, check salinity, call functions to convert infix to postfix and output*/
/*  Parameters:  int argc, char* argv[]                                                                               */
/*  Preconditions:  expression class must be implemented and included, parameters must be passed on commandline       */
/*  Postconditions:  infix equations are taken from input file, converted to postfix, and saved in output file        */

int main(int argc, char* argv[])
{
  string in_file;
  string out_file;
  expression infixT;
  if(argc == 1 || argc == 2)
  {
    cout << endl << "Not enough parameters given!" << endl << "Usage:  ./program <inputfile> <outputfile>" << endl;
    return 1;
  }
  
  if(argc > 3)
    cout << endl << "Too many parameters given ~ trying to use " << argv[1] << " as input and " << argv[2] << " as output." << endl;
  
  in_file = argv[1];
  out_file = argv[2];
  
  infixT.getInfix(in_file);
  infixT.showPostfix(out_file);

}

