Add tokens
This commit is contained in:
parent
4d0f391a31
commit
f6fe76d40e
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
*.o
|
||||
build/*
|
||||
.vscode
|
15
src/include/tokenize.h
Normal file
15
src/include/tokenize.h
Normal 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;
|
||||
};
|
Loading…
Reference in New Issue
Block a user