File: test.h

package info (click to toggle)
aflplusplus 4.21c-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 14,496 kB
  • sloc: ansic: 110,361; cpp: 16,725; sh: 4,855; python: 3,793; makefile: 963; javascript: 515; java: 43; sql: 3; xml: 1
file content (57 lines) | stat: -rw-r--r-- 1,059 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <json-c/json.h>
#include <unistd.h>
#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);