-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKeyList.h
78 lines (66 loc) · 1.21 KB
/
KeyList.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#pragma once
#include <string>
#include <vector>
#include <fstream>
constexpr auto cckeyfile = "cc_keys.txt";
constexpr auto uckeyfile = "uc_keys.txt";
// depth keywords -- must be upper case
constexpr auto dk_Actor = "ACTOR";
constexpr auto dk_States = "STATES";
constexpr auto comment_char = "//";
// state termination keywords
enum {
ST_GOTO,
ST_LOOP,
ST_STOP,
ST_WAIT,
ST_FAIL
};
#define MAX_STATE_TERMINATION_KEYS ST_FAIL + 1
constexpr auto STATE_TERMINATOR_LENGTH = 4;
const std::string dk_stateTerminate[MAX_STATE_TERMINATION_KEYS] = {
"GOTO",
"LOOP",
"STOP",
"WAIT",
"FAIL"
};
std::vector<std::string> ccase_keys;
enum {
SYMBOL_COMMA,
SYMBOL_COLON,
SYMBOL_PLUS,
SYMBOL_MINUS,
SYMBOL_DIV,
SYMBOL_MUL,
SYMBOL_EQUALS,
SYMBOL_GE,
SYMBOL_LE,
SYMBOL_ASSIGN,
SYMBOL_GREATER,
SYMBOL_LESS
};
#define MAX_PUNCTUATION_FOR_SPACING (SYMBOL_LESS + 1)
const char* dk_punctuation[MAX_PUNCTUATION_FOR_SPACING] = {
",",
":",
"+",
"-",
"/",
"*",
"==",
">=",
"<=",
"=",
">",
"<"
};
// these are the keys that will be used for forcing case
void loadKeys() {
// first camel case
std::fstream in(cckeyfile, std::ios::in);
std::string temp;
while (std::getline(in, temp)) {
ccase_keys.push_back(temp);
}
}