From e1d5009229fb5cea5845cd08e0abdc8fe440ee86 Mon Sep 17 00:00:00 2001 From: vanhauser-thc Date: Fri, 9 Jul 2021 10:32:14 +0200 Subject: fixes --- custom_mutators/gramatron/test.h | 57 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 custom_mutators/gramatron/test.h (limited to 'custom_mutators/gramatron/test.h') diff --git a/custom_mutators/gramatron/test.h b/custom_mutators/gramatron/test.h new file mode 100644 index 00000000..857cb5fc --- /dev/null +++ b/custom_mutators/gramatron/test.h @@ -0,0 +1,57 @@ +#include +#include +#include +#include +#include +#include +#include "hashmap.h" +#include "uthash.h" +#include "utarray.h" + +#define INIT_SIZE 100 // Initial size of the dynamic array holding the input + +typedef struct terminal { + + int state; + int trigger_idx; + size_t symbol_len; + char * symbol; + +} terminal; + +typedef struct trigger { + + char * id; + int dest; + char * term; + size_t term_len; + +} trigger; + +typedef struct state { + + int state_name; // Integer State name + int trigger_len; // Number of triggers associated with this state + trigger *ptr; // Pointer to beginning of the list of triggers + +} state; + +typedef struct { + + size_t used; + size_t size; + size_t inputlen; + terminal *start; + +} Array; + +int init_state; +int curr_state; +int final_state; + +state *create_pda(char *); +Array *gen_input(state *, Array *); +void print_repr(Array *, char *); +void initArray(Array *, size_t); +void insertArray(Array *, int, char *, size_t, int); + -- cgit 1.4.1