1: # define SEOS 1
2: # define 2
3: # define SLABEL 3
4: # define SUNKNOWN 4
5: # define SHOLLERITH 5
6: # define SICON 6
7: # define SRCON 7
8: # define SDCON 8
9: # define SBITCON 9
10: # define SOCTCON 10
11: # define SHEXCON 11
12: # define STRUE 12
13: # define SFALSE 13
14: # define SNAME 14
15: # define SNAMEEQ 15
16: # define SFIELD 16
17: # define SSCALE 17
18: # define SINCLUDE 18
19: # define SLET 19
20: # define SASSIGN 20
21: # define SAUTOMATIC 21
22: # define SBACKSPACE 22
23: # define SBLOCK 23
24: # define SCALL 24
25: # define SCHARACTER 25
26: # define SCLOSE 26
27: # define SCOMMON 27
28: # define SCOMPLEX 28
29: # define SCONTINUE 29
30: # define SDATA 30
31: # define SDCOMPLEX 31
32: # define SDIMENSION 32
33: # define SDO 33
34: # define SDOUBLE 34
35: # define SELSE 35
36: # define SELSEIF 36
37: # define SEND 37
38: # define SENDFILE 38
39: # define SENDIF 39
40: # define SENTRY 40
41: # define SEQUIV 41
42: # define SEXTERNAL 42
43: # define SFORMAT 43
44: # define SFUNCTION 44
45: # define SGOTO 45
46: # define SASGOTO 46
47: # define SCOMPGOTO 47
48: # define SARITHIF 48
49: # define SLOGIF 49
50: # define SIMPLICIT 50
51: # define SINQUIRE 51
52: # define SINTEGER 52
53: # define SINTRINSIC 53
54: # define SLOGICAL 54
55: # define SOPEN 55
56: # define SPARAM 56
57: # define SPAUSE 57
58: # define SPRINT 58
59: # define SPROGRAM 59
60: # define SPUNCH 60
61: # define SREAD 61
62: # define SREAL 62
63: # define SRETURN 63
64: # define SREWIND 64
65: # define SSAVE 65
66: # define SSTATIC 66
67: # define SSTOP 67
68: # define SSUBROUTINE 68
69: # define STHEN 69
70: # define STO 70
71: # define SUNDEFINED 71
72: # define SWRITE 72
73: # define SLPAR 73
74: # define SRPAR 74
75: # define SEQUALS 75
76: # define SCOLON 76
77: # define SCOMMA 77
78: # define SCURRENCY 78
79: # define SPLUS 79
80: # define SMINUS 80
81: # define SSTAR 81
82: # define SSLASH 82
83: # define SPOWER 83
84: # define SCONCAT 84
85: # define SAND 85
86: # define SOR 86
87: # define SNEQV 87
88: # define SEQV 88
89: # define SNOT 89
90: # define SEQ 90
91: # define SLT 91
92: # define SGT 92
93: # define SLE 93
94: # define SGE 94
95: # define SNE 95
96: # define SDECODE 96
97: # define SENCODE 97
98:
99: # line 99 "gram.in"
100: #include "defs"
101: #include "string_defs"
102:
103: #ifdef C_OVERLAY
104: #define yyerror(x) {fprintf(diagfile, "%s\n", x); done(3); exit(3);}
105: #else
106: #define yyerror(x) error(x, 0, 0, FATAL)
107: #endif
108:
109: static int nstars;
110: static int ndim;
111: static int vartype;
112: static ftnint varleng;
113: static struct { ptr lb, ub; } dims[8];
114: static struct labelblock *labarray[MAXLABLIST];
115: static int lastwasbranch = NO;
116: static int thiswasbranch = NO;
117: extern ftnint yystno;
118: extern flag intonly;
119:
120: ftnint convci();
121: double convcd();
122: struct addrblock *nextdata(), *mkbitcon();
123: struct constblock *mklogcon(), *mkaddcon(), *mkrealcon();
124: struct constblock *mkstrcon(), *mkcxcon();
125: struct listblock *mklist();
126: struct listblock *mklist();
127: struct impldoblock *mkiodo();
128: struct extsym *comblock();
129:
130: #define yyclearin yychar = -1
131: #define yyerrok yyerrflag = 0
132: extern int yychar;
133: extern short yyerrflag;
134: #ifndef YYMAXDEPTH
135: #define YYMAXDEPTH 150
136: #endif
137: #ifndef YYSTYPE
138: #define YYSTYPE int
139: #endif
140: YYSTYPE yylval, yyval;
141: # define YYERRCODE 256
142: short yyexca[] ={
143: -1, 1,
144: 0, -1,
145: -2, 0,
146: -1, 20,
147: 1, 31,
148: -2, 205,
149: -1, 24,
150: 1, 35,
151: -2, 205,
152: -1, 148,
153: 1, 221,
154: -2, 170,
155: -1, 166,
156: 77, 242,
157: -2, 170,
158: -1, 219,
159: 76, 156,
160: -2, 123,
161: -1, 241,
162: 73, 205,
163: -2, 202,
164: -1, 268,
165: 1, 264,
166: -2, 127,
167: -1, 272,
168: 1, 273,
169: 77, 273,
170: -2, 129,
171: -1, 317,
172: 76, 157,
173: -2, 125,
174: -1, 348,
175: 1, 244,
176: 14, 244,
177: 73, 244,
178: 77, 244,
179: -2, 171,
180: -1, 409,
181: 90, 0,
182: 91, 0,
183: 92, 0,
184: 93, 0,
185: 94, 0,
186: 95, 0,
187: -2, 137,
188: -1, 428,
189: 1, 267,
190: 77, 267,
191: -2, 127,
192: -1, 430,
193: 1, 269,
194: 77, 269,
195: -2, 127,
196: -1, 432,
197: 1, 271,
198: 77, 271,
199: -2, 127,
200: -1, 480,
201: 77, 267,
202: -2, 127,
203: };
204: # define YYNPROD 278
205: # define YYLAST 1345
206: short yyact[]={
207:
208: 233, 230, 447, 449, 448, 235, 389, 441, 395, 199,
209: 390, 290, 225, 347, 248, 440, 346, 187, 270, 276,
210: 105, 5, 307, 114, 459, 17, 261, 126, 240, 295,
211: 191, 198, 181, 267, 202, 195, 197, 116, 95, 326,
212: 180, 119, 208, 255, 259, 110, 324, 325, 326, 305,
213: 271, 102, 446, 96, 97, 98, 463, 445, 53, 43,
214: 487, 86, 269, 58, 101, 91, 101, 127, 44, 253,
215: 254, 255, 118, 153, 117, 153, 516, 88, 128, 129,
216: 130, 131, 101, 133, 54, 55, 56, 47, 300, 101,
217: 89, 514, 496, 299, 90, 498, 59, 85, 419, 111,
218: 81, 461, 49, 87, 462, 436, 60, 435, 122, 485,
219: 511, 84, 160, 161, 324, 325, 326, 332, 331, 330,
220: 329, 328, 434, 333, 335, 334, 337, 336, 338, 147,
221: 183, 184, 118, 292, 117, 82, 83, 182, 185, 361,
222: 426, 263, 186, 190, 416, 260, 401, 237, 438, 288,
223: 153, 439, 420, 252, 153, 419, 292, 239, 392, 211,
224: 382, 393, 387, 383, 153, 220, 212, 215, 217, 216,
225: 210, 368, 272, 272, 272, 367, 156, 157, 158, 159,
226: 153, 366, 352, 154, 155, 101, 251, 264, 205, 172,
227: 226, 236, 236, 112, 277, 278, 279, 280, 281, 109,
228: 108, 284, 285, 162, 164, 274, 275, 171, 107, 376,
229: 106, 294, 377, 265, 287, 104, 349, 293, 286, 350,
230: 266, 321, 309, 168, 322, 315, 219, 323, 490, 304,
231: 303, 399, 490, 301, 394, 218, 518, 323, 504, 503,
232: 502, 339, 497, 313, 247, 252, 500, 494, 153, 489,
233: 160, 161, 249, 153, 153, 153, 153, 153, 252, 252,
234: 310, 311, 345, 469, 246, 400, 471, 323, 101, 314,
235: 317, 418, 323, 320, 4, 272, 296, 188, 302, 101,
236: 340, 242, 238, 252, 342, 343, 222, 219, 196, 344,
237: 209, 207, 371, 163, 169, 135, 139, 319, 468, 228,
238: 170, 353, 372, 373, 374, 362, 391, 101, 363, 364,
239: 386, 323, 323, 100, 103, 323, 206, 375, 323, 221,
240: 397, 323, 115, 378, 340, 379, 479, 263, 160, 161,
241: 253, 254, 255, 256, 101, 404, 370, 148, 201, 166,
242: 29, 323, 93, 323, 323, 323, 160, 161, 324, 325,
243: 326, 153, 252, 153, 323, 6, 252, 252, 252, 252,
244: 252, 250, 245, 340, 99, 421, 153, 424, 272, 272,
245: 272, 80, 121, 226, 405, 406, 407, 408, 409, 410,
246: 411, 412, 413, 414, 79, 78, 450, 451, 425, 437,
247: 232, 103, 103, 103, 103, 77, 76, 386, 75, 165,
248: 189, 74, 192, 193, 194, 470, 323, 323, 323, 323,
249: 323, 323, 323, 323, 323, 323, 464, 473, 73, 72,
250: 466, 152, 57, 252, 192, 213, 214, 50, 252, 429,
251: 431, 433, 442, 476, 224, 475, 272, 272, 272, 231,
252: 241, 477, 243, 323, 48, 465, 46, 450, 451, 486,
253: 236, 478, 472, 425, 488, 484, 45, 42, 509, 481,
254: 482, 483, 31, 151, 327, 151, 323, 318, 316, 491,
255: 268, 268, 268, 323, 492, 204, 388, 495, 493, 203,
256: 153, 103, 134, 381, 291, 380, 452, 385, 450, 451,
257: 442, 508, 507, 505, 384, 132, 297, 429, 431, 433,
258: 323, 115, 252, 308, 52, 35, 306, 323, 192, 113,
259: 512, 323, 150, 25, 150, 24, 23, 515, 323, 22,
260: 21, 20, 236, 19, 156, 157, 158, 159, 499, 341,
261: 519, 154, 155, 101, 289, 92, 506, 9, 8, 7,
262: 151, 510, 3, 2, 151, 160, 161, 253, 254, 255,
263: 200, 513, 1, 0, 151, 0, 160, 161, 253, 254,
264: 255, 256, 236, 0, 0, 517, 0, 0, 0, 0,
265: 151, 244, 200, 369, 423, 257, 0, 0, 0, 160,
266: 161, 253, 254, 255, 256, 258, 0, 0, 0, 150,
267: 192, 0, 247, 150, 0, 0, 0, 0, 160, 161,
268: 283, 282, 0, 150, 262, 0, 0, 0, 262, 0,
269: 0, 0, 341, 0, 0, 402, 360, 0, 0, 150,
270: 0, 160, 161, 253, 254, 255, 256, 160, 161, 253,
271: 254, 255, 256, 0, 0, 0, 298, 0, 151, 0,
272: 0, 200, 0, 151, 151, 151, 151, 151, 160, 161,
273: 324, 325, 326, 332, 331, 330, 329, 328, 0, 333,
274: 335, 334, 337, 336, 338, 0, 428, 430, 432, 351,
275: 0, 0, 0, 291, 355, 356, 357, 358, 359, 0,
276: 0, 453, 0, 460, 0, 0, 0, 150, 0, 308,
277: 0, 467, 150, 150, 150, 150, 150, 0, 0, 0,
278: 262, 348, 0, 262, 262, 0, 160, 161, 253, 254,
279: 255, 256, 156, 157, 158, 159, 474, 0, 0, 154,
280: 155, 101, 460, 160, 161, 324, 325, 326, 332, 0,
281: 460, 460, 460, 0, 480, 430, 432, 0, 0, 0,
282: 200, 151, 453, 151, 0, 0, 453, 160, 161, 324,
283: 325, 326, 332, 331, 330, 341, 151, 0, 333, 335,
284: 334, 337, 336, 338, 0, 0, 160, 161, 324, 325,
285: 326, 332, 422, 0, 422, 0, 454, 333, 335, 334,
286: 337, 336, 338, 453, 0, 0, 0, 427, 0, 0,
287: 150, 0, 150, 0, 0, 0, 0, 0, 0, 0,
288: 0, 262, 0, 0, 365, 150, 160, 161, 324, 325,
289: 326, 332, 331, 330, 329, 328, 0, 333, 335, 334,
290: 337, 336, 338, 444, 0, 0, 0, 200, 0, 0,
291: 0, 0, 0, 0, 0, 0, 0, 454, 417, 0,
292: 0, 454, 0, 160, 161, 324, 325, 326, 332, 331,
293: 330, 329, 328, 0, 333, 335, 334, 337, 336, 338,
294: 0, 0, 0, 0, 0, 0, 262, 0, 0, 0,
295: 151, 0, 0, 0, 415, 0, 0, 0, 454, 160,
296: 161, 324, 325, 326, 332, 331, 330, 329, 328, 0,
297: 333, 335, 334, 337, 336, 338, 0, 0, 0, 0,
298: 0, 501, 0, 0, 0, 0, 12, 0, 0, 0,
299: 0, 0, 0, 0, 0, 0, 0, 0, 0, 150,
300: 10, 53, 43, 70, 86, 14, 58, 67, 91, 36,
301: 63, 44, 40, 65, 69, 30, 64, 33, 32, 11,
302: 88, 34, 18, 39, 37, 27, 16, 54, 55, 56,
303: 47, 51, 41, 89, 61, 38, 66, 90, 28, 59,
304: 85, 13, 0, 81, 62, 49, 87, 26, 71, 60,
305: 15, 403, 0, 68, 84, 0, 160, 161, 324, 325,
306: 326, 332, 331, 330, 329, 328, 0, 333, 335, 334,
307: 337, 336, 338, 0, 0, 396, 0, 0, 82, 83,
308: 160, 161, 324, 325, 326, 332, 331, 330, 329, 328,
309: 94, 333, 335, 334, 337, 336, 338, 160, 161, 324,
310: 325, 326, 332, 331, 0, 0, 0, 0, 333, 335,
311: 334, 337, 336, 338, 0, 0, 0, 0, 0, 0,
312: 0, 120, 0, 123, 124, 125, 0, 0, 0, 0,
313: 0, 0, 0, 0, 136, 137, 0, 0, 138, 0,
314: 140, 141, 142, 0, 0, 143, 144, 145, 0, 146,
315: 156, 157, 158, 159, 0, 0, 0, 154, 155, 101,
316: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
317: 173, 174, 175, 176, 177, 178, 179, 156, 157, 158,
318: 159, 0, 0, 0, 154, 155, 101, 0, 156, 157,
319: 158, 159, 0, 0, 0, 154, 155, 101, 0, 156,
320: 157, 158, 159, 0, 0, 0, 154, 155, 101, 0,
321: 0, 0, 0, 156, 157, 158, 159, 0, 229, 223,
322: 154, 155, 101, 0, 160, 161, 227, 0, 156, 157,
323: 158, 159, 0, 0, 234, 154, 155, 101, 0, 156,
324: 157, 158, 159, 0, 0, 229, 154, 155, 101, 0,
325: 0, 160, 161, 443, 0, 0, 229, 0, 0, 0,
326: 0, 234, 160, 161, 227, 0, 0, 229, 0, 0,
327: 0, 0, 234, 160, 161, 398, 0, 156, 157, 158,
328: 159, 229, 0, 234, 154, 155, 101, 160, 161, 354,
329: 0, 156, 157, 158, 159, 0, 229, 234, 154, 155,
330: 101, 0, 160, 161, 0, 0, 0, 273, 156, 157,
331: 158, 159, 234, 160, 161, 154, 155, 101, 0, 0,
332: 0, 0, 0, 234, 156, 157, 158, 159, 458, 457,
333: 456, 154, 155, 101, 156, 157, 158, 159, 0, 0,
334: 0, 154, 155, 101, 0, 312, 0, 0, 0, 0,
335: 0, 160, 161, 0, 0, 0, 0, 0, 0, 149,
336: 0, 234, 0, 0, 0, 160, 161, 167, 0, 0,
337: 0, 0, 0, 0, 70, 0, 247, 0, 67, 0,
338: 0, 63, 160, 161, 65, 69, 0, 64, 0, 0,
339: 0, 0, 455, 0, 0, 0, 0, 0, 160, 161,
340: 0, 0, 149, 0, 0, 61, 0, 66, 160, 161,
341: 0, 0, 0, 0, 0, 62, 0, 0, 0, 71,
342: 0, 0, 0, 0, 68 };
343: short yypact[]={
344:
345: -1000, 18, 354, 902,-1000,-1000,-1000,-1000,-1000,-1000,
346: 337,-1000,-1000,-1000,-1000,-1000,-1000, 320, 293, 138,
347: 133, 131, 123, 122, 22, 116, 50,-1000,-1000,-1000,
348: -1000, 39,-1000,-1000,-1000, -14,-1000,-1000,-1000,-1000,
349: -1000,-1000, 293,-1000,-1000,-1000,-1000,-1000, 223,-1000,
350: -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
351: -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
352: -1000,-1000,1249, 220,1206, 221, 221, 220, 112,-1000,
353: -1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
354: -1000,-1000,-1000,-1000,-1000, 293, 293, 293, 293,-1000,
355: -1000,-1000, 204,-1000, 293, -10, 293, 293, 293, 215,
356: 265,-1000,-1000, 111,-1000,-1000,-1000,-1000, 302, 218,
357: -1000,-1000,-1000, 217,-1000,-1000,-1000,-1000, 50, 293,
358: 293, 215, 265,-1000, 160, 214, 313,-1000, 213,1065,
359: 1143,1143, 209, 313, 293, 208, 293,-1000,-1000, 171,
360: -1000,-1000, 548,1223,-1000,-1000,-1000,-1000,-1000,-1000,
361: -1000,-1000,-1000, 171, 68, 110,-1000,-1000, 254,1143,
362: 1154,1154,1154,-1000,-1000,-1000,-1000,-1000,-1000, 519,
363: -1000,-1000,-1000, 204, 204, 293, -14,-1000, 75, -14,
364: 22,-1000, 203,-1000,-1000,-1000, 293,-1000, 11,-1000,
365: -1000, 265,-1000, 205,1273, 50, -33, 293, 313,1143,
366: 1192,-1000, 293,-1000,-1000,-1000,-1000,-1000,1143,1143,
367: 227,-1000,1143,-1000, 147,-1000, 569, 313,-1000,1143,
368: -1000,-1000,-1000,1143,1143,-1000, 569,-1000,1143,-1000,
369: -1000, 22, 313,-1000, 627, 142,-1000,1223, 105,-1000,
370: 1128,-1000,1223,1223,1223,1223,1223, -40, 542, 62,
371: 254,-1000,-1000, 254, 254, 62, 727,-1000, 104, 98,
372: 94, 569,-1000,1154,-1000,-1000,-1000,-1000,-1000,-1000,
373: -1000,-1000, 548,-1000,-1000,-1000, 204, 203,-1000, 135,
374: -1000,-1000,-1000, 203, 293,-1000,-1000, 86,-1000,-1000,
375: 265, 85, 292,-1000,-1000,-1000, 84,-1000, 159,-1000,
376: 921, 569,1114,-1000, 569, 155, 191, 569, 69, 293,
377: 897,-1000,1103,1143,1143,1143,1143,1143,1143,1143,
378: 1143,1143,1143,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
379: 800, 67, -44, 687, 764, 198, 78,-1000,-1000,-1000,
380: 171, 500, 171, 569,-1000, -12, -40, -40, -40, 466,
381: -1000, 254, 62, 63, 62,1223,1154,1154,1154, 45,
382: 30, 28,-1000,-1000,-1000,-1000,-1000, 52,-1000,-1000,
383: 74,1092,-1000, 293, -25,1239,-1000, 265, 27,-1000,
384: -24,-1000,-1000, 293,1143, 293, 229,-1000, 189,1143,
385: 193,1143,-1000, 313,-1000, -35, -44, -44, -44, 644,
386: 668, 668, 938, 687, 267,-1000,1143,-1000, 313, 313,
387: 22,-1000, 548,-1000,-1000,-1000, 254, 249,-1000,-1000,
388: -1000,-1000,-1000,-1000,1154,1154,1154,-1000,-1000,1092,
389: -1000,-1000, 33,-1000,-1000,-1000,1239,-1000,-1000, -21,
390: 707,-1000,-1000,-1000,-1000,1143,-1000,-1000,-1000, 175,
391: 153,-1000, 292, 292,-1000, 569,-1000, 157,-1000,-1000,
392: 173,1143, 569, 15, 168, 21,-1000,1143, 172,1223,
393: 168, 166, 165, 164,-1000,1092,-1000,1239,-1000,-1000,
394: 1143,-1000,-1000,-1000,-1000, 34, 313,-1000,-1000, 569,
395: -1000, 477,-1000,-1000,-1000,-1000, 569,-1000,-1000, 14,
396: 569,1143, -1,-1000,1143, 162, 313, 569,-1000,-1000 };
397: short yypgo[]={
398:
399: 0, 552, 543, 542, 539, 538, 537, 535,1010, 38,
400: 40, 32, 17, 25, 295, 534, 11, 523, 521, 520,
401: 519, 516, 515, 513, 509, 41, 506, 27, 29, 505,
402: 504, 42, 50, 8, 30, 37, 20, 35, 496, 439,
403: 495, 36, 31, 494, 487, 2, 4, 3, 0, 1,
404: 486, 23, 22, 9, 24, 485, 483, 15, 7, 16,
405: 13, 28, 34, 479, 476, 475, 6, 10, 468, 467,
406: 299, 390, 464, 5, 421, 264, 340, 462, 458, 457,
407: 456, 446, 444, 434, 427, 12, 422, 419, 129, 418,
408: 401, 44, 399, 398, 223, 396, 33, 395, 385, 384,
409: 19, 371, 362, 14, 361, 26, 62, 18 };
410: short yyr1[]={
411:
412: 0, 1, 1, 2, 2, 2, 2, 2, 2, 2,
413: 3, 4, 4, 4, 4, 4, 4, 9, 11, 14,
414: 10, 10, 12, 12, 12, 15, 15, 16, 16, 7,
415: 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
416: 5, 17, 17, 13, 29, 30, 30, 30, 30, 30,
417: 30, 30, 30, 30, 30, 30, 27, 27, 27, 18,
418: 18, 18, 18, 35, 35, 19, 19, 20, 20, 21,
419: 21, 37, 38, 38, 22, 22, 40, 41, 44, 43,
420: 43, 45, 45, 46, 46, 46, 46, 24, 24, 51,
421: 51, 26, 26, 52, 34, 53, 53, 42, 42, 28,
422: 28, 56, 55, 55, 57, 57, 58, 58, 59, 59,
423: 60, 61, 23, 23, 62, 65, 63, 64, 64, 66,
424: 66, 67, 25, 68, 68, 69, 69, 32, 32, 32,
425: 70, 70, 70, 70, 70, 70, 70, 70, 70, 70,
426: 70, 70, 70, 70, 48, 48, 72, 72, 72, 72,
427: 72, 72, 39, 39, 39, 39, 73, 73, 47, 47,
428: 71, 71, 71, 71, 71, 71, 49, 50, 50, 50,
429: 74, 74, 75, 75, 75, 75, 75, 75, 75, 75,
430: 6, 6, 6, 6, 6, 6, 6, 77, 54, 76,
431: 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
432: 79, 80, 80, 80, 80, 36, 36, 82, 83, 83,
433: 85, 85, 84, 84, 78, 78, 8, 31, 33, 81,
434: 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
435: 86, 86, 86, 86, 87, 99, 99, 99, 89, 101,
436: 101, 101, 92, 92, 88, 88, 102, 102, 103, 103,
437: 103, 103, 104, 94, 90, 97, 93, 95, 98, 98,
438: 91, 91, 105, 105, 96, 96, 96, 107, 107, 107,
439: 107, 107, 107, 106, 106, 106, 106, 100 };
440: short yyr2[]={
441:
442: 0, 0, 3, 2, 2, 2, 3, 3, 2, 1,
443: 1, 3, 3, 4, 4, 5, 3, 0, 1, 1,
444: 0, 1, 0, 2, 3, 1, 3, 1, 1, 1,
445: 1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
446: 5, 5, 5, 2, 1, 1, 1, 1, 1, 1,
447: 1, 1, 1, 1, 1, 1, 0, 4, 6, 3,
448: 4, 5, 3, 1, 3, 3, 3, 3, 3, 3,
449: 3, 3, 1, 3, 3, 3, 0, 4, 0, 2,
450: 3, 1, 3, 1, 2, 1, 1, 1, 3, 1,
451: 1, 1, 3, 3, 2, 1, 5, 1, 3, 0,
452: 3, 0, 2, 3, 1, 3, 1, 1, 1, 3,
453: 1, 1, 3, 3, 4, 0, 2, 1, 3, 1,
454: 3, 1, 0, 0, 1, 1, 3, 1, 3, 1,
455: 1, 1, 3, 3, 3, 3, 2, 3, 3, 3,
456: 3, 3, 2, 3, 1, 1, 1, 1, 1, 1,
457: 1, 1, 1, 6, 4, 9, 0, 1, 1, 1,
458: 1, 1, 1, 1, 1, 1, 5, 1, 1, 1,
459: 1, 3, 1, 1, 3, 3, 3, 3, 2, 3,
460: 1, 6, 2, 2, 6, 2, 2, 5, 3, 4,
461: 5, 2, 1, 1, 10, 1, 3, 4, 3, 3,
462: 1, 3, 3, 7, 7, 0, 1, 3, 1, 3,
463: 1, 2, 1, 1, 1, 3, 0, 0, 0, 1,
464: 2, 2, 2, 2, 3, 4, 4, 3, 2, 3,
465: 2, 3, 1, 3, 3, 1, 1, 1, 3, 1,
466: 1, 1, 1, 1, 3, 3, 3, 3, 1, 1,
467: 2, 2, 1, 7, 3, 3, 3, 3, 4, 4,
468: 1, 3, 1, 5, 1, 1, 1, 3, 3, 3,
469: 3, 3, 3, 1, 5, 5, 5, 0 };
470: short yychk[]={
471:
472: -1000, -1, -2, -3, 256, 3, 1, -4, -5, -6,
473: 18, 37, 4, 59, 23, 68, 44, -13, 40, -17,
474: -18, -19, -20, -21, -22, -23, 65, 43, 56, -76,
475: 33, -77, 36, 35, 39, -29, 27, 42, 53, 41,
476: 30, 50, -79, 20, 29, -80, -81, 48, -82, 63,
477: -84, 49, -30, 19, 45, 46, 47, -86, 24, 57,
478: 67, 52, 62, 28, 34, 31, 54, 25, 71, 32,
479: 21, 66, -87, -89, -90, -93, -95, -97, -98, -99,
480: -101, 61, 96, 97, 72, 58, 22, 64, 38, 51,
481: 55, 26, -7, 5, -8, -9, -9, -9, -9, 44,
482: -14, 14, -11, -14, 77, -36, 77, 77, 77, 77,
483: -36, 77, 77, -24, -51, -14, -35, 84, 82, -25,
484: -8, -76, 69, -8, -8, -8, -27, 81, -25, -25,
485: -25, -25, -40, -25, -39, -14, -8, -8, -8, 73,
486: -8, -8, -8, -8, -8, -8, -8, -88, -75, 73,
487: -39, -71, -74, -48, 12, 13, 5, 6, 7, 8,
488: 79, 80, -88, 73, -88, -92, -75, 81, -94, 73,
489: -94, -88, 77, -8, -8, -8, -8, -8, -8, -8,
490: -10, -11, -10, -11, -11, -9, -25, -12, 73, -14,
491: -35, -34, -14, -14, -14, -37, 73, -41, -42, -53,
492: -39, 73, -62, -63, -65, 77, 14, 73, -31, 73,
493: -31, -34, -35, -14, -14, -37, -41, -62, 75, 73,
494: -61, 6, 73, 74, -83, -85, -32, 81, -70, 73,
495: -49, -39, -71, -48, 89, -73, -32, -73, 73, -60,
496: -61, -14, 73, -14, -74,-102, -75, 73,-103, 81,
497: -104, 15, -48, 81, 82, 83, 84, -74, -74, -91,
498: 77,-105, -39, 73, 77, -91, -32, -96, -70,-106,
499: -107, -32, -49, 73, -96, -96,-100,-100,-100,-100,
500: -100,-100, -74, 81, -12, -12, -11, -27, 74, -15,
501: -16, -14, 81, -27, -36, -28, 73, -38, -39, 82,
502: 77, -42, 73, -13, -51, 82, -26, -52, -14, -60,
503: -32, -32, 73, -34, -32, -73, -68, -32, -69, 70,
504: -32, 74, 77, -48, 81, 82, 83, -72, 88, 87,
505: 86, 85, 84, 90, 92, 91, 94, 93, 95, -60,
506: -32, -70, -32, -32, -32, -36, -59, -60, 74, 74,
507: 77, -74, 77, -32, 81, -74, -74, -74, -74, -74,
508: 74, 77, -91, -91, -91, 77, 77, 77, 77, -70,
509: -106,-107,-100,-100, -12, -28, 74, 77, -28, -34,
510: -55, -56, 74, 77, -43, -44, -53, 77, -64, -66,
511: -67, 14, 74, 77, 75, -33, 74, -33, 81, 76,
512: 74, 77, -14, 74, -85, -32, -32, -32, -32, -32,
513: -32, -32, -32, -32, -32, 74, 77, 74, 73, 77,
514: 74,-103, -74, 74,-103,-105, 77, -74, -70,-106,
515: -70,-106, -70,-106, 77, 77, 77, -16, 74, 77,
516: -57, -58, -32, 81, -39, 82, 77, -45, -46, -47,
517: -48, -49, -50, -14, -71, 73, 11, 10, 9, -54,
518: -14, 74, 77, 80, -52, -32, -54, -14, 69, 74,
519: -73, 73, -32, -60, -70, -59, -60, -36, -54, 77,
520: -70, -54, -54, -54, -57, 76, -45, 81, -47, 74,
521: 75, -66, -67, -33, 74, -73, 77, 74, 74, -32,
522: 74, -74, 74, 74, 74, -58, -32, -46, -47, -78,
523: -32, 76, -60, 74, 77, -73, 77, -32, 74, -60 };
524: short yydef[]={
525:
526: 1, -2, 0, 0, 9, 10, 2, 3, 4, 5,
527: 0, 216, 8, 17, 17, 17, 17, 0, 0, 30,
528: -2, 32, 33, 34, -2, 36, 37, 39, 122, 180,
529: 216, 0, 216, 216, 216, 56, 122, 122, 122, 122,
530: 76, 122, 0, 216, 216, 192, 193, 216, 195, 216,
531: 216, 216, 44, 200, 216, 216, 216, 219, 216, 212,
532: 213, 45, 46, 47, 48, 49, 50, 51, 52, 53,
533: 54, 55, 0, 0, 0, 0, 0, 0, 232, 216,
534: 216, 216, 216, 216, 216, 216, 235, 236, 237, 239,
535: 240, 241, 6, 29, 7, 20, 20, 0, 0, 17,
536: 122, 19, 22, 18, 0, 0, 206, 0, 0, 0,
537: 0, 206, 115, 38, 87, 89, 90, 63, 0, 0,
538: 217, 182, 183, 0, 185, 186, 43, 217, 0, 0,
539: 0, 0, 0, 115, 0, 152, 0, 191, 0, 0,
540: 156, 156, 0, 0, 0, 0, 0, 220, -2, 0,
541: 172, 173, 0, 0, 160, 161, 162, 163, 164, 165,
542: 144, 145, 222, 0, 223, 0, -2, 243, 0, 0,
543: 228, 230, 0, 277, 277, 277, 277, 277, 277, 0,
544: 11, 21, 12, 22, 22, 0, 56, 16, 0, 56,
545: 205, 62, 99, 66, 68, 70, 0, 75, 0, 97,
546: 95, 0, 113, 0, 0, 0, 0, 0, 0, 0,
547: 0, 59, 0, 65, 67, 69, 74, 112, 0, -2,
548: 0, 111, 0, 196, 0, 208, 210, 0, 127, 0,
549: 129, 130, 131, 0, 0, 198, 157, 199, 0, 201,
550: 110, -2, 0, 207, 248, 0, 170, 0, 0, 249,
551: 0, 252, 0, 0, 0, 0, 0, 178, 248, 224,
552: 0, 260, 262, 0, 0, 227, 0, 229, -2, 265,
553: 266, 0, -2, 0, 231, 233, 234, 238, 254, 256,
554: 257, 255, 277, 277, 13, 14, 22, 99, 23, 0,
555: 25, 27, 28, 99, 0, 94, 101, 0, 72, 78,
556: 0, 0, 0, 116, 88, 64, 0, 91, 0, 218,
557: 0, 218, 0, 60, 189, 0, 0, -2, 124, 0,
558: 0, 197, 0, 0, 0, 0, 0, 0, 0, 0,
559: 0, 0, 0, 146, 147, 148, 149, 150, 151, 211,
560: 0, 127, 136, 142, 0, 0, 0, 108, -2, 245,
561: 0, 0, 0, 250, 251, 174, 175, 176, 177, 179,
562: 244, 0, 226, 0, 225, 0, 0, 0, 0, 127,
563: 0, 0, 258, 259, 15, 41, 24, 0, 42, 61,
564: 0, 0, 71, 0, 0, 0, 98, 0, 0, 117,
565: 119, 121, 40, 0, 0, 0, 0, 57, 0, 156,
566: 154, 0, 190, 0, 209, 132, 133, 134, 135, -2,
567: 138, 139, 140, 141, 143, 128, 0, 187, 0, 0,
568: 205, 247, 248, 171, 246, 261, 0, 0, -2, 268,
569: -2, 270, -2, 272, 0, 0, 0, 26, 100, 0,
570: 102, 104, 107, 106, 73, 77, 0, 79, 81, 83,
571: 0, 85, 86, 158, 159, 0, 167, 168, 169, 0,
572: 152, 114, 0, 0, 92, 93, 181, 0, 184, 218,
573: 0, 156, 126, 0, 127, 0, 109, 0, 0, 0,
574: -2, 0, 0, 0, 103, 0, 80, 0, 84, 96,
575: 0, 118, 120, 58, 153, 0, 0, 166, 203, 204,
576: 263, 0, 274, 275, 276, 105, 107, 82, 83, 188,
577: 214, 156, 0, 253, 0, 0, 0, 215, 155, 194 };
578: #
579: # define YYFLAG -1000
580: # define YYERROR goto yyerrlab
581: # define YYACCEPT return(0)
582: # define YYABORT return(1)
583:
584: /* parser for yacc output */
585:
586: int yydebug = 0; /* 1 for debugging */
587: YYSTYPE yyv[YYMAXDEPTH]; /* where the values are stored */
588: int yychar = -1; /* current input token number */
589: int yynerrs = 0; /* number of errors */
590: short yyerrflag = 0; /* error recovery flag */
591:
592: yyparse() {
593:
594: short yys[YYMAXDEPTH];
595: short yyj, yym;
596: register YYSTYPE *yypvt;
597: register short yystate, *yyps, yyn;
598: register YYSTYPE *yypv;
599: register short *yyxi;
600:
601: yystate = 0;
602: yychar = -1;
603: yynerrs = 0;
604: yyerrflag = 0;
605: yyps= &yys[-1];
606: yypv= &yyv[-1];
607:
608: yystack: /* put a state and value onto the stack */
609:
610: if( yydebug ) printf( "state %d, char 0%o\n", yystate, yychar );
611: if( ++yyps> &yys[YYMAXDEPTH] ) { yyerror( "yacc stack overflow" ); return(1); }
612: *yyps = yystate;
613: ++yypv;
614: *yypv = yyval;
615:
616: yynewstate:
617:
618: yyn = yypact[yystate];
619:
620: if( yyn<= YYFLAG ) goto yydefault; /* simple state */
621:
622: if( yychar<0 ) if( (yychar=yylex())<0 ) yychar=0;
623: if( (yyn += yychar)<0 || yyn >= YYLAST ) goto yydefault;
624:
625: if( yychk[ yyn=yyact[ yyn ] ] == yychar ){ /* valid shift */
626: yychar = -1;
627: yyval = yylval;
628: yystate = yyn;
629: if( yyerrflag > 0 ) --yyerrflag;
630: goto yystack;
631: }
632:
633: yydefault:
634: /* default state action */
635:
636: if( (yyn=yydef[yystate]) == -2 ) {
637: if( yychar<0 ) if( (yychar=yylex())<0 ) yychar = 0;
638: /* look through exception table */
639:
640: for( yyxi=yyexca; (*yyxi!= (-1)) || (yyxi[1]!=yystate) ; yyxi += 2 ) ; /* VOID */
641:
642: while( *(yyxi+=2) >= 0 ){
643: if( *yyxi == yychar ) break;
644: }
645: if( (yyn = yyxi[1]) < 0 ) return(0); /* accept */
646: }
647:
648: if( yyn == 0 ){ /* error */
649: /* error ... attempt to resume parsing */
650:
651: switch( yyerrflag ){
652:
653: case 0: /* brand new error */
654:
655: yyerror( "syntax error" );
656: yyerrlab:
657: ++yynerrs;
658:
659: case 1:
660: case 2: /* incompletely recovered error ... try again */
661:
662: yyerrflag = 3;
663:
664: /* find a state where "error" is a legal shift action */
665:
666: while ( yyps >= yys ) {
667: yyn = yypact[*yyps] + YYERRCODE;
668: if( yyn>= 0 && yyn < YYLAST && yychk[yyact[yyn]] == YYERRCODE ){
669: yystate = yyact[yyn]; /* simulate a shift of "error" */
670: goto yystack;
671: }
672: yyn = yypact[*yyps];
673:
674: /* the current yyps has no shift onn "error", pop stack */
675:
676: if( yydebug ) printf( "error recovery pops state %d, uncovers %d\n", *yyps, yyps[-1] );
677: --yyps;
678: --yypv;
679: }
680:
681: /* there is no state on the stack with an error shift ... abort */
682:
683: yyabort:
684: return(1);
685:
686:
687: case 3: /* no shift yet; clobber input char */
688:
689: if( yydebug ) printf( "error recovery discards char %d\n", yychar );
690:
691: if( yychar == 0 ) goto yyabort; /* don't discard EOF, quit */
692: yychar = -1;
693: goto yynewstate; /* try again in the same state */
694:
695: }
696:
697: }
698:
699: /* reduction by production yyn */
700:
701: if( yydebug ) printf("reduce %d\n",yyn);
702: yyps -= yyr2[yyn];
703: yypvt = yypv;
704: yypv -= yyr2[yyn];
705: yyval = yypv[1];
706: yym=yyn;
707: /* consult goto table to find next state */
708: yyn = yyr1[yyn];
709: yyj = yypgo[yyn] + *yyps + 1;
710: if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]];
711: switch(yym){
712:
713: case 3:
714: # line 153 "gram.in"
715: { lastwasbranch = NO; } break;
716: case 5:
717: # line 156 "gram.in"
718: { if(yypvt[-1] && (yypvt[-1]->labelno==dorange))
719: enddo(yypvt[-1]->labelno);
720: if(lastwasbranch && thislabel==NULL)
721: error("statement cannot be reached",0,0,WARN1);
722: lastwasbranch = thiswasbranch;
723: thiswasbranch = NO;
724: } break;
725: case 6:
726: # line 164 "gram.in"
727: { doinclude( yypvt[-0] ); } break;
728: case 7:
729: # line 166 "gram.in"
730: { lastwasbranch = NO; endproc(); } break;
731: case 8:
732: # line 168 "gram.in"
733: { error("unclassifiable statement",0,0,EXECERR); flline(); } break;
734: case 9:
735: # line 170 "gram.in"
736: { flline(); needkwd = NO; inioctl = NO;
737: yyerrok; yyclearin; } break;
738: case 10:
739: # line 175 "gram.in"
740: {
741: if(yystno != 0)
742: {
743: yyval = thislabel = mklabel(yystno);
744: if( ! headerdone )
745: puthead(NULL, procclass);
746: if(thislabel->labdefined)
747: error("label %s already defined",
748: convic(thislabel->stateno),0,EXECERR);
749: else {
750: if(thislabel->blklevel!=0 && thislabel->blklevel<blklevel
751: && thislabel->labtype!=LABFORMAT)
752: error("there is a branch to label %s from outside block",
753: convic( (ftnint) (thislabel->stateno) ),0,WARN1);
754: thislabel->blklevel = blklevel;
755: thislabel->labdefined = YES;
756: if(thislabel->labtype != LABFORMAT)
757: putlabel(thislabel->labelno);
758: }
759: }
760: else yyval = thislabel = NULL;
761: } break;
762: case 11:
763: # line 200 "gram.in"
764: { startproc(yypvt[-0], CLMAIN); } break;
765: case 12:
766: # line 202 "gram.in"
767: { startproc(yypvt[-0], CLBLOCK); } break;
768: case 13:
769: # line 204 "gram.in"
770: { entrypt(CLPROC, TYSUBR, (ftnint) 0, yypvt[-1], yypvt[-0]); } break;
771: case 14:
772: # line 206 "gram.in"
773: { entrypt(CLPROC, TYUNKNOWN, (ftnint) 0, yypvt[-1], yypvt[-0]); } break;
774: case 15:
775: # line 208 "gram.in"
776: { entrypt(CLPROC, yypvt[-4], varleng, yypvt[-1], yypvt[-0]); } break;
777: case 16:
778: # line 210 "gram.in"
779: { if(parstate==OUTSIDE || procclass==CLMAIN
780: || procclass==CLBLOCK)
781: error("misplaced entry statement", 0,0,EXECERR);
782: entrypt(CLENTRY, 0, (ftnint) 0, yypvt[-1], yypvt[-0]);
783: } break;
784: case 17:
785: # line 218 "gram.in"
786: { newproc(); } break;
787: case 18:
788: # line 222 "gram.in"
789: { yyval = newentry(yypvt[-0]); } break;
790: case 19:
791: # line 226 "gram.in"
792: { yyval = mkname(toklen, token); } break;
793: case 20:
794: # line 229 "gram.in"
795: { yyval = NULL; } break;
796: case 22:
797: # line 234 "gram.in"
798: { yyval = 0; } break;
799: case 23:
800: # line 236 "gram.in"
801: { yyval = 0; } break;
802: case 24:
803: # line 238 "gram.in"
804: {yyval = yypvt[-1]; } break;
805: case 25:
806: # line 242 "gram.in"
807: { yyval = (yypvt[-0] ? mkchain(yypvt[-0],0) : 0 ); } break;
808: case 26:
809: # line 244 "gram.in"
810: { if(yypvt[-0]) yypvt[-2] = yyval = hookup(yypvt[-2], mkchain(yypvt[-0],0)); } break;
811: case 27:
812: # line 248 "gram.in"
813: { yypvt[-0]->vstg = STGARG; } break;
814: case 28:
815: # line 250 "gram.in"
816: { yyval = 0; substars = YES; } break;
817: case 29:
818: # line 256 "gram.in"
819: {
820: char *s;
821: s = copyn(toklen+1, token);
822: s[toklen] = '\0';
823: yyval = s;
824: } break;
825: case 37:
826: # line 271 "gram.in"
827: { saveall = YES; } break;
828: case 39:
829: # line 274 "gram.in"
830: { fmtstmt(thislabel); setfmt(thislabel); } break;
831: case 41:
832: # line 279 "gram.in"
833: { settype(yypvt[-3], yypvt[-4], yypvt[-1]);
834: if(ndim>0) setbound(yypvt[-3],ndim,dims);
835: } break;
836: case 42:
837: # line 283 "gram.in"
838: { settype(yypvt[-2], yypvt[-4], yypvt[-1]);
839: if(ndim>0) setbound(yypvt[-2],ndim,dims);
840: } break;
841: case 43:
842: # line 289 "gram.in"
843: { varleng = yypvt[-0]; } break;
844: case 44:
845: # line 293 "gram.in"
846: { varleng = (yypvt[-0]<0 || yypvt[-0]==TYLONG ? 0 : typesize[yypvt[-0]]); } break;
847: case 45:
848: # line 296 "gram.in"
849: { yyval = TYLONG; } break;
850: case 46:
851: # line 297 "gram.in"
852: { yyval = TYREAL; } break;
853: case 47:
854: # line 298 "gram.in"
855: { yyval = TYCOMPLEX; } break;
856: case 48:
857: # line 299 "gram.in"
858: { yyval = TYDREAL; } break;
859: case 49:
860: # line 300 "gram.in"
861: { yyval = TYDCOMPLEX; } break;
862: case 50:
863: # line 301 "gram.in"
864: { yyval = TYLOGICAL; } break;
865: case 51:
866: # line 302 "gram.in"
867: { yyval = TYCHAR; } break;
868: case 52:
869: # line 303 "gram.in"
870: { yyval = TYUNKNOWN; } break;
871: case 53:
872: # line 304 "gram.in"
873: { yyval = TYUNKNOWN; } break;
874: case 54:
875: # line 305 "gram.in"
876: { yyval = - STGAUTO; } break;
877: case 55:
878: # line 306 "gram.in"
879: { yyval = - STGBSS; } break;
880: case 56:
881: # line 310 "gram.in"
882: { yyval = varleng; } break;
883: case 57:
884: # line 312 "gram.in"
885: {
886: if( ! ISICON(yypvt[-1]) )
887: {
888: yyval = 0;
889: error("length must be an integer constant", 0, 0, DCLERR);
890: }
891: else yyval = yypvt[-1]->const.ci;
892: } break;
893: case 58:
894: # line 321 "gram.in"
895: { yyval = 0; } break;
896: case 59:
897: # line 325 "gram.in"
898: { incomm( yyval = comblock(0, 0) , yypvt[-0] ); } break;
899: case 60:
900: # line 327 "gram.in"
901: { yyval = yypvt[-1]; incomm(yypvt[-1], yypvt[-0]); } break;
902: case 61:
903: # line 329 "gram.in"
904: { yyval = yypvt[-2]; incomm(yypvt[-2], yypvt[-0]); } break;
905: case 62:
906: # line 331 "gram.in"
907: { incomm(yypvt[-2], yypvt[-0]); } break;
908: case 63:
909: # line 335 "gram.in"
910: { yyval = comblock(0, 0); } break;
911: case 64:
912: # line 337 "gram.in"
913: { yyval = comblock(toklen, token); } break;
914: case 65:
915: # line 341 "gram.in"
916: { setext(yypvt[-0]); } break;
917: case 66:
918: # line 343 "gram.in"
919: { setext(yypvt[-0]); } break;
920: case 67:
921: # line 347 "gram.in"
922: { setintr(yypvt[-0]); } break;
923: case 68:
924: # line 349 "gram.in"
925: { setintr(yypvt[-0]); } break;
926: case 71:
927: # line 357 "gram.in"
928: {
929: struct equivblock *p;
930: if(nequiv >= MAXEQUIV)
931: error("too many equivalences",0,0,FATAL);
932: p = & eqvclass[nequiv++];
933: p->eqvinit = 0;
934: p->eqvbottom = 0;
935: p->eqvtop = 0;
936: p->equivs = yypvt[-1];
937: } break;
938: case 72:
939: # line 370 "gram.in"
940: { yyval = ALLOC(eqvchain); yyval->eqvitem = yypvt[-0]; } break;
941: case 73:
942: # line 372 "gram.in"
943: { yyval = ALLOC(eqvchain); yyval->eqvitem = yypvt[-0]; yyval->nextp = yypvt[-2]; } break;
944: case 76:
945: # line 380 "gram.in"
946: { if(parstate == OUTSIDE)
947: {
948: newproc();
949: startproc(0, CLMAIN);
950: }
951: if(parstate < INDATA)
952: {
953: enddcl();
954: parstate = INDATA;
955: }
956: } break;
957: case 77:
958: # line 394 "gram.in"
959: { ftnint junk;
960: if(nextdata(&junk,&junk) != NULL)
961: {
962: error("too few initializers",0,0,ERR);
963: curdtp = NULL;
964: }
965: frdata(yypvt[-3]);
966: frrpl();
967: } break;
968: case 78:
969: # line 405 "gram.in"
970: { toomanyinit = NO; } break;
971: case 81:
972: # line 410 "gram.in"
973: { dataval(NULL, yypvt[-0]); } break;
974: case 82:
975: # line 412 "gram.in"
976: { dataval(yypvt[-2], yypvt[-0]); } break;
977: case 84:
978: # line 417 "gram.in"
979: { if( yypvt[-1]==OPMINUS && ISCONST(yypvt[-0]) )
980: consnegop(yypvt[-0]);
981: yyval = yypvt[-0];
982: } break;
983: case 89:
984: # line 430 "gram.in"
985: { int k;
986: yypvt[-0]->vsave = 1;
987: k = yypvt[-0]->vstg;
988: if( ! ONEOF(k, M(STGUNKNOWN)|M(STGBSS)|M(STGINIT)) )
989: error("can only save static variables", yypvt[-0], 0, DCLERR);
990: } break;
991: case 90:
992: # line 437 "gram.in"
993: { yypvt[-0]->extsave = 1; } break;
994: case 93:
995: # line 445 "gram.in"
996: { if(yypvt[-2]->vclass == CLUNKNOWN)
997: { yypvt[-2]->vclass = CLPARAM;
998: yypvt[-2]->paramval = yypvt[-0];
999: }
1000: else error("cannot make %s parameter", yypvt[-2], 0, DCLERR);
1001: } break;
1002: case 94:
1003: # line 454 "gram.in"
1004: { if(ndim>0) setbounds(yypvt[-1], ndim, dims); } break;
1005: case 95:
1006: # line 458 "gram.in"
1007: { ptr np;
1008: vardcl(np = yypvt[-0]->namep);
1009: if(np->vstg == STGBSS)
1010: np->vstg = STGINIT;
1011: else if(np->vstg == STGCOMMON)
1012: extsymtab[np->vardesc.varno].extinit = YES;
1013: else if(np->vstg==STGEQUIV)
1014: eqvclass[np->vardesc.varno].eqvinit = YES;
1015: else if(np->vstg != STGINIT)
1016: error("inconsistent storage classes", np, 0, DCLERR);
1017: yyval = mkchain(yypvt[-0], 0);
1018: } break;
1019: case 96:
1020: # line 471 "gram.in"
1021: { chainp p; struct impldoblock *q;
1022: q = ALLOC(impldoblock);
1023: q->tag = TIMPLDO;
1024: q->varnp = yypvt[-1]->datap;
1025: p = yypvt[-1]->nextp;
1026: if(p) { q->implb = p->datap; p = p->nextp; }
1027: if(p) { q->impub = p->datap; p = p->nextp; }
1028: if(p) { q->impstep = p->datap; p = p->nextp; }
1029: frchain( & (yypvt[-1]) );
1030: yyval = mkchain(q, 0);
1031: q->datalist = hookup(yypvt[-3], yyval);
1032: } break;
1033: case 97:
1034: # line 486 "gram.in"
1035: { curdtp = yypvt[-0]; curdtelt = 0; } break;
1036: case 98:
1037: # line 488 "gram.in"
1038: { yyval = hookup(yypvt[-2], yypvt[-0]); } break;
1039: case 99:
1040: # line 492 "gram.in"
1041: { ndim = 0; } break;
1042: case 101:
1043: # line 496 "gram.in"
1044: { ndim = 0; } break;
1045: case 104:
1046: # line 501 "gram.in"
1047: { dims[ndim].lb = 0;
1048: dims[ndim].ub = yypvt[-0];
1049: ++ndim;
1050: } break;
1051: case 105:
1052: # line 506 "gram.in"
1053: { dims[ndim].lb = yypvt[-2];
1054: dims[ndim].ub = yypvt[-0];
1055: ++ndim;
1056: } break;
1057: case 106:
1058: # line 513 "gram.in"
1059: { yyval = 0; } break;
1060: case 108:
1061: # line 518 "gram.in"
1062: { nstars = 1; labarray[0] = yypvt[-0]; } break;
1063: case 109:
1064: # line 520 "gram.in"
1065: { if(nstars < MAXLABLIST) labarray[nstars++] = yypvt[-0]; } break;
1066: case 110:
1067: # line 524 "gram.in"
1068: { if(yypvt[-0]->labinacc)
1069: error("illegal branch to inner block, statement %s",
1070: convic( (ftnint) (yypvt[-0]->stateno) ),0,WARN1);
1071: else if(yypvt[-0]->labdefined == NO)
1072: yypvt[-0]->blklevel = blklevel;
1073: yypvt[-0]->labused = YES;
1074: } break;
1075: case 111:
1076: # line 534 "gram.in"
1077: { yyval = mklabel( convci(toklen, token) ); } break;
1078: case 115:
1079: # line 544 "gram.in"
1080: { needkwd = 1; } break;
1081: case 116:
1082: # line 545 "gram.in"
1083: { vartype = yypvt[-0]; } break;
1084: case 119:
1085: # line 553 "gram.in"
1086: { setimpl(vartype, varleng, yypvt[-0], yypvt[-0]); } break;
1087: case 120:
1088: # line 555 "gram.in"
1089: { setimpl(vartype, varleng, yypvt[-2], yypvt[-0]); } break;
1090: case 121:
1091: # line 559 "gram.in"
1092: { if(toklen!=1 || token[0]<'a' || token[0]>'z')
1093: {
1094: error("implicit item must be single letter", 0, 0, DCLERR);
1095: yyval = 0;
1096: }
1097: else yyval = token[0];
1098: } break;
1099: case 122:
1100: # line 569 "gram.in"
1101: { switch(parstate)
1102: {
1103: case OUTSIDE: newproc();
1104: startproc(0, CLMAIN);
1105: case INSIDE: parstate = INDCL;
1106: case INDCL: break;
1107:
1108: default:
1109: error("declaration among executables", 0, 0, DCLERR);
1110: }
1111: } break;
1112: case 123:
1113: # line 582 "gram.in"
1114: { yyval = 0; } break;
1115: case 125:
1116: # line 587 "gram.in"
1117: { yyval = mkchain(yypvt[-0], 0); } break;
1118: case 126:
1119: # line 589 "gram.in"
1120: { yyval = hookup(yypvt[-2], mkchain(yypvt[-0],0) ); } break;
1121: case 128:
1122: # line 594 "gram.in"
1123: { yyval = yypvt[-1]; } break;
1124: case 132:
1125: # line 601 "gram.in"
1126: { yyval = mkexpr(yypvt[-1], yypvt[-2], yypvt[-0]); } break;
1127: case 133:
1128: # line 603 "gram.in"
1129: { yyval = mkexpr(OPSTAR, yypvt[-2], yypvt[-0]); } break;
1130: case 134:
1131: # line 605 "gram.in"
1132: { yyval = mkexpr(OPSLASH, yypvt[-2], yypvt[-0]); } break;
1133: case 135:
1134: # line 607 "gram.in"
1135: { yyval = mkexpr(OPPOWER, yypvt[-2], yypvt[-0]); } break;
1136: case 136:
1137: # line 609 "gram.in"
1138: { if(yypvt[-1] == OPMINUS)
1139: yyval = mkexpr(OPNEG, yypvt[-0], 0);
1140: else yyval = yypvt[-0];
1141: } break;
1142: case 137:
1143: # line 614 "gram.in"
1144: { yyval = mkexpr(yypvt[-1], yypvt[-2], yypvt[-0]); } break;
1145: case 138:
1146: # line 616 "gram.in"
1147: { yyval = mkexpr(OPEQV, yypvt[-2],yypvt[-0]); } break;
1148: case 139:
1149: # line 618 "gram.in"
1150: { yyval = mkexpr(OPNEQV, yypvt[-2], yypvt[-0]); } break;
1151: case 140:
1152: # line 620 "gram.in"
1153: { yyval = mkexpr(OPOR, yypvt[-2], yypvt[-0]); } break;
1154: case 141:
1155: # line 622 "gram.in"
1156: { yyval = mkexpr(OPAND, yypvt[-2], yypvt[-0]); } break;
1157: case 142:
1158: # line 624 "gram.in"
1159: { yyval = mkexpr(OPNOT, yypvt[-0], 0); } break;
1160: case 143:
1161: # line 626 "gram.in"
1162: { yyval = mkexpr(OPCONCAT, yypvt[-2], yypvt[-0]); } break;
1163: case 144:
1164: # line 629 "gram.in"
1165: { yyval = OPPLUS; } break;
1166: case 145:
1167: # line 630 "gram.in"
1168: { yyval = OPMINUS; } break;
1169: case 146:
1170: # line 633 "gram.in"
1171: { yyval = OPEQ; } break;
1172: case 147:
1173: # line 634 "gram.in"
1174: { yyval = OPGT; } break;
1175: case 148:
1176: # line 635 "gram.in"
1177: { yyval = OPLT; } break;
1178: case 149:
1179: # line 636 "gram.in"
1180: { yyval = OPGE; } break;
1181: case 150:
1182: # line 637 "gram.in"
1183: { yyval = OPLE; } break;
1184: case 151:
1185: # line 638 "gram.in"
1186: { yyval = OPNE; } break;
1187: case 152:
1188: # line 642 "gram.in"
1189: { yyval = mkprim(yypvt[-0], 0, 0, 0); } break;
1190: case 153:
1191: # line 644 "gram.in"
1192: { yyval = mkprim(yypvt[-5], 0, yypvt[-3], yypvt[-1]); } break;
1193: case 154:
1194: # line 646 "gram.in"
1195: { yyval = mkprim(yypvt[-3], mklist(yypvt[-1]), 0, 0); } break;
1196: case 155:
1197: # line 648 "gram.in"
1198: { yyval = mkprim(yypvt[-8], mklist(yypvt[-6]), yypvt[-3], yypvt[-1]); } break;
1199: case 156:
1200: # line 652 "gram.in"
1201: { yyval = 0; } break;
1202: case 158:
1203: # line 657 "gram.in"
1204: { if(yypvt[-0]->vclass == CLPARAM)
1205: yyval = cpexpr(yypvt[-0]->paramval);
1206: } break;
1207: case 160:
1208: # line 663 "gram.in"
1209: { yyval = mklogcon(1); } break;
1210: case 161:
1211: # line 664 "gram.in"
1212: { yyval = mklogcon(0); } break;
1213: case 162:
1214: # line 665 "gram.in"
1215: { yyval = mkstrcon(toklen, token); } break;
1216: case 163:
1217: # line 666 "gram.in"
1218: { yyval = mkintcon( convci(toklen, token) ); } break;
1219: case 164:
1220: # line 667 "gram.in"
1221: { yyval = mkrealcon(TYREAL, convcd(toklen, token)); } break;
1222: case 165:
1223: # line 668 "gram.in"
1224: { yyval = mkrealcon(TYDREAL, convcd(toklen, token)); } break;
1225: case 166:
1226: # line 672 "gram.in"
1227: { yyval = mkcxcon(yypvt[-3],yypvt[-1]); } break;
1228: case 167:
1229: # line 676 "gram.in"
1230: { yyval = mkbitcon(4, toklen, token); } break;
1231: case 168:
1232: # line 678 "gram.in"
1233: { yyval = mkbitcon(3, toklen, token); } break;
1234: case 169:
1235: # line 680 "gram.in"
1236: { yyval = mkbitcon(1, toklen, token); } break;
1237: case 171:
1238: # line 685 "gram.in"
1239: { yyval = yypvt[-1]; } break;
1240: case 174:
1241: # line 691 "gram.in"
1242: { yyval = mkexpr(yypvt[-1], yypvt[-2], yypvt[-0]); } break;
1243: case 175:
1244: # line 693 "gram.in"
1245: { yyval = mkexpr(OPSTAR, yypvt[-2], yypvt[-0]); } break;
1246: case 176:
1247: # line 695 "gram.in"
1248: { yyval = mkexpr(OPSLASH, yypvt[-2], yypvt[-0]); } break;
1249: case 177:
1250: # line 697 "gram.in"
1251: { yyval = mkexpr(OPPOWER, yypvt[-2], yypvt[-0]); } break;
1252: case 178:
1253: # line 699 "gram.in"
1254: { if(yypvt[-1] == OPMINUS)
1255: yyval = mkexpr(OPNEG, yypvt[-0], 0);
1256: else yyval = yypvt[-0];
1257: } break;
1258: case 179:
1259: # line 704 "gram.in"
1260: { yyval = mkexpr(OPCONCAT, yypvt[-2], yypvt[-0]); } break;
1261: case 181:
1262: # line 708 "gram.in"
1263: {
1264: if(yypvt[-2]->labdefined)
1265: error("no backward DO loops",0,0,EXECERR);
1266: yypvt[-2]->blklevel = blklevel+1;
1267: exdo(yypvt[-2]->labelno, yypvt[-0]);
1268: } break;
1269: case 182:
1270: # line 715 "gram.in"
1271: { exendif(); thiswasbranch = NO; } break;
1272: case 184:
1273: # line 718 "gram.in"
1274: { exelif(yypvt[-2]); } break;
1275: case 185:
1276: # line 720 "gram.in"
1277: { exelse(); } break;
1278: case 186:
1279: # line 722 "gram.in"
1280: { exendif(); } break;
1281: case 187:
1282: # line 726 "gram.in"
1283: { exif(yypvt[-1]); } break;
1284: case 188:
1285: # line 730 "gram.in"
1286: { yyval = mkchain(yypvt[-2], yypvt[-0]); } break;
1287: case 189:
1288: # line 734 "gram.in"
1289: { exequals(yypvt[-2], yypvt[-0]); } break;
1290: case 190:
1291: # line 736 "gram.in"
1292: { exassign(yypvt[-0], yypvt[-2]); } break;
1293: case 193:
1294: # line 740 "gram.in"
1295: { inioctl = NO; } break;
1296: case 194:
1297: # line 742 "gram.in"
1298: { exarif(yypvt[-6], yypvt[-4], yypvt[-2], yypvt[-0]); thiswasbranch = YES; } break;
1299: case 195:
1300: # line 744 "gram.in"
1301: { excall(yypvt[-0], 0, 0, labarray); } break;
1302: case 196:
1303: # line 746 "gram.in"
1304: { excall(yypvt[-2], 0, 0, labarray); } break;
1305: case 197:
1306: # line 748 "gram.in"
1307: { if(nstars < MAXLABLIST)
1308: excall(yypvt[-3], mklist(yypvt[-1]), nstars, labarray);
1309: else
1310: error("too many alternate returns",0,0,ERR);
1311: } break;
1312: case 198:
1313: # line 754 "gram.in"
1314: { exreturn(yypvt[-0]); thiswasbranch = YES; } break;
1315: case 199:
1316: # line 756 "gram.in"
1317: { exstop(yypvt[-2], yypvt[-0]); thiswasbranch = yypvt[-2]; } break;
1318: case 200:
1319: # line 760 "gram.in"
1320: { if(parstate == OUTSIDE)
1321: {
1322: newproc();
1323: startproc(0, CLMAIN);
1324: }
1325: } break;
1326: case 201:
1327: # line 769 "gram.in"
1328: { exgoto(yypvt[-0]); thiswasbranch = YES; } break;
1329: case 202:
1330: # line 771 "gram.in"
1331: { exasgoto(yypvt[-0]); thiswasbranch = YES; } break;
1332: case 203:
1333: # line 773 "gram.in"
1334: { exasgoto(yypvt[-4]); thiswasbranch = YES; } break;
1335: case 204:
1336: # line 775 "gram.in"
1337: { if(nstars < MAXLABLIST)
1338: putcmgo(fixtype(yypvt[-0]), nstars, labarray);
1339: else
1340: error("computed GOTO list too long",0,0,ERR);
1341: } break;
1342: case 207:
1343: # line 787 "gram.in"
1344: { nstars = 0; yyval = yypvt[-0]; } break;
1345: case 208:
1346: # line 791 "gram.in"
1347: { yyval = (yypvt[-0] ? mkchain(yypvt[-0],0) : 0); } break;
1348: case 209:
1349: # line 793 "gram.in"
1350: { if(yypvt[-0])
1351: if(yypvt[-2]) yyval = hookup(yypvt[-2], mkchain(yypvt[-0],0));
1352: else yyval = mkchain(yypvt[-0],0);
1353: } break;
1354: case 211:
1355: # line 801 "gram.in"
1356: { if(nstars<MAXLABLIST) labarray[nstars++] = yypvt[-0]; yyval = 0; } break;
1357: case 212:
1358: # line 805 "gram.in"
1359: { yyval = 0; } break;
1360: case 213:
1361: # line 807 "gram.in"
1362: { yyval = 1; } break;
1363: case 214:
1364: # line 811 "gram.in"
1365: { yyval = mkchain(yypvt[-0], 0); } break;
1366: case 215:
1367: # line 813 "gram.in"
1368: { yyval = hookup(yypvt[-2], mkchain(yypvt[-0],0) ); } break;
1369: case 216:
1370: # line 817 "gram.in"
1371: { if(parstate == OUTSIDE)
1372: {
1373: newproc();
1374: startproc(0, CLMAIN);
1375: }
1376: if(parstate < INDATA) enddcl();
1377: } break;
1378: case 217:
1379: # line 827 "gram.in"
1380: { intonly = YES; } break;
1381: case 218:
1382: # line 831 "gram.in"
1383: { intonly = NO; } break;
1384: case 219:
1385: # line 836 "gram.in"
1386: { endio(); } break;
1387: case 221:
1388: # line 841 "gram.in"
1389: { ioclause(IOSUNIT, yypvt[-0]); endioctl(); } break;
1390: case 223:
1391: # line 844 "gram.in"
1392: { doio(NULL); } break;
1393: case 224:
1394: # line 846 "gram.in"
1395: { doio(yypvt[-0]); } break;
1396: case 225:
1397: # line 848 "gram.in"
1398: { doio(yypvt[-0]); } break;
1399: case 226:
1400: # line 850 "gram.in"
1401: { doio(yypvt[-0]); } break;
1402: case 227:
1403: # line 852 "gram.in"
1404: { doio(yypvt[-0]); } break;
1405: case 228:
1406: # line 854 "gram.in"
1407: { doio(NULL); } break;
1408: case 229:
1409: # line 856 "gram.in"
1410: { doio(yypvt[-0]); } break;
1411: case 230:
1412: # line 858 "gram.in"
1413: { doio(NULL); } break;
1414: case 231:
1415: # line 860 "gram.in"
1416: { doio(yypvt[-0]); } break;
1417: case 232:
1418: # line 862 "gram.in"
1419: { doio(NULL); } break;
1420: case 233:
1421: # line 864 "gram.in"
1422: { doio(yypvt[-0]); } break;
1423: case 235:
1424: # line 871 "gram.in"
1425: { iostmt = IOBACKSPACE; } break;
1426: case 236:
1427: # line 873 "gram.in"
1428: { iostmt = IOREWIND; } break;
1429: case 237:
1430: # line 875 "gram.in"
1431: { iostmt = IOENDFILE; } break;
1432: case 239:
1433: # line 882 "gram.in"
1434: { iostmt = IOINQUIRE; } break;
1435: case 240:
1436: # line 884 "gram.in"
1437: { iostmt = IOOPEN; } break;
1438: case 241:
1439: # line 886 "gram.in"
1440: { iostmt = IOCLOSE; } break;
1441: case 242:
1442: # line 890 "gram.in"
1443: {
1444: ioclause(IOSUNIT, NULL);
1445: ioclause(IOSFMT, yypvt[-0]);
1446: endioctl();
1447: } break;
1448: case 243:
1449: # line 896 "gram.in"
1450: {
1451: ioclause(IOSUNIT, NULL);
1452: ioclause(IOSFMT, NULL);
1453: endioctl();
1454: } break;
1455: case 244:
1456: # line 904 "gram.in"
1457: { ioclause(IOSUNIT, yypvt[-1]); endioctl(); } break;
1458: case 245:
1459: # line 906 "gram.in"
1460: { endioctl(); } break;
1461: case 248:
1462: # line 914 "gram.in"
1463: { ioclause(IOSPOSITIONAL, yypvt[-0]); } break;
1464: case 249:
1465: # line 916 "gram.in"
1466: { ioclause(IOSPOSITIONAL, NULL); } break;
1467: case 250:
1468: # line 918 "gram.in"
1469: { ioclause(yypvt[-1], yypvt[-0]); } break;
1470: case 251:
1471: # line 920 "gram.in"
1472: { ioclause(yypvt[-1], NULL); } break;
1473: case 252:
1474: # line 924 "gram.in"
1475: { yyval = iocname(); } break;
1476: case 253:
1477: # line 928 "gram.in"
1478: { /* E-D */
1479: iosetecdc( yypvt[-5] ); /* E-D */
1480: ioclause( IOSUNIT, yypvt[-1] ); /* E-D */
1481: ioclause( IOSFMT, yypvt[-3] ); /* E-D */
1482: endioctl(); /* E-D */
1483: } break;
1484: case 254:
1485: # line 937 "gram.in"
1486: { iostmt = IOREAD; } break;
1487: case 255:
1488: # line 941 "gram.in"
1489: { iostmt = IOWRITE; } break;
1490: case 256:
1491: # line 945 "gram.in"
1492: { iostmt = IOREAD; } break;
1493: case 257:
1494: # line 949 "gram.in"
1495: { iostmt = IOWRITE; } break;
1496: case 258:
1497: # line 953 "gram.in"
1498: {
1499: iostmt = IOWRITE;
1500: ioclause(IOSUNIT, NULL);
1501: ioclause(IOSFMT, yypvt[-1]);
1502: endioctl();
1503: } break;
1504: case 259:
1505: # line 960 "gram.in"
1506: {
1507: iostmt = IOWRITE;
1508: ioclause(IOSUNIT, NULL);
1509: ioclause(IOSFMT, NULL);
1510: endioctl();
1511: } break;
1512: case 260:
1513: # line 969 "gram.in"
1514: { yyval = mkchain(yypvt[-0],0); } break;
1515: case 261:
1516: # line 971 "gram.in"
1517: { yyval = hookup(yypvt[-2], mkchain(yypvt[-0],0)); } break;
1518: case 263:
1519: # line 976 "gram.in"
1520: { yyval = mkiodo(yypvt[-1],yypvt[-3]); } break;
1521: case 264:
1522: # line 980 "gram.in"
1523: { yyval = mkchain(yypvt[-0], 0); } break;
1524: case 265:
1525: # line 982 "gram.in"
1526: { yyval = mkchain(yypvt[-0], 0); } break;
1527: case 267:
1528: # line 987 "gram.in"
1529: { yyval = mkchain(yypvt[-2], mkchain(yypvt[-0], 0) ); } break;
1530: case 268:
1531: # line 989 "gram.in"
1532: { yyval = mkchain(yypvt[-2], mkchain(yypvt[-0], 0) ); } break;
1533: case 269:
1534: # line 991 "gram.in"
1535: { yyval = mkchain(yypvt[-2], mkchain(yypvt[-0], 0) ); } break;
1536: case 270:
1537: # line 993 "gram.in"
1538: { yyval = mkchain(yypvt[-2], mkchain(yypvt[-0], 0) ); } break;
1539: case 271:
1540: # line 995 "gram.in"
1541: { yyval = hookup(yypvt[-2], mkchain(yypvt[-0], 0) ); } break;
1542: case 272:
1543: # line 997 "gram.in"
1544: { yyval = hookup(yypvt[-2], mkchain(yypvt[-0], 0) ); } break;
1545: case 274:
1546: # line 1002 "gram.in"
1547: { yyval = mkiodo(yypvt[-1], mkchain(yypvt[-3], 0) ); } break;
1548: case 275:
1549: # line 1004 "gram.in"
1550: { yyval = mkiodo(yypvt[-1], mkchain(yypvt[-3], 0) ); } break;
1551: case 276:
1552: # line 1006 "gram.in"
1553: { yyval = mkiodo(yypvt[-1], yypvt[-3]); } break;
1554: case 277:
1555: # line 1010 "gram.in"
1556: { startioctl(); } break;
1557: }
1558: goto yystack; /* stack new state and value */
1559:
1560: }