school/cs235/lab04/expman.h

29 lines
744 B
C++

#ifndef __EXPMAN_H__
#define __EXPMAN_H__
#include <iostream>
#include <stack>
#include <vector>
#include <cstdlib>
#include <sstream>
#include <string>
#include "ExpressionManagerInterface.h"
using namespace std;
class expman : public ExpressionManagerInterface {
public:
bool isBalanced(string expression);
string postfixToInfix(string postfixExpression);
string infixToPostfix(string infixExpression);
string postfixEvaluate(string postfixExpression);
};
int precedence(string ch);
bool is_paren(string token);
bool is_int(string token);
bool is_valid_expression(string token);
bool is_valid_token(string token);
stack<string> reverse_stack(stack<string>);
stack<string> parse_expression(string);
#endif