diff options
Diffstat (limited to 'src/as_tokenizer.h')
| -rw-r--r-- | src/as_tokenizer.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/as_tokenizer.h b/src/as_tokenizer.h index 192e381..1027530 100644 --- a/src/as_tokenizer.h +++ b/src/as_tokenizer.h @@ -9,6 +9,7 @@ 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; @@ -18,6 +19,7 @@ struct token { int64_t ival; double fval; }; +typedef struct token token; #define INPUT_STREAM_BUF_SIZE 1024 @@ -29,20 +31,22 @@ struct input_stream{ int line; int col; }; +typedef struct input_stream input_stream; struct token_stream { - struct token *buf; - struct input_stream *s; + token *buf; + input_stream *s; }; +typedef struct token_stream token_stream; // result<token*> -struct result next_token(struct allocator * alct, struct token_stream * ts); +result next_token(allocator * alct, token_stream * ts); // result<token*> -struct result peek_token(struct allocator * alct, struct token_stream * ts); +result peek_token(allocator * alct, token_stream * ts); void print_token(struct token *t); -struct token_stream * new_token_stream(struct allocator * alct, FILE* fp); +token_stream* new_token_stream(allocator * alct, FILE* fp); #endif // FMV_AS_TOKENIZER_H_ |
