-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcctypes.h
More file actions
63 lines (47 loc) · 1.67 KB
/
cctypes.h
File metadata and controls
63 lines (47 loc) · 1.67 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
/*--------------------------------------------------------------------------------*/
/* TYPE CHASING FUNCTIONS */
typedef struct {
unsigned short num:12; /* namespace number */
unsigned short obj:4; /* see defines below */
} t_typespec;
typedef struct {
unsigned chain; /* pointer and function chain */
t_typespec typespec; /* type specifier */
} t_type;
typedef struct {
short a,z;
t_type t;
} t_trap;
typedef union {
t_type y_type;
t_trap y_trap;
int y_int;
} yystype;
#include "objs.h"
t_type ref(),func(),deref(),defunc(),addr(),maketype();
t_type arithassign(),add(),subtract(),inc();
t_type assign(),compare(),internal_lookup(),lookup();
t_type condition(),arith(),addassign(),array();
t_type lookup_tag(),lookup_var(),lookup_last();
t_type half_declare_tag(),half_declare_func();
int declare_tag();
#define declare_typedef(name,type) declare(name,NS_TYPEDEF,type,0)
#define declare_var(name,num,t) declare(name,num,t,0)
/*---------------------------------------------------------------------------
* Symbol table defs.
*---------------------------------------------------------------------------
*/
typedef struct {
char *name; /* identifier name */
unsigned short num:14; /* number which identifies namespace */
unsigned short typedefp:2; /* is this a typedef declaration? */
short halfdec; /* is this an incomplete declaration? */
t_type t; /* type */
char *alias; /* name printed on output */
} symbol;
struct table_tag {
struct btree *table; /* table for a particular scope level */
struct table_tag *prev; /* more global scope level */
struct table_tag *next; /* more local scope level */
};
symbol *slookup();