diff options
Diffstat (limited to 'src/as_parser.h')
| -rw-r--r-- | src/as_parser.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/as_parser.h b/src/as_parser.h index 2171fe4..f1d3b62 100644 --- a/src/as_parser.h +++ b/src/as_parser.h @@ -10,46 +10,53 @@ struct arg { int64_t ival; double fval; }; +typedef struct arg arg; struct instr { enum op op; - struct arg * arg; + arg* arg; const char* tag_name; + int lineno; }; +typedef struct instr instr; struct label { const char* name; }; +typedef struct label label; struct stmt { struct label * label; struct instr * instr; }; +typedef struct stmt stmt; struct stmts { struct stmt ** stmts; }; +typedef struct stmts stmts; struct prog { struct stmts * stmts; }; +typedef struct prog prog; // result<prog> -struct result parse_prog(struct allocator * alct, struct token_stream * ts); +result parse_prog(allocator* alct, token_stream* ts); // result<stmt> -struct result parse_stmt(struct allocator * alct, struct token_stream * ts); +result parse_stmt(allocator* alct, token_stream* ts); // result<stmts> -struct result parse_stmts(struct allocator * alct, struct token_stream * ts); +result parse_stmts(allocator* alct, token_stream* ts); // result<instr> -struct result parse_instr(struct allocator * alct, struct token_stream * ts); +result parse_instr(allocator* alct, token_stream* ts); // result<label> -struct result parse_label(struct allocator * alct, struct token_stream * ts); +result parse_label(allocator* alct, token_stream* ts); // result<enum op> -struct result parse_op(struct allocator * alct, struct token_stream * ts); +result parse_op(allocator* alct, token_stream* ts); #endif |
