// ExpressionDriver.cpp // tom bailey 19 oct 05 // Modified to minimize code. // Remove read prefix expressions, print postfix, evaluate. // tom bailey 5 apr 04 // Modified to read prefix expressions. // tom bailey 15 jan 04 // Modified to use Expression3.h. // tom bailey 21 nov 03 // Exercise the print and evaluation methods of the Expression // class. #include "Expression.h" #include using std::cin; using std::cout; using std::endl; int main() { while( true ) { cout << endl; cout << "Enter a valid, marked, fully parenthesized (+,*) infix expression:" << endl; Expression & expr = readFPIE( cin ); cout << endl; cout << "Prefix Expression: "; expr.preOrderPrint( cout ); cout << endl << endl; cout << " = " << expr.value(); cout << endl << endl; delete & expr; } return 0; }