Skip to content

Commit 175256c

Browse files
committed
upd: lazily commit on June 5th, 2026 3:25 PM UTC -0700 by lily
1 parent 9001cca commit 175256c

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

src/front-end/tokens.h++

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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++

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
int main() {
2+
3+
}

0 commit comments

Comments
 (0)