7 |
|
* 12/18/84 |
8 |
|
*/ |
9 |
|
|
10 |
+ |
#include <string.h> |
11 |
|
|
12 |
+ |
#include "rtio.h" |
13 |
|
#include "meta.h" |
14 |
|
|
15 |
|
|
34 |
|
static int curdec = NODEC; /* current declaration */ |
35 |
|
|
36 |
|
|
37 |
+ |
static int hash(register char *s); |
38 |
+ |
static int lookup(register char *name); |
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
static int |
43 |
< |
hash(s) /* hash a string */ |
43 |
> |
hash( /* hash a string */ |
44 |
> |
register char *s |
45 |
> |
) |
46 |
|
|
41 |
– |
register char *s; |
42 |
– |
|
47 |
|
{ |
48 |
|
register int hval = 0; |
49 |
|
|
58 |
|
|
59 |
|
|
60 |
|
static int |
61 |
< |
lookup(name) /* find name in declaration table */ |
61 |
> |
lookup( /* find name in declaration table */ |
62 |
> |
register char *name |
63 |
> |
) |
64 |
|
|
59 |
– |
register char *name; |
60 |
– |
|
65 |
|
{ |
66 |
|
register int curd; |
67 |
|
|
77 |
|
|
78 |
|
|
79 |
|
|
80 |
+ |
int |
81 |
+ |
inseg(void) /* return TRUE if currently in a segment */ |
82 |
|
|
77 |
– |
inseg() /* return TRUE if currently in a segment */ |
78 |
– |
|
83 |
|
{ |
84 |
|
|
85 |
|
return(curdec != NODEC); |
87 |
|
|
88 |
|
|
89 |
|
|
90 |
+ |
void |
91 |
+ |
openseg( /* open a new segment */ |
92 |
+ |
char *name |
93 |
+ |
) |
94 |
|
|
87 |
– |
openseg(name) /* open a new segment */ |
88 |
– |
|
89 |
– |
char *name; |
90 |
– |
|
95 |
|
{ |
96 |
|
register int olddec; |
97 |
|
|
112 |
|
|
113 |
|
|
114 |
|
|
115 |
+ |
void |
116 |
+ |
segprim( /* store primitive in current segment */ |
117 |
+ |
register PRIMITIVE *p |
118 |
+ |
) |
119 |
|
|
112 |
– |
segprim(p) /* store primitive in current segment */ |
113 |
– |
|
114 |
– |
register PRIMITIVE *p; |
115 |
– |
|
120 |
|
{ |
121 |
|
register PRIMITIVE *newp; |
122 |
|
|
149 |
|
} |
150 |
|
|
151 |
|
|
152 |
+ |
void |
153 |
+ |
closeseg(void) /* close the current segment */ |
154 |
|
|
149 |
– |
closeseg() /* close the current segment */ |
150 |
– |
|
155 |
|
{ |
156 |
|
register int i; |
157 |
|
|
171 |
|
hashtabl[i] = curdec; |
172 |
|
/* return context */ |
173 |
|
curdec = dectabl[curdec].context; |
170 |
– |
|
174 |
|
} |
175 |
|
|
176 |
|
|
177 |
|
|
178 |
+ |
void |
179 |
+ |
segment( /* expand segment p */ |
180 |
+ |
PRIMITIVE *p, |
181 |
+ |
void (*funcp)(PRIMITIVE *p) |
182 |
+ |
) |
183 |
|
|
176 |
– |
segment(p, funcp) /* expand segment p */ |
177 |
– |
PRIMITIVE *p; |
178 |
– |
int (*funcp)(); |
179 |
– |
|
184 |
|
{ |
185 |
|
int decln; |
186 |
|
PRIMITIVE curp; |
246 |
|
|
247 |
|
|
248 |
|
int |
249 |
< |
xlate(extrema, p, px) /* return extrema from p through px */ |
250 |
< |
|
251 |
< |
short extrema; |
252 |
< |
PRIMITIVE *p; |
253 |
< |
register PRIMITIVE *px; |
249 |
> |
xlate( /* return extrema from p through px */ |
250 |
> |
short extrema, |
251 |
> |
PRIMITIVE *p, |
252 |
> |
register PRIMITIVE *px |
253 |
> |
) |
254 |
|
|
255 |
|
{ |
256 |
|
short oldex; |