#ifndef FVM_AS_PARSER_H_ #define FVM_AS_PARSER_H_ #include "as_tokenizer.h" #include "utils.h" #include "as_op.h" struct arg { int64_t ival; double fval; }; typedef struct arg * arg_t; struct instr { enum op op; arg_t 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; }; typedef struct stmt * stmt_t; struct stmts { stmt_t * stmts; }; typedef struct stmts * stmts_t; struct prog { stmts_t 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); #endif