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

📄 scanner.h

📁 Simple语言词法分析器——————大连理工版
💻 H
字号:
#ifndef SCANNER_H
#define SCANNER_H
#include<stdio.h>
#include<string.h>
#include<stdlib.h>

//modify by webboyvc


#define LENGTH 61
#define N 100
/********************/
typedef struct token
{
	int label;
	char name[30];
	int code;
	int addr;
}token;
typedef struct KeyWord
{
	char name[30];
	int code;
}KeyWord;
typedef struct symble
{
	int number;
	int type;
	char name[30];
}symble;
/*******************************************/
char ch;
int var_count;
int error_count;
int label_count;
int code_count;
int addr_count;
int LineOfPro;
char filename[30];
FILE *KeyFin;
FILE *SourceFin;
FILE *SourceFout;
FILE *TokenFout;
FILE *SymbleFout;
KeyWord key[LENGTH];
token CurrentToken;
symble CurrentSimble;
symble SymbleList[N];
/***************************************************/
void Scanner();
void ScannerInit();
void IsAlpha();
void IsNumber();
void IsAnotation();
void IsChar();
void IsOther();
void OutPut();
void Error(int a);
int WordHave();
int strcmp(char*s,char*t)
{
	for(;*s==*t;s++,t++)
		if(*s==0)
			return 0;
		return 1;
}
#endif

⌨️ 快捷键说明

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