#include<stdio.h>
#include<string>
#include<iostream>
#include<algorithm>
#include<stack>
using namespace std;
int num;
stack<char> A;
stack<char> B;
int f(char x,char y)
{
if(x == 'E')
{
cout<<num<<" "<<"E-->TG"<<endl;
A.pop();
A.push('G');
A.push('T');
num++;
return 1;
}
else if(x == 'G'&&y=='+')
{
cout<<num<<" "<<"G-->+TG"<<endl;
A.pop();
A.push('G');
A.push('T');
A.push('+');
num++;
return 1;
}
else if(x == 'G'&&y!='+')
{
cout<<num<<" "<<"G-->&"<<endl;
A.pop();
num++
2016年秋季《编译原理》课程实验(2014级)表达式语法分析——递归子程序法
最新推荐文章于 2022-07-06 21:26:39 发布