add lex.h and lex.c except next_token

This commit is contained in:
2025-11-10 18:02:41 +09:00
parent 62b7024734
commit 171006117e
3 changed files with 127 additions and 5 deletions

View File

@@ -1,30 +1,35 @@
#pragma once
#include <stdint.h>
typedef enum {
LBRACK,
RBRACK,
LCURLY,
RCURLY,
LPAREN,
RPAREN,
ID,
SEMI,
COMMA,
ARROW,
STAR,
ANDREF,
DOLLAR,
COMMENT,
ID,
NUM,
STRING_LITERAL,
RETURN,
IF,
ELSE,
STRING_LITERAL,
ERROR
} TokenType;
typedef struct {
TokenType type;
char *data;
int line;
uint32_t line;
} Token;