
/**************************************************************************************************/
/*                                                                                                */
/*  Name:  DarC KonQuesT                                                                          */
/*  Program:  #4                                                                                  */
/*  Date:  2005.3.12                                                                              */
/*  Purpose:                                                                                      */
/*    expression.h is the class declaration for the expression class.  Allows for work with and   */
/*  conversion of infix expressions to postfix expressions.                                       */
/*                                                                                                */
/*                                                                                                */
/**************************************************************************************************/

#include <stack>
#include "queue.h"
#include "string.h"

using namespace std;

class expression //class declaration
{
  public:
    expression(); //constructor
    void getInfix(string);  //read infix equation from file (file name passed)
    string showInfix();  //show infix equation (in output stream)
    void showPostfix(string);  //show postfix equation (in output stream)
    string convertToPostfix(string);  //convert a string from infix to postfix, output filename passed
    bool precedence(char, char); //determine precedence of first char over 2nd char

  private:
    string pfx;  //postfix string
    string infix; //infix string
    queue<string> infix_q;  //infix queue
    stack<char> op_stack;  //operator stack
    queue<char> punctuation_stack; //semicolon/period band-aid made from duct tape, krazy glue and bendy straws.
};

