最新网址:www.83kk.net
首页 > 玄幻魔法 > 那么修女小姐要怎么办呢 > 假条,今天要写编译原理,来不及更新啦

假条,今天要写编译原理,来不及更新啦(1/2)

目录
好书推荐: 穿越斗破之咸鱼人生 美色勾魂:权门陆少心尖宠 我的华娱时光 变身之绯月公主 诸天最强掠夺 快穿:殿下,别自闭! 快穿系统,男神大人,求撩! 甜宠懒妃:王爷,乖乖就擒 英雄泪,彼岸花 笑傲修真录

// consoleapplication14cpp:

//

#include“stdafxh“

#include<iostrea>

#include<fstrea>

#include<string>

#include<stdlibh>

#include<ioanip>

#include<windowsh>

#include<cath>

using naespace std;

#define axsize 0xffff

int ip = 0;

int n = 0;

int n = 0;//stack nuber

bool fg=1;

int top = 0;//变量存储

struct node {

node *index;

node *bro=null;

node *child=null;

int id;

string text;

bool hasval=true;

double val;

}s, a, b, c, d, e, f, g, h, i, j,*sheet,*p,*start;

struct variable{

string nae;

double val;

}var[20];

int find_var(string a){

for (int i = 0; i <top; i)

if (var[i]nae == a)

retu i;

retu -1;

}

tepte<css type>

css y_stack

{

int top;

type* y_s;

int axsize;

public:

y_stack():top(-1), axsize(axsize)

{

y_s = new type[axsize];

if (y_s == null)

{

cerr <<“动态存储分配失败!“<< endl;

exit(1);

}

}

y_stack(int size):top(-1), axsize(size)

{

y_s = new type[axsize];

if (y_s == null)

{

cerr <<“动态存储分配失败!“<< endl;

exit(1);

}

}

~y_stack()

{

delete[] y_s;

}

//是否为空

bool epty();

//压栈

node* push(type tp);

//返回栈顶元素

type top();

//返回第n个栈顶元素

type top(int n);

//出栈

void pop();

//栈大小

int size();

string show();

string show();

int nu();

};

tepte<css type>

bool y_stack<type>::epty()

{

if (top ==-1){

retu true;

}

else

retu false;

}

tepte<css type>

type y_stack<type>::top()

{

if (top !=-1)

{

retu y_s[top];

}

else

{

cout <<“栈空\n“;

exit(1);

}

}

tepte<css type>

type y_stack<type>::top(int n)

{

if ((top - n)>-1)

{

retu y_s[top - n];

}

else

{

cout <<“栈空\n“;

exit(1);

}

}

node* y_stack<node>::push(node tp)

{

node *tep = new node;

*tep = tp;

tep->index = tep;

n;

if (top1<axsize)

{

y_s[top]=*tep;

}

else

{

cout <<“栈满\n“;

exit(1);

}

retu tep;

}

tepte<css type>

int y_stack<type>::nu(){

retu top;

}

tepte<css type>

void y_stack<type>::pop()

{

if (top >= 0)

{

top--;

}

else

{

cout <<“栈空\n“;

exit(1);

}

}

tepte<css type>

int y_stack<type>::size()

{

retu top1;

}

tepte<css type>

string y_stack<type>::show(){

string s;

for (int i = 0; i <= top; i)

s = y_s[i]text;

retu s;

}

string y_stack<node>::show(){

string s;

for (int i = 0; i <= top; i)

s=(y_s[i]index->text)““;

retu s;

}

void s_p(node *sheet, node *a, y_stack<node>≈stack){

cout <<“pop(s),“;

node t10 = sheet[10];

node t9 = sheet[9];

switch (a[ip]id){

case 10:

stackpush(t9);

stackpush(b);

stackpush(t10);

stackpush(a);

cout <<“push(ab;)“;

break;

case 17:

stackpush(t9);

stackpush(b);

stackpush(t10);

stackpush(a);

cout <<“push(ab;)“;

break;

case 21:

break;

default:

cout <<“error : no patte for s!\n“;

fg = 0;

break;

}

}

