2018-03-24 21:43:57 +00:00
|
|
|
/*
|
|
|
|
* Mr. 4th Dimention - Allen Webster
|
|
|
|
*
|
|
|
|
* 24.03.2018
|
|
|
|
*
|
|
|
|
* Parse context structures
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
// TOP
|
|
|
|
|
|
|
|
#if !defined(FRED_PARSE_CONTEXT_H)
|
|
|
|
#define FRED_PARSE_CONTEXT_H
|
|
|
|
|
2019-06-01 23:58:28 +00:00
|
|
|
// TODO(allen): this needs a rewrite
|
|
|
|
|
2018-03-24 21:43:57 +00:00
|
|
|
struct Stored_Parse_Context{
|
|
|
|
umem memsize;
|
|
|
|
u64 *kw_keywords;
|
|
|
|
u64 *pp_keywords;
|
|
|
|
u32 kw_max;
|
|
|
|
u32 pp_max;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Stored_Parse_Context_Slot{
|
|
|
|
union{
|
|
|
|
Stored_Parse_Context_Slot *next;
|
|
|
|
Stored_Parse_Context *context;
|
|
|
|
};
|
|
|
|
b32 freed;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Parse_Context_Memory{
|
|
|
|
Stored_Parse_Context_Slot *parse_context_array;
|
|
|
|
u32 parse_context_counter;
|
|
|
|
u32 parse_context_max;
|
|
|
|
|
2019-06-01 23:58:28 +00:00
|
|
|
Stored_Parse_Context_Slot *free_list;
|
2018-03-24 21:43:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Parse_Context{
|
|
|
|
b32 valid;
|
|
|
|
Cpp_Keyword_Table kw_table;
|
|
|
|
Cpp_Keyword_Table pp_table;
|
|
|
|
umem memory_size;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// BOTTOM
|
|
|
|
|