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

📄 lexer.h

📁 compiler principle how to ananilyze
💻 H
字号:
// Lexer.h: interface for the Lexer class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_LEXER_H__B4398D77_71EF_4B94_A279_08D548DD6E8A__INCLUDED_)
#define AFX_LEXER_H__B4398D77_71EF_4B94_A279_08D548DD6E8A__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "Token.h"

#include <vector>
#include <fstream>
using namespace std;

class Lexer
{
private:
	enum {BSIZE = 128 };
	char lexbuf[BSIZE];  // temporary buffer to keep a string under being recognised, 
	char* lexbuf_p;
	const char* lexbuf_end;

	int line_no;          // the current line no when doing lexcial analysing

	ifstream* inFile;	 //input grammar file

	Token getVN_epsilon(char first);
	Token getVT();
public:
	Lexer();
	void initialize(ifstream* ainFile);
	Token getNextToken();
	int getLineNo() const;
};

#endif // !defined(AFX_LEXER_H__B4398D77_71EF_4B94_A279_08D548DD6E8A__INCLUDED_)

⌨️ 快捷键说明

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