void a_p(node *sheet, node *a, y_stack<node>≈stack){

cout <<“pop(a),“;

node t9 = sheet[9];

switch (a[ip]id){

case 10:

break;

case 17:

stackpush(a);

stackpush(t9);

stackpush(c);

cout <<“push(c;a)“;

break;

default:

cout <<“error : no patte for a!\n“;

fg = 0;

break;

}

}

void b_p(node *sheet, node *a, y_stack<node>≈stack){

cout <<“pop(b),“;

switch (a[ip]id){

case 0:

stackpush(e);

stackpush(d);

cout <<“push(de)“;

break;

case 1:

stackpush(e);

stackpush(d);

cout <<“push(de)“;

break;

case 2:

stackpush(e);

stackpush(d);

cout <<“push(de)“;

break;

case 3:

stackpush(e);

stackpush(d);

cout <<“push(de)“;

break;

case 4:

stackpush(e);

stackpush(d);

cout <<“push(de)“;

break;

case 5:

stackpush(e);

stackpush(d);

cout <<“push(de)“;

break;

case 6:

stackpush(e);

stackpush(d);

cout <<“push(de)“;

break;

case 7:

stackpush(e);

stackpush(d);

cout <<“push(de)“;

break;

case 12:

stackpush(e);

stackpush(d);

cout <<“push(de)“;

break;

case 17:

stackpush(e);

stackpush(d);

cout <<“push(de)“;

break;

case 18:

stackpush(e);

stackpush(d);

cout <<“push(de)“;

break;

case 19:

stackpush(e);

stackpush(d);

cout <<“push(de)“;

break;

case 20:

stackpush(e);

stackpush(d);

cout <<“push(de)“;

break;

default:

cout <<“error : no patte for b!\n“;

fg = 0;

break;

}

}

void c_p(node *sheet, node *a, y_stack<node>≈stack)

{

cout <<“pop(c),“;

node t17 = sheet[17];

node t15 = sheet[15];

switch (a[ip]id){

case 17:

stackpush(b);

stackpush(t15);

stackpush(t17);

cout <<“push(var=b)“;

break;

default:

cout <<“error : no patte for c!\n“;

fg = 0;

break;

}

}

void d_p(node *sheet, node *a, y_stack<node>≈stack){

cout <<“pop(d),“;

switch (a[ip]id){

case 0:

stackpush(g);

stackpush(f);

cout <<“push(fg)“;

break;

case 1:

stackpush(g);

stackpush(f);

cout <<“push(fg)“;

break;

case 2:

stackpush(g);

stackpush(f);

cout <<“push(fg)“;

break;

case 3:

stackpush(g);

stackpush(f);

cout <<“push(fg)“;

break;

case 4:

stackpush(g);

stackpush(f);

cout <<“push(fg)“;

case 5:

stackpush(g);

stackpush(f);

cout <<“push(fg)“;

break;

case 6:

stackpush(g);

stackpush(f);

cout <<“push(fg)“;

break;

case 7:

stackpush(g);

stackpush(f);

cout <<“push(fg)“;

break;

case 12:

stackpush(g);

stackpush(f);

cout <<“push(fg)“;

break;

case 17:

stackpush(g);

stackpush(f);

cout <<“push(fg)“;

break;

case 18:

stackpush(g);

stackpush(f);

cout <<“push(fg)“;

break;

case 19:

stackpush(g);

stackpush(f);

cout <<“push(fg)“;

case 20:

stackpush(g);

stackpush(f);

break;

cout <<“push(fg)“;

break;

break;

default:

fg = 0;

cout <<“error : no patte for d!\n“;

break;

}

}

