jackc/tokenizer/tokenizer.h

22 lines
374 B
C
Raw Permalink Normal View History

2021-01-04 15:00:48 -05:00
#ifndef TOKENIZER_H
#define TOKENIZER_H
#include <stdio.h>
/* tokenizer
* Simple tool that splits a stream into many tokens. */
typedef enum {
keyword, identifier, symbol, integer, string
} TOKENTYPE;
typedef struct token {
char* token;
TOKENTYPE type;
int definedat;
struct token* next;
} TOKEN;
TOKEN* tokenize(char* filename);
void freetokens(TOKEN* t);
#endif