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

📄 lex.h

📁 基于C++的编译器词法分析模块生成器[Lex]
💻 H
字号:
#include <iostream>
#include <fstream>
#include <hash_map>
#include <string>
#include <stdlib.h>
#include <windows.h>

#define IDENTIFIER 1
#define NUMBER 2
#define INT 3
#define IF 4
#define ELSE 5
#define RETURN 6
#define FLOAT 7
#define STRUCT 8
#define LPAR 9
#define NEWLINE 10  //reserved 0x0a for newline char
#define RPAR 11
#define LBRACE 12
#define RBRACE 13
#define LBRACK 14
#define RBRACK 15
#define EQUAL 16
#define ASSIGN 17
#define SEMICOLON 18
#define COMMA 19
#define DOT 20
#define PLUS 21
#define MINUS 22
#define TIMES 23
#define DIVIDE 24

using namespace std;

typedef hash_map<int, hash_map<char, int> > dfa_state_map;
typedef hash_map<int, string> state_action_map;

⌨️ 快捷键说明

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