mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-07 18:22:50 -06:00
initial import of the C runtime
This commit is contained in:
37
src/runtime/c/gu/choice.h
Normal file
37
src/runtime/c/gu/choice.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef GU_CHOICE_H_
|
||||
#define GU_CHOICE_H_
|
||||
|
||||
#include <gu/mem.h>
|
||||
|
||||
typedef struct GuChoice GuChoice;
|
||||
|
||||
typedef struct GuChoiceMark GuChoiceMark;
|
||||
|
||||
GuChoice*
|
||||
gu_new_choice(GuPool* pool);
|
||||
|
||||
int
|
||||
gu_choice_next(GuChoice* ch, int n_choices);
|
||||
|
||||
GuChoiceMark
|
||||
gu_choice_mark(GuChoice* ch);
|
||||
|
||||
void
|
||||
gu_choice_reset(GuChoice* ch, GuChoiceMark mark);
|
||||
|
||||
bool
|
||||
gu_choice_advance(GuChoice* ch);
|
||||
|
||||
|
||||
// private
|
||||
|
||||
struct GuChoiceMark {
|
||||
size_t path_idx;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // GU_CHOICE_H_
|
||||
Reference in New Issue
Block a user