lex.h

来自「基于C++的编译器词法分析模块生成器[Lex]」· C头文件 代码 · 共 36 行

H
36
字号
#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 + =
减小字号Ctrl + -
显示快捷键?