h_put_value and h_get_value done.

This commit is contained in:
Meredith L. Patterson 2014-05-12 09:45:22 +02:00
parent 5679939a2c
commit eb6c74cf89
6 changed files with 145 additions and 2 deletions

View file

@ -190,6 +190,7 @@ typedef struct HHashTable_ {
* arena - the arena that has been allocated for the parse this state is in.
* lr_stack - a stack of HLeftRec's, used in Warth's recursion
* recursion_heads - table of recursion heads. Keys are HParserCacheKey's with only an HInputStream (parser can be NULL), values are HRecursionHead's.
* symbol_table - stack of tables of values that have been stashed in the context of this parse.
*
*/
@ -199,6 +200,7 @@ struct HParseState_ {
HArena * arena;
HSlist *lr_stack;
HHashTable *recursion_heads;
HSlist *symbol_table; // its contents are HHashTables
};
typedef struct HParserBackendVTable_ {
@ -316,6 +318,7 @@ HSlist* h_slist_new(HArena *arena);
HSlist* h_slist_copy(HSlist *slist);
void* h_slist_pop(HSlist *slist);
void* h_slist_drop(HSlist *slist);
static inline void* h_slist_top(HSlist *sl) { return sl->head->elem; }
void h_slist_push(HSlist *slist, void* item);
bool h_slist_find(HSlist *slist, const void* item);
HSlist* h_slist_remove_all(HSlist *slist, const void* item);
@ -347,8 +350,10 @@ bool h_eq_ptr(const void *p, const void *q);
HHashValue h_hash_ptr(const void *p);
uint32_t h_djbhash(const uint8_t *buf, size_t len);
typedef struct HCFSequence_ HCFSequence;
void h_symbol_put(HParseState *state, const char* key, void *value);
void* h_symbol_get(HParseState *state, const char* key);
typedef struct HCFSequence_ HCFSequence;
struct HCFChoice_ {
enum HCFChoiceType {