-
Notifications
You must be signed in to change notification settings - Fork 0
/
parser.h
120 lines (110 loc) · 1.88 KB
/
parser.h
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#ifndef __PARSER_h
#define __PARSER_h
#define ATOMIC_FORMULA 1
#define AND_FORMULA 2
#define OR_FORMULA 3
#define NOT_FORMULA 4
#define FORALL_FORMULA 5
#define FORALL_EFFECT 6
#define LIST_FORMULA 7
#define EMPTY_FORMULA 8
#define CERTAINTY_FORMULA 9
#define ADD_FORMULA 10
#define DEFINED_FORMULA 11
#define SET_FORMULA 12
#define WHEN_EFFECT 13
#define KNOW_FORMULA 14
#define UNKNOWN_FORMULA 15
#define ONEOF_FORMULA 16
class idList_t
{
public:
int id;
char *name;
idList_t *type;
idList_t *next;
};
class formula_t
{
public:
int type;
union
{
struct
{
int id;
int neg;
int equal;
char *name;
idList_t *args;
} atomic;
formula_t *formula;
struct
{
idList_t *vars;
formula_t *formula;
} lambda;
struct
{
formula_t *formula;
formula_t *next;
} flist;
struct
{
formula_t *literal;
formula_t *formula;
} fset;
struct
{
formula_t *formula;
formula_t *effect;
} when;
} u;
};
class schema_t
{
public:
bool is_observation;
int id;
int cost;
char *name;
idList_t *vars;
formula_t *prec;
formula_t *effect;
formula_t *obs;
schema_t *next;
};
class body_t
{
public:
int type;
union
{
int cost;
idList_t *parameters;
formula_t *formula;
} u;
body_t *next;
};
class instantiation_t
{
public:
idList_t *var, *val;
instantiation_t *next;
};
struct ltstr
{
bool operator()(const char* s1, const char* s2) const { return( strcasecmp( s1, s2 ) < 0 ); }
};
typedef union
{
float real;
int integer;
char * ident;
idList_t * idlist;
formula_t * formula;
schema_t * schema;
body_t * body;
} YYSTYPE_T;
#define YYSTYPE YYSTYPE_T
#endif