errors.h

来自「pl0文法编译器」· C头文件 代码 · 共 32 行

H
32
字号
#ifndef __ERRORS_H
#define __ERRORS_H

#include "PL0Compiler.h"
#include "SymSet.h"
#include "LexAnalyze.h"

const int MAX_ERROR_NUM = 40;
typedef map<int, string>::value_type errorVauleType;

class Errors
{
public:
	Errors(PL0Compiler *pl);

public:
	bool display();//显示错误信息
	void addError(int errorID);//添加错误

private:
	PL0Compiler *pl0Compiler;
	int numOfErrors;
	errcode_loc ErrCodeLoc;
	map<int, string> errorMap;

private:
	Location getLocation(){return pl0Compiler->lexAnalyze->getLocation();}//返回源码中当前错误位置
	void initErrorMap();

};

#endif

⌨️ 快捷键说明

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