minor implement lexer

This commit is contained in:
2025-11-15 08:01:34 +09:00
parent 171006117e
commit 682cbdc216
10 changed files with 407 additions and 20 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include <stdint.h>
#include <stddef.h>
typedef enum {
LBRACK,
@@ -21,15 +22,23 @@ typedef enum {
NUM,
STRING_LITERAL,
VAL,
RETURN,
IF,
ELSE,
EOF_TOKEN,
ERROR
} TokenType;
typedef struct {
size_t len;
char* string;
} TokenString;
typedef struct {
TokenType type;
char *data;
uint32_t line;
TokenString data;
} Token;