diff options
| author | Mistivia <i@mistivia.com> | 2025-03-23 23:37:25 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2025-03-23 23:37:25 +0800 |
| commit | 4f7f0aa49844756dbf430f35600d7c88e1a6a730 (patch) | |
| tree | 7b3fcc235f33ebec5c7623b6cc3946a138162682 /src/as_tokenizer.h | |
| parent | 45e53e55aa555d5a53d9d489e8447e9112eac1f0 (diff) | |
refactor names
Diffstat (limited to 'src/as_tokenizer.h')
| -rw-r--r-- | src/as_tokenizer.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/as_tokenizer.h b/src/as_tokenizer.h index e9025ba..72a5d8b 100644 --- a/src/as_tokenizer.h +++ b/src/as_tokenizer.h @@ -6,23 +6,23 @@ #include "utils.h" -enum tokenType { - OP, ARG, TAG, COLON, NEWLINE, ENDOFFILE +enum token_type { + TK_OP, TK_ARG, TK_TAG, TK_COLON, TK_NEWLINE, TK_ENDOFFILE }; struct token { - enum tokenType type; + enum token_type type; int line; int col; char *sval; int64_t ival; double fval; }; -typedef struct token *Token; +typedef struct token * token_t; #define INPUT_STREAM_BUF_SIZE 1024 -struct inputStream { +struct input_stream{ FILE *fp; char *buf; int buf_pos; @@ -30,17 +30,17 @@ struct inputStream { int line; int col; }; -typedef struct inputStream *InputStream; +typedef struct input_stream *input_stream_t; -struct tokenStream { - Token buf; - InputStream s; +struct token_stream { + token_t buf; + input_stream_t s; }; -typedef struct tokenStream *TokenStream; +typedef struct token_stream *token_stream_t; -Token nextToken(Allocator alct, TokenStream ts); -Token peekToken(Allocator alct, TokenStream ts); -void printToken(Token t); -TokenStream makeTokenStream(Allocator alct, FILE* fp); +token_t next_token(allocator_t alct, token_stream_t ts); +token_t peek_token(allocator_t alct, token_stream_t ts); +void print_token(token_t t); +token_stream_t new_token_stream(allocator_t alct, FILE* fp); #endif // FMV_AS_TOKENIZER_H_ |
