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

📄 stack.cpp

📁 这是一个lr文法分析器
💻 CPP
字号:
// stack.cpp: implementation of the stack class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "lr.h"
#include "stack.h"
#include "cc.h"


#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

stack::stack()
{
	c.st[0]='#';
	c.st[1]='\0';
	c.con[0]='0';
	c.con[1]='\0';
	topst=1;
	topcon=1;
}

stack::~stack()
{

}

void stack::pop(){
	topst--;
	topcon--;
	c.con[topst]='\0';
	c.con[topcon]='\0';
}

void stack::pushst(char *ch, int k){
	c.st[topst]=ch[k];

	topst++;
    c.st[topst]='\0';
}

void stack::pushcon(char *condi, int i){
	c.con[topcon]=condi[i];

	topcon++;
	c.con[topcon]='\0';
}

⌨️ 快捷键说明

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