-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathidentifier.h
43 lines (32 loc) · 875 Bytes
/
identifier.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
/* identifier.h
*
* 1994 K.W.E. de Lange
*/
#ifndef _IDENTIFIER_
#define _IDENTIFIER_
#include "object.h"
typedef struct identifier {
char *name;
struct identifier *next;
struct object *object;
struct identifier *(*add)(const char *name);
struct identifier *(*search)(const char *name);
void (*bind)(struct identifier *self, Object *o);
void (*unbind)(struct identifier *self);
} Identifier;
extern Identifier identifier;
typedef struct scope {
struct scope *parent;
Identifier *first;
int indentlevel;
int indentation[MAXINDENT];
void (*append_level)(void);
void (*remove_level)(void);
} Scope;
extern Scope scope;
#define SCOPE_INIT { .parent = NULL, \
.first = NULL, \
.indentlevel = 0, \
.indentation[0] = 0 }
extern Scope *local;
#endif