c-repl/src/include/tokenize.h

19 lines
387 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>
2023-11-10 13:42:53 +01:00
#include <variant>
2023-10-27 17:53:58 +02:00
#include <string>
2023-10-27 14:37:03 +02:00
using namespace std;
2023-10-27 16:56:54 +02:00
enum class TokenType { Type, Identifier, Number, Plus, Minus, Star, Slash, Percent, Equal, Semicolon, LParenthese, RParenthese };
2023-10-27 14:37:03 +02:00
enum class Type { Int };
2023-11-10 13:42:53 +01:00
using TokenData = variant<double, string, Type>;
2023-10-27 14:37:03 +02:00
struct Token {
TokenType type;
TokenData data;
2023-10-27 14:46:32 +02:00
};
#endif