aboutsummaryrefslogtreecommitdiff
path: root/programs/src/kconfig_parser/boolexp.h
blob: 7f3aed63b0778ccd3be38c92165b21fed125fbd5 (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
30
31
32
33
34
35
36
37
38
#ifndef _BOOLEXP_H_
#define _BOOLEXP_H_

#include <stdlib.h>
#include <stdbool.h>
#include "symlist.h"
#include "kconfig/lkc.h"

enum boolexp_type {
    BE_OR, BE_AND, BE_NOT, BE_LEAF
};

struct boolexp;
union boolexp_data {
    struct boolexp *be;
    unsigned int id;
};

struct boolexp {
    enum boolexp_type type;
    union boolexp_data left, right;
};

/*struct cnfexpr {
    int **exprs;
    unsigned *sizes;
    unsigned size;
};*/

struct cnfexpr *kconfig_dep(struct symlist *sl, struct expr *expr);
void cnfprint(struct cnfexpr *);

struct boolexp *copy_kconfig_dep(struct symlist *sl, struct expr *expr);
struct boolexp *copy_kconfig_f_dep(struct symlist *sl, struct expr *expr);
struct boolexp *boolexp_cnf(struct boolexp *be);
void boolexp_print(struct boolexp *be);

#endif /* _BOOLEXP_H_ */