diff options
| author | Mistivia <i@mistivia.com> | 2025-03-25 12:05:20 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2025-03-25 12:05:20 +0800 |
| commit | dc87ff4b0c9f311be7fad652594e3766a4ddb0c6 (patch) | |
| tree | 8e7d1c9045b8abec12b4682a2bb4d8a5b217139e /src/as_parser.h | |
| parent | 4188f791787be19f32226b8ac0f213f61cdd4666 (diff) | |
refactor name
Diffstat (limited to 'src/as_parser.h')
| -rw-r--r-- | src/as_parser.h | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/src/as_parser.h b/src/as_parser.h index 0c31df7..4630186 100644 --- a/src/as_parser.h +++ b/src/as_parser.h @@ -10,41 +10,35 @@ struct arg { int64_t ival; double fval; }; -typedef struct arg * arg_t; struct instr { enum op op; - arg_t arg; + struct arg * arg; const char* tag_name; }; -typedef struct instr * instr_t; struct label { const char* name; }; -typedef struct label * label_t; struct stmt { - label_t label; - instr_t instr; + struct label * label; + struct instr * instr; }; -typedef struct stmt * stmt_t; struct stmts { - stmt_t * stmts; + struct stmt ** stmts; }; -typedef struct stmts * stmts_t; struct prog { - stmts_t stmts; + struct stmts * stmts; }; -typedef struct prog * prog_t; - -prog_t parse_prog(allocator_t alct, token_stream_t ts); -stmt_t parse_stmt(allocator_t alct, token_stream_t ts); -stmts_t parse_stmts(allocator_t alct, token_stream_t ts); -instr_t parse_instr(allocator_t alct, token_stream_t ts); -label_t parse_label(allocator_t alct, token_stream_t ts); -enum op parse_op(allocator_t alct, token_stream_t ts); + +struct prog * parse_prog(struct allocator * alct, struct token_stream * ts); +struct stmt * parse_stmt(struct allocator * alct, struct token_stream * ts); +struct stmts * parse_stmts(struct allocator * alct, struct token_stream * ts); +struct instr * parse_instr(struct allocator * alct, struct token_stream * ts); +struct label * parse_label(struct allocator * alct, struct token_stream * ts); +enum op parse_op(struct allocator * alct, struct token_stream * ts); #endif |
