#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; }; struct instr { enum op op; struct arg * arg; const char* tag_name; }; struct label { const char* name; }; struct stmt { struct label * label; struct instr * instr; }; struct stmts { struct stmt ** stmts; }; struct prog { struct stmts * stmts; }; 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