add flex lexer

This commit is contained in:
2025-05-27 03:08:49 +01:00
parent a71071d858
commit 1540645759
10 changed files with 163 additions and 19 deletions

29
src/lexer/token.h Normal file
View File

@@ -0,0 +1,29 @@
#ifndef TOKEN_H
#define TOKEN_H
typedef enum {
TOKEN_STRING,
TOKEN_NUMBER,
TOKEN_IDENTIFIER,
TOKEN_KEYWORD,
TOKEN_DOT,
TOKEN_NEW_LINE,
} TokenType;
typedef struct {
TokenType type;
char* value;
int line;
int column;
} Token;
extern int token_count;
extern Token* tokens;
void add_token(TokenType type, const char* value, int line, int column);
void free_tokens();
#endif