📄 stdafx.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 19//数据表中,每个记录中每个属性的最大长度
#define TABLE_HEAD 10//数据表头。用来存储每个数据项中含有的属性个数。
#define RETURN_LEN 2//回车字符长度
#define FENHAO_LEN 1//分号字符长度
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; //属性标组的长度
};
struct Index
{
char index[10];//索引号
char index_in_IndexForCiDian[10];//在“数据词典索引”文件中的索引号,结合CDBControl::ReadFromIndex(long,IndexForCiDian)用于获得数据表的相关信息
char value[20];//主键值
};
struct USER
{
char name[20];
char pwd[20];
_int32 right;
};
////////////////////////////////////////////////////////////////
#define CREATE_RIGHT 1
#define ALTER_RIGHT 1<<1
#define DROP_RIGHT 1<<2
#define INSERT_RIGHT 1<<3
#define SELECT_RIGHT 1<<4
#define UPDATE_RIGHT 1<<5
#define DELETE_RIGHT 1<<6
#define GRANT_RIGHT 1<<7
#define REVOKE_RIGHT 1<<8
#define COMMON_RIGHT SELECT_RIGHT
#define ADMIN_RIGHT 0xffff
////////////////////////////////////////////////////////////
//{{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 + -