2
/* A Bison parser, made from exparse.y
5
#define EXBISON 1 /* Identify Bison output. */
37
# define PROCEDURE 287
79
* expression library grammar and compiler
81
* NOTE: procedure arguments not implemented yet
87
#undef RS /* hp.pa <signal.h> grabs this!! */
95
struct Exref_s* reference;
101
struct Exbuf_s* buffer;
103
#line 128 "exparse.y"
117
#define EXFLAG -32768
120
/* EXTRANSLATE(EXLEX) -- Bison token number corresponding to EXLEX. */
121
#define EXTRANSLATE(x) ((unsigned)(x) <= 318 ? extranslate[x] : 127)
123
/* EXTRANSLATE[EXLEX] -- Bison token number corresponding to EXLEX. */
124
static const char extranslate[] =
126
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
127
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
128
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
129
2, 2, 2, 74, 2, 2, 2, 73, 60, 2,
130
80, 85, 71, 69, 52, 70, 88, 72, 2, 2,
131
2, 2, 2, 2, 2, 2, 2, 2, 55, 84,
132
63, 53, 64, 54, 2, 2, 2, 2, 2, 2,
133
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
134
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
135
2, 86, 2, 87, 59, 2, 2, 2, 2, 2,
136
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
137
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
138
2, 2, 2, 82, 58, 83, 75, 2, 2, 2,
139
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
140
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
141
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
142
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
143
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
144
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
145
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
146
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
147
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
148
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
149
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
150
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
151
2, 2, 2, 2, 2, 2, 1, 3, 4, 5,
152
6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
153
16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
154
26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
155
36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
156
46, 47, 48, 49, 50, 51, 56, 57, 61, 62,
157
65, 66, 67, 68, 76, 77, 78, 79, 81
161
static const short exprhs[] =
163
0, 0, 3, 4, 7, 8, 13, 14, 17, 21,
164
24, 25, 30, 37, 43, 53, 59, 60, 69, 73,
165
77, 81, 82, 85, 88, 90, 93, 97, 100, 102,
166
106, 107, 112, 114, 116, 117, 120, 121, 123, 127,
167
132, 136, 140, 144, 148, 152, 156, 160, 164, 168,
168
172, 176, 180, 184, 188, 192, 196, 200, 204, 208,
169
209, 210, 218, 221, 224, 227, 230, 235, 240, 245,
170
250, 253, 256, 259, 262, 265, 267, 269, 271, 273,
171
275, 277, 279, 281, 283, 286, 290, 292, 293, 296,
172
297, 301, 302, 304, 306, 310, 311, 313, 315, 317,
173
321, 322, 326, 327, 329, 333, 336, 339, 340, 343,
176
static const short exrhs[] =
178
93, 90, 0, 0, 90, 91, 0, 0, 26, 55,
179
92, 93, 0, 0, 93, 94, 0, 82, 93, 83,
180
0, 106, 84, 0, 0, 16, 95, 101, 84, 0,
181
25, 80, 107, 85, 94, 105, 0, 21, 80, 112,
182
85, 94, 0, 21, 80, 106, 84, 106, 84, 106,
183
85, 94, 0, 38, 80, 107, 85, 94, 0, 0,
184
37, 80, 107, 96, 85, 82, 97, 83, 0, 11,
185
106, 84, 0, 15, 106, 84, 0, 35, 106, 84,
186
0, 0, 97, 98, 0, 99, 93, 0, 100, 0,
187
99, 100, 0, 13, 110, 55, 0, 17, 55, 0,
188
102, 0, 101, 52, 102, 0, 0, 28, 103, 113,
189
124, 0, 28, 0, 18, 0, 0, 19, 94, 0,
190
0, 107, 0, 80, 107, 85, 0, 80, 16, 85,
191
107, 0, 107, 63, 107, 0, 107, 70, 107, 0,
192
107, 71, 107, 0, 107, 72, 107, 0, 107, 73,
193
107, 0, 107, 67, 107, 0, 107, 68, 107, 0,
194
107, 64, 107, 0, 107, 65, 107, 0, 107, 66,
195
107, 0, 107, 61, 107, 0, 107, 62, 107, 0,
196
107, 60, 107, 0, 107, 58, 107, 0, 107, 59,
197
107, 0, 107, 69, 107, 0, 107, 57, 107, 0,
198
107, 56, 107, 0, 107, 52, 107, 0, 0, 0,
199
107, 54, 108, 107, 55, 109, 107, 0, 74, 107,
200
0, 75, 107, 0, 70, 107, 0, 69, 107, 0,
201
22, 80, 115, 85, 0, 20, 80, 107, 85, 0,
202
33, 80, 115, 85, 0, 111, 80, 115, 85, 0,
203
112, 123, 0, 77, 112, 0, 112, 77, 0, 78,
204
112, 0, 112, 78, 0, 110, 0, 14, 0, 8,
205
0, 6, 0, 9, 0, 7, 0, 32, 0, 34,
206
0, 36, 0, 24, 121, 0, 18, 114, 121, 0,
207
28, 0, 0, 86, 87, 0, 0, 86, 107, 87,
208
0, 0, 116, 0, 107, 0, 116, 52, 107, 0,
209
0, 16, 0, 118, 0, 119, 0, 118, 52, 119,
210
0, 0, 16, 120, 104, 0, 0, 122, 0, 88,
211
24, 122, 0, 88, 24, 0, 88, 28, 0, 0,
212
53, 107, 0, 123, 0, 0, 0, 80, 125, 117,
213
126, 85, 82, 93, 83, 0
219
/* EXRLINE[EXN] -- source line where rule number EXN was defined. */
220
static const short exrline[] =
222
0, 136, 157, 158, 161, 176, 196, 200, 215, 219,
223
223, 223, 227, 235, 248, 263, 271, 271, 282, 294,
224
298, 310, 340, 343, 372, 373, 376, 397, 403, 404,
225
411, 411, 451, 452, 455, 459, 465, 469, 472, 476,
226
480, 522, 526, 530, 534, 538, 542, 546, 550, 554,
227
558, 562, 566, 570, 574, 578, 582, 591, 595, 604,
228
604, 605, 643, 660, 664, 668, 672, 676, 682, 687,
229
711, 735, 743, 751, 755, 759, 762, 769, 774, 779,
230
784, 791, 792, 793, 796, 800, 816, 828, 832, 838,
231
842, 848, 852, 860, 865, 871, 875, 881, 884, 888,
232
899, 900, 909, 913, 925, 944, 948, 953, 957, 964,
238
#if EXDEBUG != 0 || defined EXERROR_VERBOSE
240
/* EXTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
241
static const char *const extname[] =
243
"$", "error", "$undefined.", "MINTOKEN", "CHAR", "INT", "INTEGER",
244
"UNSIGNED", "FLOATING", "STRING", "VOID", "BREAK", "CALL", "CASE",
245
"CONSTANT", "CONTINUE", "DECLARE", "DEFAULT", "DYNAMIC", "ELSE", "EXIT",
246
"FOR", "FUNCTION", "ITERATE", "ID", "IF", "LABEL", "MEMBER", "NAME",
247
"POS", "PRAGMA", "PRE", "PRINTF", "PROCEDURE", "QUERY", "RETURN",
248
"SPRINTF", "SWITCH", "WHILE", "F2I", "F2S", "I2F", "I2S", "S2B", "S2F",
249
"S2I", "F2X", "I2X", "S2X", "X2F", "X2I", "X2S", "','", "'='", "'?'",
250
"':'", "OR", "AND", "'|'", "'^'", "'&'", "EQ", "NE", "'<'", "'>'", "LE",
251
"GE", "LS", "RS", "'+'", "'-'", "'*'", "'/'", "'%'", "'!'", "'~'",
252
"UNARY", "INC", "DEC", "CAST", "'('", "MAXTOKEN", "'{'", "'}'", "';'",
253
"')'", "'['", "']'", "'.'", "program", "action_list", "action", "@1",
254
"statement_list", "statement", "@2", "@3", "switch_list", "switch_item",
255
"case_list", "case_item", "dcl_list", "dcl_item", "@4", "name",
256
"else_opt", "expr_opt", "expr", "@5", "@6", "constant", "print",
257
"variable", "array", "index", "args", "arg_list", "formals",
258
"formal_list", "formal_item", "@7", "members", "member", "assign",
259
"initialize", "@8", "@9", NULL
263
/* EXR1[EXN] -- Symbol number of symbol that rule EXN derives. */
264
static const short exr1[] =
266
0, 89, 90, 90, 92, 91, 93, 93, 94, 94,
267
95, 94, 94, 94, 94, 94, 96, 94, 94, 94,
268
94, 97, 97, 98, 99, 99, 100, 100, 101, 101,
269
103, 102, 104, 104, 105, 105, 106, 106, 107, 107,
270
107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
271
107, 107, 107, 107, 107, 107, 107, 107, 107, 108,
272
109, 107, 107, 107, 107, 107, 107, 107, 107, 107,
273
107, 107, 107, 107, 107, 107, 110, 110, 110, 110,
274
110, 111, 111, 111, 112, 112, 112, 113, 113, 114,
275
114, 115, 115, 116, 116, 117, 117, 117, 118, 118,
276
120, 119, 121, 121, 121, 122, 122, 123, 123, 124,
280
/* EXR2[EXN] -- Number of symbols composing right hand side of rule EXN. */
281
static const short exr2[] =
283
0, 2, 0, 2, 0, 4, 0, 2, 3, 2,
284
0, 4, 6, 5, 9, 5, 0, 8, 3, 3,
285
3, 0, 2, 2, 1, 2, 3, 2, 1, 3,
286
0, 4, 1, 1, 0, 2, 0, 1, 3, 4,
287
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
288
3, 3, 3, 3, 3, 3, 3, 3, 3, 0,
289
0, 7, 2, 2, 2, 2, 4, 4, 4, 4,
290
2, 2, 2, 2, 2, 1, 1, 1, 1, 1,
291
1, 1, 1, 1, 2, 3, 1, 0, 2, 0,
292
3, 0, 1, 1, 3, 0, 1, 1, 1, 3,
293
0, 3, 0, 1, 3, 2, 2, 0, 2, 1,
297
/* EXDEFACT[S] -- default rule to reduce with in state S when EXTABLE
298
doesn't specify something else to do. Zero means the default is an
300
static const short exdefact[] =
302
6, 2, 78, 80, 77, 79, 36, 76, 36, 10,
303
89, 0, 0, 0, 102, 0, 86, 81, 0, 82,
304
36, 83, 0, 0, 0, 0, 0, 0, 0, 0,
305
0, 6, 1, 7, 0, 37, 75, 0, 107, 0,
306
0, 0, 0, 102, 0, 36, 91, 0, 84, 103,
307
0, 91, 0, 0, 0, 65, 64, 62, 63, 71,
308
73, 0, 0, 36, 0, 3, 9, 0, 59, 0,
309
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
310
0, 0, 0, 0, 0, 0, 0, 91, 0, 72,
311
74, 70, 18, 19, 30, 0, 28, 0, 85, 0,
312
0, 107, 93, 0, 92, 105, 106, 0, 0, 20,
313
16, 0, 0, 38, 8, 4, 58, 0, 57, 56,
314
53, 54, 52, 50, 51, 40, 47, 48, 49, 45,
315
46, 55, 41, 42, 43, 44, 0, 108, 87, 0,
316
11, 90, 67, 36, 36, 66, 0, 0, 104, 36,
317
68, 0, 36, 39, 6, 0, 69, 0, 107, 29,
318
0, 13, 94, 105, 34, 0, 15, 5, 60, 88,
319
110, 109, 31, 36, 36, 12, 21, 0, 95, 0,
320
35, 0, 61, 100, 111, 97, 98, 36, 0, 0,
321
17, 22, 6, 24, 0, 0, 0, 14, 0, 27,
322
23, 25, 33, 32, 101, 0, 100, 99, 26, 6,
326
static const short exdefgoto[] =
328
212, 32, 65, 154, 1, 33, 41, 151, 181, 191,
329
192, 193, 95, 96, 138, 204, 175, 34, 35, 117,
330
177, 36, 37, 38, 158, 43, 103, 104, 184, 185,
331
186, 194, 48, 49, 91, 172, 178, 195
334
static const short expact[] =
336
-32768, 66,-32768,-32768,-32768,-32768, 429,-32768, 429,-32768,
337
-67, -43, -41, -38, -12, 3,-32768,-32768, 5,-32768,
338
429,-32768, 9, 13, 429, 429, 429, 429, -1, -1,
339
398,-32768, 22,-32768, -6, 540,-32768, 30, -32, 27,
340
31, 88, 429, -12, 429, 429, 429, -8,-32768,-32768,
341
429, 429, 40, 429, 429,-32768,-32768,-32768,-32768,-32768,
342
-32768, 42, 230, 165, 70,-32768,-32768, 429,-32768, 429,
343
429, 429, 429, 429, 429, 429, 429, 429, 429, 429,
344
429, 429, 429, 429, 429, 429, 429, 429, 429,-32768,
345
-32768,-32768,-32768,-32768,-32768, -40,-32768, 154,-32768, 308,
346
44, -42, 423, 45, 77, 43,-32768, 456, 47,-32768,
347
540, 486, 429,-32768,-32768,-32768, 423, 429, 557, 573,
348
588, 602, 615, 628, 628, 639, 639, 639, 639, 49,
349
49, -2, -2,-32768,-32768,-32768, 48, 423, 51, 88,
350
-32768,-32768,-32768, 429, 321,-32768, 429, 1,-32768, 321,
351
-32768, 57, 321,-32768,-32768, 518,-32768, 58, -39,-32768,
352
50,-32768, 423,-32768, 128, 69,-32768, 66,-32768,-32768,
353
-32768,-32768,-32768, 429, 321,-32768,-32768, 429, 133, 68,
354
-32768, -4, 423, 71,-32768, 102,-32768, 321, 99, 100,
355
-32768,-32768, 15,-32768, -10, 73, 143,-32768, 105,-32768,
356
66,-32768,-32768,-32768,-32768, 80,-32768,-32768,-32768,-32768,
357
243,-32768, 163, 164,-32768
360
static const short expgoto[] =
362
-32768,-32768,-32768,-32768, -31, -35,-32768,-32768,-32768,-32768,
363
-32768, -27,-32768, 28,-32768,-32768,-32768, -5, -20,-32768,
364
-32768, -22,-32768, 67,-32768,-32768, -49,-32768,-32768,-32768,
365
-26,-32768, 126, 72, 17,-32768,-32768,-32768
372
static const short extable[] =
374
63, 39, 108, 40, 55, 56, 57, 58, 202, 188,
375
62, 88, 139, 189, 88, 52, 105, 10, 203, 42,
376
106, 88, 97, 14, 99, 163, 102, 16, 188, 106,
377
107, 102, 189, 110, 111, 89, 90, 44, 136, 45,
378
100, 170, 46, 144, 140, 89, 90, 116, 64, 118,
379
119, 120, 121, 122, 123, 124, 125, 126, 127, 128,
380
129, 130, 131, 132, 133, 134, 135, 102, 137, 84,
381
85, 86, 2, 3, 4, 5, 47, 6, 66, 190,
382
7, 8, 9, 50, 10, 51, 11, 12, 13, 53,
383
14, 15, 153, 54, 16, 59, 60, 155, 17, 18,
384
19, 20, 21, 22, 23, 2, 3, 4, 5, 161,
385
87, 92, 101, 7, 164, 93, 94, 166, 82, 83,
386
84, 85, 86, 167, 109, 115, 162, 112, 143, 146,
387
145, 147, 150, 156, 173, 24, 25, 157, 160, 180,
388
26, 27, 165, 28, 29, 169, 30, 174, 31, 183,
389
-36, 176, 197, 187, 196, 199, -96, 182, 205, 206,
390
208, 200, 209, 213, 214, 201, 198, 159, 179, 98,
391
207, 2, 3, 4, 5, 171, 6, 148, 210, 7,
392
8, 9, 0, 10, 0, 11, 12, 13, 0, 14,
393
15, 0, 0, 16, 0, 0, 0, 17, 18, 19,
394
20, 21, 22, 23, 0, 0, 67, 0, 68, 0,
395
69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
396
79, 80, 81, 82, 83, 84, 85, 86, 0, 0,
397
0, 0, 0, 0, 24, 25, 0, 0, 0, 26,
398
27, 141, 28, 29, 0, 30, 0, 31, 114, 2,
399
3, 4, 5, 0, 6, 0, 0, 7, 8, 9,
400
0, 10, 0, 11, 12, 13, 0, 14, 15, 0,
401
0, 16, 0, 0, 0, 17, 18, 19, 20, 21,
402
22, 23, 67, 0, 68, 0, 69, 70, 71, 72,
403
73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
404
83, 84, 85, 86, 0, 0, 0, 0, 0, 0,
405
0, 0, 24, 25, 0, 113, 0, 26, 27, 0,
406
28, 29, 0, 30, 0, 31, 211, 2, 3, 4,
407
5, 0, 6, 0, 0, 7, 8, 9, 0, 10,
408
0, 11, 12, 13, 0, 14, 15, 0, 0, 16,
409
0, 0, 0, 17, 18, 19, 20, 21, 22, 23,
410
67, 0, 68, 0, 69, 70, 71, 72, 73, 74,
411
75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
412
85, 86, 0, 0, 0, 0, 0, 0, 0, 0,
413
24, 25, 0, 142, 0, 26, 27, 0, 28, 29,
414
0, 30, 0, 31, 2, 3, 4, 5, 0, 0,
415
0, 0, 7, 0, 61, 0, 10, 0, 11, 0,
416
13, 0, 14, 0, 0, 0, 16, 0, 0, 0,
417
17, 18, 19, 0, 21, 2, 3, 4, 5, 0,
418
0, 0, 0, 7, 0, 0, 0, 10, 0, 11,
419
0, 13, 0, 14, 0, 0, 0, 16, 0, 0,
420
0, 17, 18, 19, 0, 21, 0, 24, 25, 0,
421
0, 0, 26, 27, 0, 28, 29, 68, 30, 69,
422
70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
423
80, 81, 82, 83, 84, 85, 86, 0, 24, 25,
424
0, 0, 0, 26, 27, 0, 28, 29, 67, 30,
425
68, 0, 69, 70, 71, 72, 73, 74, 75, 76,
426
77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
427
0, 0, 0, 0, 0, 0, 0, 0, 67, 0,
428
68, 149, 69, 70, 71, 72, 73, 74, 75, 76,
429
77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
430
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
431
67, 152, 68, 168, 69, 70, 71, 72, 73, 74,
432
75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
433
85, 86, 67, 0, 68, 0, 69, 70, 71, 72,
434
73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
435
83, 84, 85, 86, 70, 71, 72, 73, 74, 75,
436
76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
437
86, 71, 72, 73, 74, 75, 76, 77, 78, 79,
438
80, 81, 82, 83, 84, 85, 86, 72, 73, 74,
439
75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
440
85, 86, 73, 74, 75, 76, 77, 78, 79, 80,
441
81, 82, 83, 84, 85, 86, 74, 75, 76, 77,
442
78, 79, 80, 81, 82, 83, 84, 85, 86,-32768,
443
-32768, 76, 77, 78, 79, 80, 81, 82, 83, 84,
444
85, 86,-32768,-32768,-32768,-32768, 80, 81, 82, 83,
448
static const short excheck[] =
450
31, 6, 51, 8, 24, 25, 26, 27, 18, 13,
451
30, 53, 52, 17, 53, 20, 24, 18, 28, 86,
452
28, 53, 42, 24, 44, 24, 46, 28, 13, 28,
453
50, 51, 17, 53, 54, 77, 78, 80, 87, 80,
454
45, 80, 80, 85, 84, 77, 78, 67, 26, 69,
455
70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
456
80, 81, 82, 83, 84, 85, 86, 87, 88, 71,
457
72, 73, 6, 7, 8, 9, 88, 11, 84, 83,
458
14, 15, 16, 80, 18, 80, 20, 21, 22, 80,
459
24, 25, 112, 80, 28, 28, 29, 117, 32, 33,
460
34, 35, 36, 37, 38, 6, 7, 8, 9, 144,
461
80, 84, 45, 14, 149, 84, 28, 152, 69, 70,
462
71, 72, 73, 154, 84, 55, 146, 85, 84, 52,
463
85, 88, 85, 85, 84, 69, 70, 86, 143, 174,
464
74, 75, 85, 77, 78, 87, 80, 19, 82, 16,
465
84, 82, 187, 85, 52, 55, 85, 177, 85, 16,
466
55, 192, 82, 0, 0, 192, 188, 139, 173, 43,
467
196, 6, 7, 8, 9, 158, 11, 105, 209, 14,
468
15, 16, -1, 18, -1, 20, 21, 22, -1, 24,
469
25, -1, -1, 28, -1, -1, -1, 32, 33, 34,
470
35, 36, 37, 38, -1, -1, 52, -1, 54, -1,
471
56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
472
66, 67, 68, 69, 70, 71, 72, 73, -1, -1,
473
-1, -1, -1, -1, 69, 70, -1, -1, -1, 74,
474
75, 87, 77, 78, -1, 80, -1, 82, 83, 6,
475
7, 8, 9, -1, 11, -1, -1, 14, 15, 16,
476
-1, 18, -1, 20, 21, 22, -1, 24, 25, -1,
477
-1, 28, -1, -1, -1, 32, 33, 34, 35, 36,
478
37, 38, 52, -1, 54, -1, 56, 57, 58, 59,
479
60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
480
70, 71, 72, 73, -1, -1, -1, -1, -1, -1,
481
-1, -1, 69, 70, -1, 85, -1, 74, 75, -1,
482
77, 78, -1, 80, -1, 82, 83, 6, 7, 8,
483
9, -1, 11, -1, -1, 14, 15, 16, -1, 18,
484
-1, 20, 21, 22, -1, 24, 25, -1, -1, 28,
485
-1, -1, -1, 32, 33, 34, 35, 36, 37, 38,
486
52, -1, 54, -1, 56, 57, 58, 59, 60, 61,
487
62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
488
72, 73, -1, -1, -1, -1, -1, -1, -1, -1,
489
69, 70, -1, 85, -1, 74, 75, -1, 77, 78,
490
-1, 80, -1, 82, 6, 7, 8, 9, -1, -1,
491
-1, -1, 14, -1, 16, -1, 18, -1, 20, -1,
492
22, -1, 24, -1, -1, -1, 28, -1, -1, -1,
493
32, 33, 34, -1, 36, 6, 7, 8, 9, -1,
494
-1, -1, -1, 14, -1, -1, -1, 18, -1, 20,
495
-1, 22, -1, 24, -1, -1, -1, 28, -1, -1,
496
-1, 32, 33, 34, -1, 36, -1, 69, 70, -1,
497
-1, -1, 74, 75, -1, 77, 78, 54, 80, 56,
498
57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
499
67, 68, 69, 70, 71, 72, 73, -1, 69, 70,
500
-1, -1, -1, 74, 75, -1, 77, 78, 52, 80,
501
54, -1, 56, 57, 58, 59, 60, 61, 62, 63,
502
64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
503
-1, -1, -1, -1, -1, -1, -1, -1, 52, -1,
504
54, 85, 56, 57, 58, 59, 60, 61, 62, 63,
505
64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
506
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
507
52, 85, 54, 55, 56, 57, 58, 59, 60, 61,
508
62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
509
72, 73, 52, -1, 54, -1, 56, 57, 58, 59,
510
60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
511
70, 71, 72, 73, 57, 58, 59, 60, 61, 62,
512
63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
513
73, 58, 59, 60, 61, 62, 63, 64, 65, 66,
514
67, 68, 69, 70, 71, 72, 73, 59, 60, 61,
515
62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
516
72, 73, 60, 61, 62, 63, 64, 65, 66, 67,
517
68, 69, 70, 71, 72, 73, 61, 62, 63, 64,
518
65, 66, 67, 68, 69, 70, 71, 72, 73, 61,
519
62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
520
72, 73, 63, 64, 65, 66, 67, 68, 69, 70,
523
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
524
#line 3 "/usr/share/bison/bison.simple"
526
/* Skeleton output parser for bison,
527
Copyright 1984, 1989, 1990, 2000, 2001 Free Software Foundation, Inc.
529
This program is free software; you can redistribute it and/or modify
530
it under the terms of the GNU General Public License as published by
531
the Free Software Foundation; either version 2, or (at your option)
534
This program is distributed in the hope that it will be useful,
535
but WITHOUT ANY WARRANTY; without even the implied warranty of
536
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
537
GNU General Public License for more details.
539
You should have received a copy of the GNU General Public License
540
along with this program; if not, write to the Free Software
541
Foundation, Inc., 59 Temple Place - Suite 330,
542
Boston, MA 02111-1307, USA. */
544
/* As a special exception, when this file is copied by Bison into a
545
Bison output file, you may use that output file without restriction.
546
This special exception was added by the Free Software Foundation
547
in version 1.24 of Bison. */
549
/* This is the parser code that is written into each bison parser when
550
the %semantic_parser declaration is not specified in the grammar.
551
It was written by Richard Stallman by simplifying the hairy parser
552
used when %semantic_parser is specified. */
554
#ifndef EXSTACK_USE_ALLOCA
556
# define EXSTACK_USE_ALLOCA 1
557
# else /* alloca not defined */
559
# define EXSTACK_USE_ALLOCA 1
560
# define alloca __builtin_alloca
561
# else /* not GNU C. */
562
# if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
563
# define EXSTACK_USE_ALLOCA 1
565
# else /* not sparc */
566
/* We think this test detects Watcom and Microsoft C. */
567
/* This used to test MSDOS, but that is a bad idea since that
568
symbol is in the user namespace. */
569
# if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
571
/* No need for malloc.h, which pollutes the namespace; instead,
572
just don't use alloca. */
575
# else /* not MSDOS, or __TURBOC__ */
577
/* I don't know what this was needed for, but it pollutes the
578
namespace. So I turned it off. rms, 2 May 1997. */
579
/* #include <malloc.h> */
581
# define EXSTACK_USE_ALLOCA 1
582
# else /* not MSDOS, or __TURBOC__, or _AIX */
584
/* haible@ilog.fr says this works for HPUX 9.05 and up, and on
585
HPUX 10. Eventually we can turn this on. */
587
# define EXSTACK_USE_ALLOCA 1
588
# define alloca __builtin_alloca
591
# endif /* not _AIX */
592
# endif /* not MSDOS, or __TURBOC__ */
593
# endif /* not sparc */
594
# endif /* not GNU C */
595
# endif /* alloca not defined */
596
#endif /* EXSTACK_USE_ALLOCA not defined */
598
#ifndef EXSTACK_USE_ALLOCA
599
# define EXSTACK_USE_ALLOCA 0
602
#if EXSTACK_USE_ALLOCA
603
# define EXSTACK_ALLOC alloca
605
# define EXSTACK_ALLOC malloc
608
#define exerrok (exerrstatus = 0)
609
#define exclearin (exchar = EXEMPTY)
612
#define EXACCEPT goto exacceptlab
613
#define EXABORT goto exabortlab
614
#define EXERROR goto exerrlab1
615
/* Like EXERROR except do call exerror. This remains here temporarily
616
to ease the transition to the new meaning of EXERROR, for GCC.
617
Once GCC version 2 has supplanted version 1, this can go. */
618
#define EXFAIL goto exerrlab
619
#define EXRECOVERING() (!!exerrstatus)
620
#define EXBACKUP(Token, Value) \
622
if (exchar == EXEMPTY && exlen == 1) \
626
exchar1 = EXTRANSLATE (exchar); \
632
exerror ("syntax error: cannot back up"); \
638
#define EXERRCODE 256
641
/* EXLLOC_DEFAULT -- Compute the default location (before the actions
644
When EXLLOC_DEFAULT is run, CURRENT is set the location of the
645
first token. By default, to implement support for ranges, extend
646
its range to the last symbol. */
648
#ifndef EXLLOC_DEFAULT
649
# define EXLLOC_DEFAULT(Current, Rhs, N) \
650
Current.last_line = Rhs[N].last_line; \
651
Current.last_column = Rhs[N].last_column;
655
/* EXLEX -- calling `exlex' with the right arguments. */
660
# define EXLEX exlex (&exlval, &exlloc, EXLEX_PARAM)
662
# define EXLEX exlex (&exlval, &exlloc)
664
# else /* !EXLSP_NEEDED */
666
# define EXLEX exlex (&exlval, EXLEX_PARAM)
668
# define EXLEX exlex (&exlval)
670
# endif /* !EXLSP_NEEDED */
672
# define EXLEX exlex ()
676
/* Enable debugging if requested. */
678
# define EXDPRINTF(Args) \
683
/* Nonzero means print parse trace. [The following comment makes no
684
sense to me. Could someone clarify it? --akim] Since this is
685
uninitialized, it does not stop multiple parsers from coexisting.
689
# define EXDPRINTF(Args)
690
#endif /* !EXDEBUG */
692
/* EXINITDEPTH -- initial size of the parser's stacks. */
694
# define EXINITDEPTH 200
697
/* EXMAXDEPTH -- maximum size the stacks can grow to (effective only
698
if the built-in stack extension method is used). */
704
# define EXMAXDEPTH 10000
707
/* Define __ex_memcpy. Note that the size argument
708
should be passed with type unsigned int, because that is what the non-GCC
709
definitions require. With GCC, __builtin_memcpy takes an arg
710
of type size_t, but it can handle unsigned int. */
712
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
713
# define __ex_memcpy(To, From, Count) __builtin_memcpy (To, From, Count)
714
#else /* not GNU C or C++ */
716
/* This is the most reliable way to avoid incompatibilities
717
in available built-in functions on various systems. */
720
__ex_memcpy (to, from, count)
724
# else /* __cplusplus */
725
__ex_memcpy (char *to, const char *from, unsigned int count)
728
register const char *f = from;
729
register char *t = to;
730
register int i = count;
738
#line 216 "/usr/share/bison/bison.simple"
741
/* The user can define EXPARSE_PARAM as the name of an argument to be passed
742
into exparse. The argument should have type void *.
743
It should actually point to an object.
744
Grammar actions can access the variable by casting it
745
to the proper pointer type. */
749
# define EXPARSE_PARAM_ARG void *EXPARSE_PARAM
750
# define EXPARSE_PARAM_DECL
751
# else /* !__cplusplus */
752
# define EXPARSE_PARAM_ARG EXPARSE_PARAM
753
# define EXPARSE_PARAM_DECL void *EXPARSE_PARAM;
754
# endif /* !__cplusplus */
755
#else /* !EXPARSE_PARAM */
756
# define EXPARSE_PARAM_ARG
757
# define EXPARSE_PARAM_DECL
758
#endif /* !EXPARSE_PARAM */
760
/* Prevent warning if -Wstrict-prototypes. */
762
# ifdef EXPARSE_PARAM
763
int exparse (void *);
769
/* EX_DECL_VARIABLES -- depending whether we use a pure parser,
770
variables are global, or local to EXPARSE. */
772
#define _EX_DECL_VARIABLES \
773
/* The lookahead symbol. */ \
776
/* The semantic value of the lookahead symbol. */ \
779
/* Number of parse errors so far. */ \
783
# define EX_DECL_VARIABLES \
786
/* Location data for the lookahead symbol. */ \
789
# define EX_DECL_VARIABLES \
794
/* If nonreentrant, generate the variables here. */
801
exparse (EXPARSE_PARAM_ARG)
804
/* If reentrant, generate the variables here. */
809
register int exstate;
811
/* Number of tokens to shift before error messages enabled. */
813
/* Lookahead token as an internal (translated) token number. */
816
/* Three stacks and their tools:
817
`exss': related to states,
818
`exsv': related to semantic values,
819
`exls': related to locations.
821
Refer to the stacks thru separate pointers, to allow exoverflow
822
to reallocate them elsewhere. */
824
/* The state stack. */
825
short exssa[EXINITDEPTH];
827
register short *exssp;
829
/* The semantic value stack. */
830
EXSTYPE exvsa[EXINITDEPTH];
831
EXSTYPE *exvs = exvsa;
832
register EXSTYPE *exvsp;
835
/* The location stack. */
836
EXLTYPE exlsa[EXINITDEPTH];
837
EXLTYPE *exls = exlsa;
842
# define EXPOPSTACK (exvsp--, exssp--, exlsp--)
844
# define EXPOPSTACK (exvsp--, exssp--)
847
int exstacksize = EXINITDEPTH;
848
int exfree_stacks = 0;
851
/* The variables used to return semantic value and location from the
858
/* When reducing, the number of symbols on the RHS of the reduced
862
EXDPRINTF ((stderr, "Starting parse\n"));
867
exchar = EXEMPTY; /* Cause a token to be read. */
869
/* Initialize stack pointers.
870
Waste one element of value and location stack
871
so that they stay on the same level as the state stack.
872
The wasted elements are never initialized. */
881
/*------------------------------------------------------------.
882
| exnewstate -- Push a new state, which is found in exstate. |
883
`------------------------------------------------------------*/
885
/* In all cases, when you get here, the value and location stacks
886
have just been pushed. so pushing a state here evens the stacks.
893
if (exssp >= exss + exstacksize - 1)
895
/* Give user a chance to reallocate the stack. Use copies of
896
these so that the &'s don't force the real ones into memory.
898
EXSTYPE *exvs1 = exvs;
901
EXLTYPE *exls1 = exls;
904
/* Get the current used size of the three stacks, in elements. */
905
int size = exssp - exss + 1;
908
/* Each stack pointer address is followed by the size of the
909
data in use in that stack, in bytes. */
911
/* This used to be a conditional around just the two extra args,
912
but that might be undefined if exoverflow is a macro. */
913
exoverflow ("parser stack overflow",
914
&exss1, size * sizeof (*exssp),
915
&exvs1, size * sizeof (*exvsp),
916
&exls1, size * sizeof (*exlsp),
919
exoverflow ("parser stack overflow",
920
&exss1, size * sizeof (*exssp),
921
&exvs1, size * sizeof (*exvsp),
925
exss = exss1; exvs = exvs1;
929
#else /* no exoverflow */
930
/* Extend the stack our own way. */
931
if (exstacksize >= EXMAXDEPTH)
933
exerror ("parser stack overflow");
945
if (exstacksize > EXMAXDEPTH)
946
exstacksize = EXMAXDEPTH;
947
# if !EXSTACK_USE_ALLOCA
950
exss = (short *) EXSTACK_ALLOC (exstacksize * sizeof (*exssp));
951
__ex_memcpy ((char *)exss, (char *)exss1,
952
size * (unsigned int) sizeof (*exssp));
953
exvs = (EXSTYPE *) EXSTACK_ALLOC (exstacksize * sizeof (*exvsp));
954
__ex_memcpy ((char *)exvs, (char *)exvs1,
955
size * (unsigned int) sizeof (*exvsp));
957
exls = (EXLTYPE *) EXSTACK_ALLOC (exstacksize * sizeof (*exlsp));
958
__ex_memcpy ((char *)exls, (char *)exls1,
959
size * (unsigned int) sizeof (*exlsp));
961
#endif /* no exoverflow */
963
exssp = exss + size - 1;
964
exvsp = exvs + size - 1;
966
exlsp = exls + size - 1;
969
EXDPRINTF ((stderr, "Stack size increased to %d\n", exstacksize));
971
if (exssp >= exss + exstacksize - 1)
975
EXDPRINTF ((stderr, "Entering state %d\n", exstate));
985
/* Do appropriate processing given the current state. */
986
/* Read a lookahead token if we need one and don't already have one. */
989
/* First try to decide what to do without reference to lookahead token. */
991
exn = expact[exstate];
995
/* Not known => get a lookahead token if don't already have one. */
997
/* exchar is either EXEMPTY or EXEOF
998
or a valid token in external form. */
1000
if (exchar == EXEMPTY)
1002
EXDPRINTF ((stderr, "Reading a token: "));
1006
/* Convert token to internal form (in exchar1) for indexing tables with */
1008
if (exchar <= 0) /* This means end of input. */
1011
exchar = EXEOF; /* Don't call EXLEX any more */
1013
EXDPRINTF ((stderr, "Now at end of input.\n"));
1017
exchar1 = EXTRANSLATE (exchar);
1020
/* We have to keep this `#if EXDEBUG', since we use variables
1021
which are defined only if `EXDEBUG' is set. */
1024
fprintf (stderr, "Next token is %d (%s", exchar, extname[exchar1]);
1025
/* Give the individual parser a way to print the precise
1026
meaning of a token, for further debugging info. */
1028
EXPRINT (stderr, exchar, exlval);
1030
fprintf (stderr, ")\n");
1036
if (exn < 0 || exn > EXLAST || excheck[exn] != exchar1)
1041
/* exn is what to do for this token type in this state.
1042
Negative => reduce, -exn is rule number.
1043
Positive => shift, exn is new state.
1044
New state is final state => don't bother to shift,
1045
just return success.
1046
0, or most negative number => error. */
1061
/* Shift the lookahead token. */
1062
EXDPRINTF ((stderr, "Shifting token %d (%s), ", exchar, extname[exchar1]));
1064
/* Discard the token being shifted unless it is eof. */
1065
if (exchar != EXEOF)
1073
/* Count tokens shifted since error; after three, turn off error
1082
/*-----------------------------------------------------------.
1083
| exdefault -- do the default action for the current state. |
1084
`-----------------------------------------------------------*/
1086
exn = exdefact[exstate];
1092
/*-----------------------------.
1093
| exreduce -- Do a reduction. |
1094
`-----------------------------*/
1096
/* exn is the number of a rule to reduce with. */
1099
/* If EXLEN is nonzero, implement the default value of the action:
1102
Otherwise, the following line sets EXVAL to the semantic value of
1103
the lookahead token. This behavior is undocumented and Bison
1104
users should not rely upon it. Assigning to EXVAL
1105
unconditionally makes the parser a bit smaller, and it avoids a
1106
GCC warning that EXVAL may be used uninitialized. */
1107
exval = exvsp[1-exlen];
1110
/* Similarly for the default location. Let the user run additional
1111
commands if for instance locations are ranges. */
1112
exloc = exlsp[1-exlen];
1113
EXLLOC_DEFAULT (exloc, (exlsp - exlen), exlen);
1117
/* We have to keep this `#if EXDEBUG', since we use variables which
1118
are defined only if `EXDEBUG' is set. */
1123
fprintf (stderr, "Reducing via rule %d (line %d), ",
1126
/* Print the symbols being reduced, and their result. */
1127
for (i = exprhs[exn]; exrhs[i] > 0; i++)
1128
fprintf (stderr, "%s ", extname[exrhs[i]]);
1129
fprintf (stderr, " -> %s\n", extname[exr1[exn]]);
1136
#line 137 "exparse.y"
1138
if (exvsp[-1].expr && !(expr.program->disc->flags & EX_STRICT))
1140
if (expr.program->main.value && !(expr.program->disc->flags & EX_RETAIN))
1141
exfreenode(expr.program, expr.program->main.value);
1142
if (exvsp[-1].expr->op == S2B)
1147
exvsp[-1].expr = x->data.operand.left;
1148
x->data.operand.left = 0;
1149
exfreenode(expr.program, x);
1151
expr.program->main.lex = PROCEDURE;
1152
expr.program->main.value = exnewnode(expr.program, PROCEDURE, 1, exvsp[-1].expr->type, NiL, exvsp[-1].expr);
1157
#line 161 "exparse.y"
1159
register Dtdisc_t* disc;
1162
exerror("no nested function definitions");
1163
exvsp[-1].id->lex = PROCEDURE;
1164
expr.procedure = exvsp[-1].id->value = exnewnode(expr.program, PROCEDURE, 1, exvsp[-1].id->type, NiL, NiL);
1165
expr.procedure->type = INTEGER;
1166
if (!(disc = newof(0, Dtdisc_t, 1, 0)))
1167
exerror("out of space [frame discipline]");
1168
disc->key = offsetof(Exid_t, name);
1169
if (!(expr.procedure->data.procedure.frame = dtopen(disc, Dtset)) || !dtview(expr.procedure->data.procedure.frame, expr.program->symbols))
1170
exerror("out of space [frame table]");
1171
expr.program->symbols = expr.program->frame = expr.procedure->data.procedure.frame;
1175
#line 176 "exparse.y"
1178
if (expr.program->frame)
1180
expr.program->symbols = expr.program->frame->view;
1181
dtview(expr.program->frame, NiL);
1183
if (exvsp[0].expr && exvsp[0].expr->op == S2B)
1188
exvsp[0].expr = x->data.operand.left;
1189
x->data.operand.left = 0;
1190
exfreenode(expr.program, x);
1192
exvsp[-3].id->value->data.operand.right = excast(expr.program, exvsp[0].expr, exvsp[-3].id->type, NiL, 0);
1196
#line 197 "exparse.y"
1202
#line 201 "exparse.y"
1204
if (!exvsp[-1].expr)
1205
exval.expr = exvsp[0].expr;
1206
else if (!exvsp[0].expr)
1207
exval.expr = exvsp[-1].expr;
1208
else if (exvsp[-1].expr->op == CONSTANT)
1210
exfreenode(expr.program, exvsp[-1].expr);
1211
exval.expr = exvsp[0].expr;
1213
else exval.expr = exnewnode(expr.program, ';', 1, exvsp[0].expr->type, exvsp[-1].expr, exvsp[0].expr);
1217
#line 216 "exparse.y"
1219
exval.expr = exvsp[-1].expr;
1223
#line 220 "exparse.y"
1225
exval.expr = (exvsp[-1].expr && exvsp[-1].expr->type == STRING) ? exnewnode(expr.program, S2B, 1, INTEGER, exvsp[-1].expr, NiL) : exvsp[-1].expr;
1229
#line 223 "exparse.y"
1230
{expr.declare=exvsp[0].id->type;;
1233
#line 224 "exparse.y"
1235
exval.expr = exvsp[-1].expr;
1239
#line 228 "exparse.y"
1241
if (exvsp[-3].expr->type == STRING)
1242
exvsp[-3].expr = exnewnode(expr.program, S2B, 1, INTEGER, exvsp[-3].expr, NiL);
1243
else if (!INTEGRAL(exvsp[-3].expr->type))
1244
exvsp[-3].expr = excast(expr.program, exvsp[-3].expr, INTEGER, NiL, 0);
1245
exval.expr = exnewnode(expr.program, exvsp[-5].id->index, 1, INTEGER, exvsp[-3].expr, exnewnode(expr.program, ':', 1, exvsp[-1].expr ? exvsp[-1].expr->type : 0, exvsp[-1].expr, exvsp[0].expr));
1249
#line 236 "exparse.y"
1251
exval.expr = exnewnode(expr.program, ITERATE, 0, INTEGER, NiL, NiL);
1252
exval.expr->data.generate.array = exvsp[-2].expr;
1253
if (!exvsp[-2].expr->data.variable.index || exvsp[-2].expr->data.variable.index->op != DYNAMIC)
1254
exerror("simple index variable expected");
1255
exval.expr->data.generate.index = exvsp[-2].expr->data.variable.index->data.variable.symbol;
1256
if (exvsp[-2].expr->op == ID && exval.expr->data.generate.index->type != INTEGER)
1257
exerror("integer index variable expected");
1258
exfreenode(expr.program, exvsp[-2].expr->data.variable.index);
1259
exvsp[-2].expr->data.variable.index = 0;
1260
exval.expr->data.generate.statement = exvsp[0].expr;
1264
#line 249 "exparse.y"
1266
if (!exvsp[-4].expr)
1268
exvsp[-4].expr = exnewnode(expr.program, CONSTANT, 0, INTEGER, NiL, NiL);
1269
exvsp[-4].expr->data.constant.value.integer = 1;
1271
else if (exvsp[-4].expr->type == STRING)
1272
exvsp[-4].expr = exnewnode(expr.program, S2B, 1, INTEGER, exvsp[-4].expr, NiL);
1273
else if (!INTEGRAL(exvsp[-4].expr->type))
1274
exvsp[-4].expr = excast(expr.program, exvsp[-4].expr, INTEGER, NiL, 0);
1275
exval.expr = exnewnode(expr.program, exvsp[-8].id->index, 1, INTEGER, exvsp[-4].expr, exnewnode(expr.program, ';', 1, 0, exvsp[-2].expr, exvsp[0].expr));
1277
exval.expr = exnewnode(expr.program, ';', 1, INTEGER, exvsp[-6].expr, exval.expr);
1281
#line 264 "exparse.y"
1283
if (exvsp[-2].expr->type == STRING)
1284
exvsp[-2].expr = exnewnode(expr.program, S2B, 1, INTEGER, exvsp[-2].expr, NiL);
1285
else if (!INTEGRAL(exvsp[-2].expr->type))
1286
exvsp[-2].expr = excast(expr.program, exvsp[-2].expr, INTEGER, NiL, 0);
1287
exval.expr = exnewnode(expr.program, exvsp[-4].id->index, 1, INTEGER, exvsp[-2].expr, exnewnode(expr.program, ';', 1, 0, NiL, exvsp[0].expr));
1291
#line 271 "exparse.y"
1292
{expr.declare=exvsp[0].expr->type;;
1295
#line 272 "exparse.y"
1297
register Switch_t* sw = expr.swstate;
1299
exval.expr = exnewnode(expr.program, exvsp[-7].id->index, 1, INTEGER, exvsp[-5].expr, exnewnode(expr.program, DEFAULT, 1, 0, sw->defcase, sw->firstcase));
1300
expr.swstate = expr.swstate->prev;
1308
#line 283 "exparse.y"
1311
if (!exvsp[-1].expr)
1313
exvsp[-1].expr = exnewnode(expr.program, CONSTANT, 0, INTEGER, NiL, NiL);
1314
exvsp[-1].expr->data.constant.value.integer = 1;
1316
else if (!INTEGRAL(exvsp[-1].expr->type))
1317
exvsp[-1].expr = excast(expr.program, exvsp[-1].expr, INTEGER, NiL, 0);
1318
exval.expr = exnewnode(expr.program, exvsp[-2].id->index, 1, INTEGER, exvsp[-1].expr, NiL);
1322
#line 295 "exparse.y"
1328
#line 299 "exparse.y"
1332
if (expr.procedure && !expr.procedure->type)
1333
exerror("return in void function");
1334
exvsp[-1].expr = excast(expr.program, exvsp[-1].expr, expr.procedure ? expr.procedure->type : INTEGER, NiL, 0);
1336
exval.expr = exnewnode(expr.program, RETURN, 1, exvsp[-1].expr ? exvsp[-1].expr->type : 0, exvsp[-1].expr, NiL);
1340
#line 311 "exparse.y"
1342
register Switch_t* sw;
1347
if (!(sw = newof(0, Switch_t, 1, 0)))
1349
exerror("out of space [switch]");
1352
sw->prev = expr.swstate;
1356
sw->type = expr.declare;
1362
if (!(sw->base = newof(0, Extype_t*, n, 0)))
1364
exerror("out of space [case]");
1368
sw->last = sw->base + n;
1372
#line 344 "exparse.y"
1374
register Switch_t* sw = expr.swstate;
1377
exval.expr = exnewnode(expr.program, CASE, 1, 0, exvsp[0].expr, NiL);
1378
if (sw->cur > sw->base)
1381
sw->lastcase->data.select.next = exval.expr;
1382
else sw->firstcase = exval.expr;
1383
sw->lastcase = exval.expr;
1384
n = sw->cur - sw->base;
1386
exval.expr->data.select.constant = (Extype_t**)exalloc(expr.program, (n + 1) * sizeof(Extype_t*));
1387
memcpy(exval.expr->data.select.constant, sw->base, n * sizeof(Extype_t*));
1388
exval.expr->data.select.constant[n] = 0;
1390
else exval.expr->data.select.constant = 0;
1395
exerror("duplicate default in switch");
1396
else sw->defcase = exvsp[0].expr;
1401
#line 377 "exparse.y"
1405
if (expr.swstate->cur >= expr.swstate->last)
1407
n = expr.swstate->cur - expr.swstate->base;
1408
if (!(expr.swstate->base = newof(expr.swstate->base, Extype_t*, 2 * n, 0)))
1410
exerror("too many case labels for switch");
1413
expr.swstate->cur = expr.swstate->base + n;
1414
expr.swstate->last = expr.swstate->base + 2 * n;
1416
if (expr.swstate->cur)
1418
exvsp[-1].expr = excast(expr.program, exvsp[-1].expr, expr.swstate->type, NiL, 0);
1419
*expr.swstate->cur++ = &(exvsp[-1].expr->data.constant.value);
1424
#line 398 "exparse.y"
1426
expr.swstate->def = 1;
1430
#line 405 "exparse.y"
1433
exval.expr = exvsp[-2].expr ? exnewnode(expr.program, ',', 1, exvsp[0].expr->type, exvsp[-2].expr, exvsp[0].expr) : exvsp[0].expr;
1437
#line 411 "exparse.y"
1438
{expr.id=exvsp[0].id;;
1441
#line 412 "exparse.y"
1444
exvsp[-3].id->type = expr.declare;
1445
if (exvsp[0].expr && exvsp[0].expr->op == PROCEDURE)
1447
exvsp[-3].id->lex = PROCEDURE;
1448
exvsp[-3].id->value = exvsp[0].expr;
1452
exvsp[-3].id->lex = DYNAMIC;
1453
exvsp[-3].id->value = exnewnode(expr.program, 0, 0, 0, NiL, NiL);
1454
if (exvsp[-1].integer && !exvsp[-3].id->local.pointer)
1458
if (!(disc = newof(0, Dtdisc_t, 1, 0)))
1459
exerror("out of space [associative array]");
1460
disc->key = offsetof(Exassoc_t, name);
1461
if (!(exvsp[-3].id->local.pointer = (char*)dtopen(disc, Dtoset)))
1462
exerror("%s: cannot initialize associative array", exvsp[-3].id->name);
1466
if (exvsp[0].expr->type != exvsp[-3].id->type)
1468
exvsp[0].expr->type = exvsp[-3].id->type;
1469
exvsp[0].expr->data.operand.right = excast(expr.program, exvsp[0].expr->data.operand.right, exvsp[-3].id->type, NiL, 0);
1471
exvsp[0].expr->data.operand.left = exnewnode(expr.program, DYNAMIC, 0, exvsp[-3].id->type, NiL, NiL);
1472
exvsp[0].expr->data.operand.left->data.variable.symbol = exvsp[-3].id;
1473
exval.expr = exvsp[0].expr;
1475
else if (!exvsp[-1].integer)
1476
exvsp[-3].id->value->data.value = exzero(exvsp[-3].id->type);
1481
#line 456 "exparse.y"
1487
#line 460 "exparse.y"
1489
exval.expr = exvsp[0].expr;
1493
#line 466 "exparse.y"
1499
#line 473 "exparse.y"
1501
exval.expr = exvsp[-1].expr;
1505
#line 477 "exparse.y"
1507
exval.expr = (exvsp[0].expr->type == exvsp[-2].id->type) ? exvsp[0].expr : excast(expr.program, exvsp[0].expr, exvsp[-2].id->type, NiL, 0);
1511
#line 481 "exparse.y"
1521
if (!exvsp[-2].expr->type)
1523
if (!exvsp[0].expr->type)
1524
exvsp[-2].expr->type = exvsp[0].expr->type = rel ? STRING : INTEGER;
1525
else exvsp[-2].expr->type = exvsp[0].expr->type;
1527
else if (!exvsp[0].expr->type) exvsp[0].expr->type = exvsp[-2].expr->type;
1528
if (exvsp[-2].expr->type != exvsp[0].expr->type)
1530
if (exvsp[-2].expr->type == STRING)
1531
exvsp[-2].expr = excast(expr.program, exvsp[-2].expr, exvsp[0].expr->type, exvsp[0].expr, 0);
1532
else if (exvsp[0].expr->type == STRING)
1533
exvsp[0].expr = excast(expr.program, exvsp[0].expr, exvsp[-2].expr->type, exvsp[-2].expr, 0);
1534
else if (exvsp[-2].expr->type == FLOATING)
1535
exvsp[0].expr = excast(expr.program, exvsp[0].expr, FLOATING, exvsp[-2].expr, 0);
1536
else if (exvsp[0].expr->type == FLOATING)
1537
exvsp[-2].expr = excast(expr.program, exvsp[-2].expr, FLOATING, exvsp[0].expr, 0);
1540
rel = (exvsp[-2].expr->type == STRING) ? STRING : ((exvsp[-2].expr->type == UNSIGNED) ? UNSIGNED : exvsp[0].expr->type);
1541
exval.expr = exnewnode(expr.program, exvsp[-1].op, 1, rel, exvsp[-2].expr, exvsp[0].expr);
1542
if (!expr.program->errors && exvsp[-2].expr->op == CONSTANT && exvsp[0].expr->op == CONSTANT)
1544
expr.program->vc = expr.program->vm;
1545
exval.expr->data.constant.value = exeval(expr.program, exval.expr, NiL);
1546
expr.program->vc = expr.program->ve;
1547
exval.expr->binary = 0;
1548
exval.expr->op = CONSTANT;
1549
exfreenode(expr.program, exvsp[-2].expr);
1550
exfreenode(expr.program, exvsp[0].expr);
1555
#line 523 "exparse.y"
1561
#line 527 "exparse.y"
1567
#line 531 "exparse.y"
1573
#line 535 "exparse.y"
1579
#line 539 "exparse.y"
1585
#line 543 "exparse.y"
1591
#line 547 "exparse.y"
1597
#line 551 "exparse.y"
1603
#line 555 "exparse.y"
1609
#line 559 "exparse.y"
1615
#line 563 "exparse.y"
1621
#line 567 "exparse.y"
1627
#line 571 "exparse.y"
1633
#line 575 "exparse.y"
1639
#line 579 "exparse.y"
1645
#line 583 "exparse.y"
1648
if (exvsp[-2].expr->type == STRING)
1649
exvsp[-2].expr = exnewnode(expr.program, S2B, 1, INTEGER, exvsp[-2].expr, NiL);
1650
if (exvsp[0].expr->type == STRING)
1651
exvsp[0].expr = exnewnode(expr.program, S2B, 1, INTEGER, exvsp[0].expr, NiL);
1656
#line 592 "exparse.y"
1662
#line 596 "exparse.y"
1664
if (exvsp[-2].expr->op == CONSTANT)
1666
exfreenode(expr.program, exvsp[-2].expr);
1667
exval.expr = exvsp[0].expr;
1669
else exval.expr = exnewnode(expr.program, ',', 1, exvsp[0].expr->type, exvsp[-2].expr, exvsp[0].expr);
1673
#line 604 "exparse.y"
1677
#line 604 "exparse.y"
1681
#line 605 "exparse.y"
1683
if (!exvsp[-3].expr->type)
1685
if (!exvsp[0].expr->type)
1686
exvsp[-3].expr->type = exvsp[0].expr->type = INTEGER;
1687
else exvsp[-3].expr->type = exvsp[0].expr->type;
1689
else if (!exvsp[0].expr->type)
1690
exvsp[0].expr->type = exvsp[-3].expr->type;
1691
if (exvsp[-6].expr->type == STRING)
1692
exvsp[-6].expr = exnewnode(expr.program, S2B, 1, INTEGER, exvsp[-6].expr, NiL);
1693
else if (!INTEGRAL(exvsp[-6].expr->type))
1694
exvsp[-6].expr = excast(expr.program, exvsp[-6].expr, INTEGER, NiL, 0);
1695
if (exvsp[-3].expr->type != exvsp[0].expr->type)
1697
if (exvsp[-3].expr->type == STRING || exvsp[0].expr->type == STRING)
1698
exerror("if statement string type mismatch");
1699
else if (exvsp[-3].expr->type == FLOATING)
1700
exvsp[0].expr = excast(expr.program, exvsp[0].expr, FLOATING, NiL, 0);
1701
else if (exvsp[0].expr->type == FLOATING)
1702
exvsp[-3].expr = excast(expr.program, exvsp[-3].expr, FLOATING, NiL, 0);
1704
if (exvsp[-6].expr->op == CONSTANT)
1706
if (exvsp[-6].expr->data.constant.value.integer)
1708
exval.expr = exvsp[-3].expr;
1709
exfreenode(expr.program, exvsp[0].expr);
1713
exval.expr = exvsp[0].expr;
1714
exfreenode(expr.program, exvsp[-3].expr);
1716
exfreenode(expr.program, exvsp[-6].expr);
1718
else exval.expr = exnewnode(expr.program, '?', 1, exvsp[-3].expr->type, exvsp[-6].expr, exnewnode(expr.program, ':', 1, exvsp[-3].expr->type, exvsp[-3].expr, exvsp[0].expr));
1722
#line 644 "exparse.y"
1725
if (exvsp[0].expr->type == STRING)
1726
exvsp[0].expr = exnewnode(expr.program, S2B, 1, INTEGER, exvsp[0].expr, NiL);
1727
else if (!INTEGRAL(exvsp[0].expr->type))
1728
exvsp[0].expr = excast(expr.program, exvsp[0].expr, INTEGER, NiL, 0);
1730
exval.expr = exnewnode(expr.program, exvsp[-1].op, 1, exvsp[0].expr->type == UNSIGNED ? INTEGER : exvsp[0].expr->type, exvsp[0].expr, NiL);
1731
if (exvsp[0].expr->op == CONSTANT)
1733
exval.expr->data.constant.value = exeval(expr.program, exval.expr, NiL);
1734
exval.expr->binary = 0;
1735
exval.expr->op = CONSTANT;
1736
exfreenode(expr.program, exvsp[0].expr);
1741
#line 661 "exparse.y"
1747
#line 665 "exparse.y"
1753
#line 669 "exparse.y"
1755
exval.expr = exvsp[0].expr;
1759
#line 673 "exparse.y"
1761
exval.expr = exnewnode(expr.program, FUNCTION, 1, T(exvsp[-3].id->type), call(0, exvsp[-3].id, exvsp[-1].expr), exvsp[-1].expr);
1765
#line 677 "exparse.y"
1767
if (!INTEGRAL(exvsp[-1].expr->type))
1768
exvsp[-1].expr = excast(expr.program, exvsp[-1].expr, INTEGER, NiL, 0);
1769
exval.expr = exnewnode(expr.program, EXIT, 1, INTEGER, exvsp[-1].expr, NiL);
1773
#line 683 "exparse.y"
1775
exval.expr = exnewnode(expr.program, CALL, 1, exvsp[-3].id->type, NiL, exvsp[-1].expr);
1776
exval.expr->data.call.procedure = exvsp[-3].id;
1780
#line 688 "exparse.y"
1782
exval.expr = exnewnode(expr.program, exvsp[-3].id->index, 0, exvsp[-3].id->type, NiL, NiL);
1783
if (exvsp[-1].expr && exvsp[-1].expr->data.operand.left->type == INTEGER)
1785
exval.expr->data.print.descriptor = exvsp[-1].expr->data.operand.left;
1786
exvsp[-1].expr = exvsp[-1].expr->data.operand.right;
1788
else switch (exvsp[-3].id->index)
1791
exval.expr->data.print.descriptor = exnewnode(expr.program, CONSTANT, 0, INTEGER, NiL, NiL);
1792
exval.expr->data.print.descriptor->data.constant.value.integer = 2;
1795
exval.expr->data.print.descriptor = exnewnode(expr.program, CONSTANT, 0, INTEGER, NiL, NiL);
1796
exval.expr->data.print.descriptor->data.constant.value.integer = 1;
1799
exval.expr->data.print.descriptor = 0;
1802
exval.expr->data.print.args = preprint(exvsp[-1].expr);
1806
#line 712 "exparse.y"
1810
if (exvsp[-1].expr->op == ID && !expr.program->disc->setf)
1811
exerror("%s: variable assignment not supported", exvsp[-1].expr->data.variable.symbol->name);
1814
if (!exvsp[-1].expr->type)
1815
exvsp[-1].expr->type = exvsp[0].expr->type;
1817
else if (exvsp[0].expr->type != exvsp[-1].expr->type && exvsp[-1].expr->type >= 0200)
1819
else if (exvsp[0].expr->type != exvsp[-1].expr->type)
1822
exvsp[0].expr->type = exvsp[-1].expr->type;
1823
exvsp[0].expr->data.operand.right = excast(expr.program, exvsp[0].expr->data.operand.right, exvsp[-1].expr->type, NiL, 0);
1825
exvsp[0].expr->data.operand.left = exvsp[-1].expr;
1826
exval.expr = exvsp[0].expr;
1832
#line 736 "exparse.y"
1835
if (exvsp[0].expr->type == STRING)
1836
exerror("++ and -- invalid for string variables");
1837
exval.expr = exnewnode(expr.program, exvsp[-1].op, 0, exvsp[0].expr->type, exvsp[0].expr, NiL);
1838
exval.expr->subop = PRE;
1842
#line 744 "exparse.y"
1845
if (exvsp[-1].expr->type == STRING)
1846
exerror("++ and -- invalid for string variables");
1847
exval.expr = exnewnode(expr.program, exvsp[0].op, 0, exvsp[-1].expr->type, exvsp[-1].expr, NiL);
1848
exval.expr->subop = POS;
1852
#line 752 "exparse.y"
1858
#line 756 "exparse.y"
1864
#line 763 "exparse.y"
1866
exval.expr = exnewnode(expr.program, CONSTANT, 0, exvsp[0].id->type, NiL, NiL);
1867
if (!expr.program->disc->reff)
1868
exerror("%s: identifier references not supported", exvsp[0].id->name);
1869
else exval.expr->data.constant.value = (*expr.program->disc->reff)(expr.program, exval.expr, exvsp[0].id, NiL, NiL, EX_SCALAR, expr.program->disc);
1873
#line 770 "exparse.y"
1875
exval.expr = exnewnode(expr.program, CONSTANT, 0, FLOATING, NiL, NiL);
1876
exval.expr->data.constant.value.floating = exvsp[0].floating;
1880
#line 775 "exparse.y"
1882
exval.expr = exnewnode(expr.program, CONSTANT, 0, INTEGER, NiL, NiL);
1883
exval.expr->data.constant.value.integer = exvsp[0].integer;
1887
#line 780 "exparse.y"
1889
exval.expr = exnewnode(expr.program, CONSTANT, 0, STRING, NiL, NiL);
1890
exval.expr->data.constant.value.string = exvsp[0].string;
1894
#line 785 "exparse.y"
1896
exval.expr = exnewnode(expr.program, CONSTANT, 0, UNSIGNED, NiL, NiL);
1897
exval.expr->data.constant.value.integer = exvsp[0].integer;
1901
#line 797 "exparse.y"
1903
exval.expr = makeVar(expr.program, exvsp[-1].id, 0, 0, exvsp[0].reference);
1907
#line 801 "exparse.y"
1911
n = exnewnode(expr.program, DYNAMIC, 0, exvsp[-2].id->type, NiL, NiL);
1912
n->data.variable.symbol = exvsp[-2].id;
1913
n->data.variable.reference = 0;
1914
if (((n->data.variable.index = exvsp[-1].expr) == 0) != (exvsp[-2].id->local.pointer ==
1916
exerror("%s: is%s an array", exvsp[-2].id->name, exvsp[-2].id->local.pointer ? "" : " not");
1917
if (exvsp[0].reference) {
1918
n->data.variable.dyna =exnewnode(expr.program, 0, 0, 0, NiL, NiL);
1919
exval.expr = makeVar(expr.program, exvsp[-2].id, exvsp[-1].expr, n, exvsp[0].reference);
1921
else exval.expr = n;
1925
#line 817 "exparse.y"
1927
exval.expr = exnewnode(expr.program, ID, 0, STRING, NiL, NiL);
1928
exval.expr->data.variable.symbol = exvsp[0].id;
1929
exval.expr->data.variable.reference = 0;
1930
exval.expr->data.variable.index = 0;
1931
exval.expr->data.variable.dyna = 0;
1932
if (!(expr.program->disc->flags & EX_UNDECLARED))
1933
exerror("unknown identifier");
1937
#line 829 "exparse.y"
1943
#line 833 "exparse.y"
1949
#line 839 "exparse.y"
1955
#line 843 "exparse.y"
1957
exval.expr = exvsp[-1].expr;
1961
#line 849 "exparse.y"
1967
#line 853 "exparse.y"
1969
exval.expr = exvsp[0].expr->data.operand.left;
1970
exvsp[0].expr->data.operand.left = exvsp[0].expr->data.operand.right = 0;
1971
exfreenode(expr.program, exvsp[0].expr);
1975
#line 861 "exparse.y"
1977
exval.expr = exnewnode(expr.program, ',', 1, 0, exnewnode(expr.program, ',', 1, exvsp[0].expr->type, exvsp[0].expr, NiL), NiL);
1978
exval.expr->data.operand.right = exval.expr->data.operand.left;
1982
#line 866 "exparse.y"
1984
exvsp[-2].expr->data.operand.right = exvsp[-2].expr->data.operand.right->data.operand.right = exnewnode(expr.program, ',', 1, exvsp[-2].expr->type, exvsp[0].expr, NiL);
1988
#line 872 "exparse.y"
1994
#line 876 "exparse.y"
1997
if (exvsp[0].id->type)
1998
exerror("(void) expected");
2002
#line 885 "exparse.y"
2004
exval.expr = exnewnode(expr.program, ',', 1, exvsp[0].expr->type, exvsp[0].expr, NiL);
2008
#line 889 "exparse.y"
2010
register Exnode_t* x;
2011
register Exnode_t* y;
2013
exval.expr = exvsp[-2].expr;
2014
for (x = exvsp[-2].expr; y = x->data.operand.right; x = y);
2015
x->data.operand.right = exnewnode(expr.program, ',', 1, exvsp[0].expr->type, exvsp[0].expr, NiL);
2019
#line 899 "exparse.y"
2020
{expr.declare=exvsp[0].id->type;;
2023
#line 900 "exparse.y"
2025
exval.expr = exnewnode(expr.program, ID, 0, exvsp[0].id->type, NiL, NiL);
2026
exval.expr->data.variable.symbol = exvsp[0].id;
2027
exvsp[0].id->lex = DYNAMIC;
2028
exvsp[0].id->value = exnewnode(expr.program, 0, 0, 0, NiL, NiL);
2029
expr.procedure->data.procedure.arity++;
2033
#line 910 "exparse.y"
2035
exval.reference = expr.refs = expr.lastref = 0;
2039
#line 914 "exparse.y"
2043
r = ALLOCATE(expr.program, Exref_t);
2044
r->symbol = exvsp[0].id;
2049
exval.reference = expr.refs;
2053
#line 926 "exparse.y"
2058
r = ALLOCATE(expr.program, Exref_t);
2059
r->symbol = exvsp[0].id;
2062
l = ALLOCATE(expr.program, Exref_t);
2063
l->symbol = exvsp[-1].id;
2068
exval.reference = expr.refs;
2072
#line 945 "exparse.y"
2074
exval.id = exvsp[0].id;
2078
#line 949 "exparse.y"
2080
exval.id = exvsp[0].id;
2084
#line 954 "exparse.y"
2090
#line 958 "exparse.y"
2092
exval.expr = exnewnode(expr.program, '=', 1, exvsp[0].expr->type, NiL, exvsp[0].expr);
2093
exval.expr->subop = exvsp[-1].op;
2097
#line 965 "exparse.y"
2099
register Dtdisc_t* disc;
2102
exerror("no nested function definitions");
2103
expr.procedure = exnewnode(expr.program, PROCEDURE, 1, expr.declare, NiL, NiL);
2104
if (!(disc = newof(0, Dtdisc_t, 1, 0)))
2105
exerror("out of space [frame discipline]");
2106
disc->key = offsetof(Exid_t, name);
2107
if (!(expr.procedure->data.procedure.frame = dtopen(disc, Dtset)) || !dtview(expr.procedure->data.procedure.frame, expr.program->symbols))
2108
exerror("out of space [frame table]");
2109
expr.program->symbols = expr.program->frame = expr.procedure->data.procedure.frame;
2110
expr.program->formals = 1;
2114
#line 978 "exparse.y"
2116
expr.program->formals = 0;
2117
expr.id->lex = PROCEDURE;
2118
expr.id->type = expr.declare;
2122
#line 983 "exparse.y"
2124
exval.expr = expr.procedure;
2126
if (expr.program->frame)
2128
expr.program->symbols = expr.program->frame->view;
2129
dtview(expr.program->frame, NiL);
2131
exval.expr->data.operand.left = exvsp[-5].expr;
2132
exval.expr->data.operand.right = excast(expr.program, exvsp[-1].expr, exval.expr->type, NiL, 0);
2135
* NOTE: procedure definition was slipped into the
2136
* declaration initializer statement production,
2137
* therefore requiring the statement terminator
2140
exunlex(expr.program, ';');
2145
#line 610 "/usr/share/bison/bison.simple"
2157
short *ssp1 = exss - 1;
2158
fprintf (stderr, "state stack now");
2159
while (ssp1 != exssp)
2160
fprintf (stderr, " %d", *++ssp1);
2161
fprintf (stderr, "\n");
2170
/* Now `shift' the result of the reduction. Determine what state
2171
that goes to, based on the state we popped back to and the rule
2172
number reduced by. */
2176
exstate = expgoto[exn - EXNTBASE] + *exssp;
2177
if (exstate >= 0 && exstate <= EXLAST && excheck[exstate] == *exssp)
2178
exstate = extable[exstate];
2180
exstate = exdefgoto[exn - EXNTBASE];
2185
/*------------------------------------.
2186
| exerrlab -- here on detecting error |
2187
`------------------------------------*/
2189
/* If not already recovering from an error, report this error. */
2194
#ifdef EXERROR_VERBOSE
2195
exn = expact[exstate];
2197
if (exn > EXFLAG && exn < EXLAST)
2204
/* Start X at -exn if nec to avoid negative indexes in excheck. */
2205
for (x = (exn < 0 ? -exn : 0);
2206
x < (int) (sizeof (extname) / sizeof (char *)); x++)
2207
if (excheck[x + exn] == x)
2208
size += strlen (extname[x]) + 15, count++;
2209
size += strlen ("parse error, unexpected `") + 1;
2210
size += strlen (extname[EXTRANSLATE (exchar)]);
2211
msg = (char *) malloc (size);
2214
strcpy (msg, "parse error, unexpected `");
2215
strcat (msg, extname[EXTRANSLATE (exchar)]);
2221
for (x = (exn < 0 ? -exn : 0);
2222
x < (int) (sizeof (extname) / sizeof (char *)); x++)
2223
if (excheck[x + exn] == x)
2225
strcat (msg, count == 0 ? ", expecting `" : " or `");
2226
strcat (msg, extname[x]);
2235
exerror ("parse error; also virtual memory exceeded");
2238
#endif /* EXERROR_VERBOSE */
2239
exerror ("parse error");
2244
/*--------------------------------------------------.
2245
| exerrlab1 -- error raised explicitly by an action |
2246
`--------------------------------------------------*/
2248
if (exerrstatus == 3)
2250
/* If just tried and failed to reuse lookahead token after an
2251
error, discard it. */
2253
/* return failure if at end of input */
2254
if (exchar == EXEOF)
2256
EXDPRINTF ((stderr, "Discarding token %d (%s).\n",
2257
exchar, extname[exchar1]));
2261
/* Else will try to reuse lookahead token after shifting the error
2264
exerrstatus = 3; /* Each real token shifted decrements this */
2269
/*-------------------------------------------------------------------.
2270
| exerrdefault -- current state does not do anything special for the |
2272
`-------------------------------------------------------------------*/
2275
/* This is wrong; only states that explicitly want error tokens
2276
should shift them. */
2278
/* If its default is to accept any token, ok. Otherwise pop it. */
2279
exn = exdefact[exstate];
2285
/*---------------------------------------------------------------.
2286
| exerrpop -- pop the current state because it cannot handle the |
2288
`---------------------------------------------------------------*/
2301
short *ssp1 = exss - 1;
2302
fprintf (stderr, "Error: state stack now");
2303
while (ssp1 != exssp)
2304
fprintf (stderr, " %d", *++ssp1);
2305
fprintf (stderr, "\n");
2313
exn = expact[exstate];
2318
if (exn < 0 || exn > EXLAST || excheck[exn] != EXTERROR)
2335
EXDPRINTF ((stderr, "Shifting error token, "));
2346
/*-------------------------------------.
2347
| exacceptlab -- EXACCEPT comes here. |
2348
`-------------------------------------*/
2361
/*-----------------------------------.
2362
| exabortlab -- EXABORT comes here. |
2363
`-----------------------------------*/
2375
#line 1004 "exparse.y"