-
Notifications
You must be signed in to change notification settings - Fork 0
/
lexer.h
60 lines (43 loc) · 1.61 KB
/
lexer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// ****************************************************************************
// ****************************************************************************
// lexer.h
// ****************************************************************************
//
// ****************************************************************************
// ****************************************************************************
// ****************************************************************************
// Defines
// ****************************************************************************
#ifndef H_LEXER
#define H_LEXER
// ****************************************************************************
// Lexer Class
// ****************************************************************************
class Lexer {
public:
static void init();
static void run(const comString& inFile);
static Token* tokenize(const comString& spelling);
static TokList& getTokens() {return m_tokens;}
static void printTokens();
static bool dumpFSA() {return m_dumpFSA;}
private:
static Token::Type checkKeyword(const char* spelling);
static void addCompOps();
static void addMultOps();
static void addAddOps();
static void addUnaryOps();
static void addStringConsts();
static void addNumericConsts();
static void addOthers();
static State* addIdentifiers();
static State* m_entryState;
static TokList m_tokens;
static const char m_idStarts[];
static const char m_idMids[];
static const char m_stringChars[];
static const char m_numerals[];
static bool m_debug;
static bool m_dumpFSA;
};
#endif