Replaced GQueue and GSlist with HSlist.
This commit is contained in:
parent
b6bf0ea30c
commit
ef6af551d1
3 changed files with 61 additions and 25 deletions
|
|
@ -42,6 +42,17 @@ typedef struct HInputStream_ {
|
|||
char overrun;
|
||||
} HInputStream;
|
||||
|
||||
typedef struct HSlistNode_ {
|
||||
void* elem;
|
||||
struct HSlistNode_ *next;
|
||||
} HSlistNode;
|
||||
|
||||
typedef struct HSlist_ {
|
||||
HSlistNode *head;
|
||||
struct HArena_ *arena;
|
||||
} HSlist;
|
||||
|
||||
|
||||
/* The state of the parser.
|
||||
*
|
||||
* Members:
|
||||
|
|
@ -57,7 +68,7 @@ struct HParseState_ {
|
|||
GHashTable *cache;
|
||||
HInputStream input_stream;
|
||||
HArena * arena;
|
||||
GQueue *lr_stack;
|
||||
HSlist *lr_stack;
|
||||
GHashTable *recursion_heads;
|
||||
};
|
||||
|
||||
|
|
@ -90,8 +101,8 @@ typedef enum HParserCacheValueType_ {
|
|||
*/
|
||||
typedef struct HRecursionHead_ {
|
||||
const HParser *head_parser;
|
||||
GSList *involved_set;
|
||||
GSList *eval_set;
|
||||
HSlist *involved_set;
|
||||
HSlist *eval_set;
|
||||
} HRecursionHead;
|
||||
|
||||
|
||||
|
|
@ -154,20 +165,11 @@ HCountedArray *h_carray_new_sized(HArena * arena, size_t size);
|
|||
HCountedArray *h_carray_new(HArena * arena);
|
||||
void h_carray_append(HCountedArray *array, void* item);
|
||||
|
||||
typedef struct HSlistNode_ {
|
||||
void* elem;
|
||||
struct HSlistNode_ *next;
|
||||
} HSlistNode;
|
||||
|
||||
typedef struct HSlist_ {
|
||||
HSlistNode *head;
|
||||
struct HArena_ *arena;
|
||||
} HSlist;
|
||||
|
||||
|
||||
HSlist* h_slist_new(HArena *arena);
|
||||
void* h_slist_pop(HSlist *slist);
|
||||
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);
|
||||
void h_slist_free(HSlist *slist);
|
||||
|
||||
#if 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue