instruct.cpp

来自「输入一个表达式子 然后输出 这个式子 的LL1文法形式」· C++ 代码 · 共 59 行

CPP
59
字号
// instruct.cpp: implementation of the Cinstruct class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "LL1.h"
#include "instruct.h"

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

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

Cinstruct::Cinstruct()
{
	uendflag=NULL;
}

Cinstruct::~Cinstruct()
{

}

bool Cinstruct::adduendflag(TCHAR c)
{
	if(c=='\0'){
		return FALSE;
	}
	Cuendflag * flag=uendflag;
	while(flag!=NULL){
		if(flag->flag==c){
			return FALSE;
		}
		flag=flag->next;
	}
	flag=new Cuendflag(c);
	if(uendflag==NULL){
		uendflag=flag;
		flag->next=NULL;
	}else{
		flag->next=uendflag;
		uendflag=flag;
	}
	return TRUE;
}

bool Cinstruct::checkll1()
{
	//Cendflag * endflag=Cendflag::head;
	//while(endflag!=NULL){
	//}
	return TRUE;
}

⌨️ 快捷键说明

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