#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 result parse_prog(struct allocator * alct, struct token_stream * ts); struct result parse_stmt(struct allocator * alct, struct token_stream * ts); struct result parse_stmts(struct allocator * alct, struct token_stream * ts); struct result parse_instr(struct allocator * alct, struct token_stream * ts); struct result parse_label(struct allocator * alct, struct token_stream * ts); struct result parse_op(struct allocator * alct, struct token_stream * ts); #endif