There was an error while loading. Please reload this page.
1 parent 9001cca commit 175256cCopy full SHA for 175256c
2 files changed
src/front-end/tokens.h++
@@ -0,0 +1,45 @@
1
+#include <iostream>
2
+
3
+typedef enum {
4
+ /* Special */
5
+ TOKEN_ERROR,
6
+ TOKEN_EOF,
7
+ TOKEN_IDENTIFIER,
8
9
+ /* Keywords */
10
+ TOKEN_VAR,
11
+ TOKEN_GLOBAL,
12
+ TOKEN_READONLY,
13
+ TOKEN_IF,
14
+ TOKEN_FUNC,
15
+ TOKEN_FOR,
16
+ TOKEN_WHILE,
17
+ TOKEN_REPEAT,
18
+ TOKEN_UNTIL,
19
+ TOKEN_BREAK,
20
+ TOKEN_PASS,
21
+ TOKEN_IN,
22
23
+ /* Symbols */
24
+ TOKEN_COMMA,
25
+ TOKEN_COLON,
26
+ TOKEN_EQUALS,
27
+ TOKEN_NOT,
28
+ TOKEN_SUB,
29
+ TOKEN_ADD,
30
+ TOKEN_MUL,
31
+ TOKEN_DIV,
32
+ TOKEN_LPAREN,
33
+ TOKEN_RPAREN,
34
+ TOKEN_LBRACE,
35
+ TOKEN_RBRACE,
36
+ TOKEN_SEMICOPLON,
37
+} TokenType;
38
39
+typedef struct Token {
40
+ std::string pos;
41
+ int line;
42
+ int col;
43
+ std::string lexeme;
44
+ TokenType* type;
45
+} Token;
src/main.c++
@@ -0,0 +1,3 @@
+int main() {
+}
0 commit comments