aboutsummaryrefslogtreecommitdiff
path: root/scripts/parse_kconfig/boolexpr.h
blob: 52cd4a69c5b084e6ab934039c4a8edd252d2818c (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
#include <stdlib.h>
#include <stdbool.h>

#include <kconfig/lkc.h>

#ifndef _BOOLEXPR_H_
#define _BOOLEXPR_H_

#include "symlist.h"

enum boolexpr_type {
    BT_SYM, BT_TRUE, BT_FALSE, BT_OR, BT_AND, BT_NOT
};

struct boolexpr {
    enum boolexpr_type type;
    unsigned id;
    struct boolexpr *left, *right;

    unsigned overusage;
};

struct boolexpr *boolexpr_kconfig(struct symlist *sl, struct expr *expr);

struct boolexpr *boolexpr_true();
struct boolexpr *boolexpr_false();
struct boolexpr *boolexpr_sym(struct symlist *sl, struct symbol *sym);
struct boolexpr *boolexpr_or(struct boolexpr *e1, struct boolexpr *e2);
struct boolexpr *boolexpr_and(struct boolexpr *e1, struct boolexpr *e2);
struct boolexpr *boolexpr_not(struct boolexpr *e);
struct boolexpr *boolexpr_copy(struct boolexpr *e);
void boolexpr_free(struct boolexpr *e);

#endif /* _BOOLEXPR_H_ */