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

📄 word_analysis.h

📁 一个C语言的词法分析器
💻 H
字号:
/*++
	module name: word_analysis.h
	vars and functions for word analysis
--*/
#ifndef	_WORD_ANALYSIS
#define _WORD_ANALYSIS

#include "global_def.h"
#include "error_.h"
/*****************************************************/
/* we don't have to expose these vars to user */
/*
// alloc space for file buffer 
extern char	 file_buffer[MAX_FILE_SIZE];  
extern int  pre_type;
extern char str_tem[MAX_LENGTH];
*/
extern char *p_char;
/***************************************************/
/* copy certain file to buffer */
int file_to_buffer(char *filename);
/*  */
int is_end	   (void);
/* 当前字符指针p_char自加 如果当前字符为文件结尾 返回错误 */
int  pop_char  (void);
/* 如果当前字符指针指向一个非Token的字符,将当前字符指针指向下一个Token */
int  goto_token(void);
/* some functions for certain char *p_char judging  */
int is_blank  (void);      /* is *p_char a blank */
int is_tab    (void);

int is_digit  (void);
int is_letter (void);

int is_specifier(void);			/* 界符		*/

int is_reserve (char *str);		/* 保留字	*/ 

int is_tranmean(char *p_c);     /* 转义字符 */   
/* some functions deal with certain type	*/
ENTRY deal_specifier (void);    /* 处理界符 */
ENTRY deal_double_   (void);	/* "		*/	
ENTRY deal_single_   (void);	/* '		*/
ENTRY deal_num  	 (void);
ENTRY deal_other	 (void);	/* reservers and identifiers */

/* if cannot tell which type the token is, the retern
   entry's type is TYPE_UNDEF and the pointer is NULL */	
ENTRY get_token(void );

#endif  /* _WORD_ANALYSIS */ 
/*************************end of file********************************/ 

⌨️ 快捷键说明

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