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

📄 symbol_table.h

📁 一个C语言的词法分析器
💻 H
字号:
/*++
		module name: symbol.h
		some functions and vars' declaration to manage symbol tables
--*/
#ifndef _SYMBOL_TABLE
#define _SYMBOL_TABLE

#include "global_def.h"
/******************************************************/
#define RESERVE_TABLE_LEN		18
#define SPECIFIER_TABLE_LEN		40
#define MAX_NODE_LENGTH		    15	/* 界符和运算符 and 保留字最大长度 不含'\0' */	
#define MAX_STR_LENGTH			256 /*  字符串最大长度 */
/* 保留字和界符_运算符表表项 */
typedef struct
{
	int   type;
	char  str [MAX_NODE_LENGTH +1];
}TABLE_NODE;
/* we don't have to expose these vars to user */
/*
extern int    cst_num_table [MAX_NUM];
extern double cst_real_table[MAX_NUM];
extern char   cst_char_table[MAX_NUM];
extern char   cst_str_table [MAX_NUM][MAX_LENGTH];

extern char   identifier_table[MAX_NUM][MAX_LENGTH];

extern int    cst_num_length;
extern int    cst_real_length;
extern int    cst_char_length;
extern int    cst_str_length;

extern int    identifier_length;
*/
/************************************************************/
void *query_cst_num   (int    cst_num   );
void *query_cst_real  (double cst_real  );
void *query_cst_char  (char   cst_char  );
void *query_cst_str   (char  *cst_str   );
void *query_identifier(char *identifier );

ENTRY query_reserve_table    (char *str );
ENTRY query_specifier_table  (char *str );

void *add_cst_num     (int    cst_num   );
void *add_cst_real    (double cst_real  );
void *add_cst_char    (char   cst_char  );
void *add_cst_str     (char  *cst_str   );

void *add_identifier  (char *identifier );

#endif	/* _SYMBOL_TALE */
/********************************end of file*********************************/

  

⌨️ 快捷键说明

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