⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 d_infixtopostfix.h

📁 后辍表达式的计算
💻 H
字号:
#include<iostream>
using namespace std;
#include<stack>
#include "d_instruction.h"
#include "d_expression_error.h"

class infixToPostfix{
public:
	infixToPostfix();//默认的构造函数
	infixToPostfix(const string& infix);//初始化中辍表达式
	void setInfix(const string& infix);//设置中辍表达式
	string postfix();//返回等效于中辍表达式的后辍表达式
private:
	string infixExpression;//中辍表达式
	string postfixExpression;//后辍表达式
	stack<instruction>  commandStack;//存放算术符的栈
	void outputCommand(const instruction& instr);//输出栈中的算术符到后辍表达式中
	bool isCommand(char ch) const;//判断是不是正确的算术符
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -