-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsymbols.go
105 lines (97 loc) · 2.48 KB
/
symbols.go
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
package rocket
/*
List of keyword defenitions
*/
var Keywords = UnitTable{
{"int", "INT", "IDENTIFIER"},
{"uint", "UINT", "IDENTFIER"},
{"string", "STRING", "IDENTIFIER"},
{"char", "CHAR", "IDENTIFIER"},
{"bool", "BOOLEAN", "IDENTIFIER"},
{"double", "DOUBLE", "IDENTIFIER"},
{"float", "FLOAT", "IDENTIFIER"},
}
/*
List of one character long symbols
*/
var OneCharacterSymbols = UnitTable{
{"=", "EQUALS", "OPERATOR"},
{"(", "LEFT_PARENTHESES", "SYMBOL"},
{")", "RIGHT_PARENTHESES", "SYMBOL"},
{"<", "LEFT", "OPERATOR"},
{">", "RIGHT", "OPERATOR"},
{"^", "POWER", "OPERATOR"},
{"/", "SLASH", "OPERATOR"},
{"*", "STAR", "OPERATOR"},
{"+", "PLUS", "OPERATOR"},
{"-", "MIN", "OPERATOR"},
{"!", "BANG", "OPERATOR"},
{"&", "AND", "OPERATOR"},
{".", "DOT", "SYMBOL"},
{",", "COMMA", "SYMBOL"},
{";", "END_OF_STATEMENT", "SYMBOL"},
{"{", "LEFT_CURLY_BRACKET", "SYMBOL"},
{"}", "RIGHT_CURLY_BRACKET", "SYMBOL"},
{"'", "SINGLE_QUOTE", "SYMBOL"},
{"\"", "DOUBLE_QUOTE", "SYMBOL"},
}
/*
List of two character long symbols
*/
var TwoCharacterSymbols = UnitTable{
{"==", "IS_EQUAL", "OPERATOR"},
{"<=", "LEFT_EQUAL", "OPERATOR"},
{">=", "RIGHT_EQUAL", "OPERATOR"},
{"!=", "ISNOT_EQUAL", "OPERATOR"},
{"++", "PLUS_PLUS", "OPERATOR"},
{"**", "STAR_STAR", "OPERATOR"},
{"--", "MIN_MIN", "OPERATOR"},
{"+=", "PLUS_EQUALS", "OPERATOR"},
{"*=", "STAR_EQUALS", "OPERATOR"},
{"/=", "DEVIDE_EQUALS", "OPERATOR"},
{"-=", "MIN_EQUALS", "OPERATOR"},
{"||", "OR", "OPERATOR"},
{"\\t", "TAB", "OPERATOR"},
{"\\n", "NEWLINE", "OPERATOR"},
}
//made these units for the sake of consistency
var Letters = UnitTable{
{"a", "A", "LETTER"},
{"b", "B", "LETTER"},
{"c", "C", "LETTER"},
{"d", "D", "LETTER"},
{"e", "E", "LETTER"},
{"f", "F", "LETTER"},
{"g", "G", "LETTER"},
{"h", "H", "LETTER"},
{"i", "I", "LETTER"},
{"j", "J", "LETTER"},
{"k", "K", "LETTER"},
{"l", "L", "LETTER"},
{"m", "M", "LETTER"},
{"n", "N", "LETTER"},
{"o", "O", "LETTER"},
{"p", "P", "LETTER"},
{"q", "Q", "LETTER"},
{"r", "R", "LETTER"},
{"s", "S", "LETTER"},
{"t", "T", "LETTER"},
{"u", "U", "LETTER"},
{"v", "V", "LETTER"},
{"w", "W", "LETTER"},
{"x", "X", "LETTER"},
{"y", "Y", "LETTER"},
{"z", "Z", "LETTER"},
}
var Digits = UnitTable{
{"0", "ZERO", "INTERGER"},
{"1", "ONE", "INTERGER"},
{"2", "TWO", "INTERGER"},
{"3", "THREE", "INTERGER"},
{"4", "FOUR", "INTERGER"},
{"5", "FIVE", "INTERGER"},
{"6", "SIX", "INTERGER"},
{"7", "SEVEN", "INTERGER"},
{"8", "EIGHT", "INTERGER"},
{"9", "NINE", "INTERGER"},
}