void e_p(node *sheet, node *a, y_stack<node>≈stack){

cout <<“pop(e),“;

node t11 = sheet[11], t12 = sheet[12];

switch (a[ip]id){

case 8:

break;

case 9:

break;

case 11:

stackpush(e);

stackpush(d);

stackpush(sheet[11]);

cout <<“push(de)“;

break;

case 12:

stackpush(e);

stackpush(d);

stackpush(sheet[12]);

cout <<“push(-de)“;

break;

default:

fg = 0;

cout <<“error : no patte for e!\n“;

break;

}

}

void f_p(node *sheet, node *a, y_stack<node>≈stack){

cout <<“pop(f),“;

switch (a[ip]id){

case 0:

stackpush(sheet[8]);

stackpush(h);

stackpush(sheet[7]);

stackpush(sheet[0]);

cout <<“push(sin(h))“;

break;

case 1:

stackpush(sheet[8]);

stackpush(h);

stackpush(sheet[7]);

stackpush(sheet[1]);

cout <<“push(cos(h))“;

break;

case 2:

stackpush(sheet[8]);

stackpush(h);

stackpush(sheet[7]);

stackpush(sheet[2]);

cout <<“push(tg(h))“;

break;

case 3:

stackpush(sheet[8]);

stackpush(h);

stackpush(sheet[7]);

stackpush(sheet[3]);

cout <<“push(ctg(h))“;

break;

case 4:

stackpush(sheet[8]);

stackpush(h);

stackpush(sheet[7]);

stackpush(sheet[4]);

cout <<“push(log(h))“;

break;

case 5:

stackpush(sheet[8]);

stackpush(h);

stackpush(sheet[7]);

stackpush(sheet[5]);

cout <<“push(lg(h))“;

break;

case 6:

stackpush(sheet[8]);

stackpush(h);

stackpush(sheet[7]);

stackpush(sheet[6]);

cout <<“push(ln(h))“;

break;

case 7:

stackpush(i);

stackpush(h);

cout <<“push(hi)“;

break;

case 12:

stackpush(i);

stackpush(h);

cout <<“push(hi)“;

break;

case 17:

stackpush(i);

stackpush(h);

cout <<“push(hi)“;

break;

case 18:

stackpush(i);

stackpush(h);

cout <<“push(hi)“;

break;

case 19:

stackpush(i);

stackpush(h);

cout <<“push(hi)“;

break;

case 20:

stackpush(i);

stackpush(h);

cout <<“push(hi)“;

break;

default:

cout <<“error : no patte for f!\n“;

fg = 0;

break;

}

}

void g_p(node *sheet, node *a, y_stack<node>≈stack){

cout <<“pop(g),“;

switch (a[ip]id){

case 8:

break;

case 9:

break;

case 11:

break;

case 12:

break;

case 13:

stackpush(g);

stackpush(f);

stackpush(sheet[13]);

cout <<“push(*fg)“;

break;

case 14:

stackpush(g);

stackpush(f);

stackpush(sheet[14]);

cout <<“push(/fg)“;

break;

default:

cout <<“error : no patte for g!\n“;

fg = 0;

break;

}

}

void h_p(node *sheet, node *a, y_stack<node>≈stack){

cout <<“pop(h),“;

switch (a[ip]id){

case 7:

stackpush(sheet[8]);

stackpush(b);

stackpush(sheet[7]);

cout <<“push((b))“;

break;

case 12:

stackpush(h);

stackpush(sheet[12]);

cout <<“push(-h)“;

break;

case 17:

请访问最新地址www.83kk.net

本章未完,点击下一页继续阅读。

目录
新书推荐: 妖尸不可食?快,趁热送我家火葬 八零军婚,霍先生请你矜持一点 矢车菊魔女 四合院:带着系统发展国防工业 合欢宗:仙子请献上你们的忠诚! 我都天下无敌了,才开始夺嫡? 反派:无敌从收主角师尊为仆开始 高武:我的功法有词条 混小子,我可是你师娘啊! 生活不易,红龙卖艺?
返回顶部