#ifndef FMV_AS_TOKENIZER_H_ #define FMV_AS_TOKENIZER_H_ #include #include #include "utils.h" enum token_type { TK_OP, TK_ARG, TK_TAG, TK_COLON, TK_NEWLINE, TK_ENDOFFILE }; typedef enum token_type token_type; struct token { enum token_type type; int line; int col; char *sval; int64_t ival; double fval; }; typedef struct token token; #define INPUT_STREAM_BUF_SIZE 1024 struct input_stream{ FILE *fp; char *buf; int buf_pos; int cursor; int line; int col; }; typedef struct input_stream input_stream; struct token_stream { token *buf; input_stream *s; }; typedef struct token_stream token_stream; // result result next_token(allocator * alct, token_stream * ts); // result result peek_token(allocator * alct, token_stream * ts); void print_token(struct token *t); token_stream* new_token_stream(allocator * alct, FILE* fp); #endif // FMV_AS_TOKENIZER_H_