forked from asperti/BOHM1.1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstruct.h
More file actions
158 lines (140 loc) · 4 KB
/
Copy pathstruct.h
File metadata and controls
158 lines (140 loc) · 4 KB
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#ifndef _STRUCT_H
#define _STRUCT_H
/* symbol table bucket type */
typedef struct st_bucket
{
char * id;
/* identifier */
int token;
/* token associated with */
/* the identifier (it can */
/* be either ID or a keyword */
/* token) */
struct binding_entry *curr_binding;
/* pointer to the current */
/* binding entry for the */
/* identifier */
struct st_bucket *next_st_bucket;
/* pointer to the bucket */
/* for the next identifier */
/* hashing in the same */
/* linked list of buckets */
} STBUCKET;
/* local environment entry descriptor type */
typedef struct local_env_entry
{
int nesting_depth;
/* nesting depth associated */
/* with the local environment */
struct binding_entry *last_local_binding;
/* pointer to the entry for */
/* the last binding enforced in */
/* this environment */
struct local_env_entry *prev_local_env;
/* pointer to the entry for the */
/* previous local environment */
} LOCALENVENTRY;
/* binding entry descriptor type */
typedef struct binding_entry
{
struct st_bucket *st_bucket;
/* pointer to the bucket */
/* for the identifier */
/* involved in the binding */
struct form *root;
/* pointer to the root form */
/* (for global identifiers) */
struct binding_entry *prev_id_binding,
/* pointer to the entry for */
/* the binding previously */
/* enforced for the same */
/* identifier */
*prev_local_binding;
/* pointer to the entry for the */
/* binding previously enforced */
/* in the same local environment */
} BINDINGENTRY;
/* graphical form descriptor type */
typedef struct form
{
char name;
/* name of the form */
/* (FAN, ROOT, CROISSANT */
/* BRACKET) */
int num_safe;
/* Integer value for numeric */
/* forms or indicator of safeness */
/* for other forms */
short int index;
/* index of the form */
char nport[3];
/* numbers of the ports */
/* where the three ports */
/* of the form are connected to */
/* (for CROISSANT and */
/* BRACKET only the first two */
/* fields are meaningful; for */
/* ROOT only the first one is) */
struct form *nform[3];
/* pointer to the forms */
/* where the three ports */
/* of the form are connected to */
/* (for CROISSANT and */
/* BRACKET only the first two */
/* fields are meaningful; for */
/* ROOT only the first one is) */
short int nlevel[3];
struct form *next;
struct form *prev;
} FORM;
/* free variable descriptor type */
typedef struct varentry
{
struct st_bucket *name;
/* pointer to the st_bucket */
/* for the variable */
struct form *var;
/* pointer to the form */
/* for the variable */
struct varentry *next;
/* pointer to the next free */
/* variable in a term */
} VARENTRY;
/* term descriptor type */
typedef struct term
{
struct form *rootf;
/* pointer to the root form */
/* of the term */
char rootp;
/* number of the root port */
/* of the term (0 for variables */
/* and abstractions, 1 for */
/* applications) */
struct varentry *vars;
/* pointer to the list of free */
/* variables in the term */
} TERM;
typedef struct binding_id {
struct st_bucket *id;
struct form *form;
} BINDINGID;
typedef struct var_list {
struct binding_id *id;
struct var_list *next;
} VARLIST;
typedef struct pattern{
struct var_list *var_list;
struct term *term;
} PATTERN;
typedef struct copy_form {
FORM *src;
FORM *dest;
struct copy_form *next;
} COPY_FORM;
typedef struct elem {
FORM *node;
int num;
struct elem *next;
} ELEM;
#endif