slr/lexer.h
2024-05-22 11:12:48 +01:00

22 lines
417 B
C

#ifndef LEXER_H_
#define LEXER_H_
typedef enum {
INT,
KEYWORD,
SEPARATOR,
END_OF_TOKENS,
} TokenType;
typedef struct {
TokenType type;
char *value;
} Token;
Token *lexer(char *buf);
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);
#endif