Add tokens

This commit is contained in:
ala89 2023-10-27 14:37:03 +02:00
parent 4d0f391a31
commit f6fe76d40e
2 changed files with 17 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
*.o
build/*
.vscode

15
src/include/tokenize.h Normal file
View File

@ -0,0 +1,15 @@
#include <vector>
using namespace std;
enum class TokenType { Type, Int, Plus, Star, Slash, Minus, Equal, Semicolon, LParenthese, RParenthese };
enum class Type { Int };
union TokenData {
int integer;
Type type;
};
struct Token {
TokenType type;
TokenData data;
};