aboutsummaryrefslogtreecommitdiffstats
path: root/src/analyse.h
blob: 8e21db7a00a85ba410ea64e8743abc46cdc42a29 (plain)
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
#ifndef CONFCONF_ANALYSE_H
#define CONFCONF_ANALYSE_H

#include "tok.h"
#include "parse.h"

#include <stdbool.h>

/* 26 letters * 2 for case + 1 for '_' */
#define ANALYSE_MAX_BRANCH (26 * 2 + 1)

struct analyse_tree_s {
	bool is_terminal;
	char name[TOK_MAX_LEN];
	unsigned branch_count;
	char branch_chars[ANALYSE_MAX_BRANCH];
	struct analyse_tree_s *branches[ANALYSE_MAX_BRANCH];
};

struct analyse_result_s {
	struct analyse_tree_s deftype_tree;
	struct analyse_tree_s var_tree;
};

struct analyse_result_s analyse(struct parse_result_s pr);

void analyse_result_wipe(struct analyse_result_s *r);

#endif