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

📄 lnscan.h

📁 < 虚拟机设计与实现> 的source code, linux版本
💻 H
字号:
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+                                                                   +
+ lnscan.h - takes an input file and breaks it into a stream of     + 
+	null-char terminated lines ( represented by Line struct )       +                               +
+                                                                   +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

#ifndef _LNSCAN_H
#define _LNSCAN_H

//#define INPUT_SCANNER_DEBUG		1

#ifdef INPUT_SCANNER_DEBUG
#define	INPUT_SCAN_DEBUG0(arg);				printf("LineScanner::");printf(arg);
#define INPUT_SCAN_DEBUG1(arg1,arg2);		printf("LineScanner::");printf(arg1,arg2);
#define INPUT_SCAN_DEBUG2(arg1,arg2,arg3);	printf("LineScanner::");printf(arg1,arg2,arg3);
#else
#define	INPUT_SCAN_DEBUG0(arg);
#define INPUT_SCAN_DEBUG1(arg1,arg2);
#define INPUT_SCAN_DEBUG2(arg1,arg2);
#endif

#define LINE_SIZE   512		/*max length of line of assembly code*/

/*flag from getInputChar(), indicates have hit EOF*/
#define IN_END		-1		

struct Line
{
	char src[LINE_SIZE];	/*single line of assembler code*/
	unsigned long line;		/*line number*/
	char *fName;			/*file reading assembly code from*/
	unsigned char end;		/*(TRUE|FALSE), indicates we've hit EOF*/
};

int LineScanner_init();
void LineScanner_free();

struct Line getInputLine();
void printScannedLine(struct Line *lptr);

void test_LineScanner();

#endif

⌨️ 快捷键说明

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