c-repl/src/include/tokenize.h

20 lines
344 B
C
Raw Normal View History

2023-10-27 14:46:32 +02:00
#ifndef TOKENIZE_H
#define TOKENIZE_H
2023-10-27 14:37:03 +02:00
#include <vector>
using namespace std;
2023-10-27 16:37:51 +02:00
enum class TokenType { Type, Number, Plus, Minus, Star, Slash, Percent, Equal, Semicolon, LParenthese, RParenthese };
2023-10-27 14:37:03 +02:00
enum class Type { Int };
union TokenData {
2023-10-27 16:16:40 +02:00
double number;
2023-10-27 14:37:03 +02:00
Type type;
};
struct Token {
TokenType type;
TokenData data;
2023-10-27 14:46:32 +02:00
};
#endif