groff before CVS: release 1.07
[s-roff.git] / pic / pic.cc
blobfeb583db096cc494411b6bde4c0be0d08f5c72fa
2 /* A Bison parser, made from pic.y */
4 #define YYBISON 1 /* Identify Bison output. */
6 #define LABEL 258
7 #define VARIABLE 259
8 #define NUMBER 260
9 #define TEXT 261
10 #define COMMAND_LINE 262
11 #define DELIMITED 263
12 #define ORDINAL 264
13 #define TH 265
14 #define LEFT_ARROW_HEAD 266
15 #define RIGHT_ARROW_HEAD 267
16 #define DOUBLE_ARROW_HEAD 268
17 #define LAST 269
18 #define UP 270
19 #define DOWN 271
20 #define LEFT 272
21 #define RIGHT 273
22 #define BOX 274
23 #define CIRCLE 275
24 #define ELLIPSE 276
25 #define ARC 277
26 #define LINE 278
27 #define ARROW 279
28 #define MOVE 280
29 #define SPLINE 281
30 #define HEIGHT 282
31 #define RADIUS 283
32 #define WIDTH 284
33 #define DIAMETER 285
34 #define FROM 286
35 #define TO 287
36 #define AT 288
37 #define WITH 289
38 #define BY 290
39 #define THEN 291
40 #define DOTTED 292
41 #define DASHED 293
42 #define CHOP 294
43 #define SAME 295
44 #define INVISIBLE 296
45 #define LJUST 297
46 #define RJUST 298
47 #define ABOVE 299
48 #define BELOW 300
49 #define OF 301
50 #define THE 302
51 #define WAY 303
52 #define BETWEEN 304
53 #define AND 305
54 #define HERE 306
55 #define DOT_N 307
56 #define DOT_E 308
57 #define DOT_W 309
58 #define DOT_S 310
59 #define DOT_NE 311
60 #define DOT_SE 312
61 #define DOT_NW 313
62 #define DOT_SW 314
63 #define DOT_C 315
64 #define DOT_START 316
65 #define DOT_END 317
66 #define DOT_X 318
67 #define DOT_Y 319
68 #define DOT_HT 320
69 #define DOT_WID 321
70 #define DOT_RAD 322
71 #define SIN 323
72 #define COS 324
73 #define ATAN2 325
74 #define LOG 326
75 #define EXP 327
76 #define SQRT 328
77 #define MAX 329
78 #define MIN 330
79 #define INT 331
80 #define RAND 332
81 #define COPY 333
82 #define THRU 334
83 #define TOP 335
84 #define BOTTOM 336
85 #define UPPER 337
86 #define LOWER 338
87 #define SH 339
88 #define PRINT 340
89 #define CW 341
90 #define CCW 342
91 #define FOR 343
92 #define DO 344
93 #define IF 345
94 #define ELSE 346
95 #define ANDAND 347
96 #define OROR 348
97 #define NOTEQUAL 349
98 #define EQUALEQUAL 350
99 #define LESSEQUAL 351
100 #define GREATEREQUAL 352
101 #define LEFT_CORNER 353
102 #define RIGHT_CORNER 354
103 #define CENTER 355
104 #define END 356
105 #define START 357
106 #define RESET 358
107 #define UNTIL 359
108 #define PLOT 360
109 #define THICKNESS 361
110 #define FILL 362
111 #define ALIGNED 363
112 #define SPRINTF 364
113 #define COMMAND 365
114 #define DEFINE 366
115 #define UNDEF 367
117 #line 19 "pic.y"
119 #include "pic.h"
120 #include "ptable.h"
121 #include "object.h"
123 extern int delim_flag;
124 extern void do_copy(const char *);
125 extern void copy_rest_thru(const char *, const char *);
126 extern void copy_file_thru(const char *, const char *, const char *);
127 extern void push_body(const char *);
128 extern void do_for(char *var, double from, double to,
129 int by_is_multiplicative, double by, char *body);
130 extern void do_lookahead();
132 #undef fmod
133 #undef rand
135 extern "C" {
136 double fmod(double, double);
137 int rand();
140 /* Maximum number of characters produced by printf("%g") */
141 #define GDIGITS 14
143 #ifndef __BORLANDC__
144 #define YYDEBUG 1
145 #endif /* __BORLANDC__ */
147 int yylex();
148 void yyerror(const char *);
150 void reset(const char *nm);
151 void reset_all();
153 place *lookup_label(const char *);
154 void define_label(const char *label, const place *pl);
156 direction current_direction;
157 position current_position;
159 implement_ptable(place)
161 PTABLE(place) top_table;
163 PTABLE(place) *current_table = &top_table;
164 saved_state *current_saved_state = 0;
166 object_list olist;
168 const char *ordinal_postfix(int n);
169 const char *object_type_name(object_type type);
170 char *format_number(const char *form, double n);
171 char *do_sprintf(const char *form, const double *v, int nv);
174 #line 77 "pic.y"
175 typedef union {
176 char *str;
177 int n;
178 double x;
179 struct { double x, y; } pair;
180 struct { double x; char *body; } if_data;
181 struct { char *str; const char *filename; int lineno; } lstr;
182 struct { double *v; int nv; int maxv; } dv;
183 struct { double val; int is_multiplicative; } by;
184 place pl;
185 object *obj;
186 corner crn;
187 path *pth;
188 object_spec *spec;
189 saved_state *pstate;
190 graphics_state state;
191 object_type obtype;
192 } YYSTYPE;
194 #ifndef YYLTYPE
195 typedef
196 struct yyltype
198 int timestamp;
199 int first_line;
200 int first_column;
201 int last_line;
202 int last_column;
203 char *text;
205 yyltype;
207 #define YYLTYPE yyltype
208 #endif
210 #include <stdio.h>
212 #ifndef __STDC__
213 #define const
214 #endif
218 #define YYFINAL 404
219 #define YYFLAG -32768
220 #define YYNTBASE 134
222 #define YYTRANSLATE(x) ((unsigned)(x) <= 367 ? yytranslate[x] : 179)
224 static const short yytranslate[] = { 0,
225 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
226 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
227 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
228 2, 2, 123, 2, 2, 2, 122, 2, 2, 113,
229 132, 120, 118, 115, 119, 133, 121, 2, 2, 2,
230 2, 2, 2, 2, 2, 2, 2, 127, 125, 116,
231 126, 117, 2, 2, 2, 2, 2, 2, 2, 2,
232 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
233 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
234 130, 2, 131, 124, 2, 114, 2, 2, 2, 2,
235 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
236 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
237 2, 2, 128, 2, 129, 2, 2, 2, 2, 2,
238 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
239 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
240 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
241 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
242 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
243 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
244 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
245 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
246 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
247 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
248 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
249 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
250 2, 2, 2, 2, 2, 1, 2, 3, 4, 5,
251 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
252 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
253 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
254 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
255 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
256 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
257 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
258 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
259 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
260 96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
261 106, 107, 108, 109, 110, 111, 112
264 #if YYDEBUG != 0
265 static const short yyprhs[] = { 0,
266 0, 2, 4, 8, 10, 14, 15, 17, 19, 22,
267 26, 31, 33, 35, 37, 39, 41, 44, 47, 48,
268 52, 55, 56, 57, 65, 66, 67, 74, 75, 86,
269 88, 89, 94, 96, 98, 101, 104, 108, 110, 113,
270 115, 117, 119, 120, 126, 127, 130, 132, 134, 138,
271 142, 146, 150, 154, 158, 162, 166, 169, 170, 173,
272 177, 179, 184, 189, 194, 195, 196, 203, 205, 206,
273 208, 210, 212, 214, 216, 218, 220, 222, 224, 226,
274 229, 233, 234, 239, 243, 247, 251, 255, 258, 261,
275 265, 268, 272, 275, 279, 282, 286, 290, 294, 298,
276 302, 306, 309, 312, 316, 319, 323, 326, 330, 333,
277 337, 340, 343, 346, 349, 352, 355, 358, 361, 364,
278 367, 370, 373, 377, 380, 382, 388, 389, 393, 395,
279 397, 399, 403, 407, 413, 419, 426, 428, 433, 437,
280 441, 443, 446, 449, 453, 455, 457, 459, 463, 465,
281 469, 471, 474, 477, 480, 482, 484, 486, 488, 490,
282 492, 494, 497, 499, 502, 506, 508, 510, 513, 515,
283 520, 524, 528, 531, 533, 535, 537, 539, 541, 543,
284 545, 547, 549, 551, 553, 555, 557, 559, 561, 564,
285 567, 570, 573, 575, 577, 580, 583, 586, 589, 591,
286 593, 595, 597, 599, 602, 605, 608, 611, 614, 618,
287 622, 626, 630, 634, 638, 641, 645, 650, 655, 662,
288 667, 672, 677, 684, 691, 696, 701, 705, 709, 713,
289 717, 721, 725, 729, 733, 737
292 #endif
294 static const short yyrhs[] = { 137,
295 0, 135, 0, 137, 136, 137, 0, 156, 0, 136,
296 138, 156, 0, 0, 138, 0, 125, 0, 138, 125,
297 0, 4, 126, 153, 0, 4, 127, 126, 153, 0,
298 15, 0, 16, 0, 17, 0, 18, 0, 7, 0,
299 110, 148, 0, 85, 148, 0, 0, 84, 140, 8,
300 0, 78, 6, 0, 0, 0, 78, 6, 79, 141,
301 8, 142, 152, 0, 0, 0, 78, 79, 143, 8,
302 144, 152, 0, 0, 88, 4, 126, 178, 32, 178,
303 155, 89, 145, 8, 0, 150, 0, 0, 150, 91,
304 146, 8, 0, 147, 0, 103, 0, 103, 4, 0,
305 147, 4, 0, 147, 115, 4, 0, 149, 0, 148,
306 149, 0, 178, 0, 162, 0, 164, 0, 0, 90,
307 153, 36, 151, 8, 0, 0, 104, 6, 0, 178,
308 0, 154, 0, 162, 95, 162, 0, 162, 94, 162,
309 0, 154, 92, 154, 0, 154, 92, 178, 0, 178,
310 92, 154, 0, 154, 93, 154, 0, 154, 93, 178,
311 0, 178, 93, 154, 0, 123, 154, 0, 0, 35,
312 178, 0, 35, 120, 178, 0, 160, 0, 3, 127,
313 137, 156, 0, 3, 127, 137, 165, 0, 3, 127,
314 137, 168, 0, 0, 0, 128, 157, 135, 129, 158,
315 159, 0, 139, 0, 0, 156, 0, 19, 0, 20,
316 0, 21, 0, 22, 0, 23, 0, 24, 0, 25,
317 0, 26, 0, 162, 0, 105, 178, 0, 105, 178,
318 162, 0, 0, 130, 161, 135, 131, 0, 160, 27,
319 178, 0, 160, 28, 178, 0, 160, 29, 178, 0,
320 160, 30, 178, 0, 160, 178, 0, 160, 15, 0,
321 160, 15, 178, 0, 160, 16, 0, 160, 16, 178,
322 0, 160, 18, 0, 160, 18, 178, 0, 160, 17,
323 0, 160, 17, 178, 0, 160, 31, 164, 0, 160,
324 32, 164, 0, 160, 33, 164, 0, 160, 34, 176,
325 0, 160, 35, 167, 0, 160, 36, 0, 160, 37,
326 0, 160, 37, 178, 0, 160, 38, 0, 160, 38,
327 178, 0, 160, 107, 0, 160, 107, 178, 0, 160,
328 39, 0, 160, 39, 178, 0, 160, 40, 0, 160,
329 41, 0, 160, 11, 0, 160, 12, 0, 160, 13,
330 0, 160, 86, 0, 160, 87, 0, 160, 162, 0,
331 160, 42, 0, 160, 43, 0, 160, 44, 0, 160,
332 45, 0, 160, 106, 178, 0, 160, 108, 0, 6,
333 0, 109, 113, 6, 163, 132, 0, 0, 163, 115,
334 178, 0, 165, 0, 168, 0, 167, 0, 164, 118,
335 167, 0, 164, 119, 167, 0, 113, 164, 115, 164,
336 132, 0, 178, 166, 164, 50, 164, 0, 178, 116,
337 164, 115, 164, 117, 0, 49, 0, 46, 47, 48,
338 49, 0, 178, 115, 178, 0, 113, 167, 132, 0,
339 169, 0, 169, 177, 0, 177, 169, 0, 177, 46,
340 169, 0, 51, 0, 3, 0, 172, 0, 169, 133,
341 3, 0, 9, 0, 114, 153, 10, 0, 14, 0,
342 170, 14, 0, 170, 173, 0, 171, 173, 0, 19,
343 0, 20, 0, 21, 0, 22, 0, 23, 0, 24,
344 0, 26, 0, 130, 131, 0, 6, 0, 133, 3,
345 0, 174, 133, 3, 0, 177, 0, 174, 0, 174,
346 177, 0, 175, 0, 9, 14, 173, 175, 0, 14,
347 173, 175, 0, 9, 173, 175, 0, 3, 175, 0,
348 52, 0, 53, 0, 54, 0, 55, 0, 56, 0,
349 57, 0, 58, 0, 59, 0, 60, 0, 61, 0,
350 62, 0, 80, 0, 81, 0, 17, 0, 18, 0,
351 82, 17, 0, 83, 17, 0, 82, 18, 0, 83,
352 18, 0, 98, 0, 99, 0, 82, 98, 0, 83,
353 98, 0, 82, 99, 0, 83, 99, 0, 100, 0,
354 102, 0, 101, 0, 4, 0, 5, 0, 168, 63,
355 0, 168, 64, 0, 168, 65, 0, 168, 66, 0,
356 168, 67, 0, 178, 118, 178, 0, 178, 119, 178,
357 0, 178, 120, 178, 0, 178, 121, 178, 0, 178,
358 122, 178, 0, 178, 124, 178, 0, 119, 178, 0,
359 113, 153, 132, 0, 68, 113, 153, 132, 0, 69,
360 113, 153, 132, 0, 70, 113, 153, 115, 153, 132,
361 0, 71, 113, 153, 132, 0, 72, 113, 153, 132,
362 0, 73, 113, 153, 132, 0, 74, 113, 153, 115,
363 153, 132, 0, 75, 113, 153, 115, 153, 132, 0,
364 76, 113, 153, 132, 0, 77, 113, 153, 132, 0,
365 77, 113, 132, 0, 178, 116, 178, 0, 178, 96,
366 178, 0, 178, 117, 178, 0, 178, 97, 178, 0,
367 178, 95, 178, 0, 178, 94, 178, 0, 178, 92,
368 178, 0, 178, 93, 178, 0, 123, 178, 0
371 #if YYDEBUG != 0
372 static const short yyrline[] = { 0,
373 273, 275, 283, 288, 291, 295, 297, 300, 302, 305,
374 311, 323, 325, 327, 329, 331, 336, 341, 346, 349,
375 354, 361, 364, 366, 374, 377, 379, 386, 389, 395,
376 403, 406, 417, 418, 422, 425, 427, 431, 434, 452,
377 460, 462, 470, 474, 477, 480, 484, 487, 491, 498,
378 504, 506, 508, 510, 512, 514, 516, 521, 524, 526,
379 530, 545, 547, 555, 561, 567, 574, 577, 585, 588,
380 592, 597, 601, 605, 610, 617, 624, 631, 638, 643,
381 648, 655, 670, 682, 688, 694, 700, 706, 725, 732,
382 739, 746, 753, 760, 767, 774, 781, 788, 803, 815,
383 821, 828, 840, 846, 852, 858, 864, 869, 875, 891,
384 908, 913, 918, 923, 928, 933, 938, 943, 950, 959,
385 968, 977, 986, 992, 999, 1004, 1014, 1021, 1042, 1045,
386 1053, 1056, 1061, 1066, 1071, 1076, 1083, 1085, 1088, 1091,
387 1095, 1098, 1104, 1110, 1116, 1124, 1135, 1139, 1147, 1150,
388 1157, 1160, 1164, 1179, 1195, 1198, 1200, 1202, 1204, 1206,
389 1208, 1210, 1212, 1216, 1221, 1228, 1236, 1240, 1247, 1253,
390 1259, 1265, 1271, 1279, 1282, 1284, 1286, 1288, 1290, 1292,
391 1294, 1296, 1298, 1300, 1302, 1304, 1306, 1308, 1310, 1312,
392 1314, 1316, 1318, 1320, 1322, 1324, 1326, 1328, 1330, 1332,
393 1334, 1338, 1347, 1349, 1356, 1363, 1370, 1377, 1384, 1386,
394 1388, 1390, 1398, 1406, 1419, 1421, 1423, 1432, 1441, 1454,
395 1463, 1472, 1481, 1483, 1485, 1487, 1489, 1495, 1497, 1499,
396 1501, 1503, 1505, 1507, 1509, 1511
399 static const char * const yytname[] = { "$","error","$illegal.","LABEL","VARIABLE",
400 "NUMBER","TEXT","COMMAND_LINE","DELIMITED","ORDINAL","TH","LEFT_ARROW_HEAD",
401 "RIGHT_ARROW_HEAD","DOUBLE_ARROW_HEAD","LAST","UP","DOWN","LEFT","RIGHT","BOX",
402 "CIRCLE","ELLIPSE","ARC","LINE","ARROW","MOVE","SPLINE","HEIGHT","RADIUS","WIDTH",
403 "DIAMETER","FROM","TO","AT","WITH","BY","THEN","DOTTED","DASHED","CHOP","SAME",
404 "INVISIBLE","LJUST","RJUST","ABOVE","BELOW","OF","THE","WAY","BETWEEN","AND",
405 "HERE","DOT_N","DOT_E","DOT_W","DOT_S","DOT_NE","DOT_SE","DOT_NW","DOT_SW","DOT_C",
406 "DOT_START","DOT_END","DOT_X","DOT_Y","DOT_HT","DOT_WID","DOT_RAD","SIN","COS",
407 "ATAN2","LOG","EXP","SQRT","MAX","MIN","INT","RAND","COPY","THRU","TOP","BOTTOM",
408 "UPPER","LOWER","SH","PRINT","CW","CCW","FOR","DO","IF","ELSE","ANDAND","OROR",
409 "NOTEQUAL","EQUALEQUAL","LESSEQUAL","GREATEREQUAL","LEFT_CORNER","RIGHT_CORNER",
410 "CENTER","END","START","RESET","UNTIL","PLOT","THICKNESS","FILL","ALIGNED","SPRINTF",
411 "COMMAND","DEFINE","UNDEF","'('","'`'","','","'<'","'>'","'+'","'-'","'*'","'/'",
412 "'%'","'!'","'^'","';'","'='","':'","'{'","'}'","'['","']'","')'","'.'","top",
413 "element_list","middle_element_list","optional_separator","separator","placeless_element",
414 "@1","@2","@3","@4","@5","@6","@7","reset_variables","print_args","print_arg",
415 "simple_if","@8","until","any_expr","text_expr","optional_by","element","@9",
416 "@10","optional_element","object_spec","@11","text","sprintf_args","position",
417 "position_not_place","between","expr_pair","place","label","ordinal","optional_ordinal_last",
418 "nth_primitive","object_type","label_path","relative_path","path","corner","expr",
421 #endif
423 static const short yyr1[] = { 0,
424 134, 134, 135, 136, 136, 137, 137, 138, 138, 139,
425 139, 139, 139, 139, 139, 139, 139, 139, 140, 139,
426 139, 141, 142, 139, 143, 144, 139, 145, 139, 139,
427 146, 139, 139, 139, 147, 147, 147, 148, 148, 149,
428 149, 149, 151, 150, 152, 152, 153, 153, 154, 154,
429 154, 154, 154, 154, 154, 154, 154, 155, 155, 155,
430 156, 156, 156, 156, 157, 158, 156, 156, 159, 159,
431 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
432 160, 161, 160, 160, 160, 160, 160, 160, 160, 160,
433 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
434 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
435 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
436 160, 160, 160, 160, 162, 162, 163, 163, 164, 164,
437 165, 165, 165, 165, 165, 165, 166, 166, 167, 167,
438 168, 168, 168, 168, 168, 169, 169, 169, 170, 170,
439 171, 171, 172, 172, 173, 173, 173, 173, 173, 173,
440 173, 173, 173, 174, 174, 175, 175, 175, 176, 176,
441 176, 176, 176, 177, 177, 177, 177, 177, 177, 177,
442 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
443 177, 177, 177, 177, 177, 177, 177, 177, 177, 177,
444 177, 178, 178, 178, 178, 178, 178, 178, 178, 178,
445 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
446 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
447 178, 178, 178, 178, 178, 178
450 static const short yyr2[] = { 0,
451 1, 1, 3, 1, 3, 0, 1, 1, 2, 3,
452 4, 1, 1, 1, 1, 1, 2, 2, 0, 3,
453 2, 0, 0, 7, 0, 0, 6, 0, 10, 1,
454 0, 4, 1, 1, 2, 2, 3, 1, 2, 1,
455 1, 1, 0, 5, 0, 2, 1, 1, 3, 3,
456 3, 3, 3, 3, 3, 3, 2, 0, 2, 3,
457 1, 4, 4, 4, 0, 0, 6, 1, 0, 1,
458 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
459 3, 0, 4, 3, 3, 3, 3, 2, 2, 3,
460 2, 3, 2, 3, 2, 3, 3, 3, 3, 3,
461 3, 2, 2, 3, 2, 3, 2, 3, 2, 3,
462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463 2, 2, 3, 2, 1, 5, 0, 3, 1, 1,
464 1, 3, 3, 5, 5, 6, 1, 4, 3, 3,
465 1, 2, 2, 3, 1, 1, 1, 3, 1, 3,
466 1, 2, 2, 2, 1, 1, 1, 1, 1, 1,
467 1, 2, 1, 2, 3, 1, 1, 2, 1, 4,
468 3, 3, 2, 1, 1, 1, 1, 1, 1, 1,
469 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
470 2, 2, 1, 1, 2, 2, 2, 2, 1, 1,
471 1, 1, 1, 2, 2, 2, 2, 2, 3, 3,
472 3, 3, 3, 3, 2, 3, 4, 4, 6, 4,
473 4, 4, 6, 6, 4, 4, 3, 3, 3, 3,
474 3, 3, 3, 3, 3, 2
477 static const short yydefact[] = { 6,
478 8, 2, 1, 7, 0, 0, 125, 16, 12, 13,
479 14, 15, 71, 72, 73, 74, 75, 76, 77, 78,
480 0, 19, 0, 0, 0, 34, 0, 0, 0, 65,
481 82, 6, 68, 33, 30, 4, 61, 79, 9, 6,
482 0, 0, 21, 25, 0, 146, 202, 203, 149, 151,
483 187, 188, 145, 174, 175, 176, 177, 178, 179, 180,
484 181, 182, 183, 184, 0, 0, 0, 0, 0, 0,
485 0, 0, 0, 0, 185, 186, 0, 0, 193, 194,
486 199, 201, 200, 0, 0, 0, 0, 18, 38, 41,
487 42, 129, 131, 130, 141, 0, 0, 147, 0, 40,
488 0, 0, 0, 0, 48, 0, 0, 47, 35, 80,
489 0, 17, 6, 6, 3, 7, 36, 0, 31, 113,
490 114, 115, 89, 91, 95, 93, 0, 0, 0, 0,
491 0, 0, 0, 0, 0, 102, 103, 105, 109, 111,
492 112, 119, 120, 121, 122, 116, 117, 0, 107, 124,
493 118, 88, 0, 10, 0, 22, 0, 20, 0, 0,
494 0, 0, 0, 0, 0, 0, 0, 0, 189, 191,
495 195, 197, 190, 192, 196, 198, 0, 0, 131, 47,
496 0, 215, 236, 39, 0, 0, 204, 205, 206, 207,
497 208, 0, 142, 163, 152, 155, 156, 157, 158, 159,
498 160, 161, 0, 153, 154, 0, 143, 0, 137, 0,
499 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
500 0, 0, 0, 0, 0, 0, 57, 236, 43, 0,
501 0, 0, 0, 0, 0, 0, 81, 127, 0, 0,
502 0, 5, 37, 0, 90, 92, 96, 94, 84, 85,
503 86, 87, 97, 0, 98, 99, 0, 0, 0, 0,
504 167, 169, 100, 166, 0, 101, 0, 104, 106, 110,
505 123, 108, 146, 202, 187, 188, 62, 0, 63, 64,
506 11, 0, 26, 0, 0, 0, 0, 0, 0, 0,
507 0, 0, 227, 0, 216, 0, 140, 150, 132, 133,
508 148, 162, 144, 0, 234, 235, 233, 232, 229, 231,
509 139, 0, 228, 230, 209, 210, 211, 212, 213, 214,
510 0, 0, 0, 51, 52, 54, 55, 50, 49, 53,
511 234, 56, 235, 228, 0, 66, 83, 32, 173, 0,
512 0, 0, 164, 0, 168, 0, 47, 23, 45, 217,
513 218, 0, 220, 221, 222, 0, 0, 225, 226, 0,
514 0, 0, 0, 0, 44, 0, 126, 69, 0, 172,
515 171, 165, 45, 0, 27, 0, 0, 0, 134, 138,
516 0, 135, 58, 128, 70, 67, 170, 24, 46, 219,
517 223, 224, 136, 0, 0, 0, 59, 28, 60, 0,
518 29, 0, 0, 0
521 static const short yydefgoto[] = { 402,
522 2, 32, 240, 4, 33, 45, 282, 373, 157, 349,
523 400, 244, 34, 88, 89, 35, 323, 375, 177, 105,
524 395, 36, 113, 368, 386, 37, 114, 106, 335, 91,
525 92, 225, 93, 107, 95, 96, 97, 98, 204, 261,
526 262, 263, 99, 108
529 static const short yypact[] = { -118,
530 -32768,-32768, 640, -113, -100, -59,-32768,-32768,-32768,-32768,
531 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
532 5,-32768, 860, 28, 972, 30, 1406, -61, 860,-32768,
533 -32768, -118,-32768, 12, -34,-32768, 748,-32768,-32768, -118,
534 972, -67, -24,-32768, 71,-32768,-32768,-32768,-32768,-32768,
535 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
536 -32768,-32768,-32768,-32768, -51, -2, 11, 31, 48, 51,
537 55, 73, 91, 92,-32768,-32768, 68, 129,-32768,-32768,
538 -32768,-32768,-32768, 1084, 972, 1406, 1406, 860,-32768,-32768,
539 -36,-32768,-32768, 192, 1995, -1, 273,-32768, 67, 1987,
540 2, 972, 972, 104, -5, 4, 192, 2072,-32768, 592,
541 174, 860, -118, -118,-32768, 612,-32768, 202,-32768,-32768,
542 -32768,-32768, 1855, 1855, 1693, 1774, 1406, 1406, 1406, 1406,
543 1509, 1509, 1509, 251, 1612,-32768, 1855, 1855, 1855,-32768,
544 -32768,-32768,-32768,-32768,-32768,-32768,-32768, 1406, 1855,-32768,
545 -32768, 2105, 494,-32768, 972,-32768, 201,-32768, 972, 972,
546 972, 972, 972, 972, 972, 972, 972, 373,-32768,-32768,
547 -32768,-32768,-32768,-32768,-32768,-32768, 78, -46, 83, 2020,
548 212, 100, 100,-32768, 1612, 1612,-32768,-32768,-32768,-32768,
549 -32768, 222,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
550 -32768,-32768, 95,-32768,-32768, 34, 96, 183,-32768, 1406,
551 1406, 1406, 1406, 1406, 1406, 1406, 1509, 1406, 1406, 1406,
552 1406, 1406, 1406, 1406, 1509, 1406,-32768, 100,-32768, 972,
553 972, 27, 27, 972, 972, 1406,-32768,-32768, 108, 640,
554 110,-32768,-32768, 236, 2105, 2105, 2105, 2105, 2105, 2105,
555 2105, 2105, -36, 1987, -36, -36, 1927, 264, 273, 242,
556 1941,-32768,-32768,-32768, 1196,-32768, 2030, 2105, 2105, 2105,
557 2105, 2105, -100, -59, 53, 54,-32768, -36, 3, 153,
558 -32768, 240,-32768, 119, 135, 146, 143, 144, 150, 159,
559 176, 157,-32768, 166,-32768, 1509,-32768,-32768,-32768,-32768,
560 -32768,-32768, 96, 252, 241, 2114, 289, 289, 114, 114,
561 2105, -41, 197, 114, 142, 142, 100, 100, 100, 100,
562 -22, 556, 293,-32768, 241, 228, 2123,-32768,-32768,-32768,
563 241, 228, 2123, 114, -76,-32768,-32768,-32768,-32768, 273,
564 1927, 1927,-32768, 311,-32768, 83, 2063,-32768, 218,-32768,
565 -32768, 972,-32768,-32768,-32768, 972, 972,-32768,-32768, -72,
566 274, 1509, 1509, 1406,-32768, 1406,-32768, 640, 1927,-32768,
567 -32768,-32768, 218, 318,-32768, 193, 194, 195,-32768,-32768,
568 15, -36, 1310, 2105,-32768,-32768,-32768,-32768,-32768,-32768,
569 -32768,-32768,-32768, 1299, 239, 1406, 2105,-32768, 2105, 321,
570 -32768, 330, 344,-32768
573 static const short yypgoto[] = {-32768,
574 61,-32768, 26, 313,-32768,-32768,-32768,-32768,-32768,-32768,
575 -32768,-32768,-32768, 319, -71,-32768,-32768, -19, -10, -58,
576 -32768, -115,-32768,-32768,-32768,-32768,-32768, 7,-32768, -82,
577 203,-32768, -44, 6, -75,-32768,-32768,-32768, -88,-32768,
578 -249,-32768, -92, -23
582 #define YYLAST 2247
585 static const short yytable[] = { 100,
586 242, 178, 193, 110, 194, 100, 1, 339, 205, 38,
587 43, 39, 195, 152, 104, 117, 184, 196, 197, 198,
588 199, 200, 201, 207, 202, 3, 40, 363, 94, 90,
589 154, 101, 7, 109, 94, 90, 46, 277, 366, 179,
590 184, 264, 49, 151, 227, 185, 186, 50, 253, 255,
591 256, 111, -14, -15, 156, 367, 119, 115, 155, 379,
592 180, 159, 182, 183, 100, 153, 41, 42, 296, 46,
593 278, 185, 186, 362, 181, 49, 185, 186, 158, 228,
594 50, 185, 186, 44, 169, 170, 230, 231, 100, 94,
595 266, 370, 371, 94, 90, 185, 186, 232, 233, 245,
596 246, 247, 248, 249, 250, 251, 252, 254, 254, 254,
597 160, 267, 206, 268, 269, 270, 237, 94, 90, 387,
598 -129, -129, 38, 161, 271, 272, 118, 226, 203, 254,
599 303, 393, 185, 186, 312, 28, 94, 94, 94, 229,
600 299, 300, 321, 162, 281, 173, 174, 85, 284, 285,
601 286, 287, 288, 289, 290, 291, 292, 294, 280, 38,
602 163, 267, 267, 164, 264, 171, 172, 165, 345, 341,
603 342, 324, 326, 239, 241, 330, 332, -14, -15, 238,
604 85, -14, -15, -14, -15, 166, 305, 306, 307, 308,
605 309, 310, 311, 313, 314, 315, 316, 317, 318, 319,
606 320, 254, 322, 167, 168, 243, 325, 327, 283, 295,
607 331, 333, 334, 360, 297, 187, 188, 189, 190, 191,
608 346, 298, 94, 224, 301, 302, 175, 176, 192, 304,
609 94, 219, 220, 221, 222, 223, 336, 224, 328, 329,
610 337, 347, 208, 338, 343, 209, 38, 348, 264, 264,
611 350, 369, 385, 257, 187, 188, 189, 190, 191, 258,
612 352, 221, 222, 223, 259, 224, 351, 51, 52, 194,
613 -130, -130, 254, 356, 353, 354, 264, 340, 194, 381,
614 382, 355, 196, 197, 198, 199, 200, 201, 358, 202,
615 357, 196, 197, 198, 199, 200, 201, 359, 202, 361,
616 365, 94, 54, 55, 56, 57, 58, 59, 60, 61,
617 62, 63, 64, 372, 219, 220, 221, 222, 223, 230,
618 224, 374, 380, 389, 390, 391, 392, 398, 401, 403,
619 75, 76, 77, 78, 212, 213, 214, 215, 254, 254,
620 383, 376, 384, 404, 116, 377, 378, 112, 79, 80,
621 81, 82, 83, 388, 0, 279, 236, 218, 219, 220,
622 221, 222, 223, 0, 224, 0, 0, 94, 94, 0,
623 397, 0, 399, 0, 38, 46, 47, 48, 7, 0,
624 0, 49, 0, 260, 214, 215, 50, 0, 0, 51,
625 52, 0, 0, 203, 0, 0, 0, 0, 0, 0,
626 0, 0, 203, 0, 236, 218, 219, 220, 221, 222,
627 223, 0, 224, 0, 0, 0, 0, 0, 0, 0,
628 0, 0, 0, 53, 54, 55, 56, 57, 58, 59,
629 60, 61, 62, 63, 64, 0, 0, 0, 0, 0,
630 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
631 0, 0, 75, 76, 77, 78, 0, 0, 0, 0,
632 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
633 79, 80, 81, 82, 83, 0, 0, 0, 0, 0,
634 0, 28, 0, 0, 0, 102, 85, 0, 0, 0,
635 0, 86, 0, 0, 0, 103, 273, 274, 48, 7,
636 8, 0, 49, 0, 293, 0, 0, 50, 9, 10,
637 275, 276, 13, 14, 15, 16, 17, 18, 19, 20,
638 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
639 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
640 0, 0, 0, 0, 53, 54, 55, 56, 57, 58,
641 59, 60, 61, 62, 63, 64, 0, 0, 0, 0,
642 0, 65, 66, 67, 68, 69, 70, 71, 72, 73,
643 74, 21, 0, 75, 76, 77, 78, 22, 23, 0,
644 0, 24, 0, 25, 0, 0, 0, 364, 0, 0,
645 0, 79, 80, 81, 82, 83, 26, 7, 27, 0,
646 0, 0, 28, 29, 0, 0, 84, 85, 0, 0,
647 0, 0, 86, 0, 5, 6, 87, 7, 8, 0,
648 0, 30, 0, 31, 0, 0, 9, 10, 11, 12,
649 13, 14, 15, 16, 17, 18, 19, 20, 0, 0,
650 0, 0, 5, 6, 0, 7, 8, 210, 211, 212,
651 213, 214, 215, 0, 9, 10, 11, 12, 13, 14,
652 15, 16, 17, 18, 19, 20, 0, 0, 0, 0,
653 0, 236, 218, 219, 220, 221, 222, 223, 0, 224,
654 0, 0, 0, 210, 211, 212, 213, 214, 215, 21,
655 0, 0, 0, 0, 0, 22, 23, 0, 0, 24,
656 28, 25, 0, 0, 0, 0, 0, 236, 218, 219,
657 220, 221, 222, 223, 26, 224, 27, 21, 0, 0,
658 28, 29, 0, 22, 23, 0, 0, 24, 0, 25,
659 0, 0, 0, 0, 0, 0, 39, 0, 0, 30,
660 0, 31, 26, 0, 27, 0, 0, 0, 28, 29,
661 46, 47, 48, 7, 0, 0, 49, 0, 120, 121,
662 122, 50, 123, 124, 125, 126, 0, 30, 0, 31,
663 0, 0, 0, 0, 127, 128, 129, 130, 131, 132,
664 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
665 143, 144, 145, 0, 0, 0, 0, 0, 53, 54,
666 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
667 0, 0, 0, 0, 0, 65, 66, 67, 68, 69,
668 70, 71, 72, 73, 74, 0, 0, 75, 76, 77,
669 78, 0, 0, 146, 147, 0, 0, 0, 0, 0,
670 0, 0, 0, 0, 0, 79, 80, 81, 82, 83,
671 0, 0, 0, 148, 149, 150, 28, 0, 0, 0,
672 102, 85, 46, 47, 48, 7, 86, 0, 49, 0,
673 87, 0, 0, 50, 0, 0, 51, 52, 0, 0,
674 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
675 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
676 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
677 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
678 63, 64, 0, 0, 0, 0, 0, 65, 66, 67,
679 68, 69, 70, 71, 72, 73, 74, 0, 0, 75,
680 76, 77, 78, 0, 0, 0, 0, 0, 0, 0,
681 0, 0, 0, 0, 0, 0, 0, 79, 80, 81,
682 82, 83, 0, 0, 0, 0, 0, 0, 28, 0,
683 0, 0, 84, 85, 46, 47, 48, 7, 86, 0,
684 49, 0, 87, 0, 0, 50, 0, 0, 51, 52,
685 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
686 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
687 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
688 0, 0, 53, 54, 55, 56, 57, 58, 59, 60,
689 61, 62, 63, 64, 0, 0, 0, 0, 0, 65,
690 66, 67, 68, 69, 70, 71, 72, 73, 74, 0,
691 0, 75, 76, 77, 78, 0, 0, 0, 0, 0,
692 0, 0, 0, 0, 0, 0, 0, 0, 0, 79,
693 80, 81, 82, 83, 0, 0, 0, 0, 0, 0,
694 28, 0, 0, 0, 102, 85, 46, 47, 48, 7,
695 86, 0, 49, 0, 103, 0, 0, 50, 0, 0,
696 51, 52, 0, 0, 0, 0, 0, 0, 0, 0,
697 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
698 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
699 0, 0, 0, 0, 53, 54, 55, 56, 57, 58,
700 59, 60, 61, 62, 63, 64, 0, 0, 0, 0,
701 0, 65, 66, 67, 68, 69, 70, 71, 72, 73,
702 74, 0, 0, 75, 76, 77, 78, 0, 0, 0,
703 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
704 0, 79, 80, 81, 82, 83, 0, 0, 0, 0,
705 0, 0, 28, 0, 0, 0, 84, 85, 46, 47,
706 48, 7, 86, 0, 49, 0, 103, 0, 0, 50,
707 0, 0, 51, 52, 0, 0, 0, 0, 0, 0,
708 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
709 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
710 0, 0, 0, 0, 0, 0, 53, 54, 55, 56,
711 57, 58, 59, 60, 61, 62, 63, 64, 0, 0,
712 0, 0, 0, 65, 66, 67, 68, 69, 70, 71,
713 72, 73, 74, 0, 0, 75, 76, 77, 78, 0,
714 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
715 0, 0, 0, 79, 80, 81, 82, 83, 0, 0,
716 0, 46, 47, 48, 28, 0, 0, 49, 265, 85,
717 0, 0, 50, 0, 86, 51, 52, 0, 103, 0,
718 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
719 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
720 0, 0, 0, 0, 394, 0, 0, 0, 0, 53,
721 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
722 64, 0, 0, 0, 0, 0, 65, 66, 67, 68,
723 69, 70, 71, 72, 73, 74, 0, 0, 75, 76,
724 77, 78, 0, 0, 0, 0, 0, 0, 0, 0,
725 0, 0, 0, 0, 0, 0, 79, 80, 81, 82,
726 83, 210, 211, 212, 213, 214, 215, 0, 46, 47,
727 48, 102, 85, 0, 49, 0, 0, 86, 396, 50,
728 0, 87, 51, 52, 0, 236, 218, 219, 220, 221,
729 222, 223, 0, 224, 0, 0, 0, 0, 0, 0,
730 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
731 0, 0, 0, 0, 0, 0, 53, 54, 55, 56,
732 57, 58, 59, 60, 61, 62, 63, 64, 0, 0,
733 0, 0, 0, 65, 66, 67, 68, 69, 70, 71,
734 72, 73, 74, 0, 0, 75, 76, 77, 78, 0,
735 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
736 0, 0, 0, 79, 80, 81, 82, 83, 0, 0,
737 0, 46, 47, 48, 0, 0, 0, 49, 102, 85,
738 0, 0, 50, 0, 86, 51, 52, 0, 87, 0,
739 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
740 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
741 0, 0, 0, 0, 0, 0, 0, 0, 0, 53,
742 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
743 64, 0, 0, 0, 0, 0, 65, 66, 67, 68,
744 69, 70, 71, 72, 73, 74, 0, 0, 75, 76,
745 77, 78, 0, 0, 0, 0, 0, 0, 0, 0,
746 0, 0, 0, 0, 0, 0, 79, 80, 81, 82,
747 83, 0, 0, 0, 46, 47, 48, 0, 0, 0,
748 49, 84, 85, 0, 0, 50, 0, 86, 51, 52,
749 0, 87, 0, 0, 0, 0, 0, 0, 0, 0,
750 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
751 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
752 0, 0, 53, 54, 55, 56, 57, 58, 59, 60,
753 61, 62, 63, 64, 0, 0, 0, 0, 0, 65,
754 66, 67, 68, 69, 70, 71, 72, 73, 74, 0,
755 0, 75, 76, 77, 78, 46, 47, 48, 0, 0,
756 0, 49, 0, 0, 0, 0, 50, 0, 0, 79,
757 80, 81, 82, 83, 0, 0, 0, 0, 0, 0,
758 0, 0, 0, 0, 265, 85, 0, 0, 0, 0,
759 86, 0, 0, 0, 87, 0, 0, 0, -187, 0,
760 0, 0, 0, 53, 54, 55, 56, 57, 58, 59,
761 60, 61, 62, 63, 64, 0, 0, 0, 0, 0,
762 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
763 0, 0, 75, 76, 77, 78, 46, 47, 48, 0,
764 0, 0, 49, 0, 0, 0, 0, 50, 0, 0,
765 79, 80, 81, 82, 83, 0, 0, 0, 0, 0,
766 0, 0, 0, 0, 0, 102, 85, 0, 0, 0,
767 0, 86, 0, 0, 0, 87, 0, 0, 0, -188,
768 0, 0, 0, 0, 53, 54, 55, 56, 57, 58,
769 59, 60, 61, 62, 63, 64, 0, 0, 0, 0,
770 0, 65, 66, 67, 68, 69, 70, 71, 72, 73,
771 74, 0, 0, 75, 76, 77, 78, 46, 47, 48,
772 0, 0, 0, 49, 0, 0, 0, 0, 50, 0,
773 0, 79, 80, 81, 82, 83, 0, 0, 0, 0,
774 0, 0, 0, 0, 0, 0, 102, 85, 0, 0,
775 0, 0, 86, 0, 0, 0, 87, 0, 0, 0,
776 0, 0, 0, 0, 0, 53, 54, 55, 56, 57,
777 58, 59, 60, 61, 62, 63, 64, 0, 0, 0,
778 0, 0, 65, 66, 67, 68, 69, 70, 71, 72,
779 73, 74, 0, 0, 75, 76, 77, 78, 0, 0,
780 0, 0, 0, 51, 52, 0, 0, 0, 0, 0,
781 0, 0, 79, 80, 81, 82, 83, 51, 52, 0,
782 0, 0, 0, 0, 0, 0, 0, 102, 85, 0,
783 0, 0, 0, 86, 0, 0, 0, 87, 54, 55,
784 56, 57, 58, 59, 60, 61, 62, 63, 64, 0,
785 0, 0, 54, 55, 56, 57, 58, 59, 60, 61,
786 62, 63, 64, 0, 0, 0, 75, 76, 77, 78,
787 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
788 75, 76, 77, 78, 79, 80, 81, 82, 83, 0,
789 0, 0, 208, 0, 0, 209, 0, 0, 79, 80,
790 81, 82, 83, 0, 0, 0, 54, 55, 56, 57,
791 58, 59, 60, 61, 62, 63, 64, 0, 0, 260,
792 0, 0, 0, 0, 0, 208, 0, 0, 209, 0,
793 0, 0, 0, 344, 75, 76, 77, 78, 210, 211,
794 212, 213, 214, 215, 0, 0, 0, 0, 0, 0,
795 0, 0, 79, 80, 81, 82, 83, 0, 0, 0,
796 0, 216, 217, 218, 219, 220, 221, 222, 223, 0,
797 224, 234, 235, 212, 213, 214, 215, 0, 0, 0,
798 0, 210, 211, 212, 213, 214, 215, 192, 0, 0,
799 0, 0, 0, 0, 216, 217, 218, 219, 220, 221,
800 222, 223, 0, 224, 216, 236, 218, 219, 220, 221,
801 222, 223, 0, 224, 234, 235, 212, 213, 214, 215,
802 0, 0, 0, 234, 235, 212, 213, 214, 215, 0,
803 0, 0, 0, 0, 0, 0, 0, 216, 236, 218,
804 219, 220, 221, 222, 223, 0, 224, 236, 218, 219,
805 220, 221, 222, 223, 0, 224, 210, 211, 212, 213,
806 214, 215, 0, 0, 0, 210, 0, 212, 213, 214,
807 215, 0, 0, 0, 234, 0, 212, 213, 214, 215,
808 236, 218, 219, 220, 221, 222, 223, 0, 224, 236,
809 218, 219, 220, 221, 222, 223, 0, 224, 236, 218,
810 219, 220, 221, 222, 223, 0, 224
813 static const short yycheck[] = { 23,
814 116, 84, 95, 27, 6, 29, 125, 257, 97, 3,
815 6, 125, 14, 37, 25, 4, 88, 19, 20, 21,
816 22, 23, 24, 99, 26, 0, 127, 50, 23, 23,
817 41, 4, 6, 4, 29, 29, 3, 153, 115, 84,
818 112, 134, 9, 37, 103, 118, 119, 14, 131, 132,
819 133, 113, 0, 0, 79, 132, 91, 32, 126, 132,
820 84, 113, 86, 87, 88, 40, 126, 127, 115, 3,
821 153, 118, 119, 115, 85, 9, 118, 119, 8, 103,
822 14, 118, 119, 79, 17, 18, 92, 93, 112, 84,
823 135, 341, 342, 88, 88, 118, 119, 94, 95, 123,
824 124, 125, 126, 127, 128, 129, 130, 131, 132, 133,
825 113, 135, 46, 137, 138, 139, 110, 112, 112, 369,
826 118, 119, 116, 113, 148, 149, 115, 126, 130, 153,
827 206, 117, 118, 119, 217, 109, 131, 132, 133, 36,
828 185, 186, 225, 113, 155, 17, 18, 114, 159, 160,
829 161, 162, 163, 164, 165, 166, 167, 168, 153, 153,
830 113, 185, 186, 113, 257, 98, 99, 113, 261, 258,
831 259, 230, 231, 113, 114, 234, 235, 125, 125, 6,
832 114, 129, 129, 131, 131, 113, 210, 211, 212, 213,
833 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
834 224, 225, 226, 113, 113, 4, 230, 231, 8, 132,
835 234, 235, 236, 296, 132, 63, 64, 65, 66, 67,
836 265, 10, 217, 124, 3, 131, 98, 99, 133, 47,
837 225, 118, 119, 120, 121, 122, 129, 124, 232, 233,
838 131, 265, 46, 8, 3, 49, 240, 8, 341, 342,
839 132, 340, 368, 3, 63, 64, 65, 66, 67, 9,
840 115, 120, 121, 122, 14, 124, 132, 17, 18, 6,
841 118, 119, 296, 115, 132, 132, 369, 14, 6, 362,
842 363, 132, 19, 20, 21, 22, 23, 24, 132, 26,
843 115, 19, 20, 21, 22, 23, 24, 132, 26, 48,
844 8, 296, 52, 53, 54, 55, 56, 57, 58, 59,
845 60, 61, 62, 3, 118, 119, 120, 121, 122, 92,
846 124, 104, 49, 6, 132, 132, 132, 89, 8, 0,
847 80, 81, 82, 83, 94, 95, 96, 97, 362, 363,
848 364, 352, 366, 0, 32, 356, 357, 29, 98, 99,
849 100, 101, 102, 373, -1, 153, 116, 117, 118, 119,
850 120, 121, 122, -1, 124, -1, -1, 362, 363, -1,
851 394, -1, 396, -1, 368, 3, 4, 5, 6, -1,
852 -1, 9, -1, 133, 96, 97, 14, -1, -1, 17,
853 18, -1, -1, 130, -1, -1, -1, -1, -1, -1,
854 -1, -1, 130, -1, 116, 117, 118, 119, 120, 121,
855 122, -1, 124, -1, -1, -1, -1, -1, -1, -1,
856 -1, -1, -1, 51, 52, 53, 54, 55, 56, 57,
857 58, 59, 60, 61, 62, -1, -1, -1, -1, -1,
858 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
859 -1, -1, 80, 81, 82, 83, -1, -1, -1, -1,
860 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
861 98, 99, 100, 101, 102, -1, -1, -1, -1, -1,
862 -1, 109, -1, -1, -1, 113, 114, -1, -1, -1,
863 -1, 119, -1, -1, -1, 123, 3, 4, 5, 6,
864 7, -1, 9, -1, 132, -1, -1, 14, 15, 16,
865 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
866 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
867 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
868 -1, -1, -1, -1, 51, 52, 53, 54, 55, 56,
869 57, 58, 59, 60, 61, 62, -1, -1, -1, -1,
870 -1, 68, 69, 70, 71, 72, 73, 74, 75, 76,
871 77, 78, -1, 80, 81, 82, 83, 84, 85, -1,
872 -1, 88, -1, 90, -1, -1, -1, 32, -1, -1,
873 -1, 98, 99, 100, 101, 102, 103, 6, 105, -1,
874 -1, -1, 109, 110, -1, -1, 113, 114, -1, -1,
875 -1, -1, 119, -1, 3, 4, 123, 6, 7, -1,
876 -1, 128, -1, 130, -1, -1, 15, 16, 17, 18,
877 19, 20, 21, 22, 23, 24, 25, 26, -1, -1,
878 -1, -1, 3, 4, -1, 6, 7, 92, 93, 94,
879 95, 96, 97, -1, 15, 16, 17, 18, 19, 20,
880 21, 22, 23, 24, 25, 26, -1, -1, -1, -1,
881 -1, 116, 117, 118, 119, 120, 121, 122, -1, 124,
882 -1, -1, -1, 92, 93, 94, 95, 96, 97, 78,
883 -1, -1, -1, -1, -1, 84, 85, -1, -1, 88,
884 109, 90, -1, -1, -1, -1, -1, 116, 117, 118,
885 119, 120, 121, 122, 103, 124, 105, 78, -1, -1,
886 109, 110, -1, 84, 85, -1, -1, 88, -1, 90,
887 -1, -1, -1, -1, -1, -1, 125, -1, -1, 128,
888 -1, 130, 103, -1, 105, -1, -1, -1, 109, 110,
889 3, 4, 5, 6, -1, -1, 9, -1, 11, 12,
890 13, 14, 15, 16, 17, 18, -1, 128, -1, 130,
891 -1, -1, -1, -1, 27, 28, 29, 30, 31, 32,
892 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
893 43, 44, 45, -1, -1, -1, -1, -1, 51, 52,
894 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
895 -1, -1, -1, -1, -1, 68, 69, 70, 71, 72,
896 73, 74, 75, 76, 77, -1, -1, 80, 81, 82,
897 83, -1, -1, 86, 87, -1, -1, -1, -1, -1,
898 -1, -1, -1, -1, -1, 98, 99, 100, 101, 102,
899 -1, -1, -1, 106, 107, 108, 109, -1, -1, -1,
900 113, 114, 3, 4, 5, 6, 119, -1, 9, -1,
901 123, -1, -1, 14, -1, -1, 17, 18, -1, -1,
902 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
903 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
904 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
905 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
906 61, 62, -1, -1, -1, -1, -1, 68, 69, 70,
907 71, 72, 73, 74, 75, 76, 77, -1, -1, 80,
908 81, 82, 83, -1, -1, -1, -1, -1, -1, -1,
909 -1, -1, -1, -1, -1, -1, -1, 98, 99, 100,
910 101, 102, -1, -1, -1, -1, -1, -1, 109, -1,
911 -1, -1, 113, 114, 3, 4, 5, 6, 119, -1,
912 9, -1, 123, -1, -1, 14, -1, -1, 17, 18,
913 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
914 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
915 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
916 -1, -1, 51, 52, 53, 54, 55, 56, 57, 58,
917 59, 60, 61, 62, -1, -1, -1, -1, -1, 68,
918 69, 70, 71, 72, 73, 74, 75, 76, 77, -1,
919 -1, 80, 81, 82, 83, -1, -1, -1, -1, -1,
920 -1, -1, -1, -1, -1, -1, -1, -1, -1, 98,
921 99, 100, 101, 102, -1, -1, -1, -1, -1, -1,
922 109, -1, -1, -1, 113, 114, 3, 4, 5, 6,
923 119, -1, 9, -1, 123, -1, -1, 14, -1, -1,
924 17, 18, -1, -1, -1, -1, -1, -1, -1, -1,
925 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
926 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
927 -1, -1, -1, -1, 51, 52, 53, 54, 55, 56,
928 57, 58, 59, 60, 61, 62, -1, -1, -1, -1,
929 -1, 68, 69, 70, 71, 72, 73, 74, 75, 76,
930 77, -1, -1, 80, 81, 82, 83, -1, -1, -1,
931 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
932 -1, 98, 99, 100, 101, 102, -1, -1, -1, -1,
933 -1, -1, 109, -1, -1, -1, 113, 114, 3, 4,
934 5, 6, 119, -1, 9, -1, 123, -1, -1, 14,
935 -1, -1, 17, 18, -1, -1, -1, -1, -1, -1,
936 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
937 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
938 -1, -1, -1, -1, -1, -1, 51, 52, 53, 54,
939 55, 56, 57, 58, 59, 60, 61, 62, -1, -1,
940 -1, -1, -1, 68, 69, 70, 71, 72, 73, 74,
941 75, 76, 77, -1, -1, 80, 81, 82, 83, -1,
942 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
943 -1, -1, -1, 98, 99, 100, 101, 102, -1, -1,
944 -1, 3, 4, 5, 109, -1, -1, 9, 113, 114,
945 -1, -1, 14, -1, 119, 17, 18, -1, 123, -1,
946 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
947 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
948 -1, -1, -1, -1, 35, -1, -1, -1, -1, 51,
949 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
950 62, -1, -1, -1, -1, -1, 68, 69, 70, 71,
951 72, 73, 74, 75, 76, 77, -1, -1, 80, 81,
952 82, 83, -1, -1, -1, -1, -1, -1, -1, -1,
953 -1, -1, -1, -1, -1, -1, 98, 99, 100, 101,
954 102, 92, 93, 94, 95, 96, 97, -1, 3, 4,
955 5, 113, 114, -1, 9, -1, -1, 119, 120, 14,
956 -1, 123, 17, 18, -1, 116, 117, 118, 119, 120,
957 121, 122, -1, 124, -1, -1, -1, -1, -1, -1,
958 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
959 -1, -1, -1, -1, -1, -1, 51, 52, 53, 54,
960 55, 56, 57, 58, 59, 60, 61, 62, -1, -1,
961 -1, -1, -1, 68, 69, 70, 71, 72, 73, 74,
962 75, 76, 77, -1, -1, 80, 81, 82, 83, -1,
963 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
964 -1, -1, -1, 98, 99, 100, 101, 102, -1, -1,
965 -1, 3, 4, 5, -1, -1, -1, 9, 113, 114,
966 -1, -1, 14, -1, 119, 17, 18, -1, 123, -1,
967 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
968 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
969 -1, -1, -1, -1, -1, -1, -1, -1, -1, 51,
970 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
971 62, -1, -1, -1, -1, -1, 68, 69, 70, 71,
972 72, 73, 74, 75, 76, 77, -1, -1, 80, 81,
973 82, 83, -1, -1, -1, -1, -1, -1, -1, -1,
974 -1, -1, -1, -1, -1, -1, 98, 99, 100, 101,
975 102, -1, -1, -1, 3, 4, 5, -1, -1, -1,
976 9, 113, 114, -1, -1, 14, -1, 119, 17, 18,
977 -1, 123, -1, -1, -1, -1, -1, -1, -1, -1,
978 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
979 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
980 -1, -1, 51, 52, 53, 54, 55, 56, 57, 58,
981 59, 60, 61, 62, -1, -1, -1, -1, -1, 68,
982 69, 70, 71, 72, 73, 74, 75, 76, 77, -1,
983 -1, 80, 81, 82, 83, 3, 4, 5, -1, -1,
984 -1, 9, -1, -1, -1, -1, 14, -1, -1, 98,
985 99, 100, 101, 102, -1, -1, -1, -1, -1, -1,
986 -1, -1, -1, -1, 113, 114, -1, -1, -1, -1,
987 119, -1, -1, -1, 123, -1, -1, -1, 46, -1,
988 -1, -1, -1, 51, 52, 53, 54, 55, 56, 57,
989 58, 59, 60, 61, 62, -1, -1, -1, -1, -1,
990 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
991 -1, -1, 80, 81, 82, 83, 3, 4, 5, -1,
992 -1, -1, 9, -1, -1, -1, -1, 14, -1, -1,
993 98, 99, 100, 101, 102, -1, -1, -1, -1, -1,
994 -1, -1, -1, -1, -1, 113, 114, -1, -1, -1,
995 -1, 119, -1, -1, -1, 123, -1, -1, -1, 46,
996 -1, -1, -1, -1, 51, 52, 53, 54, 55, 56,
997 57, 58, 59, 60, 61, 62, -1, -1, -1, -1,
998 -1, 68, 69, 70, 71, 72, 73, 74, 75, 76,
999 77, -1, -1, 80, 81, 82, 83, 3, 4, 5,
1000 -1, -1, -1, 9, -1, -1, -1, -1, 14, -1,
1001 -1, 98, 99, 100, 101, 102, -1, -1, -1, -1,
1002 -1, -1, -1, -1, -1, -1, 113, 114, -1, -1,
1003 -1, -1, 119, -1, -1, -1, 123, -1, -1, -1,
1004 -1, -1, -1, -1, -1, 51, 52, 53, 54, 55,
1005 56, 57, 58, 59, 60, 61, 62, -1, -1, -1,
1006 -1, -1, 68, 69, 70, 71, 72, 73, 74, 75,
1007 76, 77, -1, -1, 80, 81, 82, 83, -1, -1,
1008 -1, -1, -1, 17, 18, -1, -1, -1, -1, -1,
1009 -1, -1, 98, 99, 100, 101, 102, 17, 18, -1,
1010 -1, -1, -1, -1, -1, -1, -1, 113, 114, -1,
1011 -1, -1, -1, 119, -1, -1, -1, 123, 52, 53,
1012 54, 55, 56, 57, 58, 59, 60, 61, 62, -1,
1013 -1, -1, 52, 53, 54, 55, 56, 57, 58, 59,
1014 60, 61, 62, -1, -1, -1, 80, 81, 82, 83,
1015 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1016 80, 81, 82, 83, 98, 99, 100, 101, 102, -1,
1017 -1, -1, 46, -1, -1, 49, -1, -1, 98, 99,
1018 100, 101, 102, -1, -1, -1, 52, 53, 54, 55,
1019 56, 57, 58, 59, 60, 61, 62, -1, -1, 133,
1020 -1, -1, -1, -1, -1, 46, -1, -1, 49, -1,
1021 -1, -1, -1, 133, 80, 81, 82, 83, 92, 93,
1022 94, 95, 96, 97, -1, -1, -1, -1, -1, -1,
1023 -1, -1, 98, 99, 100, 101, 102, -1, -1, -1,
1024 -1, 115, 116, 117, 118, 119, 120, 121, 122, -1,
1025 124, 92, 93, 94, 95, 96, 97, -1, -1, -1,
1026 -1, 92, 93, 94, 95, 96, 97, 133, -1, -1,
1027 -1, -1, -1, -1, 115, 116, 117, 118, 119, 120,
1028 121, 122, -1, 124, 115, 116, 117, 118, 119, 120,
1029 121, 122, -1, 124, 92, 93, 94, 95, 96, 97,
1030 -1, -1, -1, 92, 93, 94, 95, 96, 97, -1,
1031 -1, -1, -1, -1, -1, -1, -1, 115, 116, 117,
1032 118, 119, 120, 121, 122, -1, 124, 116, 117, 118,
1033 119, 120, 121, 122, -1, 124, 92, 93, 94, 95,
1034 96, 97, -1, -1, -1, 92, -1, 94, 95, 96,
1035 97, -1, -1, -1, 92, -1, 94, 95, 96, 97,
1036 116, 117, 118, 119, 120, 121, 122, -1, 124, 116,
1037 117, 118, 119, 120, 121, 122, -1, 124, 116, 117,
1038 118, 119, 120, 121, 122, -1, 124
1040 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
1041 #line 3 "/usr/local/lib/bison.simple"
1043 /* Skeleton output parser for bison,
1044 Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman
1046 This program is free software; you can redistribute it and/or modify
1047 it under the terms of the GNU General Public License as published by
1048 the Free Software Foundation; either version 1, or (at your option)
1049 any later version.
1051 This program is distributed in the hope that it will be useful,
1052 but WITHOUT ANY WARRANTY; without even the implied warranty of
1053 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1054 GNU General Public License for more details.
1056 You should have received a copy of the GNU General Public License
1057 along with this program; if not, write to the Free Software
1058 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
1061 #ifndef alloca
1062 #ifdef __GNUC__
1063 #define alloca __builtin_alloca
1064 #else /* not GNU C. */
1065 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc)
1066 #include <alloca.h>
1067 #else /* not sparc */
1068 #if defined (MSDOS) && !defined (__TURBOC__)
1069 #include <malloc.h>
1070 #else /* not MSDOS, or __TURBOC__ */
1071 #if defined(_AIX)
1072 #include <malloc.h>
1073 #pragma alloca
1074 #endif /* not _AIX */
1075 #endif /* not MSDOS, or __TURBOC__ */
1076 #endif /* not sparc. */
1077 #endif /* not GNU C. */
1078 #endif /* alloca not defined. */
1080 /* This is the parser code that is written into each bison parser
1081 when the %semantic_parser declaration is not specified in the grammar.
1082 It was written by Richard Stallman by simplifying the hairy parser
1083 used when %semantic_parser is specified. */
1085 /* Note: there must be only one dollar sign in this file.
1086 It is replaced by the list of actions, each action
1087 as one case of the switch. */
1089 #define yyerrok (yyerrstatus = 0)
1090 #define yyclearin (yychar = YYEMPTY)
1091 #define YYEMPTY -2
1092 #define YYEOF 0
1093 #define YYACCEPT return(0)
1094 #define YYABORT return(1)
1095 #define YYERROR goto yyerrlab1
1096 /* Like YYERROR except do call yyerror.
1097 This remains here temporarily to ease the
1098 transition to the new meaning of YYERROR, for GCC.
1099 Once GCC version 2 has supplanted version 1, this can go. */
1100 #define YYFAIL goto yyerrlab
1101 #define YYRECOVERING() (!!yyerrstatus)
1102 #define YYBACKUP(token, value) \
1103 do \
1104 if (yychar == YYEMPTY && yylen == 1) \
1105 { yychar = (token), yylval = (value); \
1106 yychar1 = YYTRANSLATE (yychar); \
1107 YYPOPSTACK; \
1108 goto yybackup; \
1110 else \
1111 { yyerror ("syntax error: cannot back up"); YYERROR; } \
1112 while (0)
1114 #define YYTERROR 1
1115 #define YYERRCODE 256
1117 #ifndef YYPURE
1118 #define YYLEX yylex()
1119 #endif
1121 #ifdef YYPURE
1122 #ifdef YYLSP_NEEDED
1123 #define YYLEX yylex(&yylval, &yylloc)
1124 #else
1125 #define YYLEX yylex(&yylval)
1126 #endif
1127 #endif
1129 /* If nonreentrant, generate the variables here */
1131 #ifndef YYPURE
1133 int yychar; /* the lookahead symbol */
1134 YYSTYPE yylval; /* the semantic value of the */
1135 /* lookahead symbol */
1137 #ifdef YYLSP_NEEDED
1138 YYLTYPE yylloc; /* location data for the lookahead */
1139 /* symbol */
1140 #endif
1142 int yynerrs; /* number of parse errors so far */
1143 #endif /* not YYPURE */
1145 #if YYDEBUG != 0
1146 int yydebug; /* nonzero means print parse trace */
1147 /* Since this is uninitialized, it does not stop multiple parsers
1148 from coexisting. */
1149 #endif
1151 /* YYINITDEPTH indicates the initial size of the parser's stacks */
1153 #ifndef YYINITDEPTH
1154 #define YYINITDEPTH 200
1155 #endif
1157 /* YYMAXDEPTH is the maximum size the stacks can grow to
1158 (effective only if the built-in stack extension method is used). */
1160 #if YYMAXDEPTH == 0
1161 #undef YYMAXDEPTH
1162 #endif
1164 #ifndef YYMAXDEPTH
1165 #define YYMAXDEPTH 10000
1166 #endif
1168 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
1169 #define __yy_bcopy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT)
1170 #else /* not GNU C or C++ */
1171 #ifndef __cplusplus
1173 /* This is the most reliable way to avoid incompatibilities
1174 in available built-in functions on various systems. */
1175 static void
1176 __yy_bcopy (from, to, count)
1177 char *from;
1178 char *to;
1179 int count;
1181 register char *f = from;
1182 register char *t = to;
1183 register int i = count;
1185 while (i-- > 0)
1186 *t++ = *f++;
1189 #else /* __cplusplus */
1191 /* This is the most reliable way to avoid incompatibilities
1192 in available built-in functions on various systems. */
1193 static void
1194 __yy_bcopy (char *from, char *to, int count)
1196 register char *f = from;
1197 register char *t = to;
1198 register int i = count;
1200 while (i-- > 0)
1201 *t++ = *f++;
1204 #endif
1205 #endif
1207 #line 169 "/usr/local/lib/bison.simple"
1209 yyparse()
1211 register int yystate;
1212 register int yyn;
1213 register short *yyssp;
1214 register YYSTYPE *yyvsp;
1215 int yyerrstatus; /* number of tokens to shift before error messages enabled */
1216 int yychar1; /* lookahead token as an internal (translated) token number */
1218 short yyssa[YYINITDEPTH]; /* the state stack */
1219 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
1221 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
1222 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
1224 #ifdef YYLSP_NEEDED
1225 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
1226 YYLTYPE *yyls = yylsa;
1227 YYLTYPE *yylsp;
1229 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
1230 #else
1231 #define YYPOPSTACK (yyvsp--, yyssp--)
1232 #endif
1234 int yystacksize = YYINITDEPTH;
1236 #ifdef YYPURE
1237 int yychar;
1238 YYSTYPE yylval;
1239 int yynerrs;
1240 #ifdef YYLSP_NEEDED
1241 YYLTYPE yylloc;
1242 #endif
1243 #endif
1245 YYSTYPE yyval; /* the variable used to return */
1246 /* semantic values from the action */
1247 /* routines */
1249 int yylen;
1251 #if YYDEBUG != 0
1252 if (yydebug)
1253 fprintf(stderr, "Starting parse\n");
1254 #endif
1256 yystate = 0;
1257 yyerrstatus = 0;
1258 yynerrs = 0;
1259 yychar = YYEMPTY; /* Cause a token to be read. */
1261 /* Initialize stack pointers.
1262 Waste one element of value and location stack
1263 so that they stay on the same level as the state stack.
1264 The wasted elements are never initialized. */
1266 yyssp = yyss - 1;
1267 yyvsp = yyvs;
1268 #ifdef YYLSP_NEEDED
1269 yylsp = yyls;
1270 #endif
1272 /* Push a new state, which is found in yystate . */
1273 /* In all cases, when you get here, the value and location stacks
1274 have just been pushed. so pushing a state here evens the stacks. */
1275 yynewstate:
1277 *++yyssp = yystate;
1279 if (yyssp >= yyss + yystacksize - 1)
1281 /* Give user a chance to reallocate the stack */
1282 /* Use copies of these so that the &'s don't force the real ones into memory. */
1283 YYSTYPE *yyvs1 = yyvs;
1284 short *yyss1 = yyss;
1285 #ifdef YYLSP_NEEDED
1286 YYLTYPE *yyls1 = yyls;
1287 #endif
1289 /* Get the current used size of the three stacks, in elements. */
1290 int size = yyssp - yyss + 1;
1292 #ifdef yyoverflow
1293 /* Each stack pointer address is followed by the size of
1294 the data in use in that stack, in bytes. */
1295 yyoverflow("parser stack overflow",
1296 &yyss1, size * sizeof (*yyssp),
1297 &yyvs1, size * sizeof (*yyvsp),
1298 #ifdef YYLSP_NEEDED
1299 &yyls1, size * sizeof (*yylsp),
1300 #endif
1301 &yystacksize);
1303 yyss = yyss1; yyvs = yyvs1;
1304 #ifdef YYLSP_NEEDED
1305 yyls = yyls1;
1306 #endif
1307 #else /* no yyoverflow */
1308 /* Extend the stack our own way. */
1309 if (yystacksize >= YYMAXDEPTH)
1311 yyerror("parser stack overflow");
1312 return 2;
1314 yystacksize *= 2;
1315 if (yystacksize > YYMAXDEPTH)
1316 yystacksize = YYMAXDEPTH;
1317 yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
1318 __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
1319 yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
1320 __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
1321 #ifdef YYLSP_NEEDED
1322 yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
1323 __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
1324 #endif
1325 #endif /* no yyoverflow */
1327 yyssp = yyss + size - 1;
1328 yyvsp = yyvs + size - 1;
1329 #ifdef YYLSP_NEEDED
1330 yylsp = yyls + size - 1;
1331 #endif
1333 #if YYDEBUG != 0
1334 if (yydebug)
1335 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
1336 #endif
1338 if (yyssp >= yyss + yystacksize - 1)
1339 YYABORT;
1342 #if YYDEBUG != 0
1343 if (yydebug)
1344 fprintf(stderr, "Entering state %d\n", yystate);
1345 #endif
1347 goto yybackup;
1348 yybackup:
1350 /* Do appropriate processing given the current state. */
1351 /* Read a lookahead token if we need one and don't already have one. */
1352 /* yyresume: */
1354 /* First try to decide what to do without reference to lookahead token. */
1356 yyn = yypact[yystate];
1357 if (yyn == YYFLAG)
1358 goto yydefault;
1360 /* Not known => get a lookahead token if don't already have one. */
1362 /* yychar is either YYEMPTY or YYEOF
1363 or a valid token in external form. */
1365 if (yychar == YYEMPTY)
1367 #if YYDEBUG != 0
1368 if (yydebug)
1369 fprintf(stderr, "Reading a token: ");
1370 #endif
1371 yychar = YYLEX;
1374 /* Convert token to internal form (in yychar1) for indexing tables with */
1376 if (yychar <= 0) /* This means end of input. */
1378 yychar1 = 0;
1379 yychar = YYEOF; /* Don't call YYLEX any more */
1381 #if YYDEBUG != 0
1382 if (yydebug)
1383 fprintf(stderr, "Now at end of input.\n");
1384 #endif
1386 else
1388 yychar1 = YYTRANSLATE(yychar);
1390 #if YYDEBUG != 0
1391 if (yydebug)
1393 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
1394 /* Give the individual parser a way to print the precise meaning
1395 of a token, for further debugging info. */
1396 #ifdef YYPRINT
1397 YYPRINT (stderr, yychar, yylval);
1398 #endif
1399 fprintf (stderr, ")\n");
1401 #endif
1404 yyn += yychar1;
1405 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
1406 goto yydefault;
1408 yyn = yytable[yyn];
1410 /* yyn is what to do for this token type in this state.
1411 Negative => reduce, -yyn is rule number.
1412 Positive => shift, yyn is new state.
1413 New state is final state => don't bother to shift,
1414 just return success.
1415 0, or most negative number => error. */
1417 if (yyn < 0)
1419 if (yyn == YYFLAG)
1420 goto yyerrlab;
1421 yyn = -yyn;
1422 goto yyreduce;
1424 else if (yyn == 0)
1425 goto yyerrlab;
1427 if (yyn == YYFINAL)
1428 YYACCEPT;
1430 /* Shift the lookahead token. */
1432 #if YYDEBUG != 0
1433 if (yydebug)
1434 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
1435 #endif
1437 /* Discard the token being shifted unless it is eof. */
1438 if (yychar != YYEOF)
1439 yychar = YYEMPTY;
1441 *++yyvsp = yylval;
1442 #ifdef YYLSP_NEEDED
1443 *++yylsp = yylloc;
1444 #endif
1446 /* count tokens shifted since error; after three, turn off error status. */
1447 if (yyerrstatus) yyerrstatus--;
1449 yystate = yyn;
1450 goto yynewstate;
1452 /* Do the default action for the current state. */
1453 yydefault:
1455 yyn = yydefact[yystate];
1456 if (yyn == 0)
1457 goto yyerrlab;
1459 /* Do a reduction. yyn is the number of a rule to reduce with. */
1460 yyreduce:
1461 yylen = yyr2[yyn];
1462 yyval = yyvsp[1-yylen]; /* implement default value of the action */
1464 #if YYDEBUG != 0
1465 if (yydebug)
1467 int i;
1469 fprintf (stderr, "Reducing via rule %d (line %d), ",
1470 yyn, yyrline[yyn]);
1472 /* Print the symbols being reduced, and their result. */
1473 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
1474 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
1475 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
1477 #endif
1480 switch (yyn) {
1482 case 2:
1483 #line 276 "pic.y"
1485 if (olist.head)
1486 print_picture(olist.head);
1488 break;}
1489 case 3:
1490 #line 285 "pic.y"
1491 { yyval.pl = yyvsp[-1].pl; ;
1492 break;}
1493 case 4:
1494 #line 290 "pic.y"
1495 { yyval.pl = yyvsp[0].pl; ;
1496 break;}
1497 case 5:
1498 #line 292 "pic.y"
1499 { yyval.pl = yyvsp[-2].pl; ;
1500 break;}
1501 case 10:
1502 #line 307 "pic.y"
1504 define_variable(yyvsp[-2].str, yyvsp[0].x);
1505 a_delete yyvsp[-2].str;
1507 break;}
1508 case 11:
1509 #line 312 "pic.y"
1511 place *p = lookup_label(yyvsp[-3].str);
1512 if (!p) {
1513 lex_error("variable `%1' not defined", yyvsp[-3].str);
1514 YYABORT;
1516 p->obj = 0;
1517 p->x = yyvsp[0].x;
1518 p->y = 0.0;
1519 a_delete yyvsp[-3].str;
1521 break;}
1522 case 12:
1523 #line 324 "pic.y"
1524 { current_direction = UP_DIRECTION; ;
1525 break;}
1526 case 13:
1527 #line 326 "pic.y"
1528 { current_direction = DOWN_DIRECTION; ;
1529 break;}
1530 case 14:
1531 #line 328 "pic.y"
1532 { current_direction = LEFT_DIRECTION; ;
1533 break;}
1534 case 15:
1535 #line 330 "pic.y"
1536 { current_direction = RIGHT_DIRECTION; ;
1537 break;}
1538 case 16:
1539 #line 332 "pic.y"
1541 olist.append(make_command_object(yyvsp[0].lstr.str, yyvsp[0].lstr.filename,
1542 yyvsp[0].lstr.lineno));
1544 break;}
1545 case 17:
1546 #line 337 "pic.y"
1548 olist.append(make_command_object(yyvsp[0].lstr.str, yyvsp[0].lstr.filename,
1549 yyvsp[0].lstr.lineno));
1551 break;}
1552 case 18:
1553 #line 342 "pic.y"
1555 fprintf(stderr, "%s\n", yyvsp[0].lstr.str);
1556 fflush(stderr);
1558 break;}
1559 case 19:
1560 #line 347 "pic.y"
1561 { delim_flag = 1; ;
1562 break;}
1563 case 20:
1564 #line 349 "pic.y"
1566 delim_flag = 0;
1567 system(yyvsp[0].str);
1568 a_delete yyvsp[0].str;
1570 break;}
1571 case 21:
1572 #line 355 "pic.y"
1574 if (yychar < 0)
1575 do_lookahead();
1576 do_copy(yyvsp[0].lstr.str);
1577 // do not delete the filename
1579 break;}
1580 case 22:
1581 #line 362 "pic.y"
1582 { delim_flag = 2; ;
1583 break;}
1584 case 23:
1585 #line 364 "pic.y"
1586 { delim_flag = 0; ;
1587 break;}
1588 case 24:
1589 #line 366 "pic.y"
1591 if (yychar < 0)
1592 do_lookahead();
1593 copy_file_thru(yyvsp[-5].lstr.str, yyvsp[-2].str, yyvsp[0].str);
1594 // do not delete the filename
1595 a_delete yyvsp[-2].str;
1596 a_delete yyvsp[0].str;
1598 break;}
1599 case 25:
1600 #line 375 "pic.y"
1601 { delim_flag = 2; ;
1602 break;}
1603 case 26:
1604 #line 377 "pic.y"
1605 { delim_flag = 0; ;
1606 break;}
1607 case 27:
1608 #line 379 "pic.y"
1610 if (yychar < 0)
1611 do_lookahead();
1612 copy_rest_thru(yyvsp[-2].str, yyvsp[0].str);
1613 a_delete yyvsp[-2].str;
1614 a_delete yyvsp[0].str;
1616 break;}
1617 case 28:
1618 #line 387 "pic.y"
1619 { delim_flag = 1; ;
1620 break;}
1621 case 29:
1622 #line 389 "pic.y"
1624 delim_flag = 0;
1625 if (yychar < 0)
1626 do_lookahead();
1627 do_for(yyvsp[-8].str, yyvsp[-6].x, yyvsp[-4].x, yyvsp[-3].by.is_multiplicative, yyvsp[-3].by.val, yyvsp[0].str);
1629 break;}
1630 case 30:
1631 #line 396 "pic.y"
1633 if (yychar < 0)
1634 do_lookahead();
1635 if (yyvsp[0].if_data.x != 0.0)
1636 push_body(yyvsp[0].if_data.body);
1637 a_delete yyvsp[0].if_data.body;
1639 break;}
1640 case 31:
1641 #line 404 "pic.y"
1642 { delim_flag = 1; ;
1643 break;}
1644 case 32:
1645 #line 406 "pic.y"
1647 delim_flag = 0;
1648 if (yychar < 0)
1649 do_lookahead();
1650 if (yyvsp[-3].if_data.x != 0.0)
1651 push_body(yyvsp[-3].if_data.body);
1652 else
1653 push_body(yyvsp[0].str);
1654 a_delete yyvsp[-3].if_data.body;
1655 a_delete yyvsp[0].str;
1657 break;}
1658 case 34:
1659 #line 419 "pic.y"
1660 { define_variable("scale", 1.0); ;
1661 break;}
1662 case 35:
1663 #line 424 "pic.y"
1664 { reset(yyvsp[0].str); a_delete yyvsp[0].str; ;
1665 break;}
1666 case 36:
1667 #line 426 "pic.y"
1668 { reset(yyvsp[0].str); a_delete yyvsp[0].str; ;
1669 break;}
1670 case 37:
1671 #line 428 "pic.y"
1672 { reset(yyvsp[0].str); a_delete yyvsp[0].str; ;
1673 break;}
1674 case 38:
1675 #line 433 "pic.y"
1676 { yyval.lstr = yyvsp[0].lstr; ;
1677 break;}
1678 case 39:
1679 #line 435 "pic.y"
1681 yyval.lstr.str = new char[strlen(yyvsp[-1].lstr.str) + strlen(yyvsp[0].lstr.str) + 1];
1682 strcpy(yyval.lstr.str, yyvsp[-1].lstr.str);
1683 strcat(yyval.lstr.str, yyvsp[0].lstr.str);
1684 a_delete yyvsp[-1].lstr.str;
1685 a_delete yyvsp[0].lstr.str;
1686 if (yyvsp[-1].lstr.filename) {
1687 yyval.lstr.filename = yyvsp[-1].lstr.filename;
1688 yyval.lstr.lineno = yyvsp[-1].lstr.lineno;
1690 else if (yyvsp[0].lstr.filename) {
1691 yyval.lstr.filename = yyvsp[0].lstr.filename;
1692 yyval.lstr.lineno = yyvsp[0].lstr.lineno;
1695 break;}
1696 case 40:
1697 #line 454 "pic.y"
1699 yyval.lstr.str = new char[GDIGITS + 1];
1700 sprintf(yyval.lstr.str, "%g", yyvsp[0].x);
1701 yyval.lstr.filename = 0;
1702 yyval.lstr.lineno = 0;
1704 break;}
1705 case 41:
1706 #line 461 "pic.y"
1707 { yyval.lstr = yyvsp[0].lstr; ;
1708 break;}
1709 case 42:
1710 #line 463 "pic.y"
1712 yyval.lstr.str = new char[GDIGITS + 2 + GDIGITS + 1];
1713 sprintf(yyval.lstr.str, "%g, %g", yyvsp[0].pair.x, yyvsp[0].pair.y);
1714 yyval.lstr.filename = 0;
1715 yyval.lstr.lineno = 0;
1717 break;}
1718 case 43:
1719 #line 472 "pic.y"
1720 { delim_flag = 1; ;
1721 break;}
1722 case 44:
1723 #line 474 "pic.y"
1724 { delim_flag = 0; yyval.if_data.x = yyvsp[-3].x; yyval.if_data.body = yyvsp[0].str; ;
1725 break;}
1726 case 45:
1727 #line 479 "pic.y"
1728 { yyval.str = 0; ;
1729 break;}
1730 case 46:
1731 #line 481 "pic.y"
1732 { yyval.str = yyvsp[0].lstr.str; ;
1733 break;}
1734 case 47:
1735 #line 486 "pic.y"
1736 { yyval.x = yyvsp[0].x; ;
1737 break;}
1738 case 48:
1739 #line 488 "pic.y"
1740 { yyval.x = yyvsp[0].x; ;
1741 break;}
1742 case 49:
1743 #line 493 "pic.y"
1745 yyval.x = strcmp(yyvsp[-2].lstr.str, yyvsp[0].lstr.str) == 0;
1746 a_delete yyvsp[-2].lstr.str;
1747 a_delete yyvsp[0].lstr.str;
1749 break;}
1750 case 50:
1751 #line 499 "pic.y"
1753 yyval.x = strcmp(yyvsp[-2].lstr.str, yyvsp[0].lstr.str) != 0;
1754 a_delete yyvsp[-2].lstr.str;
1755 a_delete yyvsp[0].lstr.str;
1757 break;}
1758 case 51:
1759 #line 505 "pic.y"
1760 { yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); ;
1761 break;}
1762 case 52:
1763 #line 507 "pic.y"
1764 { yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); ;
1765 break;}
1766 case 53:
1767 #line 509 "pic.y"
1768 { yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); ;
1769 break;}
1770 case 54:
1771 #line 511 "pic.y"
1772 { yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); ;
1773 break;}
1774 case 55:
1775 #line 513 "pic.y"
1776 { yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); ;
1777 break;}
1778 case 56:
1779 #line 515 "pic.y"
1780 { yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); ;
1781 break;}
1782 case 57:
1783 #line 517 "pic.y"
1784 { yyval.x = (yyvsp[0].x == 0.0); ;
1785 break;}
1786 case 58:
1787 #line 523 "pic.y"
1788 { yyval.by.val = 1.0; yyval.by.is_multiplicative = 0; ;
1789 break;}
1790 case 59:
1791 #line 525 "pic.y"
1792 { yyval.by.val = yyvsp[0].x; yyval.by.is_multiplicative = 0; ;
1793 break;}
1794 case 60:
1795 #line 527 "pic.y"
1796 { yyval.by.val = yyvsp[0].x; yyval.by.is_multiplicative = 1; ;
1797 break;}
1798 case 61:
1799 #line 532 "pic.y"
1801 yyval.pl.obj = yyvsp[0].spec->make_object(&current_position,
1802 &current_direction);
1803 if (yyval.pl.obj == 0)
1804 YYABORT;
1805 delete yyvsp[0].spec;
1806 if (yyval.pl.obj)
1807 olist.append(yyval.pl.obj);
1808 else {
1809 yyval.pl.x = current_position.x;
1810 yyval.pl.y = current_position.y;
1813 break;}
1814 case 62:
1815 #line 546 "pic.y"
1816 { yyval.pl = yyvsp[0].pl; define_label(yyvsp[-3].str, & yyval.pl); a_delete yyvsp[-3].str; ;
1817 break;}
1818 case 63:
1819 #line 548 "pic.y"
1821 yyval.pl.obj = 0;
1822 yyval.pl.x = yyvsp[0].pair.x;
1823 yyval.pl.y = yyvsp[0].pair.y;
1824 define_label(yyvsp[-3].str, & yyval.pl);
1825 a_delete yyvsp[-3].str;
1827 break;}
1828 case 64:
1829 #line 556 "pic.y"
1831 yyval.pl = yyvsp[0].pl;
1832 define_label(yyvsp[-3].str, & yyval.pl);
1833 a_delete yyvsp[-3].str;
1835 break;}
1836 case 65:
1837 #line 562 "pic.y"
1839 yyval.state.x = current_position.x;
1840 yyval.state.y = current_position.y;
1841 yyval.state.dir = current_direction;
1843 break;}
1844 case 66:
1845 #line 568 "pic.y"
1847 current_position.x = yyvsp[-2].state.x;
1848 current_position.y = yyvsp[-2].state.y;
1849 current_direction = yyvsp[-2].state.dir;
1851 break;}
1852 case 67:
1853 #line 574 "pic.y"
1855 yyval.pl = yyvsp[-3].pl;
1857 break;}
1858 case 68:
1859 #line 578 "pic.y"
1861 yyval.pl.obj = 0;
1862 yyval.pl.x = current_position.x;
1863 yyval.pl.y = current_position.y;
1865 break;}
1866 case 69:
1867 #line 587 "pic.y"
1869 break;}
1870 case 70:
1871 #line 589 "pic.y"
1873 break;}
1874 case 71:
1875 #line 594 "pic.y"
1877 yyval.spec = new object_spec(BOX_OBJECT);
1879 break;}
1880 case 72:
1881 #line 598 "pic.y"
1883 yyval.spec = new object_spec(CIRCLE_OBJECT);
1885 break;}
1886 case 73:
1887 #line 602 "pic.y"
1889 yyval.spec = new object_spec(ELLIPSE_OBJECT);
1891 break;}
1892 case 74:
1893 #line 606 "pic.y"
1895 yyval.spec = new object_spec(ARC_OBJECT);
1896 yyval.spec->dir = current_direction;
1898 break;}
1899 case 75:
1900 #line 611 "pic.y"
1902 yyval.spec = new object_spec(LINE_OBJECT);
1903 lookup_variable("lineht", & yyval.spec->segment_height);
1904 lookup_variable("linewid", & yyval.spec->segment_width);
1905 yyval.spec->dir = current_direction;
1907 break;}
1908 case 76:
1909 #line 618 "pic.y"
1911 yyval.spec = new object_spec(ARROW_OBJECT);
1912 lookup_variable("lineht", & yyval.spec->segment_height);
1913 lookup_variable("linewid", & yyval.spec->segment_width);
1914 yyval.spec->dir = current_direction;
1916 break;}
1917 case 77:
1918 #line 625 "pic.y"
1920 yyval.spec = new object_spec(MOVE_OBJECT);
1921 lookup_variable("moveht", & yyval.spec->segment_height);
1922 lookup_variable("movewid", & yyval.spec->segment_width);
1923 yyval.spec->dir = current_direction;
1925 break;}
1926 case 78:
1927 #line 632 "pic.y"
1929 yyval.spec = new object_spec(SPLINE_OBJECT);
1930 lookup_variable("lineht", & yyval.spec->segment_height);
1931 lookup_variable("linewid", & yyval.spec->segment_width);
1932 yyval.spec->dir = current_direction;
1934 break;}
1935 case 79:
1936 #line 639 "pic.y"
1938 yyval.spec = new object_spec(TEXT_OBJECT);
1939 yyval.spec->text = new text_item(yyvsp[0].lstr.str, yyvsp[0].lstr.filename, yyvsp[0].lstr.lineno);
1941 break;}
1942 case 80:
1943 #line 644 "pic.y"
1945 yyval.spec = new object_spec(TEXT_OBJECT);
1946 yyval.spec->text = new text_item(format_number(0, yyvsp[0].x), 0, -1);
1948 break;}
1949 case 81:
1950 #line 649 "pic.y"
1952 yyval.spec = new object_spec(TEXT_OBJECT);
1953 yyval.spec->text = new text_item(format_number(yyvsp[0].lstr.str, yyvsp[-1].x),
1954 yyvsp[0].lstr.filename, yyvsp[0].lstr.lineno);
1955 a_delete yyvsp[0].lstr.str;
1957 break;}
1958 case 82:
1959 #line 656 "pic.y"
1961 saved_state *p = new saved_state;
1962 yyval.pstate = p;
1963 p->x = current_position.x;
1964 p->y = current_position.y;
1965 p->dir = current_direction;
1966 p->tbl = current_table;
1967 p->prev = current_saved_state;
1968 current_position.x = 0.0;
1969 current_position.y = 0.0;
1970 current_table = new PTABLE(place);
1971 current_saved_state = p;
1972 olist.append(make_mark_object());
1974 break;}
1975 case 83:
1976 #line 671 "pic.y"
1978 current_position.x = yyvsp[-2].pstate->x;
1979 current_position.y = yyvsp[-2].pstate->y;
1980 current_direction = yyvsp[-2].pstate->dir;
1981 yyval.spec = new object_spec(BLOCK_OBJECT);
1982 olist.wrap_up_block(& yyval.spec->oblist);
1983 yyval.spec->tbl = current_table;
1984 current_table = yyvsp[-2].pstate->tbl;
1985 current_saved_state = yyvsp[-2].pstate->prev;
1986 delete yyvsp[-2].pstate;
1988 break;}
1989 case 84:
1990 #line 683 "pic.y"
1992 yyval.spec = yyvsp[-2].spec;
1993 yyval.spec->height = yyvsp[0].x;
1994 yyval.spec->flags |= HAS_HEIGHT;
1996 break;}
1997 case 85:
1998 #line 689 "pic.y"
2000 yyval.spec = yyvsp[-2].spec;
2001 yyval.spec->radius = yyvsp[0].x;
2002 yyval.spec->flags |= HAS_RADIUS;
2004 break;}
2005 case 86:
2006 #line 695 "pic.y"
2008 yyval.spec = yyvsp[-2].spec;
2009 yyval.spec->width = yyvsp[0].x;
2010 yyval.spec->flags |= HAS_WIDTH;
2012 break;}
2013 case 87:
2014 #line 701 "pic.y"
2016 yyval.spec = yyvsp[-2].spec;
2017 yyval.spec->radius = yyvsp[0].x/2.0;
2018 yyval.spec->flags |= HAS_RADIUS;
2020 break;}
2021 case 88:
2022 #line 707 "pic.y"
2024 yyval.spec = yyvsp[-1].spec;
2025 yyval.spec->flags |= HAS_SEGMENT;
2026 switch (yyval.spec->dir) {
2027 case UP_DIRECTION:
2028 yyval.spec->segment_pos.y += yyvsp[0].x;
2029 break;
2030 case DOWN_DIRECTION:
2031 yyval.spec->segment_pos.y -= yyvsp[0].x;
2032 break;
2033 case RIGHT_DIRECTION:
2034 yyval.spec->segment_pos.x += yyvsp[0].x;
2035 break;
2036 case LEFT_DIRECTION:
2037 yyval.spec->segment_pos.x -= yyvsp[0].x;
2038 break;
2041 break;}
2042 case 89:
2043 #line 726 "pic.y"
2045 yyval.spec = yyvsp[-1].spec;
2046 yyval.spec->dir = UP_DIRECTION;
2047 yyval.spec->flags |= HAS_SEGMENT;
2048 yyval.spec->segment_pos.y += yyval.spec->segment_height;
2050 break;}
2051 case 90:
2052 #line 733 "pic.y"
2054 yyval.spec = yyvsp[-2].spec;
2055 yyval.spec->dir = UP_DIRECTION;
2056 yyval.spec->flags |= HAS_SEGMENT;
2057 yyval.spec->segment_pos.y += yyvsp[0].x;
2059 break;}
2060 case 91:
2061 #line 740 "pic.y"
2063 yyval.spec = yyvsp[-1].spec;
2064 yyval.spec->dir = DOWN_DIRECTION;
2065 yyval.spec->flags |= HAS_SEGMENT;
2066 yyval.spec->segment_pos.y -= yyval.spec->segment_height;
2068 break;}
2069 case 92:
2070 #line 747 "pic.y"
2072 yyval.spec = yyvsp[-2].spec;
2073 yyval.spec->dir = DOWN_DIRECTION;
2074 yyval.spec->flags |= HAS_SEGMENT;
2075 yyval.spec->segment_pos.y -= yyvsp[0].x;
2077 break;}
2078 case 93:
2079 #line 754 "pic.y"
2081 yyval.spec = yyvsp[-1].spec;
2082 yyval.spec->dir = RIGHT_DIRECTION;
2083 yyval.spec->flags |= HAS_SEGMENT;
2084 yyval.spec->segment_pos.x += yyval.spec->segment_width;
2086 break;}
2087 case 94:
2088 #line 761 "pic.y"
2090 yyval.spec = yyvsp[-2].spec;
2091 yyval.spec->dir = RIGHT_DIRECTION;
2092 yyval.spec->flags |= HAS_SEGMENT;
2093 yyval.spec->segment_pos.x += yyvsp[0].x;
2095 break;}
2096 case 95:
2097 #line 768 "pic.y"
2099 yyval.spec = yyvsp[-1].spec;
2100 yyval.spec->dir = LEFT_DIRECTION;
2101 yyval.spec->flags |= HAS_SEGMENT;
2102 yyval.spec->segment_pos.x -= yyval.spec->segment_width;
2104 break;}
2105 case 96:
2106 #line 775 "pic.y"
2108 yyval.spec = yyvsp[-2].spec;
2109 yyval.spec->dir = LEFT_DIRECTION;
2110 yyval.spec->flags |= HAS_SEGMENT;
2111 yyval.spec->segment_pos.x -= yyvsp[0].x;
2113 break;}
2114 case 97:
2115 #line 782 "pic.y"
2117 yyval.spec = yyvsp[-2].spec;
2118 yyval.spec->flags |= HAS_FROM;
2119 yyval.spec->from.x = yyvsp[0].pair.x;
2120 yyval.spec->from.y = yyvsp[0].pair.y;
2122 break;}
2123 case 98:
2124 #line 789 "pic.y"
2126 yyval.spec = yyvsp[-2].spec;
2127 if (yyval.spec->flags & HAS_SEGMENT)
2128 yyval.spec->segment_list = new segment(yyval.spec->segment_pos,
2129 yyval.spec->segment_is_absolute,
2130 yyval.spec->segment_list);
2131 yyval.spec->flags |= HAS_SEGMENT;
2132 yyval.spec->segment_pos.x = yyvsp[0].pair.x;
2133 yyval.spec->segment_pos.y = yyvsp[0].pair.y;
2134 yyval.spec->segment_is_absolute = 1;
2135 yyval.spec->flags |= HAS_TO;
2136 yyval.spec->to.x = yyvsp[0].pair.x;
2137 yyval.spec->to.y = yyvsp[0].pair.y;
2139 break;}
2140 case 99:
2141 #line 804 "pic.y"
2143 yyval.spec = yyvsp[-2].spec;
2144 yyval.spec->flags |= HAS_AT;
2145 yyval.spec->at.x = yyvsp[0].pair.x;
2146 yyval.spec->at.y = yyvsp[0].pair.y;
2147 if (yyval.spec->type != ARC_OBJECT) {
2148 yyval.spec->flags |= HAS_FROM;
2149 yyval.spec->from.x = yyvsp[0].pair.x;
2150 yyval.spec->from.y = yyvsp[0].pair.y;
2153 break;}
2154 case 100:
2155 #line 816 "pic.y"
2157 yyval.spec = yyvsp[-2].spec;
2158 yyval.spec->flags |= HAS_WITH;
2159 yyval.spec->with = yyvsp[0].pth;
2161 break;}
2162 case 101:
2163 #line 822 "pic.y"
2165 yyval.spec = yyvsp[-2].spec;
2166 yyval.spec->flags |= HAS_SEGMENT;
2167 yyval.spec->segment_pos.x += yyvsp[0].pair.x;
2168 yyval.spec->segment_pos.y += yyvsp[0].pair.y;
2170 break;}
2171 case 102:
2172 #line 829 "pic.y"
2174 yyval.spec = yyvsp[-1].spec;
2175 if (yyval.spec->flags & HAS_SEGMENT) {
2176 yyval.spec->segment_list = new segment(yyval.spec->segment_pos,
2177 yyval.spec->segment_is_absolute,
2178 yyval.spec->segment_list);
2179 yyval.spec->flags &= ~HAS_SEGMENT;
2180 yyval.spec->segment_pos.x = yyval.spec->segment_pos.y = 0.0;
2181 yyval.spec->segment_is_absolute = 0;
2184 break;}
2185 case 103:
2186 #line 841 "pic.y"
2188 yyval.spec = yyvsp[-1].spec;
2189 yyval.spec->flags |= IS_DOTTED;
2190 lookup_variable("dashwid", & yyval.spec->dash_width);
2192 break;}
2193 case 104:
2194 #line 847 "pic.y"
2196 yyval.spec = yyvsp[-2].spec;
2197 yyval.spec->flags |= IS_DOTTED;
2198 yyval.spec->dash_width = yyvsp[0].x;
2200 break;}
2201 case 105:
2202 #line 853 "pic.y"
2204 yyval.spec = yyvsp[-1].spec;
2205 yyval.spec->flags |= IS_DASHED;
2206 lookup_variable("dashwid", & yyval.spec->dash_width);
2208 break;}
2209 case 106:
2210 #line 859 "pic.y"
2212 yyval.spec = yyvsp[-2].spec;
2213 yyval.spec->flags |= IS_DASHED;
2214 yyval.spec->dash_width = yyvsp[0].x;
2216 break;}
2217 case 107:
2218 #line 865 "pic.y"
2220 yyval.spec = yyvsp[-1].spec;
2221 yyval.spec->flags |= IS_DEFAULT_FILLED;
2223 break;}
2224 case 108:
2225 #line 870 "pic.y"
2227 yyval.spec = yyvsp[-2].spec;
2228 yyval.spec->flags |= IS_FILLED;
2229 yyval.spec->fill = yyvsp[0].x;
2231 break;}
2232 case 109:
2233 #line 876 "pic.y"
2235 yyval.spec = yyvsp[-1].spec;
2236 // line chop chop means line chop 0 chop 0
2237 if (yyval.spec->flags & IS_DEFAULT_CHOPPED) {
2238 yyval.spec->flags |= IS_CHOPPED;
2239 yyval.spec->flags &= ~IS_DEFAULT_CHOPPED;
2240 yyval.spec->start_chop = yyval.spec->end_chop = 0.0;
2242 else if (yyval.spec->flags & IS_CHOPPED) {
2243 yyval.spec->end_chop = 0.0;
2245 else {
2246 yyval.spec->flags |= IS_DEFAULT_CHOPPED;
2249 break;}
2250 case 110:
2251 #line 892 "pic.y"
2253 yyval.spec = yyvsp[-2].spec;
2254 if (yyval.spec->flags & IS_DEFAULT_CHOPPED) {
2255 yyval.spec->flags |= IS_CHOPPED;
2256 yyval.spec->flags &= ~IS_DEFAULT_CHOPPED;
2257 yyval.spec->start_chop = 0.0;
2258 yyval.spec->end_chop = yyvsp[0].x;
2260 else if (yyval.spec->flags & IS_CHOPPED) {
2261 yyval.spec->end_chop = yyvsp[0].x;
2263 else {
2264 yyval.spec->start_chop = yyval.spec->end_chop = yyvsp[0].x;
2265 yyval.spec->flags |= IS_CHOPPED;
2268 break;}
2269 case 111:
2270 #line 909 "pic.y"
2272 yyval.spec = yyvsp[-1].spec;
2273 yyval.spec->flags |= IS_SAME;
2275 break;}
2276 case 112:
2277 #line 914 "pic.y"
2279 yyval.spec = yyvsp[-1].spec;
2280 yyval.spec->flags |= IS_INVISIBLE;
2282 break;}
2283 case 113:
2284 #line 919 "pic.y"
2286 yyval.spec = yyvsp[-1].spec;
2287 yyval.spec->flags |= HAS_LEFT_ARROW_HEAD;
2289 break;}
2290 case 114:
2291 #line 924 "pic.y"
2293 yyval.spec = yyvsp[-1].spec;
2294 yyval.spec->flags |= HAS_RIGHT_ARROW_HEAD;
2296 break;}
2297 case 115:
2298 #line 929 "pic.y"
2300 yyval.spec = yyvsp[-1].spec;
2301 yyval.spec->flags |= (HAS_LEFT_ARROW_HEAD|HAS_RIGHT_ARROW_HEAD);
2303 break;}
2304 case 116:
2305 #line 934 "pic.y"
2307 yyval.spec = yyvsp[-1].spec;
2308 yyval.spec->flags |= IS_CLOCKWISE;
2310 break;}
2311 case 117:
2312 #line 939 "pic.y"
2314 yyval.spec = yyvsp[-1].spec;
2315 yyval.spec->flags &= ~IS_CLOCKWISE;
2317 break;}
2318 case 118:
2319 #line 944 "pic.y"
2321 yyval.spec = yyvsp[-1].spec;
2322 for (text_item **p = & yyval.spec->text; *p; p = &(*p)->next)
2324 *p = new text_item(yyvsp[0].lstr.str, yyvsp[0].lstr.filename, yyvsp[0].lstr.lineno);
2326 break;}
2327 case 119:
2328 #line 951 "pic.y"
2330 yyval.spec = yyvsp[-1].spec;
2331 if (yyval.spec->text) {
2332 for (text_item *p = yyval.spec->text; p->next; p = p->next)
2334 p->adj.h = LEFT_ADJUST;
2337 break;}
2338 case 120:
2339 #line 960 "pic.y"
2341 yyval.spec = yyvsp[-1].spec;
2342 if (yyval.spec->text) {
2343 for (text_item *p = yyval.spec->text; p->next; p = p->next)
2345 p->adj.h = RIGHT_ADJUST;
2348 break;}
2349 case 121:
2350 #line 969 "pic.y"
2352 yyval.spec = yyvsp[-1].spec;
2353 if (yyval.spec->text) {
2354 for (text_item *p = yyval.spec->text; p->next; p = p->next)
2356 p->adj.v = ABOVE_ADJUST;
2359 break;}
2360 case 122:
2361 #line 978 "pic.y"
2363 yyval.spec = yyvsp[-1].spec;
2364 if (yyval.spec->text) {
2365 for (text_item *p = yyval.spec->text; p->next; p = p->next)
2367 p->adj.v = BELOW_ADJUST;
2370 break;}
2371 case 123:
2372 #line 987 "pic.y"
2374 yyval.spec = yyvsp[-2].spec;
2375 yyval.spec->flags |= HAS_THICKNESS;
2376 yyval.spec->thickness = yyvsp[0].x;
2378 break;}
2379 case 124:
2380 #line 993 "pic.y"
2382 yyval.spec = yyvsp[-1].spec;
2383 yyval.spec->flags |= IS_ALIGNED;
2385 break;}
2386 case 125:
2387 #line 1001 "pic.y"
2389 yyval.lstr = yyvsp[0].lstr;
2391 break;}
2392 case 126:
2393 #line 1005 "pic.y"
2395 yyval.lstr.filename = yyvsp[-2].lstr.filename;
2396 yyval.lstr.lineno = yyvsp[-2].lstr.lineno;
2397 yyval.lstr.str = do_sprintf(yyvsp[-2].lstr.str, yyvsp[-1].dv.v, yyvsp[-1].dv.nv);
2398 a_delete yyvsp[-1].dv.v;
2399 a_delete yyvsp[-2].lstr.str;
2401 break;}
2402 case 127:
2403 #line 1016 "pic.y"
2405 yyval.dv.v = 0;
2406 yyval.dv.nv = 0;
2407 yyval.dv.maxv = 0;
2409 break;}
2410 case 128:
2411 #line 1022 "pic.y"
2413 yyval.dv = yyvsp[-2].dv;
2414 if (yyval.dv.nv >= yyval.dv.maxv) {
2415 if (yyval.dv.nv == 0) {
2416 yyval.dv.v = new double[4];
2417 yyval.dv.maxv = 4;
2419 else {
2420 double *oldv = yyval.dv.v;
2421 yyval.dv.maxv *= 2;
2422 yyval.dv.v = new double[yyval.dv.maxv];
2423 memcpy(yyval.dv.v, oldv, yyval.dv.nv*sizeof(double));
2424 a_delete oldv;
2427 yyval.dv.v[yyval.dv.nv] = yyvsp[0].x;
2428 yyval.dv.nv += 1;
2430 break;}
2431 case 129:
2432 #line 1044 "pic.y"
2433 { yyval.pair = yyvsp[0].pair; ;
2434 break;}
2435 case 130:
2436 #line 1046 "pic.y"
2438 position pos = yyvsp[0].pl;
2439 yyval.pair.x = pos.x;
2440 yyval.pair.y = pos.y;
2442 break;}
2443 case 131:
2444 #line 1055 "pic.y"
2445 { yyval.pair = yyvsp[0].pair; ;
2446 break;}
2447 case 132:
2448 #line 1057 "pic.y"
2450 yyval.pair.x = yyvsp[-2].pair.x + yyvsp[0].pair.x;
2451 yyval.pair.y = yyvsp[-2].pair.y + yyvsp[0].pair.y;
2453 break;}
2454 case 133:
2455 #line 1062 "pic.y"
2457 yyval.pair.x = yyvsp[-2].pair.x - yyvsp[0].pair.x;
2458 yyval.pair.y = yyvsp[-2].pair.y - yyvsp[0].pair.y;
2460 break;}
2461 case 134:
2462 #line 1067 "pic.y"
2464 yyval.pair.x = yyvsp[-3].pair.x;
2465 yyval.pair.y = yyvsp[-1].pair.y;
2467 break;}
2468 case 135:
2469 #line 1072 "pic.y"
2471 yyval.pair.x = (1.0 - yyvsp[-4].x)*yyvsp[-2].pair.x + yyvsp[-4].x*yyvsp[0].pair.x;
2472 yyval.pair.y = (1.0 - yyvsp[-4].x)*yyvsp[-2].pair.y + yyvsp[-4].x*yyvsp[0].pair.y;
2474 break;}
2475 case 136:
2476 #line 1077 "pic.y"
2478 yyval.pair.x = (1.0 - yyvsp[-5].x)*yyvsp[-3].pair.x + yyvsp[-5].x*yyvsp[-1].pair.x;
2479 yyval.pair.y = (1.0 - yyvsp[-5].x)*yyvsp[-3].pair.y + yyvsp[-5].x*yyvsp[-1].pair.y;
2481 break;}
2482 case 139:
2483 #line 1090 "pic.y"
2484 { yyval.pair.x = yyvsp[-2].x; yyval.pair.y = yyvsp[0].x; ;
2485 break;}
2486 case 140:
2487 #line 1092 "pic.y"
2488 { yyval.pair = yyvsp[-1].pair; ;
2489 break;}
2490 case 141:
2491 #line 1097 "pic.y"
2492 { yyval.pl = yyvsp[0].pl; ;
2493 break;}
2494 case 142:
2495 #line 1099 "pic.y"
2497 path pth(yyvsp[0].crn);
2498 if (!pth.follow(yyvsp[-1].pl, & yyval.pl))
2499 YYABORT;
2501 break;}
2502 case 143:
2503 #line 1105 "pic.y"
2505 path pth(yyvsp[-1].crn);
2506 if (!pth.follow(yyvsp[0].pl, & yyval.pl))
2507 YYABORT;
2509 break;}
2510 case 144:
2511 #line 1111 "pic.y"
2513 path pth(yyvsp[-2].crn);
2514 if (!pth.follow(yyvsp[0].pl, & yyval.pl))
2515 YYABORT;
2517 break;}
2518 case 145:
2519 #line 1117 "pic.y"
2521 yyval.pl.x = current_position.x;
2522 yyval.pl.y = current_position.y;
2523 yyval.pl.obj = 0;
2525 break;}
2526 case 146:
2527 #line 1126 "pic.y"
2529 place *p = lookup_label(yyvsp[0].str);
2530 if (!p) {
2531 lex_error("there is no place `%1'", yyvsp[0].str);
2532 YYABORT;
2534 yyval.pl = *p;
2535 a_delete yyvsp[0].str;
2537 break;}
2538 case 147:
2539 #line 1136 "pic.y"
2541 yyval.pl.obj = yyvsp[0].obj;
2543 break;}
2544 case 148:
2545 #line 1140 "pic.y"
2547 path pth(yyvsp[0].str);
2548 if (!pth.follow(yyvsp[-2].pl, & yyval.pl))
2549 YYABORT;
2551 break;}
2552 case 149:
2553 #line 1149 "pic.y"
2554 { yyval.n = yyvsp[0].n; ;
2555 break;}
2556 case 150:
2557 #line 1151 "pic.y"
2559 // XXX Check for overflow (and non-integers?).
2560 yyval.n = (int)yyvsp[-1].x;
2562 break;}
2563 case 151:
2564 #line 1159 "pic.y"
2565 { yyval.n = 1; ;
2566 break;}
2567 case 152:
2568 #line 1161 "pic.y"
2569 { yyval.n = yyvsp[-1].n; ;
2570 break;}
2571 case 153:
2572 #line 1166 "pic.y"
2574 int count = 0;
2575 for (object *p = olist.head; p != 0; p = p->next)
2576 if (p->type() == yyvsp[0].obtype && ++count == yyvsp[-1].n) {
2577 yyval.obj = p;
2578 break;
2580 if (p == 0) {
2581 lex_error("there is no %1%2 %3", yyvsp[-1].n, ordinal_postfix(yyvsp[-1].n),
2582 object_type_name(yyvsp[0].obtype));
2583 YYABORT;
2586 break;}
2587 case 154:
2588 #line 1180 "pic.y"
2590 int count = 0;
2591 for (object *p = olist.tail; p != 0; p = p->prev)
2592 if (p->type() == yyvsp[0].obtype && ++count == yyvsp[-1].n) {
2593 yyval.obj = p;
2594 break;
2596 if (p == 0) {
2597 lex_error("there is no %1%2 last %3", yyvsp[-1].n,
2598 ordinal_postfix(yyvsp[-1].n), object_type_name(yyvsp[0].obtype));
2599 YYABORT;
2602 break;}
2603 case 155:
2604 #line 1197 "pic.y"
2605 { yyval.obtype = BOX_OBJECT; ;
2606 break;}
2607 case 156:
2608 #line 1199 "pic.y"
2609 { yyval.obtype = CIRCLE_OBJECT; ;
2610 break;}
2611 case 157:
2612 #line 1201 "pic.y"
2613 { yyval.obtype = ELLIPSE_OBJECT; ;
2614 break;}
2615 case 158:
2616 #line 1203 "pic.y"
2617 { yyval.obtype = ARC_OBJECT; ;
2618 break;}
2619 case 159:
2620 #line 1205 "pic.y"
2621 { yyval.obtype = LINE_OBJECT; ;
2622 break;}
2623 case 160:
2624 #line 1207 "pic.y"
2625 { yyval.obtype = ARROW_OBJECT; ;
2626 break;}
2627 case 161:
2628 #line 1209 "pic.y"
2629 { yyval.obtype = SPLINE_OBJECT; ;
2630 break;}
2631 case 162:
2632 #line 1211 "pic.y"
2633 { yyval.obtype = BLOCK_OBJECT; ;
2634 break;}
2635 case 163:
2636 #line 1213 "pic.y"
2637 { yyval.obtype = TEXT_OBJECT; ;
2638 break;}
2639 case 164:
2640 #line 1218 "pic.y"
2642 yyval.pth = new path(yyvsp[0].str);
2644 break;}
2645 case 165:
2646 #line 1222 "pic.y"
2648 yyval.pth = yyvsp[-2].pth;
2649 yyval.pth->append(yyvsp[0].str);
2651 break;}
2652 case 166:
2653 #line 1230 "pic.y"
2655 yyval.pth = new path(yyvsp[0].crn);
2657 break;}
2658 case 167:
2659 #line 1237 "pic.y"
2661 yyval.pth = yyvsp[0].pth;
2663 break;}
2664 case 168:
2665 #line 1241 "pic.y"
2667 yyval.pth = yyvsp[-1].pth;
2668 yyval.pth->append(yyvsp[0].crn);
2670 break;}
2671 case 169:
2672 #line 1249 "pic.y"
2674 yyval.pth = yyvsp[0].pth;
2676 break;}
2677 case 170:
2678 #line 1254 "pic.y"
2680 lex_warning("`%1%2 last %3' in `with' argument ignored",
2681 yyvsp[-3].n, ordinal_postfix(yyvsp[-3].n), object_type_name(yyvsp[-1].obtype));
2682 yyval.pth = yyvsp[0].pth;
2684 break;}
2685 case 171:
2686 #line 1260 "pic.y"
2688 lex_warning("`last %1' in `with' argument ignored",
2689 object_type_name(yyvsp[-1].obtype));
2690 yyval.pth = yyvsp[0].pth;
2692 break;}
2693 case 172:
2694 #line 1266 "pic.y"
2696 lex_warning("`%1%2 %3' in `with' argument ignored",
2697 yyvsp[-2].n, ordinal_postfix(yyvsp[-2].n), object_type_name(yyvsp[-1].obtype));
2698 yyval.pth = yyvsp[0].pth;
2700 break;}
2701 case 173:
2702 #line 1272 "pic.y"
2704 lex_warning("initial `%1' in `with' argument ignored", yyvsp[-1].str);
2705 a_delete yyvsp[-1].str;
2706 yyval.pth = yyvsp[0].pth;
2708 break;}
2709 case 174:
2710 #line 1281 "pic.y"
2711 { yyval.crn = &object::north; ;
2712 break;}
2713 case 175:
2714 #line 1283 "pic.y"
2715 { yyval.crn = &object::east; ;
2716 break;}
2717 case 176:
2718 #line 1285 "pic.y"
2719 { yyval.crn = &object::west; ;
2720 break;}
2721 case 177:
2722 #line 1287 "pic.y"
2723 { yyval.crn = &object::south; ;
2724 break;}
2725 case 178:
2726 #line 1289 "pic.y"
2727 { yyval.crn = &object::north_east; ;
2728 break;}
2729 case 179:
2730 #line 1291 "pic.y"
2731 { yyval.crn = &object:: south_east; ;
2732 break;}
2733 case 180:
2734 #line 1293 "pic.y"
2735 { yyval.crn = &object::north_west; ;
2736 break;}
2737 case 181:
2738 #line 1295 "pic.y"
2739 { yyval.crn = &object::south_west; ;
2740 break;}
2741 case 182:
2742 #line 1297 "pic.y"
2743 { yyval.crn = &object::center; ;
2744 break;}
2745 case 183:
2746 #line 1299 "pic.y"
2747 { yyval.crn = &object::start; ;
2748 break;}
2749 case 184:
2750 #line 1301 "pic.y"
2751 { yyval.crn = &object::end; ;
2752 break;}
2753 case 185:
2754 #line 1303 "pic.y"
2755 { yyval.crn = &object::north; ;
2756 break;}
2757 case 186:
2758 #line 1305 "pic.y"
2759 { yyval.crn = &object::south; ;
2760 break;}
2761 case 187:
2762 #line 1307 "pic.y"
2763 { yyval.crn = &object::west; ;
2764 break;}
2765 case 188:
2766 #line 1309 "pic.y"
2767 { yyval.crn = &object::east; ;
2768 break;}
2769 case 189:
2770 #line 1311 "pic.y"
2771 { yyval.crn = &object::north_west; ;
2772 break;}
2773 case 190:
2774 #line 1313 "pic.y"
2775 { yyval.crn = &object::south_west; ;
2776 break;}
2777 case 191:
2778 #line 1315 "pic.y"
2779 { yyval.crn = &object::north_east; ;
2780 break;}
2781 case 192:
2782 #line 1317 "pic.y"
2783 { yyval.crn = &object::south_east; ;
2784 break;}
2785 case 193:
2786 #line 1319 "pic.y"
2787 { yyval.crn = &object::west; ;
2788 break;}
2789 case 194:
2790 #line 1321 "pic.y"
2791 { yyval.crn = &object::east; ;
2792 break;}
2793 case 195:
2794 #line 1323 "pic.y"
2795 { yyval.crn = &object::north_west; ;
2796 break;}
2797 case 196:
2798 #line 1325 "pic.y"
2799 { yyval.crn = &object::south_west; ;
2800 break;}
2801 case 197:
2802 #line 1327 "pic.y"
2803 { yyval.crn = &object::north_east; ;
2804 break;}
2805 case 198:
2806 #line 1329 "pic.y"
2807 { yyval.crn = &object::south_east; ;
2808 break;}
2809 case 199:
2810 #line 1331 "pic.y"
2811 { yyval.crn = &object::center; ;
2812 break;}
2813 case 200:
2814 #line 1333 "pic.y"
2815 { yyval.crn = &object::start; ;
2816 break;}
2817 case 201:
2818 #line 1335 "pic.y"
2819 { yyval.crn = &object::end; ;
2820 break;}
2821 case 202:
2822 #line 1340 "pic.y"
2824 if (!lookup_variable(yyvsp[0].str, & yyval.x)) {
2825 lex_error("there is no variable `%1'", yyvsp[0].str);
2826 YYABORT;
2828 a_delete yyvsp[0].str;
2830 break;}
2831 case 203:
2832 #line 1348 "pic.y"
2833 { yyval.x = yyvsp[0].x; ;
2834 break;}
2835 case 204:
2836 #line 1350 "pic.y"
2838 if (yyvsp[-1].pl.obj != 0)
2839 yyval.x = yyvsp[-1].pl.obj->origin().x;
2840 else
2841 yyval.x = yyvsp[-1].pl.x;
2843 break;}
2844 case 205:
2845 #line 1357 "pic.y"
2847 if (yyvsp[-1].pl.obj != 0)
2848 yyval.x = yyvsp[-1].pl.obj->origin().y;
2849 else
2850 yyval.x = yyvsp[-1].pl.y;
2852 break;}
2853 case 206:
2854 #line 1364 "pic.y"
2856 if (yyvsp[-1].pl.obj != 0)
2857 yyval.x = yyvsp[-1].pl.obj->height();
2858 else
2859 yyval.x = 0.0;
2861 break;}
2862 case 207:
2863 #line 1371 "pic.y"
2865 if (yyvsp[-1].pl.obj != 0)
2866 yyval.x = yyvsp[-1].pl.obj->width();
2867 else
2868 yyval.x = 0.0;
2870 break;}
2871 case 208:
2872 #line 1378 "pic.y"
2874 if (yyvsp[-1].pl.obj != 0)
2875 yyval.x = yyvsp[-1].pl.obj->radius();
2876 else
2877 yyval.x = 0.0;
2879 break;}
2880 case 209:
2881 #line 1385 "pic.y"
2882 { yyval.x = yyvsp[-2].x + yyvsp[0].x; ;
2883 break;}
2884 case 210:
2885 #line 1387 "pic.y"
2886 { yyval.x = yyvsp[-2].x - yyvsp[0].x; ;
2887 break;}
2888 case 211:
2889 #line 1389 "pic.y"
2890 { yyval.x = yyvsp[-2].x * yyvsp[0].x; ;
2891 break;}
2892 case 212:
2893 #line 1391 "pic.y"
2895 if (yyvsp[0].x == 0.0) {
2896 lex_error("division by zero");
2897 YYABORT;
2899 yyval.x = yyvsp[-2].x/yyvsp[0].x;
2901 break;}
2902 case 213:
2903 #line 1399 "pic.y"
2905 if (yyvsp[0].x == 0.0) {
2906 lex_error("modulus by zero");
2907 YYABORT;
2909 yyval.x = fmod(yyvsp[-2].x, yyvsp[0].x);
2911 break;}
2912 case 214:
2913 #line 1407 "pic.y"
2915 errno = 0;
2916 yyval.x = pow(yyvsp[-2].x, yyvsp[0].x);
2917 if (errno == EDOM) {
2918 lex_error("arguments to `^' operator out of domain");
2919 YYABORT;
2921 if (errno == ERANGE) {
2922 lex_error("result of `^' operator out of range");
2923 YYABORT;
2926 break;}
2927 case 215:
2928 #line 1420 "pic.y"
2929 { yyval.x = -yyvsp[0].x; ;
2930 break;}
2931 case 216:
2932 #line 1422 "pic.y"
2933 { yyval.x = yyvsp[-1].x; ;
2934 break;}
2935 case 217:
2936 #line 1424 "pic.y"
2938 errno = 0;
2939 yyval.x = sin(yyvsp[-1].x);
2940 if (errno == ERANGE) {
2941 lex_error("sin result out of range");
2942 YYABORT;
2945 break;}
2946 case 218:
2947 #line 1433 "pic.y"
2949 errno = 0;
2950 yyval.x = cos(yyvsp[-1].x);
2951 if (errno == ERANGE) {
2952 lex_error("cos result out of range");
2953 YYABORT;
2956 break;}
2957 case 219:
2958 #line 1442 "pic.y"
2960 errno = 0;
2961 yyval.x = atan2(yyvsp[-3].x, yyvsp[-1].x);
2962 if (errno == EDOM) {
2963 lex_error("atan2 argument out of domain");
2964 YYABORT;
2966 if (errno == ERANGE) {
2967 lex_error("atan2 result out of range");
2968 YYABORT;
2971 break;}
2972 case 220:
2973 #line 1455 "pic.y"
2975 errno = 0;
2976 yyval.x = log10(yyvsp[-1].x);
2977 if (errno == ERANGE) {
2978 lex_error("log result out of range");
2979 YYABORT;
2982 break;}
2983 case 221:
2984 #line 1464 "pic.y"
2986 errno = 0;
2987 yyval.x = pow(10.0, yyvsp[-1].x);
2988 if (errno == ERANGE) {
2989 lex_error("exp result out of range");
2990 YYABORT;
2993 break;}
2994 case 222:
2995 #line 1473 "pic.y"
2997 errno = 0;
2998 yyval.x = sqrt(yyvsp[-1].x);
2999 if (errno == EDOM) {
3000 lex_error("sqrt argument out of domain");
3001 YYABORT;
3004 break;}
3005 case 223:
3006 #line 1482 "pic.y"
3007 { yyval.x = yyvsp[-3].x > yyvsp[-1].x ? yyvsp[-3].x : yyvsp[-1].x; ;
3008 break;}
3009 case 224:
3010 #line 1484 "pic.y"
3011 { yyval.x = yyvsp[-3].x < yyvsp[-1].x ? yyvsp[-3].x : yyvsp[-1].x; ;
3012 break;}
3013 case 225:
3014 #line 1486 "pic.y"
3015 { yyval.x = floor(yyvsp[-1].x); ;
3016 break;}
3017 case 226:
3018 #line 1488 "pic.y"
3019 { yyval.x = 1.0 + floor(((rand()&0x7fff)/double(0x7fff))*yyvsp[-1].x); ;
3020 break;}
3021 case 227:
3022 #line 1490 "pic.y"
3024 /* return a random number in the range [0,1) */
3025 /* portable, but not very random */
3026 yyval.x = (rand() & 0x7fff) / double(0x8000);
3028 break;}
3029 case 228:
3030 #line 1496 "pic.y"
3031 { yyval.x = (yyvsp[-2].x < yyvsp[0].x); ;
3032 break;}
3033 case 229:
3034 #line 1498 "pic.y"
3035 { yyval.x = (yyvsp[-2].x <= yyvsp[0].x); ;
3036 break;}
3037 case 230:
3038 #line 1500 "pic.y"
3039 { yyval.x = (yyvsp[-2].x > yyvsp[0].x); ;
3040 break;}
3041 case 231:
3042 #line 1502 "pic.y"
3043 { yyval.x = (yyvsp[-2].x >= yyvsp[0].x); ;
3044 break;}
3045 case 232:
3046 #line 1504 "pic.y"
3047 { yyval.x = (yyvsp[-2].x == yyvsp[0].x); ;
3048 break;}
3049 case 233:
3050 #line 1506 "pic.y"
3051 { yyval.x = (yyvsp[-2].x != yyvsp[0].x); ;
3052 break;}
3053 case 234:
3054 #line 1508 "pic.y"
3055 { yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); ;
3056 break;}
3057 case 235:
3058 #line 1510 "pic.y"
3059 { yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); ;
3060 break;}
3061 case 236:
3062 #line 1512 "pic.y"
3063 { yyval.x = (yyvsp[0].x == 0.0); ;
3064 break;}
3066 /* the action file gets copied in in place of this dollarsign */
3067 #line 442 "/usr/local/lib/bison.simple"
3069 yyvsp -= yylen;
3070 yyssp -= yylen;
3071 #ifdef YYLSP_NEEDED
3072 yylsp -= yylen;
3073 #endif
3075 #if YYDEBUG != 0
3076 if (yydebug)
3078 short *ssp1 = yyss - 1;
3079 fprintf (stderr, "state stack now");
3080 while (ssp1 != yyssp)
3081 fprintf (stderr, " %d", *++ssp1);
3082 fprintf (stderr, "\n");
3084 #endif
3086 *++yyvsp = yyval;
3088 #ifdef YYLSP_NEEDED
3089 yylsp++;
3090 if (yylen == 0)
3092 yylsp->first_line = yylloc.first_line;
3093 yylsp->first_column = yylloc.first_column;
3094 yylsp->last_line = (yylsp-1)->last_line;
3095 yylsp->last_column = (yylsp-1)->last_column;
3096 yylsp->text = 0;
3098 else
3100 yylsp->last_line = (yylsp+yylen-1)->last_line;
3101 yylsp->last_column = (yylsp+yylen-1)->last_column;
3103 #endif
3105 /* Now "shift" the result of the reduction.
3106 Determine what state that goes to,
3107 based on the state we popped back to
3108 and the rule number reduced by. */
3110 yyn = yyr1[yyn];
3112 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
3113 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
3114 yystate = yytable[yystate];
3115 else
3116 yystate = yydefgoto[yyn - YYNTBASE];
3118 goto yynewstate;
3120 yyerrlab: /* here on detecting error */
3122 if (! yyerrstatus)
3123 /* If not already recovering from an error, report this error. */
3125 ++yynerrs;
3127 #ifdef YYERROR_VERBOSE
3128 yyn = yypact[yystate];
3130 if (yyn > YYFLAG && yyn < YYLAST)
3132 int size = 0;
3133 char *msg;
3134 int x, count;
3136 count = 0;
3137 for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
3138 if (yycheck[x + yyn] == x)
3139 size += strlen(yytname[x]) + 15, count++;
3140 msg = (char *) malloc(size + 15);
3141 if (msg != 0)
3143 strcpy(msg, "parse error");
3145 if (count < 5)
3147 count = 0;
3148 for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
3149 if (yycheck[x + yyn] == x)
3151 strcat(msg, count == 0 ? ", expecting `" : " or `");
3152 strcat(msg, yytname[x]);
3153 strcat(msg, "'");
3154 count++;
3157 yyerror(msg);
3158 free(msg);
3160 else
3161 yyerror ("parse error; also virtual memory exceeded");
3163 else
3164 #endif /* YYERROR_VERBOSE */
3165 yyerror("parse error");
3168 goto yyerrlab1;
3169 yyerrlab1: /* here on error raised explicitly by an action */
3171 if (yyerrstatus == 3)
3173 /* if just tried and failed to reuse lookahead token after an error, discard it. */
3175 /* return failure if at end of input */
3176 if (yychar == YYEOF)
3177 YYABORT;
3179 #if YYDEBUG != 0
3180 if (yydebug)
3181 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
3182 #endif
3184 yychar = YYEMPTY;
3187 /* Else will try to reuse lookahead token
3188 after shifting the error token. */
3190 yyerrstatus = 3; /* Each real token shifted decrements this */
3192 goto yyerrhandle;
3194 yyerrdefault: /* current state does not do anything special for the error token. */
3196 #if 0
3197 /* This is wrong; only states that explicitly want error tokens
3198 should shift them. */
3199 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
3200 if (yyn) goto yydefault;
3201 #endif
3203 yyerrpop: /* pop the current state because it cannot handle the error token */
3205 if (yyssp == yyss) YYABORT;
3206 yyvsp--;
3207 yystate = *--yyssp;
3208 #ifdef YYLSP_NEEDED
3209 yylsp--;
3210 #endif
3212 #if YYDEBUG != 0
3213 if (yydebug)
3215 short *ssp1 = yyss - 1;
3216 fprintf (stderr, "Error: state stack now");
3217 while (ssp1 != yyssp)
3218 fprintf (stderr, " %d", *++ssp1);
3219 fprintf (stderr, "\n");
3221 #endif
3223 yyerrhandle:
3225 yyn = yypact[yystate];
3226 if (yyn == YYFLAG)
3227 goto yyerrdefault;
3229 yyn += YYTERROR;
3230 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
3231 goto yyerrdefault;
3233 yyn = yytable[yyn];
3234 if (yyn < 0)
3236 if (yyn == YYFLAG)
3237 goto yyerrpop;
3238 yyn = -yyn;
3239 goto yyreduce;
3241 else if (yyn == 0)
3242 goto yyerrpop;
3244 if (yyn == YYFINAL)
3245 YYACCEPT;
3247 #if YYDEBUG != 0
3248 if (yydebug)
3249 fprintf(stderr, "Shifting error token, ");
3250 #endif
3252 *++yyvsp = yylval;
3253 #ifdef YYLSP_NEEDED
3254 *++yylsp = yylloc;
3255 #endif
3257 yystate = yyn;
3258 goto yynewstate;
3260 #line 1516 "pic.y"
3263 /* bison defines const to be empty unless __STDC__ is defined, which it
3264 isn't under cfront */
3266 #ifdef const
3267 #undef const
3268 #endif
3270 static struct {
3271 const char *name;
3272 double val;
3273 int scaled; // non-zero if val should be multiplied by scale
3274 } defaults_table[] = {
3275 "arcrad", .25, 1,
3276 "arrowht", .1, 1,
3277 "arrowwid", .05, 1,
3278 "circlerad", .25, 1,
3279 "boxht", .5, 1,
3280 "boxwid", .75, 1,
3281 "boxrad", 0.0, 1,
3282 "dashwid", .05, 1,
3283 "ellipseht", .5, 1,
3284 "ellipsewid", .75, 1,
3285 "moveht", .5, 1,
3286 "movewid", .5, 1,
3287 "lineht", .5, 1,
3288 "linewid", .5, 1,
3289 "textht", 0.0, 1,
3290 "textwid", 0.0, 1,
3291 "scale", 1.0, 0,
3292 "linethick", -1.0, 0, // in points
3293 "fillval", .5, 0,
3294 "arrowhead", 1.0, 0,
3295 "maxpswid", 8.5, 0,
3296 "maxpsht", 11.0, 0,
3299 place *lookup_label(const char *label)
3301 saved_state *state = current_saved_state;
3302 PTABLE(place) *tbl = current_table;
3303 for (;;) {
3304 place *pl = tbl->lookup(label);
3305 if (pl)
3306 return pl;
3307 if (!state)
3308 return 0;
3309 tbl = state->tbl;
3310 state = state->prev;
3314 void define_label(const char *label, const place *pl)
3316 place *p = new place;
3317 *p = *pl;
3318 current_table->define(label, p);
3321 int lookup_variable(const char *name, double *val)
3323 place *pl = lookup_label(name);
3324 if (pl) {
3325 *val = pl->x;
3326 return 1;
3328 return 0;
3331 void define_variable(const char *name, double val)
3333 place *p = new place;
3334 p->obj = 0;
3335 p->x = val;
3336 p->y = 0.0;
3337 current_table->define(name, p);
3338 if (strcmp(name, "scale") == 0) {
3339 // When the scale changes, reset all scaled pre-defined variables to
3340 // their default values.
3341 for (int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++)
3342 if (defaults_table[i].scaled)
3343 define_variable(defaults_table[i].name, val*defaults_table[i].val);
3347 // called once only (not once per parse)
3349 void parse_init()
3351 current_direction = RIGHT_DIRECTION;
3352 current_position.x = 0.0;
3353 current_position.y = 0.0;
3354 // This resets everything to its default value.
3355 reset_all();
3358 void reset(const char *nm)
3360 for (int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++)
3361 if (strcmp(nm, defaults_table[i].name) == 0) {
3362 double val = defaults_table[i].val;
3363 if (defaults_table[i].scaled) {
3364 double scale;
3365 lookup_variable("scale", &scale);
3366 val *= scale;
3368 define_variable(defaults_table[i].name, val);
3369 return;
3371 lex_error("`%1' is not a predefined variable", nm);
3374 void reset_all()
3376 // We only have to explicitly reset the pre-defined variables that
3377 // aren't scaled because `scale' is not scaled, and changing the
3378 // value of `scale' will reset all the pre-defined variables that
3379 // are scaled.
3380 for (int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++)
3381 if (!defaults_table[i].scaled)
3382 define_variable(defaults_table[i].name, defaults_table[i].val);
3385 // called after each parse
3387 void parse_cleanup()
3389 while (current_saved_state != 0) {
3390 delete current_table;
3391 current_table = current_saved_state->tbl;
3392 saved_state *tem = current_saved_state;
3393 current_saved_state = current_saved_state->prev;
3394 delete tem;
3396 assert(current_table == &top_table);
3397 PTABLE_ITERATOR(place) iter(current_table);
3398 const char *key;
3399 place *pl;
3400 while (iter.next(&key, &pl))
3401 if (pl->obj != 0) {
3402 position pos = pl->obj->origin();
3403 pl->obj = 0;
3404 pl->x = pos.x;
3405 pl->y = pos.y;
3407 while (olist.head != 0) {
3408 object *tem = olist.head;
3409 olist.head = olist.head->next;
3410 delete tem;
3412 olist.tail = 0;
3413 current_direction = RIGHT_DIRECTION;
3414 current_position.x = 0.0;
3415 current_position.y = 0.0;
3418 const char *ordinal_postfix(int n)
3420 if (n < 10 || n > 20)
3421 switch (n % 10) {
3422 case 1:
3423 return "st";
3424 case 2:
3425 return "nd";
3426 case 3:
3427 return "rd";
3429 return "th";
3432 const char *object_type_name(object_type type)
3434 switch (type) {
3435 case BOX_OBJECT:
3436 return "box";
3437 case CIRCLE_OBJECT:
3438 return "circle";
3439 case ELLIPSE_OBJECT:
3440 return "ellipse";
3441 case ARC_OBJECT:
3442 return "arc";
3443 case SPLINE_OBJECT:
3444 return "spline";
3445 case LINE_OBJECT:
3446 return "line";
3447 case ARROW_OBJECT:
3448 return "arrow";
3449 case MOVE_OBJECT:
3450 return "move";
3451 case TEXT_OBJECT:
3452 return "\"\"";
3453 case BLOCK_OBJECT:
3454 return "[]";
3455 case OTHER_OBJECT:
3456 case MARK_OBJECT:
3457 default:
3458 break;
3460 return "object";
3463 static char sprintf_buf[1024];
3465 char *format_number(const char *form, double n)
3467 if (form == 0)
3468 form = "%g";
3469 else {
3470 // this is a fairly feeble attempt at validation of the format
3471 int nspecs = 0;
3472 for (const char *p = form; *p != '\0'; p++)
3473 if (*p == '%') {
3474 if (p[1] == '%')
3475 p++;
3476 else
3477 nspecs++;
3479 if (nspecs > 1) {
3480 lex_error("bad format `%1'", form);
3481 return strsave(form);
3484 sprintf(sprintf_buf, form, n);
3485 return strsave(sprintf_buf);
3488 char *do_sprintf(const char *form, const double *v, int nv)
3490 string result;
3491 int i = 0;
3492 string one_format;
3493 while (*form) {
3494 if (*form == '%') {
3495 one_format += *form++;
3496 for (; *form != '\0' && strchr("#-+ 0123456789.", *form) != 0; form++)
3497 one_format += *form;
3498 if (*form == '\0' || strchr("eEfgG%", *form) == 0) {
3499 lex_error("bad sprintf format");
3500 result += one_format;
3501 result += form;
3502 break;
3504 if (*form == '%') {
3505 one_format += *form++;
3506 one_format += '\0';
3507 sprintf(sprintf_buf, one_format.contents());
3509 else {
3510 if (i >= nv) {
3511 lex_error("too few arguments to sprintf");
3512 result += one_format;
3513 result += form;
3514 break;
3516 one_format += *form++;
3517 one_format += '\0';
3518 sprintf(sprintf_buf, one_format.contents(), v[i++]);
3520 one_format.clear();
3521 result += sprintf_buf;
3523 else
3524 result += *form++;
3526 result += '\0';
3527 return strsave(result.contents());