1 #ifndef GMQCC_PARSER_HDR
2 #define GMQCC_PARSER_HDR
12 #define parser_ctx(p) ((p)->lex->tok.ctx)
25 std::vector<ast_expression *> globals;
26 std::vector<ast_expression *> fields;
27 std::vector<ast_function *> functions;
30 /* must be deleted first, they reference immediates and values */
31 std::vector<ast_value *> accessors;
34 ast_value *reserved_version;
39 ast_function *function;
42 /* All the labels the function defined...
43 * Should they be in ast_function instead?
45 std::vector<ast_label*> labels;
46 std::vector<ast_goto*> gotos;
47 std::vector<const char *> breaks;
48 std::vector<const char *> continues;
50 /* A list of hashtables for each scope */
51 std::vector<ht> variables;
54 std::vector<ht> typedefs;
56 /* not to be used directly, we use the hash table */
57 std::vector<ast_expression*> _locals;
58 std::vector<size_t> _blocklocals;
59 std::vector<std::unique_ptr<ast_value>> _typedefs;
60 std::vector<size_t> _blocktypedefs;
61 std::vector<lex_ctx_t> _block_ctx;
63 /* we store the '=' operator info */
64 const oper_info *assign_op;
67 ast_value *const_vec[3];
72 /* collected information */
73 size_t max_param_count;
81 char *parser_strdup (const char *str);
82 ast_expression *parser_find_global(parser_t *parser, const char *name);