/* A Bison parser, made from gram.yy by GNU Bison version 1.28 */ #define YYBISON 1 /* Identify Bison output. */ #define LABEL 257 #define VARIABLE 258 #define NUMBER 259 #define TEXT 260 #define COMMAND_LINE 261 #define DELIMITED 262 #define ORDINAL 263 #define TH 264 #define LEFT_ARROW_HEAD 265 #define RIGHT_ARROW_HEAD 266 #define DOUBLE_ARROW_HEAD 267 #define LAST 268 #define UP 269 #define DOWN 270 #define LEFT 271 #define RIGHT 272 #define BOX 273 #define CIRCLE 274 #define ELLIPSE 275 #define ARC 276 #define LINE 277 #define ARROW 278 #define MOVE 279 #define SPLINE 280 #define HEIGHT 281 #define RADIUS 282 #define WIDTH 283 #define DIAMETER 284 #define FROM 285 #define TO 286 #define AT 287 #define WITH 288 #define BY 289 #define THEN 290 #define DOTTED 291 #define DASHED 292 #define CHOP 293 #define SAME 294 #define INVISIBLE 295 #define LJUST 296 #define RJUST 297 #define ABOVE 298 #define BELOW 299 #define OF 300 #define THE 301 #define WAY 302 #define BETWEEN 303 #define AND 304 #define HERE 305 #define DOT_N 306 #define DOT_E 307 #define DOT_W 308 #define DOT_S 309 #define DOT_NE 310 #define DOT_SE 311 #define DOT_NW 312 #define DOT_SW 313 #define DOT_C 314 #define DOT_START 315 #define DOT_END 316 #define DOT_X 317 #define DOT_Y 318 #define DOT_HT 319 #define DOT_WID 320 #define DOT_RAD 321 #define SIN 322 #define COS 323 #define ATAN2 324 #define LOG 325 #define EXP 326 #define SQRT 327 #define K_MAX 328 #define K_MIN 329 #define INT 330 #define RAND 331 #define SRAND 332 #define COPY 333 #define THRU 334 #define TOP 335 #define BOTTOM 336 #define UPPER 337 #define LOWER 338 #define SH 339 #define PRINT 340 #define CW 341 #define CCW 342 #define FOR 343 #define DO 344 #define IF 345 #define ELSE 346 #define ANDAND 347 #define OROR 348 #define NOTEQUAL 349 #define EQUALEQUAL 350 #define LESSEQUAL 351 #define GREATEREQUAL 352 #define LEFT_CORNER 353 #define RIGHT_CORNER 354 #define CENTER 355 #define END 356 #define START 357 #define RESET 358 #define UNTIL 359 #define PLOT 360 #define THICKNESS 361 #define FILL 362 #define ALIGNED 363 #define SPRINTF 364 #define COMMAND 365 #define DEFINE 366 #define UNDEF 367 #line 5 "gram.yy" #include "pic.h" #include "object.h" ////////////////////////////////////////////////////////////////////// // PIC PARSER // Public interface: // // parse_init() [should be called only once] // yyparse() // parse_cleanup() [should be called after each parse] // define_variable(), lookup_variable() [declared in object.h, // also used in lex.cc for `for' loops] // // delim_flag [state flag read by lexer in lex.cc] // // The parser makes heavy use of special functions provided by the lexer, // such as do_copy(), do_for(), copy_file_thru(), copy_rest_thru(), // push_body(), and especially do_lookahead(). It also calls lex_warning() // and lex_error(). ////////////////////////////////////////////////////////////////////// #undef fmod #undef rand #undef srand extern "C" { double fmod(double, double); int rand(); void srand(unsigned int); } // Maximum number of characters produced by printf("%g") #define GDIGITS 14 static char sprintf_buf[1024]; direction current_direction; position current_position; implement_ptable(place) PTABLE(place) top_table; PTABLE(place) *current_table = &top_table; saved_state *current_saved_state = 0; object_list olist; // external variable, used by lexer int delim_flag = 0; // forward references static place *lookup_label(const char *label); static void define_label(const char *label, const place *pl); static void reset (const char *nm); static void reset_all (void); static const char * ordinal_postfix(int n); static const char * object_type_name(object_type type); static char * format_number(const char *form, double n); static char * do_sprintf(const char *form, const double *v, int nv); #line 70 "gram.yy" typedef union { char *str; int n; double x; struct { double x, y; } pair; struct { double x; char *body; } if_data; struct { char *str; const char *filename; int lineno; } lstr; struct { double *v; int nv; int maxv; } dv; struct { double val; int is_multiplicative; } by; place pl; object *obj; corner crn; path *pth; object_spec *spec; saved_state *pstate; graphics_state state; object_type obtype; } YYSTYPE; #include #ifndef __cplusplus #ifndef __STDC__ #define const #endif #endif #define YYFINAL 413 #define YYFLAG -32768 #define YYNTBASE 135 #define YYTRANSLATE(x) ((unsigned)(x) <= 367 ? yytranslate[x] : 180) static const short yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 124, 2, 2, 2, 123, 2, 2, 114, 133, 121, 119, 116, 120, 134, 122, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 128, 126, 117, 127, 118, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 131, 2, 132, 125, 2, 115, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 129, 2, 130, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113 }; #if YYDEBUG != 0 static const short yyprhs[] = { 0, 0, 2, 4, 8, 10, 14, 15, 17, 19, 22, 26, 31, 33, 35, 37, 39, 41, 44, 47, 48, 52, 55, 56, 57, 65, 66, 67, 74, 75, 86, 88, 89, 94, 96, 98, 101, 104, 108, 110, 113, 115, 117, 119, 120, 126, 127, 130, 132, 134, 138, 142, 146, 150, 154, 158, 162, 166, 169, 170, 173, 177, 179, 184, 189, 194, 195, 196, 203, 205, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 229, 233, 234, 239, 243, 247, 251, 255, 258, 261, 265, 268, 272, 275, 279, 282, 286, 290, 294, 298, 302, 306, 309, 312, 316, 319, 323, 326, 330, 333, 337, 340, 343, 346, 349, 352, 355, 358, 361, 364, 367, 370, 373, 377, 380, 382, 388, 389, 393, 395, 397, 399, 403, 407, 413, 419, 426, 428, 433, 437, 441, 443, 446, 449, 453, 455, 457, 459, 463, 465, 469, 471, 474, 477, 480, 482, 484, 486, 488, 490, 492, 494, 497, 499, 502, 506, 508, 510, 513, 515, 521, 526, 530, 534, 537, 539, 541, 543, 545, 547, 549, 551, 553, 555, 557, 559, 561, 563, 565, 567, 570, 573, 576, 579, 581, 583, 586, 589, 592, 595, 597, 599, 601, 603, 605, 608, 611, 614, 617, 620, 624, 628, 632, 636, 640, 644, 647, 651, 656, 661, 668, 673, 678, 683, 690, 697, 702, 707, 711, 716, 720, 724, 728, 732, 736, 740, 744, 748 }; static const short yyrhs[] = { 138, 0, 136, 0, 138, 137, 138, 0, 157, 0, 137, 139, 157, 0, 0, 139, 0, 126, 0, 139, 126, 0, 4, 127, 154, 0, 4, 128, 127, 154, 0, 15, 0, 16, 0, 17, 0, 18, 0, 7, 0, 111, 149, 0, 86, 149, 0, 0, 85, 141, 8, 0, 79, 6, 0, 0, 0, 79, 6, 80, 142, 8, 143, 153, 0, 0, 0, 79, 80, 144, 8, 145, 153, 0, 0, 89, 4, 127, 179, 32, 179, 156, 90, 146, 8, 0, 151, 0, 0, 151, 92, 147, 8, 0, 148, 0, 104, 0, 104, 4, 0, 148, 4, 0, 148, 116, 4, 0, 150, 0, 149, 150, 0, 179, 0, 163, 0, 165, 0, 0, 91, 154, 36, 152, 8, 0, 0, 105, 6, 0, 179, 0, 155, 0, 163, 96, 163, 0, 163, 95, 163, 0, 155, 93, 155, 0, 155, 93, 179, 0, 179, 93, 155, 0, 155, 94, 155, 0, 155, 94, 179, 0, 179, 94, 155, 0, 124, 155, 0, 0, 35, 179, 0, 35, 121, 179, 0, 161, 0, 3, 128, 138, 157, 0, 3, 128, 138, 166, 0, 3, 128, 138, 169, 0, 0, 0, 129, 158, 136, 130, 159, 160, 0, 140, 0, 0, 157, 0, 19, 0, 20, 0, 21, 0, 22, 0, 23, 0, 24, 0, 25, 0, 26, 0, 163, 0, 106, 179, 0, 106, 179, 163, 0, 0, 131, 162, 136, 132, 0, 161, 27, 179, 0, 161, 28, 179, 0, 161, 29, 179, 0, 161, 30, 179, 0, 161, 179, 0, 161, 15, 0, 161, 15, 179, 0, 161, 16, 0, 161, 16, 179, 0, 161, 18, 0, 161, 18, 179, 0, 161, 17, 0, 161, 17, 179, 0, 161, 31, 165, 0, 161, 32, 165, 0, 161, 33, 165, 0, 161, 34, 177, 0, 161, 35, 168, 0, 161, 36, 0, 161, 37, 0, 161, 37, 179, 0, 161, 38, 0, 161, 38, 179, 0, 161, 108, 0, 161, 108, 179, 0, 161, 39, 0, 161, 39, 179, 0, 161, 40, 0, 161, 41, 0, 161, 11, 0, 161, 12, 0, 161, 13, 0, 161, 87, 0, 161, 88, 0, 161, 163, 0, 161, 42, 0, 161, 43, 0, 161, 44, 0, 161, 45, 0, 161, 107, 179, 0, 161, 109, 0, 6, 0, 110, 114, 6, 164, 133, 0, 0, 164, 116, 179, 0, 166, 0, 169, 0, 168, 0, 165, 119, 168, 0, 165, 120, 168, 0, 114, 165, 116, 165, 133, 0, 179, 167, 165, 50, 165, 0, 179, 117, 165, 116, 165, 118, 0, 49, 0, 46, 47, 48, 49, 0, 179, 116, 179, 0, 114, 168, 133, 0, 170, 0, 170, 178, 0, 178, 170, 0, 178, 46, 170, 0, 51, 0, 3, 0, 173, 0, 170, 134, 3, 0, 9, 0, 115, 154, 10, 0, 14, 0, 171, 14, 0, 171, 174, 0, 172, 174, 0, 19, 0, 20, 0, 21, 0, 22, 0, 23, 0, 24, 0, 26, 0, 131, 132, 0, 6, 0, 134, 3, 0, 175, 134, 3, 0, 178, 0, 175, 0, 175, 178, 0, 176, 0, 114, 176, 116, 176, 133, 0, 9, 14, 174, 176, 0, 14, 174, 176, 0, 9, 174, 176, 0, 3, 176, 0, 52, 0, 53, 0, 54, 0, 55, 0, 56, 0, 57, 0, 58, 0, 59, 0, 60, 0, 61, 0, 62, 0, 81, 0, 82, 0, 17, 0, 18, 0, 83, 17, 0, 84, 17, 0, 83, 18, 0, 84, 18, 0, 99, 0, 100, 0, 83, 99, 0, 84, 99, 0, 83, 100, 0, 84, 100, 0, 101, 0, 103, 0, 102, 0, 4, 0, 5, 0, 169, 63, 0, 169, 64, 0, 169, 65, 0, 169, 66, 0, 169, 67, 0, 179, 119, 179, 0, 179, 120, 179, 0, 179, 121, 179, 0, 179, 122, 179, 0, 179, 123, 179, 0, 179, 125, 179, 0, 120, 179, 0, 114, 154, 133, 0, 68, 114, 154, 133, 0, 69, 114, 154, 133, 0, 70, 114, 154, 116, 154, 133, 0, 71, 114, 154, 133, 0, 72, 114, 154, 133, 0, 73, 114, 154, 133, 0, 74, 114, 154, 116, 154, 133, 0, 75, 114, 154, 116, 154, 133, 0, 76, 114, 154, 133, 0, 77, 114, 154, 133, 0, 77, 114, 133, 0, 78, 114, 154, 133, 0, 179, 117, 179, 0, 179, 97, 179, 0, 179, 118, 179, 0, 179, 98, 179, 0, 179, 96, 179, 0, 179, 95, 179, 0, 179, 93, 179, 0, 179, 94, 179, 0, 124, 179, 0 }; #endif #if YYDEBUG != 0 static const short yyrline[] = { 0, 264, 266, 274, 279, 282, 286, 288, 291, 293, 296, 302, 315, 317, 319, 321, 323, 328, 333, 339, 342, 350, 357, 360, 362, 370, 373, 375, 382, 385, 391, 399, 402, 413, 414, 418, 421, 423, 427, 430, 450, 458, 460, 468, 472, 475, 478, 482, 485, 489, 496, 502, 504, 506, 508, 510, 512, 514, 519, 522, 524, 528, 544, 546, 554, 560, 566, 573, 576, 584, 587, 591, 596, 600, 604, 609, 616, 623, 630, 637, 642, 647, 654, 669, 681, 687, 693, 699, 705, 725, 732, 739, 746, 753, 760, 767, 774, 781, 788, 803, 816, 822, 829, 842, 848, 854, 860, 866, 871, 877, 896, 916, 921, 926, 931, 936, 941, 946, 951, 959, 970, 981, 992, 1003, 1009, 1016, 1021, 1031, 1038, 1062, 1065, 1073, 1076, 1081, 1086, 1091, 1096, 1103, 1105, 1108, 1111, 1115, 1118, 1124, 1130, 1136, 1144, 1156, 1160, 1168, 1171, 1178, 1181, 1185, 1203, 1222, 1225, 1227, 1229, 1231, 1233, 1235, 1237, 1239, 1243, 1248, 1255, 1263, 1267, 1274, 1279, 1285, 1291, 1297, 1303, 1311, 1314, 1316, 1318, 1320, 1322, 1324, 1326, 1328, 1330, 1332, 1334, 1336, 1338, 1340, 1342, 1344, 1346, 1348, 1350, 1352, 1354, 1356, 1358, 1360, 1362, 1364, 1366, 1370, 1380, 1382, 1389, 1396, 1403, 1410, 1417, 1419, 1421, 1423, 1432, 1441, 1456, 1458, 1460, 1470, 1480, 1495, 1505, 1515, 1525, 1527, 1529, 1531, 1533, 1539, 1541, 1543, 1545, 1547, 1549, 1551, 1553, 1555, 1557 }; #endif #if YYDEBUG != 0 || defined (YYERROR_VERBOSE) static const char * const yytname[] = { "$","error","$undefined.","LABEL", "VARIABLE","NUMBER","TEXT","COMMAND_LINE","DELIMITED","ORDINAL","TH","LEFT_ARROW_HEAD", "RIGHT_ARROW_HEAD","DOUBLE_ARROW_HEAD","LAST","UP","DOWN","LEFT","RIGHT","BOX", "CIRCLE","ELLIPSE","ARC","LINE","ARROW","MOVE","SPLINE","HEIGHT","RADIUS","WIDTH", "DIAMETER","FROM","TO","AT","WITH","BY","THEN","DOTTED","DASHED","CHOP","SAME", "INVISIBLE","LJUST","RJUST","ABOVE","BELOW","OF","THE","WAY","BETWEEN","AND", "HERE","DOT_N","DOT_E","DOT_W","DOT_S","DOT_NE","DOT_SE","DOT_NW","DOT_SW","DOT_C", "DOT_START","DOT_END","DOT_X","DOT_Y","DOT_HT","DOT_WID","DOT_RAD","SIN","COS", "ATAN2","LOG","EXP","SQRT","K_MAX","K_MIN","INT","RAND","SRAND","COPY","THRU", "TOP","BOTTOM","UPPER","LOWER","SH","PRINT","CW","CCW","FOR","DO","IF","ELSE", "ANDAND","OROR","NOTEQUAL","EQUALEQUAL","LESSEQUAL","GREATEREQUAL","LEFT_CORNER", "RIGHT_CORNER","CENTER","END","START","RESET","UNTIL","PLOT","THICKNESS","FILL", "ALIGNED","SPRINTF","COMMAND","DEFINE","UNDEF","'('","'`'","','","'<'","'>'", "'+'","'-'","'*'","'/'","'%'","'!'","'^'","';'","'='","':'","'{'","'}'","'['", "']'","')'","'.'","top","element_list","middle_element_list","optional_separator", "separator","placeless_element","@1","@2","@3","@4","@5","@6","@7","reset_variables", "print_args","print_arg","simple_if","@8","until","any_expr","text_expr","optional_by", "element","@9","@10","optional_element","object_spec","@11","text","sprintf_args", "position","position_not_place","between","expr_pair","place","label","ordinal", "optional_ordinal_last","nth_primitive","object_type","label_path","relative_path", "path","corner","expr", NULL }; #endif static const short yyr1[] = { 0, 135, 135, 136, 137, 137, 138, 138, 139, 139, 140, 140, 140, 140, 140, 140, 140, 140, 140, 141, 140, 140, 142, 143, 140, 144, 145, 140, 146, 140, 140, 147, 140, 140, 140, 148, 148, 148, 149, 149, 150, 150, 150, 152, 151, 153, 153, 154, 154, 155, 155, 155, 155, 155, 155, 155, 155, 155, 156, 156, 156, 157, 157, 157, 157, 158, 159, 157, 157, 160, 160, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 162, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 163, 163, 164, 164, 165, 165, 166, 166, 166, 166, 166, 166, 167, 167, 168, 168, 169, 169, 169, 169, 169, 170, 170, 170, 171, 171, 172, 172, 173, 173, 174, 174, 174, 174, 174, 174, 174, 174, 174, 175, 175, 176, 176, 176, 177, 177, 177, 177, 177, 177, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179 }; static const short yyr2[] = { 0, 1, 1, 3, 1, 3, 0, 1, 1, 2, 3, 4, 1, 1, 1, 1, 1, 2, 2, 0, 3, 2, 0, 0, 7, 0, 0, 6, 0, 10, 1, 0, 4, 1, 1, 2, 2, 3, 1, 2, 1, 1, 1, 0, 5, 0, 2, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 2, 0, 2, 3, 1, 4, 4, 4, 0, 0, 6, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 0, 4, 3, 3, 3, 3, 2, 2, 3, 2, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 2, 2, 3, 2, 3, 2, 3, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 1, 5, 0, 3, 1, 1, 1, 3, 3, 5, 5, 6, 1, 4, 3, 3, 1, 2, 2, 3, 1, 1, 1, 3, 1, 3, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 3, 1, 1, 2, 1, 5, 4, 3, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 2, 3, 4, 4, 6, 4, 4, 4, 6, 6, 4, 4, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 2 }; static const short yydefact[] = { 6, 8, 2, 1, 7, 0, 0, 125, 16, 12, 13, 14, 15, 71, 72, 73, 74, 75, 76, 77, 78, 0, 19, 0, 0, 0, 34, 0, 0, 0, 65, 82, 6, 68, 33, 30, 4, 61, 79, 9, 6, 0, 0, 21, 25, 0, 146, 203, 204, 149, 151, 188, 189, 145, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 186, 187, 0, 0, 194, 195, 200, 202, 201, 0, 0, 0, 0, 18, 38, 41, 42, 129, 131, 130, 141, 0, 0, 147, 0, 40, 0, 0, 0, 0, 48, 0, 0, 47, 35, 80, 0, 17, 6, 6, 3, 7, 36, 0, 31, 113, 114, 115, 89, 91, 95, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 102, 103, 105, 109, 111, 112, 119, 120, 121, 122, 116, 117, 0, 107, 124, 118, 88, 0, 10, 0, 22, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 190, 192, 196, 198, 191, 193, 197, 199, 0, 0, 131, 47, 0, 216, 238, 39, 0, 0, 205, 206, 207, 208, 209, 0, 142, 163, 152, 155, 156, 157, 158, 159, 160, 161, 0, 153, 154, 0, 143, 0, 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 238, 43, 0, 0, 0, 0, 0, 0, 0, 81, 127, 0, 0, 0, 5, 37, 0, 90, 92, 96, 94, 84, 85, 86, 87, 97, 0, 98, 99, 0, 0, 0, 0, 0, 167, 169, 100, 166, 0, 101, 0, 104, 106, 110, 123, 108, 146, 203, 188, 189, 62, 0, 63, 64, 11, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 0, 0, 217, 0, 140, 150, 132, 133, 148, 162, 144, 0, 236, 237, 235, 234, 231, 233, 139, 0, 230, 232, 210, 211, 212, 213, 214, 215, 0, 0, 0, 51, 52, 54, 55, 50, 49, 53, 236, 56, 237, 230, 0, 66, 83, 32, 174, 0, 0, 0, 0, 164, 0, 168, 0, 47, 23, 45, 218, 219, 0, 221, 222, 223, 0, 0, 226, 227, 229, 0, 0, 0, 0, 0, 44, 0, 126, 69, 0, 173, 172, 0, 165, 45, 0, 27, 0, 0, 0, 134, 138, 0, 135, 58, 128, 70, 67, 171, 0, 24, 46, 220, 224, 225, 136, 0, 0, 170, 0, 59, 28, 60, 0, 29, 0, 0, 0 }; static const short yydefgoto[] = { 411, 2, 32, 242, 4, 33, 45, 285, 380, 158, 354, 409, 246, 34, 89, 90, 35, 327, 382, 179, 106, 403, 36, 114, 374, 393, 37, 115, 107, 339, 92, 93, 227, 94, 108, 96, 97, 98, 99, 206, 264, 265, 266, 100, 109 }; static const short yypact[] = { -114, -32768,-32768, 677, -100, -104, -120,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 3,-32768, 899, 29, 1012, 43, 1450, -61, 899,-32768, -32768, -114,-32768, 9, -33,-32768, 786,-32768,-32768, -114, 1012, -66, -13,-32768, 61,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768, -35, -32, -30, -2, 0, 16, 30, 36, 40, 45, 49,-32768,-32768, 70, 80,-32768, -32768,-32768,-32768,-32768, 1125, 1012, 1450, 1450, 899,-32768, -32768, -64,-32768,-32768, 172, 2045, 54, 267,-32768, 8, 2037, -5, 1012, 1012, 126, 48, 4, 172, 2113,-32768, 629, 66, 899, -114, -114,-32768, 649,-32768, 173,-32768, -32768,-32768,-32768, 1904, 1904, 1740, 1822, 1450, 1450, 1450, 1450, 1554, 1554, 1554, 302, 1658,-32768, 1904, 1904, 1904, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 1450, 1904, -32768,-32768, 2122, 530,-32768, 1012,-32768, 175,-32768, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 408, 1012, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 74, -74, 79, 2070, 196, 92, 92,-32768, 1658, 1658,-32768,-32768, -32768,-32768,-32768, 220,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768, 95,-32768,-32768, 18, 90, 193, -32768, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1554, 1450, 1450, 1450, 1450, 1450, 1450, 1450, 1554, 1450,-32768, 92, -32768, 1012, 1012, 19, 19, 1012, 1012, 1450,-32768,-32768, 113, 677, 112,-32768,-32768, 245, 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, -64, 2037, -64, -64, 1977, 152, 267, 1977, 251, 1991,-32768,-32768,-32768, 1238,-32768, 1353, 2122, 2122, 2122, 2122, 2122, -104, -120, 2, 23,-32768, -64, 37, 155,-32768, 247,-32768, 136, 137, 160, 138, 145, 146, 164, 165, 149,-32768, 159, 163,-32768, 1554, -32768,-32768,-32768,-32768,-32768,-32768, 90, 250, 312, 217, 376, 376, 109, 109, 2122, -27, 327, 109, 125, 125, 92, 92, 92, 92, -34, 272, 291,-32768, 312, 208, 2131,-32768,-32768,-32768, 312, 208, 2131, 109, -113,-32768, -32768,-32768,-32768, 267, 1977, 1977, 186,-32768, 300,-32768, 79, 2080,-32768, 202,-32768,-32768, 1012,-32768,-32768,-32768, 1012, 1012,-32768,-32768,-32768, -82, 259, 1554, 1554, 1450, -32768, 1450,-32768, 677, 1977,-32768,-32768, 1977,-32768, 202, 303,-32768, 184, 185, 188,-32768,-32768, -79, -64, 592, 2122,-32768,-32768,-32768, 189,-32768,-32768,-32768,-32768,-32768, -32768, 1342, 233,-32768, 1450, 2122,-32768, 2122, 317,-32768, 326, 328,-32768 }; static const short yypgoto[] = {-32768, 73,-32768, 31, 297,-32768,-32768,-32768,-32768,-32768,-32768, -32768,-32768,-32768, 301, -55,-32768,-32768, -49, 96, -85, -32768, -102,-32768,-32768,-32768,-32768,-32768, 7,-32768, -84, 178,-32768, -42, 6, -72,-32768,-32768,-32768, -93,-32768, -51,-32768, -78, -23 }; #define YYLAST 2256 static const short yytable[] = { 101, 180, -14, 372, 111, 207, 101, 41, 42, 43, 38, 46, 1, 118, 153, 244, 369, 49, 195, 229, 373, 46, 50, -15, 40, 7, 39, 49, 209, 95, 91, 3, 50, 102, 186, 95, 91, 187, 188, 401, 187, 188, 300, 181, 152, 187, 188, 110, 255, 257, 258, 386, 280, 112, 208, 187, 188, 267, 186, 120, 196, 156, 182, 116, 184, 185, 101, 157, 197, 159, 281, 154, 240, 198, 199, 200, 201, 202, 203, 160, 204, 230, 161, 44, 162, 187, 188, 171, 172, 368, 101, 95, 187, 188, 269, 95, 91, 175, 176, 234, 235, 247, 248, 249, 250, 251, 252, 253, 254, 256, 256, 256, 163, 270, 164, 271, 272, 273, 239, 95, 91, 105, 228, 86, 38, 119, 274, 275, -14, 28, 165, 256, -14, 86, -14, 316, 307, 155, 95, 95, 95, 232, 233, 325, 166, 303, 304, 328, 330, -15, 167, 334, 336, -15, 168, -15, -129, -129, 196, 169, 283, 38, 231, 170, 270, 270, 344, 345, 346, 173, 174, 198, 199, 200, 201, 202, 203, 245, 204, 177, 178, 267, 183, 286, 267, 205, 350, 241, 243, 309, 310, 311, 312, 313, 314, 315, 317, 318, 319, 320, 321, 322, 323, 324, 256, 326, 302, 299, 343, 329, 331, 347, 301, 335, 337, 338, 366, 226, 189, 190, 191, 192, 193, 305, 194, 95, 351, 306, 221, 222, 223, 224, 225, 95, 226, 189, 190, 191, 192, 193, 308, 332, 333, 340, 341, 352, 223, 224, 225, 38, 226, 375, 284, 342, 348, 353, 287, 288, 289, 290, 291, 292, 293, 294, 295, 297, 298, 267, 267, 355, 356, 358, 392, 196, -130, -130, 357, 256, 359, 360, 361, 362, 363, 205, 388, 389, 198, 199, 200, 201, 202, 203, 364, 204, 376, 377, 365, 267, 367, 371, 267, 232, 378, 379, 370, 259, 95, 381, 387, 397, 212, 260, 214, 215, 216, 217, 261, 398, 399, 51, 52, 400, 404, 407, 394, 410, 412, 395, 413, 117, 113, 396, 282, 0, 238, 220, 221, 222, 223, 224, 225, 0, 226, 0, 0, 256, 256, 390, 0, 391, 0, 0, 0, 0, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 212, 213, 214, 215, 216, 217, 0, 0, 210, 95, 95, 211, 0, 0, 406, 0, 38, 408, 76, 77, 78, 79, 0, 0, 238, 220, 221, 222, 223, 224, 225, 0, 226, 205, 0, 0, 80, 81, 82, 83, 84, 0, 214, 215, 216, 217, 46, 47, 48, 7, 0, 262, 49, 0, 0, 0, 0, 50, 0, 0, 51, 52, 0, 0, 238, 220, 221, 222, 223, 224, 225, 263, 226, 0, 0, 0, 0, 0, 0, 0, 0, 221, 222, 223, 224, 225, 0, 226, 383, 0, 0, 0, 384, 385, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 216, 217, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 238, 220, 221, 222, 223, 224, 225, 0, 226, 0, 0, 0, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 103, 86, 0, 0, 0, 0, 87, 0, 0, 0, 104, 276, 277, 48, 7, 8, 0, 49, 0, 296, 0, 0, 50, 9, 10, 278, 279, 13, 14, 15, 16, 17, 18, 19, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 21, 0, 76, 77, 78, 79, 22, 23, 0, 0, 24, 0, 25, 0, 0, 0, 0, 0, 402, 0, 80, 81, 82, 83, 84, 26, 7, 27, 0, 0, 0, 28, 29, 0, 0, 85, 86, 0, 0, 0, 0, 87, 0, 5, 6, 88, 7, 8, 0, 0, 30, 0, 31, 0, 0, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 0, 0, 0, 0, 5, 6, 0, 7, 8, 212, 213, 214, 215, 216, 217, 0, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 0, 0, 0, 0, 0, 238, 220, 221, 222, 223, 224, 225, 0, 226, 0, 0, 0, 0, 212, 213, 214, 215, 216, 217, 21, 0, 0, 0, 0, 0, 22, 23, 0, 0, 24, 28, 25, 0, 0, 0, 0, 0, 238, 220, 221, 222, 223, 224, 225, 26, 226, 27, 21, 0, 0, 28, 29, 0, 22, 23, 0, 0, 24, 0, 25, 0, 0, 0, 0, 0, 0, 39, 0, 0, 30, 0, 31, 26, 0, 27, 0, 0, 0, 28, 29, 46, 47, 48, 7, 0, 0, 49, 0, 121, 122, 123, 50, 124, 125, 126, 127, 0, 30, 0, 31, 0, 0, 0, 0, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 0, 0, 147, 148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 149, 150, 151, 28, 0, 0, 0, 103, 86, 46, 47, 48, 7, 87, 0, 49, 0, 88, 0, 0, 50, 0, 0, 51, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 85, 86, 46, 47, 48, 7, 87, 0, 49, 0, 88, 0, 0, 50, 0, 0, 51, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 103, 86, 46, 47, 48, 7, 87, 0, 49, 0, 104, 0, 0, 50, 0, 0, 51, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 85, 86, 46, 47, 48, 7, 87, 0, 49, 0, 104, 0, 0, 50, 0, 0, 51, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 46, 47, 48, 28, 0, 0, 49, 268, 86, 0, 0, 50, 0, 87, 51, 52, 0, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, 84, 212, 213, 214, 215, 216, 217, 0, 46, 47, 48, 103, 86, 0, 49, 0, 0, 87, 405, 50, 0, 88, 51, 52, 218, 238, 220, 221, 222, 223, 224, 225, 0, 226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 46, 47, 48, 0, 0, 0, 49, 103, 86, 0, 0, 50, 0, 87, 51, 52, 0, 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 46, 47, 48, 0, 0, 0, 49, 85, 86, 0, 0, 50, 0, 87, 51, 52, 0, 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 46, 47, 48, 0, 0, 0, 49, 0, 0, 0, 0, 50, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 268, 86, 0, 0, 0, 0, 87, 0, 0, 0, 88, 0, 0, 0, -188, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 46, 47, 48, 0, 0, 0, 49, 0, 0, 0, 0, 50, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 103, 86, 0, 0, 0, 0, 87, 0, 0, 0, 88, 0, 0, 0, -189, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 46, 47, 48, 0, 0, 0, 49, 0, 0, 0, 0, 50, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 103, 86, 0, 0, 0, 0, 87, 0, 0, 0, 88, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 76, 77, 78, 79, 0, 0, 0, 0, 0, 51, 52, 0, 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, 84, 51, 52, 0, 0, 0, 0, 0, 0, 0, 0, 103, 86, 0, 0, 0, 0, 87, 0, 0, 0, 88, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 76, 77, 78, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 77, 78, 79, 80, 81, 82, 83, 84, 0, 0, 210, 0, 0, 211, 0, 0, 0, 80, 81, 82, 83, 84, 0, 0, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 0, 0, 0, 263, 0, 0, 0, 0, 210, 0, 0, 211, 0, 0, 0, 0, 0, 349, 76, 77, 78, 79, 212, 213, 214, 215, 216, 217, 0, 0, 0, 0, 0, 0, 0, 0, 80, 81, 82, 83, 84, 0, 0, 0, 0, 218, 219, 220, 221, 222, 223, 224, 225, 0, 226, 236, 237, 214, 215, 216, 217, 0, 0, 0, 0, 236, 237, 214, 215, 216, 217, 194, 0, 0, 0, 0, 0, 0, 218, 219, 220, 221, 222, 223, 224, 225, 0, 226, 218, 238, 220, 221, 222, 223, 224, 225, 0, 226, 236, 237, 214, 215, 216, 217, 0, 0, 0, 212, 213, 214, 215, 216, 217, 0, 0, 0, 236, 0, 214, 215, 216, 217, 238, 220, 221, 222, 223, 224, 225, 0, 226, 238, 220, 221, 222, 223, 224, 225, 0, 226, 238, 220, 221, 222, 223, 224, 225, 0, 226 }; static const short yycheck[] = { 23, 85, 0, 116, 27, 98, 29, 127, 128, 6, 3, 3, 126, 4, 37, 117, 50, 9, 96, 104, 133, 3, 14, 0, 128, 6, 126, 9, 100, 23, 23, 0, 14, 4, 89, 29, 29, 119, 120, 118, 119, 120, 116, 85, 37, 119, 120, 4, 132, 133, 134, 133, 154, 114, 46, 119, 120, 135, 113, 92, 6, 127, 85, 32, 87, 88, 89, 80, 14, 8, 154, 40, 6, 19, 20, 21, 22, 23, 24, 114, 26, 104, 114, 80, 114, 119, 120, 17, 18, 116, 113, 85, 119, 120, 136, 89, 89, 17, 18, 95, 96, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 114, 136, 114, 138, 139, 140, 111, 113, 113, 25, 127, 115, 117, 116, 149, 150, 126, 110, 114, 154, 130, 115, 132, 219, 208, 41, 132, 133, 134, 93, 94, 227, 114, 187, 188, 232, 233, 126, 114, 236, 237, 130, 114, 132, 119, 120, 6, 114, 154, 154, 36, 114, 187, 188, 14, 260, 261, 99, 100, 19, 20, 21, 22, 23, 24, 4, 26, 99, 100, 259, 86, 8, 262, 131, 264, 114, 115, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 10, 133, 259, 232, 233, 262, 133, 236, 237, 238, 300, 125, 63, 64, 65, 66, 67, 3, 134, 219, 268, 132, 119, 120, 121, 122, 123, 227, 125, 63, 64, 65, 66, 67, 47, 234, 235, 130, 132, 268, 121, 122, 123, 242, 125, 344, 156, 8, 3, 8, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 345, 346, 133, 133, 133, 374, 6, 119, 120, 116, 300, 133, 133, 116, 116, 133, 131, 368, 369, 19, 20, 21, 22, 23, 24, 133, 26, 345, 346, 133, 375, 48, 8, 378, 93, 116, 3, 32, 3, 300, 105, 49, 6, 93, 9, 95, 96, 97, 98, 14, 133, 133, 17, 18, 133, 133, 90, 375, 8, 0, 378, 0, 32, 29, 380, 154, -1, 117, 118, 119, 120, 121, 122, 123, -1, 125, -1, -1, 368, 369, 370, -1, 372, -1, -1, -1, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 93, 94, 95, 96, 97, 98, -1, -1, 46, 368, 369, 49, -1, -1, 402, -1, 374, 405, 81, 82, 83, 84, -1, -1, 117, 118, 119, 120, 121, 122, 123, -1, 125, 131, -1, -1, 99, 100, 101, 102, 103, -1, 95, 96, 97, 98, 3, 4, 5, 6, -1, 114, 9, -1, -1, -1, -1, 14, -1, -1, 17, 18, -1, -1, 117, 118, 119, 120, 121, 122, 123, 134, 125, -1, -1, -1, -1, -1, -1, -1, -1, 119, 120, 121, 122, 123, -1, 125, 357, -1, -1, -1, 361, 362, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, 97, 98, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, 117, 118, 119, 120, 121, 122, 123, -1, 125, -1, -1, -1, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, -1, -1, -1, 110, -1, -1, -1, 114, 115, -1, -1, -1, -1, 120, -1, -1, -1, 124, 3, 4, 5, 6, 7, -1, 9, -1, 133, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, -1, 81, 82, 83, 84, 85, 86, -1, -1, 89, -1, 91, -1, -1, -1, -1, -1, 35, -1, 99, 100, 101, 102, 103, 104, 6, 106, -1, -1, -1, 110, 111, -1, -1, 114, 115, -1, -1, -1, -1, 120, -1, 3, 4, 124, 6, 7, -1, -1, 129, -1, 131, -1, -1, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, -1, -1, -1, -1, 3, 4, -1, 6, 7, 93, 94, 95, 96, 97, 98, -1, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, -1, -1, -1, -1, -1, 117, 118, 119, 120, 121, 122, 123, -1, 125, -1, -1, -1, -1, 93, 94, 95, 96, 97, 98, 79, -1, -1, -1, -1, -1, 85, 86, -1, -1, 89, 110, 91, -1, -1, -1, -1, -1, 117, 118, 119, 120, 121, 122, 123, 104, 125, 106, 79, -1, -1, 110, 111, -1, 85, 86, -1, -1, 89, -1, 91, -1, -1, -1, -1, -1, -1, 126, -1, -1, 129, -1, 131, 104, -1, 106, -1, -1, -1, 110, 111, 3, 4, 5, 6, -1, -1, 9, -1, 11, 12, 13, 14, 15, 16, 17, 18, -1, 129, -1, 131, -1, -1, -1, -1, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, -1, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, -1, -1, 87, 88, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, 107, 108, 109, 110, -1, -1, -1, 114, 115, 3, 4, 5, 6, 120, -1, 9, -1, 124, -1, -1, 14, -1, -1, 17, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, -1, -1, -1, 110, -1, -1, -1, 114, 115, 3, 4, 5, 6, 120, -1, 9, -1, 124, -1, -1, 14, -1, -1, 17, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, -1, -1, -1, 110, -1, -1, -1, 114, 115, 3, 4, 5, 6, 120, -1, 9, -1, 124, -1, -1, 14, -1, -1, 17, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, -1, -1, -1, 110, -1, -1, -1, 114, 115, 3, 4, 5, 6, 120, -1, 9, -1, 124, -1, -1, 14, -1, -1, 17, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, 3, 4, 5, 110, -1, -1, 9, 114, 115, -1, -1, 14, -1, 120, 17, 18, -1, 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 100, 101, 102, 103, 93, 94, 95, 96, 97, 98, -1, 3, 4, 5, 114, 115, -1, 9, -1, -1, 120, 121, 14, -1, 124, 17, 18, 116, 117, 118, 119, 120, 121, 122, 123, -1, 125, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, 3, 4, 5, -1, -1, -1, 9, 114, 115, -1, -1, 14, -1, 120, 17, 18, -1, 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, 3, 4, 5, -1, -1, -1, 9, 114, 115, -1, -1, 14, -1, 120, 17, 18, -1, 124, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, 3, 4, 5, -1, -1, -1, 9, -1, -1, -1, -1, 14, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 114, 115, -1, -1, -1, -1, 120, -1, -1, -1, 124, -1, -1, -1, 46, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, 3, 4, 5, -1, -1, -1, 9, -1, -1, -1, -1, 14, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 114, 115, -1, -1, -1, -1, 120, -1, -1, -1, 124, -1, -1, -1, 46, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, 3, 4, 5, -1, -1, -1, 9, -1, -1, -1, -1, 14, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 114, 115, -1, -1, -1, -1, 120, -1, -1, -1, 124, -1, -1, -1, -1, -1, -1, -1, -1, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, -1, -1, -1, -1, -1, 17, 18, -1, -1, -1, -1, -1, -1, -1, 99, 100, 101, 102, 103, 17, 18, -1, -1, -1, -1, -1, -1, -1, -1, 114, 115, -1, -1, -1, -1, 120, -1, -1, -1, 124, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, -1, 81, 82, 83, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 81, 82, 83, 84, 99, 100, 101, 102, 103, -1, -1, 46, -1, -1, 49, -1, -1, -1, 99, 100, 101, 102, 103, -1, -1, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, -1, -1, 134, -1, -1, -1, -1, 46, -1, -1, 49, -1, -1, -1, -1, -1, 134, 81, 82, 83, 84, 93, 94, 95, 96, 97, 98, -1, -1, -1, -1, -1, -1, -1, -1, 99, 100, 101, 102, 103, -1, -1, -1, -1, 116, 117, 118, 119, 120, 121, 122, 123, -1, 125, 93, 94, 95, 96, 97, 98, -1, -1, -1, -1, 93, 94, 95, 96, 97, 98, 134, -1, -1, -1, -1, -1, -1, 116, 117, 118, 119, 120, 121, 122, 123, -1, 125, 116, 117, 118, 119, 120, 121, 122, 123, -1, 125, 93, 94, 95, 96, 97, 98, -1, -1, -1, 93, 94, 95, 96, 97, 98, -1, -1, -1, 93, -1, 95, 96, 97, 98, 117, 118, 119, 120, 121, 122, 123, -1, 125, 117, 118, 119, 120, 121, 122, 123, -1, 125, 117, 118, 119, 120, 121, 122, 123, -1, 125 }; /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ #line 3 "/usr/local/share/bison.simple" /* This file comes from bison-1.28. */ /* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* This is the parser code that is written into each bison parser when the %semantic_parser declaration is not specified in the grammar. It was written by Richard Stallman by simplifying the hairy parser used when %semantic_parser is specified. */ #ifndef YYSTACK_USE_ALLOCA #ifdef alloca #define YYSTACK_USE_ALLOCA #else /* alloca not defined */ #ifdef __GNUC__ #define YYSTACK_USE_ALLOCA #define alloca __builtin_alloca #else /* not GNU C. */ #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) #define YYSTACK_USE_ALLOCA #include #else /* not sparc */ /* We think this test detects Watcom and Microsoft C. */ /* This used to test MSDOS, but that is a bad idea since that symbol is in the user namespace. */ #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) #if 0 /* No need for malloc.h, which pollutes the namespace; instead, just don't use alloca. */ #include #endif #else /* not MSDOS, or __TURBOC__ */ #if defined(_AIX) /* I don't know what this was needed for, but it pollutes the namespace. So I turned it off. rms, 2 May 1997. */ /* #include */ #pragma alloca #define YYSTACK_USE_ALLOCA #else /* not MSDOS, or __TURBOC__, or _AIX */ #if 0 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, and on HPUX 10. Eventually we can turn this on. */ #define YYSTACK_USE_ALLOCA #define alloca __builtin_alloca #endif /* __hpux */ #endif #endif /* not _AIX */ #endif /* not MSDOS, or __TURBOC__ */ #endif /* not sparc */ #endif /* not GNU C */ #endif /* alloca not defined */ #endif /* YYSTACK_USE_ALLOCA not defined */ #ifdef YYSTACK_USE_ALLOCA #define YYSTACK_ALLOC alloca #else #define YYSTACK_ALLOC malloc #endif /* Note: there must be only one dollar sign in this file. It is replaced by the list of actions, each action as one case of the switch. */ #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY -2 #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(token, value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { yychar = (token), yylval = (value); \ yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { yyerror ("syntax error: cannot back up"); YYERROR; } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 #ifndef YYPURE #define YYLEX yylex() #endif #ifdef YYPURE #ifdef YYLSP_NEEDED #ifdef YYLEX_PARAM #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) #else #define YYLEX yylex(&yylval, &yylloc) #endif #else /* not YYLSP_NEEDED */ #ifdef YYLEX_PARAM #define YYLEX yylex(&yylval, YYLEX_PARAM) #else #define YYLEX yylex(&yylval) #endif #endif /* not YYLSP_NEEDED */ #endif /* If nonreentrant, generate the variables here */ #ifndef YYPURE int yychar; /* the lookahead symbol */ YYSTYPE yylval; /* the semantic value of the */ /* lookahead symbol */ #ifdef YYLSP_NEEDED YYLTYPE yylloc; /* location data for the lookahead */ /* symbol */ #endif int yynerrs; /* number of parse errors so far */ #endif /* not YYPURE */ #if YYDEBUG != 0 int yydebug; /* nonzero means print parse trace */ /* Since this is uninitialized, it does not stop multiple parsers from coexisting. */ #endif /* YYINITDEPTH indicates the initial size of the parser's stacks */ #ifndef YYINITDEPTH #define YYINITDEPTH 200 #endif /* YYMAXDEPTH is the maximum size the stacks can grow to (effective only if the built-in stack extension method is used). */ #if YYMAXDEPTH == 0 #undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH #define YYMAXDEPTH 10000 #endif /* Define __yy_memcpy. Note that the size argument should be passed with type unsigned int, because that is what the non-GCC definitions require. With GCC, __builtin_memcpy takes an arg of type size_t, but it can handle unsigned int. */ #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) #else /* not GNU C or C++ */ #ifndef __cplusplus /* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */ static void __yy_memcpy (to, from, count) char *to; char *from; unsigned int count; { register char *f = from; register char *t = to; register int i = count; while (i-- > 0) *t++ = *f++; } #else /* __cplusplus */ /* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */ static void __yy_memcpy (char *to, char *from, unsigned int count) { register char *t = to; register char *f = from; register int i = count; while (i-- > 0) *t++ = *f++; } #endif #endif #line 217 "/usr/local/share/bison.simple" /* The user can define YYPARSE_PARAM as the name of an argument to be passed into yyparse. The argument should have type void *. It should actually point to an object. Grammar actions can access the variable by casting it to the proper pointer type. */ #ifdef YYPARSE_PARAM #ifdef __cplusplus #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM #define YYPARSE_PARAM_DECL #else /* not __cplusplus */ #define YYPARSE_PARAM_ARG YYPARSE_PARAM #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; #endif /* not __cplusplus */ #else /* not YYPARSE_PARAM */ #define YYPARSE_PARAM_ARG #define YYPARSE_PARAM_DECL #endif /* not YYPARSE_PARAM */ /* Prevent warning if -Wstrict-prototypes. */ #ifdef __GNUC__ #ifdef YYPARSE_PARAM int yyparse (void *); #else int yyparse (void); #endif #endif int yyparse(YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL { register int yystate; register int yyn; register short *yyssp; register YYSTYPE *yyvsp; int yyerrstatus; /* number of tokens to shift before error messages enabled */ int yychar1 = 0; /* lookahead token as an internal (translated) token number */ short yyssa[YYINITDEPTH]; /* the state stack */ YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ short *yyss = yyssa; /* refer to the stacks thru separate pointers */ YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ #ifdef YYLSP_NEEDED YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ YYLTYPE *yyls = yylsa; YYLTYPE *yylsp; #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) #else #define YYPOPSTACK (yyvsp--, yyssp--) #endif int yystacksize = YYINITDEPTH; int yyfree_stacks = 0; #ifdef YYPURE int yychar; YYSTYPE yylval; int yynerrs; #ifdef YYLSP_NEEDED YYLTYPE yylloc; #endif #endif YYSTYPE yyval; /* the variable used to return */ /* semantic values from the action */ /* routines */ int yylen; #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Starting parse\n"); #endif yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss - 1; yyvsp = yyvs; #ifdef YYLSP_NEEDED yylsp = yyls; #endif /* Push a new state, which is found in yystate . */ /* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ yynewstate: *++yyssp = yystate; if (yyssp >= yyss + yystacksize - 1) { /* Give user a chance to reallocate the stack */ /* Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; #ifdef YYLSP_NEEDED YYLTYPE *yyls1 = yyls; #endif /* Get the current used size of the three stacks, in elements. */ int size = yyssp - yyss + 1; #ifdef yyoverflow /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. */ #ifdef YYLSP_NEEDED /* This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow("parser stack overflow", &yyss1, size * sizeof (*yyssp), &yyvs1, size * sizeof (*yyvsp), &yyls1, size * sizeof (*yylsp), &yystacksize); #else yyoverflow("parser stack overflow", &yyss1, size * sizeof (*yyssp), &yyvs1, size * sizeof (*yyvsp), &yystacksize); #endif yyss = yyss1; yyvs = yyvs1; #ifdef YYLSP_NEEDED yyls = yyls1; #endif #else /* no yyoverflow */ /* Extend the stack our own way. */ if (yystacksize >= YYMAXDEPTH) { yyerror("parser stack overflow"); if (yyfree_stacks) { free (yyss); free (yyvs); #ifdef YYLSP_NEEDED free (yyls); #endif } return 2; } yystacksize *= 2; if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; #ifndef YYSTACK_USE_ALLOCA yyfree_stacks = 1; #endif yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); __yy_memcpy ((char *)yyss, (char *)yyss1, size * (unsigned int) sizeof (*yyssp)); yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * (unsigned int) sizeof (*yyvsp)); #ifdef YYLSP_NEEDED yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); __yy_memcpy ((char *)yyls, (char *)yyls1, size * (unsigned int) sizeof (*yylsp)); #endif #endif /* no yyoverflow */ yyssp = yyss + size - 1; yyvsp = yyvs + size - 1; #ifdef YYLSP_NEEDED yylsp = yyls + size - 1; #endif #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Stack size increased to %d\n", yystacksize); #endif if (yyssp >= yyss + yystacksize - 1) YYABORT; } #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Entering state %d\n", yystate); #endif goto yybackup; yybackup: /* Do appropriate processing given the current state. */ /* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYFLAG) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* yychar is either YYEMPTY or YYEOF or a valid token in external form. */ if (yychar == YYEMPTY) { #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Reading a token: "); #endif yychar = YYLEX; } /* Convert token to internal form (in yychar1) for indexing tables with */ if (yychar <= 0) /* This means end of input. */ { yychar1 = 0; yychar = YYEOF; /* Don't call YYLEX any more */ #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Now at end of input.\n"); #endif } else { yychar1 = YYTRANSLATE(yychar); #if YYDEBUG != 0 if (yydebug) { fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); /* Give the individual parser a way to print the precise meaning of a token, for further debugging info. */ #ifdef YYPRINT YYPRINT (stderr, yychar, yylval); #endif fprintf (stderr, ")\n"); } #endif } yyn += yychar1; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) goto yydefault; yyn = yytable[yyn]; /* yyn is what to do for this token type in this state. Negative => reduce, -yyn is rule number. Positive => shift, yyn is new state. New state is final state => don't bother to shift, just return success. 0, or most negative number => error. */ if (yyn < 0) { if (yyn == YYFLAG) goto yyerrlab; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); #endif /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; #ifdef YYLSP_NEEDED *++yylsp = yylloc; #endif /* count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; /* Do the default action for the current state. */ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; /* Do a reduction. yyn is the number of a rule to reduce with. */ yyreduce: yylen = yyr2[yyn]; if (yylen > 0) yyval = yyvsp[1-yylen]; /* implement default value of the action */ #if YYDEBUG != 0 if (yydebug) { int i; fprintf (stderr, "Reducing via rule %d (line %d), ", yyn, yyrline[yyn]); /* Print the symbols being reduced, and their result. */ for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) fprintf (stderr, "%s ", yytname[yyrhs[i]]); fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); } #endif switch (yyn) { case 2: #line 267 "gram.yy" { if (olist.head) print_picture(olist.head); ; break;} case 3: #line 276 "gram.yy" { yyval.pl = yyvsp[-1].pl; ; break;} case 4: #line 281 "gram.yy" { yyval.pl = yyvsp[0].pl; ; break;} case 5: #line 283 "gram.yy" { yyval.pl = yyvsp[-2].pl; ; break;} case 10: #line 298 "gram.yy" { define_variable(yyvsp[-2].str, yyvsp[0].x); a_delete yyvsp[-2].str; ; break;} case 11: #line 303 "gram.yy" { place *p = lookup_label(yyvsp[-3].str); if (!p) { lex_error("variable `%1' not defined", yyvsp[-3].str); YYABORT; } p->obj = 0; p->x = yyvsp[0].x; p->y = 0.0; a_delete yyvsp[-3].str; ; break;} case 12: #line 316 "gram.yy" { current_direction = UP_DIRECTION; ; break;} case 13: #line 318 "gram.yy" { current_direction = DOWN_DIRECTION; ; break;} case 14: #line 320 "gram.yy" { current_direction = LEFT_DIRECTION; ; break;} case 15: #line 322 "gram.yy" { current_direction = RIGHT_DIRECTION; ; break;} case 16: #line 324 "gram.yy" { olist.append(make_command_object(yyvsp[0].lstr.str, yyvsp[0].lstr.filename, yyvsp[0].lstr.lineno)); ; break;} case 17: #line 329 "gram.yy" { olist.append(make_command_object(yyvsp[0].lstr.str, yyvsp[0].lstr.filename, yyvsp[0].lstr.lineno)); ; break;} case 18: #line 334 "gram.yy" { fprintf(stderr, "%s\n", yyvsp[0].lstr.str); a_delete yyvsp[0].lstr.str; fflush(stderr); ; break;} case 19: #line 340 "gram.yy" { delim_flag = 1; ; break;} case 20: #line 342 "gram.yy" { delim_flag = 0; if (safer_flag) lex_error("unsafe to run command `%1'", yyvsp[0].str); else system(yyvsp[0].str); a_delete yyvsp[0].str; ; break;} case 21: #line 351 "gram.yy" { if (yychar < 0) do_lookahead(); do_copy(yyvsp[0].lstr.str); // do not delete the filename ; break;} case 22: #line 358 "gram.yy" { delim_flag = 2; ; break;} case 23: #line 360 "gram.yy" { delim_flag = 0; ; break;} case 24: #line 362 "gram.yy" { if (yychar < 0) do_lookahead(); copy_file_thru(yyvsp[-5].lstr.str, yyvsp[-2].str, yyvsp[0].str); // do not delete the filename a_delete yyvsp[-2].str; a_delete yyvsp[0].str; ; break;} case 25: #line 371 "gram.yy" { delim_flag = 2; ; break;} case 26: #line 373 "gram.yy" { delim_flag = 0; ; break;} case 27: #line 375 "gram.yy" { if (yychar < 0) do_lookahead(); copy_rest_thru(yyvsp[-2].str, yyvsp[0].str); a_delete yyvsp[-2].str; a_delete yyvsp[0].str; ; break;} case 28: #line 383 "gram.yy" { delim_flag = 1; ; break;} case 29: #line 385 "gram.yy" { delim_flag = 0; if (yychar < 0) do_lookahead(); do_for(yyvsp[-8].str, yyvsp[-6].x, yyvsp[-4].x, yyvsp[-3].by.is_multiplicative, yyvsp[-3].by.val, yyvsp[0].str); ; break;} case 30: #line 392 "gram.yy" { if (yychar < 0) do_lookahead(); if (yyvsp[0].if_data.x != 0.0) push_body(yyvsp[0].if_data.body); a_delete yyvsp[0].if_data.body; ; break;} case 31: #line 400 "gram.yy" { delim_flag = 1; ; break;} case 32: #line 402 "gram.yy" { delim_flag = 0; if (yychar < 0) do_lookahead(); if (yyvsp[-3].if_data.x != 0.0) push_body(yyvsp[-3].if_data.body); else push_body(yyvsp[0].str); a_delete yyvsp[-3].if_data.body; a_delete yyvsp[0].str; ; break;} case 34: #line 415 "gram.yy" { define_variable("scale", 1.0); ; break;} case 35: #line 420 "gram.yy" { reset(yyvsp[0].str); a_delete yyvsp[0].str; ; break;} case 36: #line 422 "gram.yy" { reset(yyvsp[0].str); a_delete yyvsp[0].str; ; break;} case 37: #line 424 "gram.yy" { reset(yyvsp[0].str); a_delete yyvsp[0].str; ; break;} case 38: #line 429 "gram.yy" { yyval.lstr = yyvsp[0].lstr; ; break;} case 39: #line 431 "gram.yy" { yyval.lstr.str = new char[strlen(yyvsp[-1].lstr.str) + strlen(yyvsp[0].lstr.str) + 1]; strcpy(yyval.lstr.str, yyvsp[-1].lstr.str); strcat(yyval.lstr.str, yyvsp[0].lstr.str); a_delete yyvsp[-1].lstr.str; a_delete yyvsp[0].lstr.str; if (yyvsp[-1].lstr.filename) { yyval.lstr.filename = yyvsp[-1].lstr.filename; yyval.lstr.lineno = yyvsp[-1].lstr.lineno; } else if (yyvsp[0].lstr.filename) { yyval.lstr.filename = yyvsp[0].lstr.filename; yyval.lstr.lineno = yyvsp[0].lstr.lineno; } ; break;} case 40: #line 452 "gram.yy" { yyval.lstr.str = new char[GDIGITS + 1]; sprintf(yyval.lstr.str, "%g", yyvsp[0].x); yyval.lstr.filename = 0; yyval.lstr.lineno = 0; ; break;} case 41: #line 459 "gram.yy" { yyval.lstr = yyvsp[0].lstr; ; break;} case 42: #line 461 "gram.yy" { yyval.lstr.str = new char[GDIGITS + 2 + GDIGITS + 1]; sprintf(yyval.lstr.str, "%g, %g", yyvsp[0].pair.x, yyvsp[0].pair.y); yyval.lstr.filename = 0; yyval.lstr.lineno = 0; ; break;} case 43: #line 470 "gram.yy" { delim_flag = 1; ; break;} case 44: #line 472 "gram.yy" { delim_flag = 0; yyval.if_data.x = yyvsp[-3].x; yyval.if_data.body = yyvsp[0].str; ; break;} case 45: #line 477 "gram.yy" { yyval.str = 0; ; break;} case 46: #line 479 "gram.yy" { yyval.str = yyvsp[0].lstr.str; ; break;} case 47: #line 484 "gram.yy" { yyval.x = yyvsp[0].x; ; break;} case 48: #line 486 "gram.yy" { yyval.x = yyvsp[0].x; ; break;} case 49: #line 491 "gram.yy" { yyval.x = strcmp(yyvsp[-2].lstr.str, yyvsp[0].lstr.str) == 0; a_delete yyvsp[-2].lstr.str; a_delete yyvsp[0].lstr.str; ; break;} case 50: #line 497 "gram.yy" { yyval.x = strcmp(yyvsp[-2].lstr.str, yyvsp[0].lstr.str) != 0; a_delete yyvsp[-2].lstr.str; a_delete yyvsp[0].lstr.str; ; break;} case 51: #line 503 "gram.yy" { yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); ; break;} case 52: #line 505 "gram.yy" { yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); ; break;} case 53: #line 507 "gram.yy" { yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); ; break;} case 54: #line 509 "gram.yy" { yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); ; break;} case 55: #line 511 "gram.yy" { yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); ; break;} case 56: #line 513 "gram.yy" { yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); ; break;} case 57: #line 515 "gram.yy" { yyval.x = (yyvsp[0].x == 0.0); ; break;} case 58: #line 521 "gram.yy" { yyval.by.val = 1.0; yyval.by.is_multiplicative = 0; ; break;} case 59: #line 523 "gram.yy" { yyval.by.val = yyvsp[0].x; yyval.by.is_multiplicative = 0; ; break;} case 60: #line 525 "gram.yy" { yyval.by.val = yyvsp[0].x; yyval.by.is_multiplicative = 1; ; break;} case 61: #line 530 "gram.yy" { yyval.pl.obj = yyvsp[0].spec->make_object(¤t_position, ¤t_direction); if (yyval.pl.obj == 0) YYABORT; delete yyvsp[0].spec; if (yyval.pl.obj) olist.append(yyval.pl.obj); else { yyval.pl.x = current_position.x; yyval.pl.y = current_position.y; } ; break;} case 62: #line 545 "gram.yy" { yyval.pl = yyvsp[0].pl; define_label(yyvsp[-3].str, & yyval.pl); a_delete yyvsp[-3].str; ; break;} case 63: #line 547 "gram.yy" { yyval.pl.obj = 0; yyval.pl.x = yyvsp[0].pair.x; yyval.pl.y = yyvsp[0].pair.y; define_label(yyvsp[-3].str, & yyval.pl); a_delete yyvsp[-3].str; ; break;} case 64: #line 555 "gram.yy" { yyval.pl = yyvsp[0].pl; define_label(yyvsp[-3].str, & yyval.pl); a_delete yyvsp[-3].str; ; break;} case 65: #line 561 "gram.yy" { yyval.state.x = current_position.x; yyval.state.y = current_position.y; yyval.state.dir = current_direction; ; break;} case 66: #line 567 "gram.yy" { current_position.x = yyvsp[-2].state.x; current_position.y = yyvsp[-2].state.y; current_direction = yyvsp[-2].state.dir; ; break;} case 67: #line 573 "gram.yy" { yyval.pl = yyvsp[-3].pl; ; break;} case 68: #line 577 "gram.yy" { yyval.pl.obj = 0; yyval.pl.x = current_position.x; yyval.pl.y = current_position.y; ; break;} case 69: #line 586 "gram.yy" {; break;} case 70: #line 588 "gram.yy" {; break;} case 71: #line 593 "gram.yy" { yyval.spec = new object_spec(BOX_OBJECT); ; break;} case 72: #line 597 "gram.yy" { yyval.spec = new object_spec(CIRCLE_OBJECT); ; break;} case 73: #line 601 "gram.yy" { yyval.spec = new object_spec(ELLIPSE_OBJECT); ; break;} case 74: #line 605 "gram.yy" { yyval.spec = new object_spec(ARC_OBJECT); yyval.spec->dir = current_direction; ; break;} case 75: #line 610 "gram.yy" { yyval.spec = new object_spec(LINE_OBJECT); lookup_variable("lineht", & yyval.spec->segment_height); lookup_variable("linewid", & yyval.spec->segment_width); yyval.spec->dir = current_direction; ; break;} case 76: #line 617 "gram.yy" { yyval.spec = new object_spec(ARROW_OBJECT); lookup_variable("lineht", & yyval.spec->segment_height); lookup_variable("linewid", & yyval.spec->segment_width); yyval.spec->dir = current_direction; ; break;} case 77: #line 624 "gram.yy" { yyval.spec = new object_spec(MOVE_OBJECT); lookup_variable("moveht", & yyval.spec->segment_height); lookup_variable("movewid", & yyval.spec->segment_width); yyval.spec->dir = current_direction; ; break;} case 78: #line 631 "gram.yy" { yyval.spec = new object_spec(SPLINE_OBJECT); lookup_variable("lineht", & yyval.spec->segment_height); lookup_variable("linewid", & yyval.spec->segment_width); yyval.spec->dir = current_direction; ; break;} case 79: #line 638 "gram.yy" { yyval.spec = new object_spec(TEXT_OBJECT); yyval.spec->text = new text_item(yyvsp[0].lstr.str, yyvsp[0].lstr.filename, yyvsp[0].lstr.lineno); ; break;} case 80: #line 643 "gram.yy" { yyval.spec = new object_spec(TEXT_OBJECT); yyval.spec->text = new text_item(format_number(0, yyvsp[0].x), 0, -1); ; break;} case 81: #line 648 "gram.yy" { yyval.spec = new object_spec(TEXT_OBJECT); yyval.spec->text = new text_item(format_number(yyvsp[0].lstr.str, yyvsp[-1].x), yyvsp[0].lstr.filename, yyvsp[0].lstr.lineno); a_delete yyvsp[0].lstr.str; ; break;} case 82: #line 655 "gram.yy" { saved_state *p = new saved_state; yyval.pstate = p; p->x = current_position.x; p->y = current_position.y; p->dir = current_direction; p->tbl = current_table; p->prev = current_saved_state; current_position.x = 0.0; current_position.y = 0.0; current_table = new PTABLE(place); current_saved_state = p; olist.append(make_mark_object()); ; break;} case 83: #line 670 "gram.yy" { current_position.x = yyvsp[-2].pstate->x; current_position.y = yyvsp[-2].pstate->y; current_direction = yyvsp[-2].pstate->dir; yyval.spec = new object_spec(BLOCK_OBJECT); olist.wrap_up_block(& yyval.spec->oblist); yyval.spec->tbl = current_table; current_table = yyvsp[-2].pstate->tbl; current_saved_state = yyvsp[-2].pstate->prev; delete yyvsp[-2].pstate; ; break;} case 84: #line 682 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->height = yyvsp[0].x; yyval.spec->flags |= HAS_HEIGHT; ; break;} case 85: #line 688 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->radius = yyvsp[0].x; yyval.spec->flags |= HAS_RADIUS; ; break;} case 86: #line 694 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->width = yyvsp[0].x; yyval.spec->flags |= HAS_WIDTH; ; break;} case 87: #line 700 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->radius = yyvsp[0].x/2.0; yyval.spec->flags |= HAS_RADIUS; ; break;} case 88: #line 706 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags |= HAS_SEGMENT; switch (yyval.spec->dir) { case UP_DIRECTION: yyval.spec->segment_pos.y += yyvsp[0].x; break; case DOWN_DIRECTION: yyval.spec->segment_pos.y -= yyvsp[0].x; break; case RIGHT_DIRECTION: yyval.spec->segment_pos.x += yyvsp[0].x; break; case LEFT_DIRECTION: yyval.spec->segment_pos.x -= yyvsp[0].x; break; } ; break;} case 89: #line 726 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->dir = UP_DIRECTION; yyval.spec->flags |= HAS_SEGMENT; yyval.spec->segment_pos.y += yyval.spec->segment_height; ; break;} case 90: #line 733 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->dir = UP_DIRECTION; yyval.spec->flags |= HAS_SEGMENT; yyval.spec->segment_pos.y += yyvsp[0].x; ; break;} case 91: #line 740 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->dir = DOWN_DIRECTION; yyval.spec->flags |= HAS_SEGMENT; yyval.spec->segment_pos.y -= yyval.spec->segment_height; ; break;} case 92: #line 747 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->dir = DOWN_DIRECTION; yyval.spec->flags |= HAS_SEGMENT; yyval.spec->segment_pos.y -= yyvsp[0].x; ; break;} case 93: #line 754 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->dir = RIGHT_DIRECTION; yyval.spec->flags |= HAS_SEGMENT; yyval.spec->segment_pos.x += yyval.spec->segment_width; ; break;} case 94: #line 761 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->dir = RIGHT_DIRECTION; yyval.spec->flags |= HAS_SEGMENT; yyval.spec->segment_pos.x += yyvsp[0].x; ; break;} case 95: #line 768 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->dir = LEFT_DIRECTION; yyval.spec->flags |= HAS_SEGMENT; yyval.spec->segment_pos.x -= yyval.spec->segment_width; ; break;} case 96: #line 775 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->dir = LEFT_DIRECTION; yyval.spec->flags |= HAS_SEGMENT; yyval.spec->segment_pos.x -= yyvsp[0].x; ; break;} case 97: #line 782 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->flags |= HAS_FROM; yyval.spec->from.x = yyvsp[0].pair.x; yyval.spec->from.y = yyvsp[0].pair.y; ; break;} case 98: #line 789 "gram.yy" { yyval.spec = yyvsp[-2].spec; if (yyval.spec->flags & HAS_SEGMENT) yyval.spec->segment_list = new segment(yyval.spec->segment_pos, yyval.spec->segment_is_absolute, yyval.spec->segment_list); yyval.spec->flags |= HAS_SEGMENT; yyval.spec->segment_pos.x = yyvsp[0].pair.x; yyval.spec->segment_pos.y = yyvsp[0].pair.y; yyval.spec->segment_is_absolute = 1; yyval.spec->flags |= HAS_TO; yyval.spec->to.x = yyvsp[0].pair.x; yyval.spec->to.y = yyvsp[0].pair.y; ; break;} case 99: #line 804 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->flags |= HAS_AT; yyval.spec->at.x = yyvsp[0].pair.x; yyval.spec->at.y = yyvsp[0].pair.y; if (yyval.spec->type != ARC_OBJECT) { yyval.spec->flags |= HAS_FROM; yyval.spec->from.x = yyvsp[0].pair.x; yyval.spec->from.y = yyvsp[0].pair.y; } ; break;} case 100: #line 817 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->flags |= HAS_WITH; yyval.spec->with = yyvsp[0].pth; ; break;} case 101: #line 823 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->flags |= HAS_SEGMENT; yyval.spec->segment_pos.x += yyvsp[0].pair.x; yyval.spec->segment_pos.y += yyvsp[0].pair.y; ; break;} case 102: #line 830 "gram.yy" { yyval.spec = yyvsp[-1].spec; if (yyval.spec->flags & HAS_SEGMENT) { yyval.spec->segment_list = new segment(yyval.spec->segment_pos, yyval.spec->segment_is_absolute, yyval.spec->segment_list); yyval.spec->flags &= ~HAS_SEGMENT; yyval.spec->segment_pos.x = yyval.spec->segment_pos.y = 0.0; yyval.spec->segment_is_absolute = 0; } ; break;} case 103: #line 843 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags |= IS_DOTTED; lookup_variable("dashwid", & yyval.spec->dash_width); ; break;} case 104: #line 849 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->flags |= IS_DOTTED; yyval.spec->dash_width = yyvsp[0].x; ; break;} case 105: #line 855 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags |= IS_DASHED; lookup_variable("dashwid", & yyval.spec->dash_width); ; break;} case 106: #line 861 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->flags |= IS_DASHED; yyval.spec->dash_width = yyvsp[0].x; ; break;} case 107: #line 867 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags |= IS_DEFAULT_FILLED; ; break;} case 108: #line 872 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->flags |= IS_FILLED; yyval.spec->fill = yyvsp[0].x; ; break;} case 109: #line 878 "gram.yy" { yyval.spec = yyvsp[-1].spec; // line chop chop means line chop 0 chop 0 if (yyval.spec->flags & IS_DEFAULT_CHOPPED) { yyval.spec->flags |= IS_CHOPPED; yyval.spec->flags &= ~IS_DEFAULT_CHOPPED; yyval.spec->start_chop = yyval.spec->end_chop = 0.0; } else if (yyval.spec->flags & IS_CHOPPED) { yyval.spec->end_chop = 0.0; } else { yyval.spec->flags |= IS_DEFAULT_CHOPPED; } ; break;} case 110: #line 897 "gram.yy" { yyval.spec = yyvsp[-2].spec; if (yyval.spec->flags & IS_DEFAULT_CHOPPED) { yyval.spec->flags |= IS_CHOPPED; yyval.spec->flags &= ~IS_DEFAULT_CHOPPED; yyval.spec->start_chop = 0.0; yyval.spec->end_chop = yyvsp[0].x; } else if (yyval.spec->flags & IS_CHOPPED) { yyval.spec->end_chop = yyvsp[0].x; } else { yyval.spec->start_chop = yyval.spec->end_chop = yyvsp[0].x; yyval.spec->flags |= IS_CHOPPED; } ; break;} case 111: #line 917 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags |= IS_SAME; ; break;} case 112: #line 922 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags |= IS_INVISIBLE; ; break;} case 113: #line 927 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags |= HAS_LEFT_ARROW_HEAD; ; break;} case 114: #line 932 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags |= HAS_RIGHT_ARROW_HEAD; ; break;} case 115: #line 937 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags |= (HAS_LEFT_ARROW_HEAD|HAS_RIGHT_ARROW_HEAD); ; break;} case 116: #line 942 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags |= IS_CLOCKWISE; ; break;} case 117: #line 947 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags &= ~IS_CLOCKWISE; ; break;} case 118: #line 952 "gram.yy" { yyval.spec = yyvsp[-1].spec; text_item **p; for (p = & yyval.spec->text; *p; p = &(*p)->next) ; *p = new text_item(yyvsp[0].lstr.str, yyvsp[0].lstr.filename, yyvsp[0].lstr.lineno); ; break;} case 119: #line 960 "gram.yy" { yyval.spec = yyvsp[-1].spec; if (yyval.spec->text) { text_item *p; for (p = yyval.spec->text; p->next; p = p->next) ; p->adj.h = LEFT_ADJUST; } ; break;} case 120: #line 971 "gram.yy" { yyval.spec = yyvsp[-1].spec; if (yyval.spec->text) { text_item *p; for (p = yyval.spec->text; p->next; p = p->next) ; p->adj.h = RIGHT_ADJUST; } ; break;} case 121: #line 982 "gram.yy" { yyval.spec = yyvsp[-1].spec; if (yyval.spec->text) { text_item *p; for (p = yyval.spec->text; p->next; p = p->next) ; p->adj.v = ABOVE_ADJUST; } ; break;} case 122: #line 993 "gram.yy" { yyval.spec = yyvsp[-1].spec; if (yyval.spec->text) { text_item *p; for (p = yyval.spec->text; p->next; p = p->next) ; p->adj.v = BELOW_ADJUST; } ; break;} case 123: #line 1004 "gram.yy" { yyval.spec = yyvsp[-2].spec; yyval.spec->flags |= HAS_THICKNESS; yyval.spec->thickness = yyvsp[0].x; ; break;} case 124: #line 1010 "gram.yy" { yyval.spec = yyvsp[-1].spec; yyval.spec->flags |= IS_ALIGNED; ; break;} case 125: #line 1018 "gram.yy" { yyval.lstr = yyvsp[0].lstr; ; break;} case 126: #line 1022 "gram.yy" { yyval.lstr.filename = yyvsp[-2].lstr.filename; yyval.lstr.lineno = yyvsp[-2].lstr.lineno; yyval.lstr.str = do_sprintf(yyvsp[-2].lstr.str, yyvsp[-1].dv.v, yyvsp[-1].dv.nv); a_delete yyvsp[-1].dv.v; a_delete yyvsp[-2].lstr.str; ; break;} case 127: #line 1033 "gram.yy" { yyval.dv.v = 0; yyval.dv.nv = 0; yyval.dv.maxv = 0; ; break;} case 128: #line 1039 "gram.yy" { yyval.dv = yyvsp[-2].dv; if (yyval.dv.nv >= yyval.dv.maxv) { if (yyval.dv.nv == 0) { yyval.dv.v = new double[4]; yyval.dv.maxv = 4; } else { double *oldv = yyval.dv.v; yyval.dv.maxv *= 2; yyval.dv.v = new double[yyval.dv.maxv]; memcpy(yyval.dv.v, oldv, yyval.dv.nv*sizeof(double)); a_delete oldv; } } yyval.dv.v[yyval.dv.nv] = yyvsp[0].x; yyval.dv.nv += 1; ; break;} case 129: #line 1064 "gram.yy" { yyval.pair = yyvsp[0].pair; ; break;} case 130: #line 1066 "gram.yy" { position pos = yyvsp[0].pl; yyval.pair.x = pos.x; yyval.pair.y = pos.y; ; break;} case 131: #line 1075 "gram.yy" { yyval.pair = yyvsp[0].pair; ; break;} case 132: #line 1077 "gram.yy" { yyval.pair.x = yyvsp[-2].pair.x + yyvsp[0].pair.x; yyval.pair.y = yyvsp[-2].pair.y + yyvsp[0].pair.y; ; break;} case 133: #line 1082 "gram.yy" { yyval.pair.x = yyvsp[-2].pair.x - yyvsp[0].pair.x; yyval.pair.y = yyvsp[-2].pair.y - yyvsp[0].pair.y; ; break;} case 134: #line 1087 "gram.yy" { yyval.pair.x = yyvsp[-3].pair.x; yyval.pair.y = yyvsp[-1].pair.y; ; break;} case 135: #line 1092 "gram.yy" { yyval.pair.x = (1.0 - yyvsp[-4].x)*yyvsp[-2].pair.x + yyvsp[-4].x*yyvsp[0].pair.x; yyval.pair.y = (1.0 - yyvsp[-4].x)*yyvsp[-2].pair.y + yyvsp[-4].x*yyvsp[0].pair.y; ; break;} case 136: #line 1097 "gram.yy" { yyval.pair.x = (1.0 - yyvsp[-5].x)*yyvsp[-3].pair.x + yyvsp[-5].x*yyvsp[-1].pair.x; yyval.pair.y = (1.0 - yyvsp[-5].x)*yyvsp[-3].pair.y + yyvsp[-5].x*yyvsp[-1].pair.y; ; break;} case 139: #line 1110 "gram.yy" { yyval.pair.x = yyvsp[-2].x; yyval.pair.y = yyvsp[0].x; ; break;} case 140: #line 1112 "gram.yy" { yyval.pair = yyvsp[-1].pair; ; break;} case 141: #line 1117 "gram.yy" { yyval.pl = yyvsp[0].pl; ; break;} case 142: #line 1119 "gram.yy" { path pth(yyvsp[0].crn); if (!pth.follow(yyvsp[-1].pl, & yyval.pl)) YYABORT; ; break;} case 143: #line 1125 "gram.yy" { path pth(yyvsp[-1].crn); if (!pth.follow(yyvsp[0].pl, & yyval.pl)) YYABORT; ; break;} case 144: #line 1131 "gram.yy" { path pth(yyvsp[-2].crn); if (!pth.follow(yyvsp[0].pl, & yyval.pl)) YYABORT; ; break;} case 145: #line 1137 "gram.yy" { yyval.pl.x = current_position.x; yyval.pl.y = current_position.y; yyval.pl.obj = 0; ; break;} case 146: #line 1146 "gram.yy" { place *p = lookup_label(yyvsp[0].str); if (!p) { lex_error("there is no place `%1'", yyvsp[0].str); YYABORT; } yyval.pl = *p; a_delete yyvsp[0].str; ; break;} case 147: #line 1157 "gram.yy" { yyval.pl.obj = yyvsp[0].obj; ; break;} case 148: #line 1161 "gram.yy" { path pth(yyvsp[0].str); if (!pth.follow(yyvsp[-2].pl, & yyval.pl)) YYABORT; ; break;} case 149: #line 1170 "gram.yy" { yyval.n = yyvsp[0].n; ; break;} case 150: #line 1172 "gram.yy" { // XXX Check for overflow (and non-integers?). yyval.n = (int)yyvsp[-1].x; ; break;} case 151: #line 1180 "gram.yy" { yyval.n = 1; ; break;} case 152: #line 1182 "gram.yy" { yyval.n = yyvsp[-1].n; ; break;} case 153: #line 1187 "gram.yy" { int count = 0; object *p; for (p = olist.head; p != 0; p = p->next) if (p->type() == yyvsp[0].obtype && ++count == yyvsp[-1].n) { yyval.obj = p; break; } if (p == 0) { lex_error("there is no %1%2 %3", yyvsp[-1].n, ordinal_postfix(yyvsp[-1].n), object_type_name(yyvsp[0].obtype)); YYABORT; } ; break;} case 154: #line 1204 "gram.yy" { int count = 0; object *p; for (p = olist.tail; p != 0; p = p->prev) if (p->type() == yyvsp[0].obtype && ++count == yyvsp[-1].n) { yyval.obj = p; break; } if (p == 0) { lex_error("there is no %1%2 last %3", yyvsp[-1].n, ordinal_postfix(yyvsp[-1].n), object_type_name(yyvsp[0].obtype)); YYABORT; } ; break;} case 155: #line 1224 "gram.yy" { yyval.obtype = BOX_OBJECT; ; break;} case 156: #line 1226 "gram.yy" { yyval.obtype = CIRCLE_OBJECT; ; break;} case 157: #line 1228 "gram.yy" { yyval.obtype = ELLIPSE_OBJECT; ; break;} case 158: #line 1230 "gram.yy" { yyval.obtype = ARC_OBJECT; ; break;} case 159: #line 1232 "gram.yy" { yyval.obtype = LINE_OBJECT; ; break;} case 160: #line 1234 "gram.yy" { yyval.obtype = ARROW_OBJECT; ; break;} case 161: #line 1236 "gram.yy" { yyval.obtype = SPLINE_OBJECT; ; break;} case 162: #line 1238 "gram.yy" { yyval.obtype = BLOCK_OBJECT; ; break;} case 163: #line 1240 "gram.yy" { yyval.obtype = TEXT_OBJECT; ; break;} case 164: #line 1245 "gram.yy" { yyval.pth = new path(yyvsp[0].str); ; break;} case 165: #line 1249 "gram.yy" { yyval.pth = yyvsp[-2].pth; yyval.pth->append(yyvsp[0].str); ; break;} case 166: #line 1257 "gram.yy" { yyval.pth = new path(yyvsp[0].crn); ; break;} case 167: #line 1264 "gram.yy" { yyval.pth = yyvsp[0].pth; ; break;} case 168: #line 1268 "gram.yy" { yyval.pth = yyvsp[-1].pth; yyval.pth->append(yyvsp[0].crn); ; break;} case 169: #line 1276 "gram.yy" { yyval.pth = yyvsp[0].pth; ; break;} case 170: #line 1280 "gram.yy" { yyval.pth = yyvsp[-3].pth; yyval.pth->set_ypath(yyvsp[-1].pth); ; break;} case 171: #line 1286 "gram.yy" { lex_warning("`%1%2 last %3' in `with' argument ignored", yyvsp[-3].n, ordinal_postfix(yyvsp[-3].n), object_type_name(yyvsp[-1].obtype)); yyval.pth = yyvsp[0].pth; ; break;} case 172: #line 1292 "gram.yy" { lex_warning("`last %1' in `with' argument ignored", object_type_name(yyvsp[-1].obtype)); yyval.pth = yyvsp[0].pth; ; break;} case 173: #line 1298 "gram.yy" { lex_warning("`%1%2 %3' in `with' argument ignored", yyvsp[-2].n, ordinal_postfix(yyvsp[-2].n), object_type_name(yyvsp[-1].obtype)); yyval.pth = yyvsp[0].pth; ; break;} case 174: #line 1304 "gram.yy" { lex_warning("initial `%1' in `with' argument ignored", yyvsp[-1].str); a_delete yyvsp[-1].str; yyval.pth = yyvsp[0].pth; ; break;} case 175: #line 1313 "gram.yy" { yyval.crn = &object::north; ; break;} case 176: #line 1315 "gram.yy" { yyval.crn = &object::east; ; break;} case 177: #line 1317 "gram.yy" { yyval.crn = &object::west; ; break;} case 178: #line 1319 "gram.yy" { yyval.crn = &object::south; ; break;} case 179: #line 1321 "gram.yy" { yyval.crn = &object::north_east; ; break;} case 180: #line 1323 "gram.yy" { yyval.crn = &object:: south_east; ; break;} case 181: #line 1325 "gram.yy" { yyval.crn = &object::north_west; ; break;} case 182: #line 1327 "gram.yy" { yyval.crn = &object::south_west; ; break;} case 183: #line 1329 "gram.yy" { yyval.crn = &object::center; ; break;} case 184: #line 1331 "gram.yy" { yyval.crn = &object::start; ; break;} case 185: #line 1333 "gram.yy" { yyval.crn = &object::end; ; break;} case 186: #line 1335 "gram.yy" { yyval.crn = &object::north; ; break;} case 187: #line 1337 "gram.yy" { yyval.crn = &object::south; ; break;} case 188: #line 1339 "gram.yy" { yyval.crn = &object::west; ; break;} case 189: #line 1341 "gram.yy" { yyval.crn = &object::east; ; break;} case 190: #line 1343 "gram.yy" { yyval.crn = &object::north_west; ; break;} case 191: #line 1345 "gram.yy" { yyval.crn = &object::south_west; ; break;} case 192: #line 1347 "gram.yy" { yyval.crn = &object::north_east; ; break;} case 193: #line 1349 "gram.yy" { yyval.crn = &object::south_east; ; break;} case 194: #line 1351 "gram.yy" { yyval.crn = &object::west; ; break;} case 195: #line 1353 "gram.yy" { yyval.crn = &object::east; ; break;} case 196: #line 1355 "gram.yy" { yyval.crn = &object::north_west; ; break;} case 197: #line 1357 "gram.yy" { yyval.crn = &object::south_west; ; break;} case 198: #line 1359 "gram.yy" { yyval.crn = &object::north_east; ; break;} case 199: #line 1361 "gram.yy" { yyval.crn = &object::south_east; ; break;} case 200: #line 1363 "gram.yy" { yyval.crn = &object::center; ; break;} case 201: #line 1365 "gram.yy" { yyval.crn = &object::start; ; break;} case 202: #line 1367 "gram.yy" { yyval.crn = &object::end; ; break;} case 203: #line 1372 "gram.yy" { if (!lookup_variable(yyvsp[0].str, & yyval.x)) { lex_error("there is no variable `%1'", yyvsp[0].str); YYABORT; } a_delete yyvsp[0].str; ; break;} case 204: #line 1381 "gram.yy" { yyval.x = yyvsp[0].x; ; break;} case 205: #line 1383 "gram.yy" { if (yyvsp[-1].pl.obj != 0) yyval.x = yyvsp[-1].pl.obj->origin().x; else yyval.x = yyvsp[-1].pl.x; ; break;} case 206: #line 1390 "gram.yy" { if (yyvsp[-1].pl.obj != 0) yyval.x = yyvsp[-1].pl.obj->origin().y; else yyval.x = yyvsp[-1].pl.y; ; break;} case 207: #line 1397 "gram.yy" { if (yyvsp[-1].pl.obj != 0) yyval.x = yyvsp[-1].pl.obj->height(); else yyval.x = 0.0; ; break;} case 208: #line 1404 "gram.yy" { if (yyvsp[-1].pl.obj != 0) yyval.x = yyvsp[-1].pl.obj->width(); else yyval.x = 0.0; ; break;} case 209: #line 1411 "gram.yy" { if (yyvsp[-1].pl.obj != 0) yyval.x = yyvsp[-1].pl.obj->radius(); else yyval.x = 0.0; ; break;} case 210: #line 1418 "gram.yy" { yyval.x = yyvsp[-2].x + yyvsp[0].x; ; break;} case 211: #line 1420 "gram.yy" { yyval.x = yyvsp[-2].x - yyvsp[0].x; ; break;} case 212: #line 1422 "gram.yy" { yyval.x = yyvsp[-2].x * yyvsp[0].x; ; break;} case 213: #line 1424 "gram.yy" { if (yyvsp[0].x == 0.0) { lex_error("division by zero"); YYABORT; } yyval.x = yyvsp[-2].x/yyvsp[0].x; ; break;} case 214: #line 1433 "gram.yy" { if (yyvsp[0].x == 0.0) { lex_error("modulus by zero"); YYABORT; } yyval.x = fmod(yyvsp[-2].x, yyvsp[0].x); ; break;} case 215: #line 1442 "gram.yy" { errno = 0; yyval.x = pow(yyvsp[-2].x, yyvsp[0].x); if (errno == EDOM) { lex_error("arguments to `^' operator out of domain"); YYABORT; } if (errno == ERANGE) { lex_error("result of `^' operator out of range"); YYABORT; } ; break;} case 216: #line 1457 "gram.yy" { yyval.x = -yyvsp[0].x; ; break;} case 217: #line 1459 "gram.yy" { yyval.x = yyvsp[-1].x; ; break;} case 218: #line 1461 "gram.yy" { errno = 0; yyval.x = sin(yyvsp[-1].x); if (errno == ERANGE) { lex_error("sin result out of range"); YYABORT; } ; break;} case 219: #line 1471 "gram.yy" { errno = 0; yyval.x = cos(yyvsp[-1].x); if (errno == ERANGE) { lex_error("cos result out of range"); YYABORT; } ; break;} case 220: #line 1481 "gram.yy" { errno = 0; yyval.x = atan2(yyvsp[-3].x, yyvsp[-1].x); if (errno == EDOM) { lex_error("atan2 argument out of domain"); YYABORT; } if (errno == ERANGE) { lex_error("atan2 result out of range"); YYABORT; } ; break;} case 221: #line 1496 "gram.yy" { errno = 0; yyval.x = log10(yyvsp[-1].x); if (errno == ERANGE) { lex_error("log result out of range"); YYABORT; } ; break;} case 222: #line 1506 "gram.yy" { errno = 0; yyval.x = pow(10.0, yyvsp[-1].x); if (errno == ERANGE) { lex_error("exp result out of range"); YYABORT; } ; break;} case 223: #line 1516 "gram.yy" { errno = 0; yyval.x = sqrt(yyvsp[-1].x); if (errno == EDOM) { lex_error("sqrt argument out of domain"); YYABORT; } ; break;} case 224: #line 1526 "gram.yy" { yyval.x = yyvsp[-3].x > yyvsp[-1].x ? yyvsp[-3].x : yyvsp[-1].x; ; break;} case 225: #line 1528 "gram.yy" { yyval.x = yyvsp[-3].x < yyvsp[-1].x ? yyvsp[-3].x : yyvsp[-1].x; ; break;} case 226: #line 1530 "gram.yy" { yyval.x = floor(yyvsp[-1].x); ; break;} case 227: #line 1532 "gram.yy" { yyval.x = 1.0 + floor(((rand()&0x7fff)/double(0x7fff))*yyvsp[-1].x); ; break;} case 228: #line 1534 "gram.yy" { // return a random number in the range [0,1) // portable, but not very random yyval.x = (rand() & 0x7fff) / double(0x8000); ; break;} case 229: #line 1540 "gram.yy" { yyval.x = 0; srand((unsigned int)yyvsp[-1].x); ; break;} case 230: #line 1542 "gram.yy" { yyval.x = (yyvsp[-2].x < yyvsp[0].x); ; break;} case 231: #line 1544 "gram.yy" { yyval.x = (yyvsp[-2].x <= yyvsp[0].x); ; break;} case 232: #line 1546 "gram.yy" { yyval.x = (yyvsp[-2].x > yyvsp[0].x); ; break;} case 233: #line 1548 "gram.yy" { yyval.x = (yyvsp[-2].x >= yyvsp[0].x); ; break;} case 234: #line 1550 "gram.yy" { yyval.x = (yyvsp[-2].x == yyvsp[0].x); ; break;} case 235: #line 1552 "gram.yy" { yyval.x = (yyvsp[-2].x != yyvsp[0].x); ; break;} case 236: #line 1554 "gram.yy" { yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); ; break;} case 237: #line 1556 "gram.yy" { yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); ; break;} case 238: #line 1558 "gram.yy" { yyval.x = (yyvsp[0].x == 0.0); ; break;} } /* the action file gets copied in in place of this dollarsign */ #line 543 "/usr/local/share/bison.simple" yyvsp -= yylen; yyssp -= yylen; #ifdef YYLSP_NEEDED yylsp -= yylen; #endif #if YYDEBUG != 0 if (yydebug) { short *ssp1 = yyss - 1; fprintf (stderr, "state stack now"); while (ssp1 != yyssp) fprintf (stderr, " %d", *++ssp1); fprintf (stderr, "\n"); } #endif *++yyvsp = yyval; #ifdef YYLSP_NEEDED yylsp++; if (yylen == 0) { yylsp->first_line = yylloc.first_line; yylsp->first_column = yylloc.first_column; yylsp->last_line = (yylsp-1)->last_line; yylsp->last_column = (yylsp-1)->last_column; yylsp->text = 0; } else { yylsp->last_line = (yylsp+yylen-1)->last_line; yylsp->last_column = (yylsp+yylen-1)->last_column; } #endif /* Now "shift" the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTBASE] + *yyssp; if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTBASE]; goto yynewstate; yyerrlab: /* here on detecting error */ if (! yyerrstatus) /* If not already recovering from an error, report this error. */ { ++yynerrs; #ifdef YYERROR_VERBOSE yyn = yypact[yystate]; if (yyn > YYFLAG && yyn < YYLAST) { int size = 0; char *msg; int x, count; count = 0; /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ for (x = (yyn < 0 ? -yyn : 0); x < (sizeof(yytname) / sizeof(char *)); x++) if (yycheck[x + yyn] == x) size += strlen(yytname[x]) + 15, count++; msg = (char *) malloc(size + 15); if (msg != 0) { strcpy(msg, "parse error"); if (count < 5) { count = 0; for (x = (yyn < 0 ? -yyn : 0); x < (sizeof(yytname) / sizeof(char *)); x++) if (yycheck[x + yyn] == x) { strcat(msg, count == 0 ? ", expecting `" : " or `"); strcat(msg, yytname[x]); strcat(msg, "'"); count++; } } yyerror(msg); free(msg); } else yyerror ("parse error; also virtual memory exceeded"); } else #endif /* YYERROR_VERBOSE */ yyerror("parse error"); } goto yyerrlab1; yyerrlab1: /* here on error raised explicitly by an action */ if (yyerrstatus == 3) { /* if just tried and failed to reuse lookahead token after an error, discard it. */ /* return failure if at end of input */ if (yychar == YYEOF) YYABORT; #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); #endif yychar = YYEMPTY; } /* Else will try to reuse lookahead token after shifting the error token. */ yyerrstatus = 3; /* Each real token shifted decrements this */ goto yyerrhandle; yyerrdefault: /* current state does not do anything special for the error token. */ #if 0 /* This is wrong; only states that explicitly want error tokens should shift them. */ yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ if (yyn) goto yydefault; #endif yyerrpop: /* pop the current state because it cannot handle the error token */ if (yyssp == yyss) YYABORT; yyvsp--; yystate = *--yyssp; #ifdef YYLSP_NEEDED yylsp--; #endif #if YYDEBUG != 0 if (yydebug) { short *ssp1 = yyss - 1; fprintf (stderr, "Error: state stack now"); while (ssp1 != yyssp) fprintf (stderr, " %d", *++ssp1); fprintf (stderr, "\n"); } #endif yyerrhandle: yyn = yypact[yystate]; if (yyn == YYFLAG) goto yyerrdefault; yyn += YYTERROR; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) goto yyerrdefault; yyn = yytable[yyn]; if (yyn < 0) { if (yyn == YYFLAG) goto yyerrpop; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Shifting error token, "); #endif *++yyvsp = yylval; #ifdef YYLSP_NEEDED *++yylsp = yylloc; #endif yystate = yyn; goto yynewstate; yyacceptlab: /* YYACCEPT comes here. */ if (yyfree_stacks) { free (yyss); free (yyvs); #ifdef YYLSP_NEEDED free (yyls); #endif } return 0; yyabortlab: /* YYABORT comes here. */ if (yyfree_stacks) { free (yyss); free (yyvs); #ifdef YYLSP_NEEDED free (yyls); #endif } return 1; } #line 1562 "gram.yy" // bison defines const to be empty unless __STDC__ is defined, which it // isn't under cfront #ifdef const #undef const #endif static struct { const char *name; double val; int scaled; // non-zero if val should be multiplied by scale } defaults_table[] = { { "arcrad", .25, 1 }, { "arrowht", .1, 1 }, { "arrowwid", .05, 1 }, { "circlerad", .25, 1 }, { "boxht", .5, 1 }, { "boxwid", .75, 1 }, { "boxrad", 0.0, 1 }, { "dashwid", .05, 1 }, { "ellipseht", .5, 1 }, { "ellipsewid", .75, 1 }, { "moveht", .5, 1 }, { "movewid", .5, 1 }, { "lineht", .5, 1 }, { "linewid", .5, 1 }, { "textht", 0.0, 1 }, { "textwid", 0.0, 1 }, { "scale", 1.0, 0 }, { "linethick", -1.0, 1 }, // in points (<0 is default); now scaled { "fillval", .5, 0 }, { "arrowhead", 1.0, 0 }, { "maxpswid", 8.5, 0 }, { "maxpsht", 11.0, 0 }, }; static place * lookup_label(const char *label) { saved_state *state = current_saved_state; PTABLE(place) *tbl = current_table; for (;;) { place *pl = tbl->lookup(label); if (pl) return pl; if (!state) return 0; tbl = state->tbl; state = state->prev; } } static void define_label(const char *label, const place *pl) { place *p = new place; *p = *pl; current_table->define(label, p); } int lookup_variable(const char *name, double *val) { place *pl = lookup_label(name); if (pl) { *val = pl->x; return 1; } return 0; } void define_variable(const char *name, double val) { place *p = new place; p->obj = 0; p->x = val; p->y = 0.0; current_table->define(name, p); if (strcmp(name, "scale") == 0) { // When the scale changes, reset all scaled pre-defined variables to // their default values. for (unsigned int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++) if (defaults_table[i].scaled) define_variable(defaults_table[i].name, val*defaults_table[i].val); } } // called once only (not once per parse) void parse_init (void) { current_direction = RIGHT_DIRECTION; current_position.x = 0.0; current_position.y = 0.0; // This resets everything to its default value. reset_all(); } static void reset (const char *nm) { for (unsigned int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++) if (strcmp(nm, defaults_table[i].name) == 0) { double val = defaults_table[i].val; if (defaults_table[i].scaled) { double scale; lookup_variable("scale", &scale); val *= scale; } define_variable(defaults_table[i].name, val); return; } lex_error("`%1' is not a predefined variable", nm); } static void reset_all (void) { // We only have to explicitly reset the pre-defined variables that // aren't scaled because `scale' is not scaled, and changing the // value of `scale' will reset all the pre-defined variables that // are scaled. for (unsigned int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++) if (!defaults_table[i].scaled) define_variable(defaults_table[i].name, defaults_table[i].val); } // called after each parse void parse_cleanup (void) { while (current_saved_state != 0) { delete current_table; current_table = current_saved_state->tbl; saved_state *tem = current_saved_state; current_saved_state = current_saved_state->prev; delete tem; } assert(current_table == &top_table); PTABLE_ITERATOR(place) iter(current_table); const char *key; place *pl; while (iter.next(&key, &pl)) if (pl->obj != 0) { position pos = pl->obj->origin(); pl->obj = 0; pl->x = pos.x; pl->y = pos.y; } while (olist.head != 0) { object *tem = olist.head; olist.head = olist.head->next; delete tem; } olist.tail = 0; current_direction = RIGHT_DIRECTION; current_position.x = 0.0; current_position.y = 0.0; } static const char * ordinal_postfix(int n) { if (n < 10 || n > 20) switch (n % 10) { case 1: return "st"; case 2: return "nd"; case 3: return "rd"; } return "th"; } static const char * object_type_name(object_type type) { switch (type) { case BOX_OBJECT: return "box"; case CIRCLE_OBJECT: return "circle"; case ELLIPSE_OBJECT: return "ellipse"; case ARC_OBJECT: return "arc"; case SPLINE_OBJECT: return "spline"; case LINE_OBJECT: return "line"; case ARROW_OBJECT: return "arrow"; case MOVE_OBJECT: return "move"; case TEXT_OBJECT: return "\"\""; case BLOCK_OBJECT: return "[]"; case OTHER_OBJECT: case MARK_OBJECT: default: break; } return "object"; } static char * format_number(const char *form, double n) { if (form == 0) form = "%g"; else { // this is a fairly feeble attempt at validation of the format int nspecs = 0; for (const char *p = form; *p != '\0'; p++) if (*p == '%') { if (p[1] == '%') p++; else nspecs++; } if (nspecs > 1) { lex_error("bad format `%1'", form); return strsave(form); } } sprintf(sprintf_buf, form, n); return strsave(sprintf_buf); } static char * do_sprintf(const char *form, const double *v, int nv) { string result; int i = 0; string one_format; while (*form) { if (*form == '%') { one_format += *form++; for (; *form != '\0' && strchr("#-+ 0123456789.", *form) != 0; form++) one_format += *form; if (*form == '\0' || strchr("eEfgG%", *form) == 0) { lex_error("bad sprintf format"); result += one_format; result += form; break; } if (*form == '%') { one_format += *form++; one_format += '\0'; sprintf(sprintf_buf, one_format.contents()); } else { if (i >= nv) { lex_error("too few arguments to sprintf"); result += one_format; result += form; break; } one_format += *form++; one_format += '\0'; sprintf(sprintf_buf, one_format.contents(), v[i++]); } one_format.clear(); result += sprintf_buf; } else result += *form++; } result += '\0'; return strsave(result.contents()); }