2024-05-16 20:03:04 +02:00
|
|
|
#ifndef LEXER_H_
|
|
|
|
#define LEXER_H_
|
|
|
|
|
2024-05-22 12:12:48 +02:00
|
|
|
typedef enum {
|
|
|
|
INT,
|
|
|
|
KEYWORD,
|
|
|
|
SEPARATOR,
|
|
|
|
END_OF_TOKENS,
|
|
|
|
} TokenType;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
TokenType type;
|
|
|
|
char *value;
|
|
|
|
} Token;
|
2024-05-16 20:03:04 +02:00
|
|
|
|
|
|
|
Token *lexer(char *buf);
|
2024-05-22 12:12:48 +02:00
|
|
|
void print_token(Token token);
|
|
|
|
Token *generate_separator(char *current, int *current_index);
|
|
|
|
Token *generate_number(char *current, int *current_index);
|
|
|
|
Token *generate_keyword(char *current, int *current_index);
|
2024-05-16 20:03:04 +02:00
|
|
|
|
|
|
|
#endif
|