2020-11-30 16:44:22 -05:00
|
|
|
#ifndef TOKENIZER_H
|
|
|
|
#define TOKENIZER_H
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
typedef enum {
|
2020-12-14 14:12:20 -05:00
|
|
|
keyword, identifier, symbol, integer, string
|
2020-11-30 16:44:22 -05:00
|
|
|
} TOKENTYPE;
|
|
|
|
|
2020-12-14 14:12:20 -05:00
|
|
|
typedef struct token {
|
2020-11-30 16:44:22 -05:00
|
|
|
char* token;
|
|
|
|
TOKENTYPE type;
|
|
|
|
int truen;
|
2020-12-14 14:12:20 -05:00
|
|
|
struct token* next;
|
|
|
|
} TOKEN;
|
2020-11-30 16:44:22 -05:00
|
|
|
|
2020-12-14 14:12:20 -05:00
|
|
|
TOKEN* tokenize(FILE* input);
|
|
|
|
void freetokenlist(TOKEN l);
|
2020-11-30 16:44:22 -05:00
|
|
|
#endif
|