glossary.h

来自「编译器 用C语言对下述文法和单词表定义的语言设计编制一个编译器」· C头文件 代码 · 共 44 行

H
44
字号
/******************************************************************************
 * glossary.h
 *
 * 2008-03-28 20:01
 * 周鑫(zhouxin63766@yahoo.com.cn)
 *
 * 说明:翻译器的词法分析阶段。读取源文件中的词汇,然后判断是保留字还是错误代码
 ******************************************************************************/

#ifndef GLOSSARY_H
#define GLOSSARY_H

#include <QString>
#include "shared.h"

// Foreward declearation
class QFile;

class Glossary
{
public:
	Glossary();
	~Glossary();

public:
	bool openFile( const QString &fileName );

public:
	Token getToken();
	int lineNo()
	{
		return _lineNo;
	}

private:
	Token judgeValidToken( QString &lexeme );

	int _lineNo;
	QFile *sourceFile;
	QString tokenBuffer;
	bool fileEnd;
};
#endif

⌨️ 快捷键说明

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