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

📄 stdafx.h

📁 数据库模拟程序 实现控制台命令词法分析
💻 H
字号:
// stdafx.h : include file for standard system include files,
//  or project specific include files that are used frequently, but
//      are changed infrequently
//

#if !defined(AFX_STDAFX_H__5BA9DAF4_479E_416E_8E48_0183087194CC__INCLUDED_)
#define AFX_STDAFX_H__5BA9DAF4_479E_416E_8E48_0183087194CC__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define VC_EXTRALEAN		// Exclude rarely-used stuff from Windows headers

#include <afxwin.h>         // MFC core and standard components
#include <afxext.h>         // MFC extensions
#include <afxdisp.h>        // MFC Automation classes
#include <afxdtctl.h>		// MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>			// MFC support for Windows Common Controls
#include <iostream.h>		//支持io输入输出流
#include <fstream.h>		//支持文件流
#endif // _AFX_NO_AFXCMN_SUPPORT

#define MAXSIZE 84
#define FALSE 0
#define TRUE 1

struct Word
{
	int kind;             // kind-->symbol:1   constant:2  key:3   界符:4  运算符:5   wrong:-1
	char name[10];
	int pointer;
	char mark[20];
};
struct Symbol
{
	char name[10];
};
struct Constant            //常数.
{
	float value;
};
struct item
{
 char n; /*非终结符*/
 char t;  /*终结符*/
 char gen[10]; /*产生式*/
};

typedef char datatype; /*栈的定义*/  
typedef struct
{
 datatype data[MAXSIZE];
 int top;
}seqstack;


/////////////以下用于语法命令处理
#define CREATE_TABLE 1
#define CREATE_VIEW 2
#define CREATE_INDEX 3
#define DROP_TABLE 4
#define DROP_VIEW 5
#define DROP_INDEX 6
#define ALTER 7
#define INSERT 8
#define SELECT 9
#define UPDATE 10
#define GRANT 11
#define REVOKE 12

#define NAME_LEN 40
#define ITEM_LEN 20//数据表中,每个记录中每个属性的最大长度

enum IndexType {TABLE, VIEW, INDEX};
struct IndexForCiDian
{
	IndexType indexType; //处理的类型: 表 = TABLE 索引 = INDEX 视图 = VIEW
	char name[NAME_LEN];		 //代处理的表名/索引名/视图名
	long startOffset;	 //在indexForCiDian文件中的起始位置
	long item_len;			 //数据项的长度
};

struct DataItem//属性单元 既一个属性
{
	char name[NAME_LEN];
	int type;//类型 int = 1,char = 2;
	int len; //类型为int时 ,无意义,忽略本项
			 //    为char时表示命令行中char后面的数字
};

struct Data
{
	char name[NAME_LEN];//table name
	struct DataItem * pDataArray;//属性表组
	int pDataArray_len; //属性标组的长度
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_STDAFX_H__5BA9DAF4_479E_416E_8E48_0183087194CC__INCLUDED_)

⌨️ 快捷键说明

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