www.pudn.com > pl0_compiler_c.rar > cifa.h
// cifa.h: interface for the cifa class. ////////////////////////////////////////////////////////////////////// #ifndef __CIFA_H #define __CIFA_H #include#include "symset.h" #include "pl0.h" #define IDENT_LENGTH 9 //标识符最长长度 #define NUMBER_LENGTH 14 //最大数位 #define MAX_NUMBER 2047 //最大整数 class CCifa { public: CCifa(CPlCompiler * ); ~CCifa(); symbol GetSymbol(); int GetLine() {return line;} public: char id[IDENT_LENGTH+1]; int num; private: void create_ht(); int hushsrch(char *word); int hush(char *s); //哈希函数 private: struct word_table{ char word[IDENT_LENGTH+1]; symbol sym; } *wt; //关键字表 char ht[20]; //关键字的哈希表 char ch; //当前字符 int line; //行号 CPlCompiler *pl; }; #endif