X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=parser.h;h=e5361a8aae020ba1c8ac8d2e2d74bcc78a55ecc9;hp=a09238df68d768dbd1d0f2fbee2bc5165c0d5686;hb=047ecd426f4068566a2db97a894d00d98c66f345;hpb=fb3af2831b9a6e3156de2577bf71e34ccd5c1e4e diff --git a/parser.h b/parser.h index a09238d..e5361a8 100644 --- a/parser.h +++ b/parser.h @@ -2,7 +2,7 @@ #define GMQCC_PARSER_HDR #include "gmqcc.h" #include "lexer.h" -//#include "ast.h" +#include "ast.h" #include "intrin.h" #include "fold.h" @@ -12,7 +12,10 @@ struct parser_t; #define parser_ctx(p) ((p)->lex->tok.ctx) struct parser_t { - parser_t() { } + parser_t(); + ~parser_t(); + + void remove_ast(); lex_file *lex; int tok; @@ -45,17 +48,17 @@ struct parser_t { std::vector continues; /* A list of hashtables for each scope */ - ht *variables; + std::vector variables; ht htfields; ht htglobals; - ht *typedefs; + std::vector typedefs; /* not to be used directly, we use the hash table */ - ast_expression **_locals; - size_t *_blocklocals; - ast_value **_typedefs; - size_t *_blocktypedefs; - lex_ctx_t *_block_ctx; + std::vector _locals; + std::vector _blocklocals; + std::vector> _typedefs; + std::vector _blocktypedefs; + std::vector _block_ctx; /* we store the '=' operator info */ const oper_info *assign_op;