github.com/xushiwei/go@v0.0.0-20130601165731-2b9d83f45bc9/src/cmd/8a/y.tab.c (about) 1 /* A Bison parser, made by GNU Bison 2.3. */ 2 3 /* Skeleton implementation for Bison's Yacc-like parsers in C 4 5 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 6 Free Software Foundation, Inc. 7 8 This program is free software; you can redistribute it and/or modify 9 it under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2, or (at your option) 11 any later version. 12 13 This program is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 18 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 Boston, MA 02110-1301, USA. */ 22 23 /* As a special exception, you may create a larger work that contains 24 part or all of the Bison parser skeleton and distribute that work 25 under terms of your choice, so long as that work isn't itself a 26 parser generator using the skeleton or a modified version thereof 27 as a parser skeleton. Alternatively, if you modify or redistribute 28 the parser skeleton itself, you may (at your option) remove this 29 special exception, which will cause the skeleton and the resulting 30 Bison output files to be licensed under the GNU General Public 31 License without this special exception. 32 33 This special exception was added by the Free Software Foundation in 34 version 2.2 of Bison. */ 35 36 /* C LALR(1) parser skeleton written by Richard Stallman, by 37 simplifying the original so-called "semantic" parser. */ 38 39 /* All symbols defined below should begin with yy or YY, to avoid 40 infringing on user name space. This should be done even for local 41 variables, as they might otherwise be expanded by user macros. 42 There are some unavoidable exceptions within include files to 43 define necessary library symbols; they are noted "INFRINGES ON 44 USER NAME SPACE" below. */ 45 46 /* Identify Bison output. */ 47 #define YYBISON 1 48 49 /* Bison version. */ 50 #define YYBISON_VERSION "2.3" 51 52 /* Skeleton name. */ 53 #define YYSKELETON_NAME "yacc.c" 54 55 /* Pure parsers. */ 56 #define YYPURE 0 57 58 /* Using locations. */ 59 #define YYLSP_NEEDED 0 60 61 62 63 /* Tokens. */ 64 #ifndef YYTOKENTYPE 65 # define YYTOKENTYPE 66 /* Put the tokens into the symbol table, so that GDB and other debuggers 67 know about them. */ 68 enum yytokentype { 69 LTYPE0 = 258, 70 LTYPE1 = 259, 71 LTYPE2 = 260, 72 LTYPE3 = 261, 73 LTYPE4 = 262, 74 LTYPEC = 263, 75 LTYPED = 264, 76 LTYPEN = 265, 77 LTYPER = 266, 78 LTYPET = 267, 79 LTYPES = 268, 80 LTYPEM = 269, 81 LTYPEI = 270, 82 LTYPEG = 271, 83 LTYPEXC = 272, 84 LTYPEX = 273, 85 LCONST = 274, 86 LFP = 275, 87 LPC = 276, 88 LSB = 277, 89 LBREG = 278, 90 LLREG = 279, 91 LSREG = 280, 92 LFREG = 281, 93 LXREG = 282, 94 LFCONST = 283, 95 LSCONST = 284, 96 LSP = 285, 97 LNAME = 286, 98 LLAB = 287, 99 LVAR = 288 100 }; 101 #endif 102 /* Tokens. */ 103 #define LTYPE0 258 104 #define LTYPE1 259 105 #define LTYPE2 260 106 #define LTYPE3 261 107 #define LTYPE4 262 108 #define LTYPEC 263 109 #define LTYPED 264 110 #define LTYPEN 265 111 #define LTYPER 266 112 #define LTYPET 267 113 #define LTYPES 268 114 #define LTYPEM 269 115 #define LTYPEI 270 116 #define LTYPEG 271 117 #define LTYPEXC 272 118 #define LTYPEX 273 119 #define LCONST 274 120 #define LFP 275 121 #define LPC 276 122 #define LSB 277 123 #define LBREG 278 124 #define LLREG 279 125 #define LSREG 280 126 #define LFREG 281 127 #define LXREG 282 128 #define LFCONST 283 129 #define LSCONST 284 130 #define LSP 285 131 #define LNAME 286 132 #define LLAB 287 133 #define LVAR 288 134 135 136 137 138 /* Copy the first part of user declarations. */ 139 #line 31 "a.y" 140 141 #include <u.h> 142 #include <stdio.h> /* if we don't, bison will, and a.h re-#defines getc */ 143 #include <libc.h> 144 #include "a.h" 145 146 147 /* Enabling traces. */ 148 #ifndef YYDEBUG 149 # define YYDEBUG 0 150 #endif 151 152 /* Enabling verbose error messages. */ 153 #ifdef YYERROR_VERBOSE 154 # undef YYERROR_VERBOSE 155 # define YYERROR_VERBOSE 1 156 #else 157 # define YYERROR_VERBOSE 0 158 #endif 159 160 /* Enabling the token table. */ 161 #ifndef YYTOKEN_TABLE 162 # define YYTOKEN_TABLE 0 163 #endif 164 165 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 166 typedef union YYSTYPE 167 #line 37 "a.y" 168 { 169 Sym *sym; 170 int32 lval; 171 struct { 172 int32 v1; 173 int32 v2; 174 } con2; 175 double dval; 176 char sval[8]; 177 Gen gen; 178 Gen2 gen2; 179 } 180 /* Line 193 of yacc.c. */ 181 #line 182 "y.tab.c" 182 YYSTYPE; 183 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ 184 # define YYSTYPE_IS_DECLARED 1 185 # define YYSTYPE_IS_TRIVIAL 1 186 #endif 187 188 189 190 /* Copy the second part of user declarations. */ 191 192 193 /* Line 216 of yacc.c. */ 194 #line 195 "y.tab.c" 195 196 #ifdef short 197 # undef short 198 #endif 199 200 #ifdef YYTYPE_UINT8 201 typedef YYTYPE_UINT8 yytype_uint8; 202 #else 203 typedef unsigned char yytype_uint8; 204 #endif 205 206 #ifdef YYTYPE_INT8 207 typedef YYTYPE_INT8 yytype_int8; 208 #elif (defined __STDC__ || defined __C99__FUNC__ \ 209 || defined __cplusplus || defined _MSC_VER) 210 typedef signed char yytype_int8; 211 #else 212 typedef short int yytype_int8; 213 #endif 214 215 #ifdef YYTYPE_UINT16 216 typedef YYTYPE_UINT16 yytype_uint16; 217 #else 218 typedef unsigned short int yytype_uint16; 219 #endif 220 221 #ifdef YYTYPE_INT16 222 typedef YYTYPE_INT16 yytype_int16; 223 #else 224 typedef short int yytype_int16; 225 #endif 226 227 #ifndef YYSIZE_T 228 # ifdef __SIZE_TYPE__ 229 # define YYSIZE_T __SIZE_TYPE__ 230 # elif defined size_t 231 # define YYSIZE_T size_t 232 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ 233 || defined __cplusplus || defined _MSC_VER) 234 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 235 # define YYSIZE_T size_t 236 # else 237 # define YYSIZE_T unsigned int 238 # endif 239 #endif 240 241 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 242 243 #ifndef YY_ 244 # if defined YYENABLE_NLS && YYENABLE_NLS 245 # if ENABLE_NLS 246 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 247 # define YY_(msgid) dgettext ("bison-runtime", msgid) 248 # endif 249 # endif 250 # ifndef YY_ 251 # define YY_(msgid) msgid 252 # endif 253 #endif 254 255 /* Suppress unused-variable warnings by "using" E. */ 256 #if ! defined lint || defined __GNUC__ 257 # define YYUSE(e) ((void) (e)) 258 #else 259 # define YYUSE(e) /* empty */ 260 #endif 261 262 /* Identity function, used to suppress warnings about constant conditions. */ 263 #ifndef lint 264 # define YYID(n) (n) 265 #else 266 #if (defined __STDC__ || defined __C99__FUNC__ \ 267 || defined __cplusplus || defined _MSC_VER) 268 static int 269 YYID (int i) 270 #else 271 static int 272 YYID (i) 273 int i; 274 #endif 275 { 276 return i; 277 } 278 #endif 279 280 #if ! defined yyoverflow || YYERROR_VERBOSE 281 282 /* The parser invokes alloca or malloc; define the necessary symbols. */ 283 284 # ifdef YYSTACK_USE_ALLOCA 285 # if YYSTACK_USE_ALLOCA 286 # ifdef __GNUC__ 287 # define YYSTACK_ALLOC __builtin_alloca 288 # elif defined __BUILTIN_VA_ARG_INCR 289 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ 290 # elif defined _AIX 291 # define YYSTACK_ALLOC __alloca 292 # elif defined _MSC_VER 293 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ 294 # define alloca _alloca 295 # else 296 # define YYSTACK_ALLOC alloca 297 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 298 || defined __cplusplus || defined _MSC_VER) 299 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 300 # ifndef _STDLIB_H 301 # define _STDLIB_H 1 302 # endif 303 # endif 304 # endif 305 # endif 306 # endif 307 308 # ifdef YYSTACK_ALLOC 309 /* Pacify GCC's `empty if-body' warning. */ 310 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) 311 # ifndef YYSTACK_ALLOC_MAXIMUM 312 /* The OS might guarantee only one guard page at the bottom of the stack, 313 and a page size can be as small as 4096 bytes. So we cannot safely 314 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 315 to allow for a few compiler-allocated temporary stack slots. */ 316 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ 317 # endif 318 # else 319 # define YYSTACK_ALLOC YYMALLOC 320 # define YYSTACK_FREE YYFREE 321 # ifndef YYSTACK_ALLOC_MAXIMUM 322 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 323 # endif 324 # if (defined __cplusplus && ! defined _STDLIB_H \ 325 && ! ((defined YYMALLOC || defined malloc) \ 326 && (defined YYFREE || defined free))) 327 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 328 # ifndef _STDLIB_H 329 # define _STDLIB_H 1 330 # endif 331 # endif 332 # ifndef YYMALLOC 333 # define YYMALLOC malloc 334 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 335 || defined __cplusplus || defined _MSC_VER) 336 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 337 # endif 338 # endif 339 # ifndef YYFREE 340 # define YYFREE free 341 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 342 || defined __cplusplus || defined _MSC_VER) 343 void free (void *); /* INFRINGES ON USER NAME SPACE */ 344 # endif 345 # endif 346 # endif 347 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ 348 349 350 #if (! defined yyoverflow \ 351 && (! defined __cplusplus \ 352 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 353 354 /* A type that is properly aligned for any stack member. */ 355 union yyalloc 356 { 357 yytype_int16 yyss; 358 YYSTYPE yyvs; 359 }; 360 361 /* The size of the maximum gap between one aligned stack and the next. */ 362 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 363 364 /* The size of an array large to enough to hold all stacks, each with 365 N elements. */ 366 # define YYSTACK_BYTES(N) \ 367 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 368 + YYSTACK_GAP_MAXIMUM) 369 370 /* Copy COUNT objects from FROM to TO. The source and destination do 371 not overlap. */ 372 # ifndef YYCOPY 373 # if defined __GNUC__ && 1 < __GNUC__ 374 # define YYCOPY(To, From, Count) \ 375 __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 376 # else 377 # define YYCOPY(To, From, Count) \ 378 do \ 379 { \ 380 YYSIZE_T yyi; \ 381 for (yyi = 0; yyi < (Count); yyi++) \ 382 (To)[yyi] = (From)[yyi]; \ 383 } \ 384 while (YYID (0)) 385 # endif 386 # endif 387 388 /* Relocate STACK from its old location to the new one. The 389 local variables YYSIZE and YYSTACKSIZE give the old and new number of 390 elements in the stack, and YYPTR gives the new location of the 391 stack. Advance YYPTR to a properly aligned location for the next 392 stack. */ 393 # define YYSTACK_RELOCATE(Stack) \ 394 do \ 395 { \ 396 YYSIZE_T yynewbytes; \ 397 YYCOPY (&yyptr->Stack, Stack, yysize); \ 398 Stack = &yyptr->Stack; \ 399 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 400 yyptr += yynewbytes / sizeof (*yyptr); \ 401 } \ 402 while (YYID (0)) 403 404 #endif 405 406 /* YYFINAL -- State number of the termination state. */ 407 #define YYFINAL 2 408 /* YYLAST -- Last index in YYTABLE. */ 409 #define YYLAST 537 410 411 /* YYNTOKENS -- Number of terminals. */ 412 #define YYNTOKENS 52 413 /* YYNNTS -- Number of nonterminals. */ 414 #define YYNNTS 39 415 /* YYNRULES -- Number of rules. */ 416 #define YYNRULES 131 417 /* YYNRULES -- Number of states. */ 418 #define YYNSTATES 266 419 420 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 421 #define YYUNDEFTOK 2 422 #define YYMAXUTOK 288 423 424 #define YYTRANSLATE(YYX) \ 425 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 426 427 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 428 static const yytype_uint8 yytranslate[] = 429 { 430 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 431 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 432 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 433 2, 2, 2, 2, 2, 2, 50, 12, 5, 2, 434 48, 49, 10, 8, 47, 9, 2, 11, 2, 2, 435 2, 2, 2, 2, 2, 2, 2, 2, 44, 45, 436 6, 46, 7, 2, 2, 2, 2, 2, 2, 2, 437 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 438 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 439 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 441 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 442 2, 2, 2, 2, 3, 2, 51, 2, 2, 2, 443 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 444 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 445 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 450 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 451 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 452 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 455 2, 2, 2, 2, 2, 2, 1, 2, 13, 14, 456 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 457 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 458 35, 36, 37, 38, 39, 40, 41, 42, 43 459 }; 460 461 #if YYDEBUG 462 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 463 YYRHS. */ 464 static const yytype_uint16 yyprhs[] = 465 { 466 0, 0, 3, 4, 5, 9, 10, 15, 16, 21, 467 23, 26, 29, 33, 37, 40, 43, 46, 49, 52, 468 55, 58, 61, 64, 67, 70, 73, 76, 79, 82, 469 85, 86, 88, 92, 96, 99, 101, 104, 106, 109, 470 111, 115, 121, 125, 131, 134, 136, 139, 141, 143, 471 147, 153, 157, 163, 166, 168, 172, 176, 182, 188, 472 194, 196, 198, 200, 202, 205, 208, 210, 212, 214, 473 216, 218, 223, 226, 229, 231, 233, 235, 237, 239, 474 241, 244, 247, 250, 253, 258, 264, 268, 271, 273, 475 276, 280, 285, 287, 289, 291, 296, 301, 308, 318, 476 328, 332, 336, 341, 347, 356, 358, 365, 371, 379, 477 380, 383, 386, 388, 390, 392, 394, 396, 399, 402, 478 405, 409, 411, 415, 419, 423, 427, 431, 436, 441, 479 445, 449 480 }; 481 482 /* YYRHS -- A `-1'-separated list of the rules' RHS. */ 483 static const yytype_int8 yyrhs[] = 484 { 485 53, 0, -1, -1, -1, 53, 54, 55, -1, -1, 486 42, 44, 56, 55, -1, -1, 41, 44, 57, 55, 487 -1, 45, -1, 58, 45, -1, 1, 45, -1, 41, 488 46, 90, -1, 43, 46, 90, -1, 13, 59, -1, 489 14, 63, -1, 15, 62, -1, 16, 60, -1, 17, 490 61, -1, 21, 64, -1, 19, 65, -1, 22, 66, 491 -1, 18, 67, -1, 20, 68, -1, 23, 69, -1, 492 24, 70, -1, 25, 71, -1, 26, 72, -1, 27, 493 73, -1, 28, 74, -1, -1, 47, -1, 77, 47, 494 75, -1, 75, 47, 77, -1, 77, 47, -1, 77, 495 -1, 47, 75, -1, 75, -1, 47, 78, -1, 78, 496 -1, 80, 47, 78, -1, 86, 11, 89, 47, 80, 497 -1, 83, 47, 81, -1, 83, 47, 89, 47, 81, 498 -1, 47, 76, -1, 76, -1, 10, 86, -1, 59, 499 -1, 63, -1, 77, 47, 75, -1, 77, 47, 75, 500 44, 34, -1, 77, 47, 75, -1, 77, 47, 75, 501 44, 35, -1, 77, 47, -1, 77, -1, 77, 47, 502 75, -1, 83, 47, 80, -1, 83, 47, 89, 47, 503 80, -1, 79, 47, 75, 47, 89, -1, 80, 47, 504 75, 47, 79, -1, 79, -1, 83, -1, 78, -1, 505 85, -1, 10, 79, -1, 10, 84, -1, 79, -1, 506 84, -1, 80, -1, 75, -1, 80, -1, 89, 48, 507 31, 49, -1, 41, 87, -1, 42, 87, -1, 33, 508 -1, 36, -1, 34, -1, 37, -1, 40, -1, 35, 509 -1, 50, 89, -1, 50, 86, -1, 50, 39, -1, 510 50, 38, -1, 50, 48, 38, 49, -1, 50, 48, 511 9, 38, 49, -1, 50, 9, 38, -1, 50, 82, 512 -1, 29, -1, 9, 29, -1, 29, 9, 29, -1, 513 9, 29, 9, 29, -1, 84, -1, 85, -1, 89, 514 -1, 89, 48, 34, 49, -1, 89, 48, 40, 49, 515 -1, 89, 48, 34, 10, 89, 49, -1, 89, 48, 516 34, 49, 48, 34, 10, 89, 49, -1, 89, 48, 517 34, 49, 48, 35, 10, 89, 49, -1, 48, 34, 518 49, -1, 48, 40, 49, -1, 89, 48, 35, 49, 519 -1, 48, 34, 10, 89, 49, -1, 48, 34, 49, 520 48, 34, 10, 89, 49, -1, 86, -1, 86, 48, 521 34, 10, 89, 49, -1, 41, 87, 48, 88, 49, 522 -1, 41, 6, 7, 87, 48, 32, 49, -1, -1, 523 8, 89, -1, 9, 89, -1, 32, -1, 40, -1, 524 30, -1, 29, -1, 43, -1, 9, 89, -1, 8, 525 89, -1, 51, 89, -1, 48, 90, 49, -1, 89, 526 -1, 90, 8, 90, -1, 90, 9, 90, -1, 90, 527 10, 90, -1, 90, 11, 90, -1, 90, 12, 90, 528 -1, 90, 6, 6, 90, -1, 90, 7, 7, 90, 529 -1, 90, 5, 90, -1, 90, 4, 90, -1, 90, 530 3, 90, -1 531 }; 532 533 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 534 static const yytype_uint16 yyrline[] = 535 { 536 0, 68, 68, 70, 69, 77, 76, 84, 83, 89, 537 90, 91, 94, 99, 105, 106, 107, 108, 109, 110, 538 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 539 123, 127, 134, 141, 148, 153, 160, 165, 172, 177, 540 182, 189, 197, 202, 210, 215, 220, 229, 230, 233, 541 238, 248, 253, 263, 268, 273, 280, 285, 293, 301, 542 311, 312, 315, 316, 317, 321, 325, 326, 327, 330, 543 331, 334, 340, 349, 358, 363, 368, 373, 378, 383, 544 390, 396, 407, 413, 419, 425, 431, 439, 448, 453, 545 458, 463, 470, 471, 474, 480, 486, 492, 501, 510, 546 519, 524, 529, 535, 543, 553, 557, 566, 573, 582, 547 585, 589, 595, 596, 600, 603, 604, 608, 612, 616, 548 620, 626, 627, 631, 635, 639, 643, 647, 651, 655, 549 659, 663 550 }; 551 #endif 552 553 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 554 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 555 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 556 static const char *const yytname[] = 557 { 558 "$end", "error", "$undefined", "'|'", "'^'", "'&'", "'<'", "'>'", "'+'", 559 "'-'", "'*'", "'/'", "'%'", "LTYPE0", "LTYPE1", "LTYPE2", "LTYPE3", 560 "LTYPE4", "LTYPEC", "LTYPED", "LTYPEN", "LTYPER", "LTYPET", "LTYPES", 561 "LTYPEM", "LTYPEI", "LTYPEG", "LTYPEXC", "LTYPEX", "LCONST", "LFP", 562 "LPC", "LSB", "LBREG", "LLREG", "LSREG", "LFREG", "LXREG", "LFCONST", 563 "LSCONST", "LSP", "LNAME", "LLAB", "LVAR", "':'", "';'", "'='", "','", 564 "'('", "')'", "'$'", "'~'", "$accept", "prog", "@1", "line", "@2", "@3", 565 "inst", "nonnon", "rimrem", "remrim", "rimnon", "nonrem", "nonrel", 566 "spec1", "spec2", "spec3", "spec4", "spec5", "spec6", "spec7", "spec8", 567 "spec9", "spec10", "rem", "rom", "rim", "rel", "reg", "imm", "imm2", 568 "con2", "mem", "omem", "nmem", "nam", "offset", "pointer", "con", "expr", 0 569 }; 570 #endif 571 572 # ifdef YYPRINT 573 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 574 token YYLEX-NUM. */ 575 static const yytype_uint16 yytoknum[] = 576 { 577 0, 256, 257, 124, 94, 38, 60, 62, 43, 45, 578 42, 47, 37, 258, 259, 260, 261, 262, 263, 264, 579 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 580 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 581 285, 286, 287, 288, 58, 59, 61, 44, 40, 41, 582 36, 126 583 }; 584 # endif 585 586 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 587 static const yytype_uint8 yyr1[] = 588 { 589 0, 52, 53, 54, 53, 56, 55, 57, 55, 55, 590 55, 55, 58, 58, 58, 58, 58, 58, 58, 58, 591 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 592 59, 59, 60, 61, 62, 62, 63, 63, 64, 64, 593 64, 65, 66, 66, 67, 67, 67, 68, 68, 69, 594 69, 70, 70, 71, 71, 71, 72, 72, 73, 74, 595 75, 75, 76, 76, 76, 76, 76, 76, 76, 77, 596 77, 78, 78, 78, 79, 79, 79, 79, 79, 79, 597 80, 80, 80, 80, 80, 80, 80, 81, 82, 82, 598 82, 82, 83, 83, 84, 84, 84, 84, 84, 84, 599 84, 84, 84, 84, 84, 85, 85, 86, 86, 87, 600 87, 87, 88, 88, 88, 89, 89, 89, 89, 89, 601 89, 90, 90, 90, 90, 90, 90, 90, 90, 90, 602 90, 90 603 }; 604 605 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 606 static const yytype_uint8 yyr2[] = 607 { 608 0, 2, 0, 0, 3, 0, 4, 0, 4, 1, 609 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 610 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 611 0, 1, 3, 3, 2, 1, 2, 1, 2, 1, 612 3, 5, 3, 5, 2, 1, 2, 1, 1, 3, 613 5, 3, 5, 2, 1, 3, 3, 5, 5, 5, 614 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 615 1, 4, 2, 2, 1, 1, 1, 1, 1, 1, 616 2, 2, 2, 2, 4, 5, 3, 2, 1, 2, 617 3, 4, 1, 1, 1, 4, 4, 6, 9, 9, 618 3, 3, 4, 5, 8, 1, 6, 5, 7, 0, 619 2, 2, 1, 1, 1, 1, 1, 2, 2, 2, 620 3, 1, 3, 3, 3, 3, 3, 4, 4, 3, 621 3, 3 622 }; 623 624 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state 625 STATE-NUM when YYTABLE doesn't specify something else to do. Zero 626 means the default is an error. */ 627 static const yytype_uint8 yydefact[] = 628 { 629 2, 3, 1, 0, 0, 30, 0, 0, 0, 0, 630 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 631 0, 0, 0, 0, 9, 4, 0, 11, 31, 14, 632 0, 0, 115, 74, 76, 79, 75, 77, 78, 109, 633 116, 0, 0, 0, 15, 37, 60, 61, 92, 93, 634 105, 94, 0, 16, 69, 35, 70, 17, 0, 18, 635 0, 0, 109, 109, 0, 22, 45, 62, 66, 68, 636 67, 63, 94, 20, 0, 31, 47, 48, 23, 109, 637 0, 0, 19, 39, 0, 0, 21, 0, 24, 0, 638 25, 0, 26, 54, 27, 0, 28, 0, 29, 0, 639 7, 0, 5, 0, 10, 118, 117, 0, 0, 0, 640 0, 36, 0, 0, 121, 0, 119, 0, 0, 0, 641 83, 82, 0, 81, 80, 34, 0, 0, 64, 65, 642 46, 72, 73, 0, 44, 0, 0, 72, 38, 0, 643 0, 0, 0, 0, 53, 0, 0, 0, 0, 12, 644 0, 13, 109, 110, 111, 0, 0, 100, 101, 0, 645 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 646 0, 0, 0, 0, 86, 0, 0, 32, 33, 0, 647 0, 40, 0, 42, 0, 49, 51, 55, 56, 0, 648 0, 0, 8, 6, 0, 114, 112, 113, 0, 0, 649 0, 131, 130, 129, 0, 0, 122, 123, 124, 125, 650 126, 0, 0, 95, 102, 96, 0, 84, 71, 0, 651 0, 88, 87, 0, 0, 0, 0, 0, 0, 0, 652 107, 103, 0, 127, 128, 0, 0, 0, 85, 41, 653 89, 0, 43, 50, 52, 57, 58, 59, 0, 0, 654 106, 97, 0, 0, 0, 90, 108, 0, 0, 0, 655 91, 104, 0, 0, 98, 99 656 }; 657 658 /* YYDEFGOTO[NTERM-NUM]. */ 659 static const yytype_int16 yydefgoto[] = 660 { 661 -1, 1, 3, 25, 150, 148, 26, 29, 57, 59, 662 53, 44, 82, 73, 86, 65, 78, 88, 90, 92, 663 94, 96, 98, 54, 66, 55, 67, 46, 56, 183, 664 222, 47, 48, 49, 50, 110, 198, 51, 115 665 }; 666 667 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 668 STATE-NUM. */ 669 #define YYPACT_NINF -100 670 static const yytype_int16 yypact[] = 671 { 672 -100, 22, -100, 165, -32, -22, 265, 288, 288, 334, 673 195, -1, 311, 212, 416, 288, 288, 288, 416, 81, 674 7, -16, 24, -12, -100, -100, -4, -100, -100, -100, 675 469, 469, -100, -100, -100, -100, -100, -100, -100, 39, 676 -100, 334, 387, 469, -100, -100, -100, -100, -100, -100, 677 46, 65, 372, -100, -100, 72, -100, -100, 83, -100, 678 86, 334, 39, 102, 242, -100, -100, -100, -100, -100, 679 -100, -100, 77, -100, 117, 334, -100, -100, -100, 102, 680 410, 469, -100, -100, 89, 90, -100, 92, -100, 97, 681 -100, 98, -100, 100, -100, 101, -100, 105, -100, 106, 682 -100, 469, -100, 469, -100, -100, -100, 135, 469, 469, 683 114, -100, -6, 128, -100, 71, -100, 175, 32, 218, 684 -100, -100, 425, -100, -100, -100, 334, 288, -100, -100, 685 -100, 114, -100, 357, -100, 29, 469, -100, -100, 410, 686 181, 440, 334, 334, 334, 457, 334, 334, 165, 164, 687 165, 164, 102, -100, -100, 6, 469, 166, -100, 469, 688 469, 469, 207, 208, 469, 469, 469, 469, 469, -100, 689 206, 4, 173, 174, -100, 463, 176, -100, -100, 184, 690 187, -100, 15, -100, 193, 200, 213, -100, -100, 211, 691 217, 220, -100, -100, 222, -100, -100, -100, 216, 219, 692 238, 517, 525, 78, 469, 469, 95, 95, -100, -100, 693 -100, 469, 469, 232, -100, -100, 237, -100, -100, 7, 694 252, 278, -100, 239, 254, 256, 7, 469, 81, 263, 695 -100, -100, 293, 188, 188, 255, 258, 88, -100, -100, 696 300, 281, -100, -100, -100, -100, -100, -100, 262, 469, 697 -100, -100, 304, 305, 289, -100, -100, 277, 469, 469, 698 -100, -100, 283, 284, -100, -100 699 }; 700 701 /* YYPGOTO[NTERM-NUM]. */ 702 static const yytype_int16 yypgoto[] = 703 { 704 -100, -100, -100, -99, -100, -100, -100, 315, -100, -100, 705 -100, 318, -100, -100, -100, -100, -100, -100, -100, -100, 706 -100, -100, -100, 17, 270, 0, -7, -9, -8, 112, 707 -100, 13, 1, -3, -2, -44, -100, -10, -64 708 }; 709 710 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 711 positive, shift that token. If negative, reduce the rule which 712 number is the opposite. If zero, do what YYDEFACT says. 713 If YYTABLE_NINF, syntax error. */ 714 #define YYTABLE_NINF -1 715 static const yytype_uint16 yytable[] = 716 { 717 72, 68, 69, 85, 156, 84, 83, 71, 58, 74, 718 97, 70, 99, 27, 212, 89, 91, 93, 131, 132, 719 105, 106, 2, 45, 220, 28, 60, 87, 100, 45, 720 101, 95, 114, 116, 103, 137, 195, 149, 196, 151, 721 39, 104, 124, 157, 221, 107, 197, 108, 109, 192, 722 123, 193, 128, 213, 72, 68, 69, 52, 111, 130, 723 179, 71, 129, 171, 172, 70, 171, 172, 102, 173, 724 85, 114, 173, 138, 159, 160, 161, 162, 163, 164, 725 165, 166, 167, 168, 162, 163, 164, 165, 166, 167, 726 168, 114, 111, 114, 117, 201, 202, 203, 153, 154, 727 206, 207, 208, 209, 210, 166, 167, 168, 194, 106, 728 108, 109, 114, 118, 33, 34, 35, 36, 37, 125, 729 169, 38, 252, 253, 128, 135, 180, 178, 136, 85, 730 126, 184, 181, 127, 129, 189, 139, 188, 140, 141, 731 233, 234, 152, 177, 142, 143, 199, 144, 145, 114, 732 114, 114, 146, 147, 114, 114, 114, 114, 114, 185, 733 186, 187, 155, 190, 191, 106, 4, 159, 160, 161, 734 162, 163, 164, 165, 166, 167, 168, 158, 5, 6, 735 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 736 17, 18, 19, 20, 114, 114, 164, 165, 166, 167, 737 168, 235, 236, 30, 31, 61, 21, 22, 23, 170, 738 24, 239, 179, 204, 200, 205, 211, 246, 245, 247, 739 30, 31, 214, 215, 32, 217, 30, 31, 33, 34, 740 35, 36, 37, 218, 219, 38, 62, 63, 40, 257, 741 223, 32, 64, 42, 224, 52, 43, 32, 262, 263, 742 30, 31, 133, 79, 63, 40, 174, 225, 226, 80, 743 81, 40, 52, 43, 227, 230, 81, 228, 231, 43, 744 229, 32, 232, 30, 31, 33, 34, 35, 36, 37, 745 237, 240, 38, 62, 63, 40, 238, 241, 243, 182, 746 42, 244, 52, 43, 32, 248, 30, 31, 33, 34, 747 35, 36, 37, 249, 250, 38, 39, 251, 40, 254, 748 255, 256, 41, 42, 258, 259, 43, 32, 260, 30, 749 31, 33, 34, 35, 36, 37, 261, 76, 38, 39, 750 77, 40, 264, 265, 134, 242, 42, 0, 52, 43, 751 32, 0, 30, 31, 33, 34, 35, 36, 37, 0, 752 0, 38, 39, 0, 40, 0, 0, 0, 75, 42, 753 0, 0, 43, 32, 0, 30, 31, 33, 34, 35, 754 36, 37, 0, 0, 38, 39, 0, 40, 0, 0, 755 30, 119, 42, 0, 0, 43, 32, 0, 0, 0, 756 33, 34, 35, 36, 37, 30, 31, 38, 0, 0, 757 40, 32, 0, 0, 0, 42, 0, 0, 43, 0, 758 120, 121, 0, 39, 0, 40, 32, 0, 30, 31, 759 122, 112, 0, 43, 30, 31, 0, 113, 0, 0, 760 40, 0, 0, 30, 175, 81, 0, 0, 43, 32, 761 0, 0, 0, 0, 0, 32, 0, 0, 30, 31, 762 0, 79, 63, 40, 32, 0, 0, 39, 81, 40, 763 0, 43, 0, 176, 42, 30, 31, 43, 40, 32, 764 0, 30, 31, 81, 0, 0, 43, 30, 31, 0, 765 0, 0, 0, 40, 0, 0, 32, 0, 81, 0, 766 182, 43, 32, 0, 0, 0, 0, 0, 32, 0, 767 40, 216, 0, 0, 0, 81, 40, 52, 43, 0, 768 0, 81, 40, 0, 43, 0, 0, 81, 0, 0, 769 43, 160, 161, 162, 163, 164, 165, 166, 167, 168, 770 161, 162, 163, 164, 165, 166, 167, 168 771 }; 772 773 static const yytype_int16 yycheck[] = 774 { 775 10, 10, 10, 13, 10, 13, 13, 10, 8, 11, 776 19, 10, 20, 45, 10, 15, 16, 17, 62, 63, 777 30, 31, 0, 6, 9, 47, 9, 14, 44, 12, 778 46, 18, 42, 43, 46, 79, 30, 101, 32, 103, 779 41, 45, 52, 49, 29, 6, 40, 8, 9, 148, 780 52, 150, 61, 49, 64, 64, 64, 50, 41, 61, 781 31, 64, 61, 34, 35, 64, 34, 35, 44, 40, 782 80, 81, 40, 80, 3, 4, 5, 6, 7, 8, 783 9, 10, 11, 12, 6, 7, 8, 9, 10, 11, 784 12, 101, 75, 103, 48, 159, 160, 161, 108, 109, 785 164, 165, 166, 167, 168, 10, 11, 12, 152, 119, 786 8, 9, 122, 48, 33, 34, 35, 36, 37, 47, 787 49, 40, 34, 35, 133, 48, 136, 127, 11, 139, 788 47, 141, 139, 47, 133, 145, 47, 145, 48, 47, 789 204, 205, 7, 126, 47, 47, 156, 47, 47, 159, 790 160, 161, 47, 47, 164, 165, 166, 167, 168, 142, 791 143, 144, 48, 146, 147, 175, 1, 3, 4, 5, 792 6, 7, 8, 9, 10, 11, 12, 49, 13, 14, 793 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 794 25, 26, 27, 28, 204, 205, 8, 9, 10, 11, 795 12, 211, 212, 8, 9, 10, 41, 42, 43, 34, 796 45, 219, 31, 6, 48, 7, 10, 227, 226, 228, 797 8, 9, 49, 49, 29, 49, 8, 9, 33, 34, 798 35, 36, 37, 49, 47, 40, 41, 42, 43, 249, 799 47, 29, 47, 48, 44, 50, 51, 29, 258, 259, 800 8, 9, 10, 41, 42, 43, 38, 44, 47, 47, 801 48, 43, 50, 51, 47, 49, 48, 47, 49, 51, 802 48, 29, 34, 8, 9, 33, 34, 35, 36, 37, 803 48, 29, 40, 41, 42, 43, 49, 9, 34, 50, 804 48, 35, 50, 51, 29, 32, 8, 9, 33, 34, 805 35, 36, 37, 10, 49, 40, 41, 49, 43, 9, 806 29, 49, 47, 48, 10, 10, 51, 29, 29, 8, 807 9, 33, 34, 35, 36, 37, 49, 12, 40, 41, 808 12, 43, 49, 49, 64, 223, 48, -1, 50, 51, 809 29, -1, 8, 9, 33, 34, 35, 36, 37, -1, 810 -1, 40, 41, -1, 43, -1, -1, -1, 47, 48, 811 -1, -1, 51, 29, -1, 8, 9, 33, 34, 35, 812 36, 37, -1, -1, 40, 41, -1, 43, -1, -1, 813 8, 9, 48, -1, -1, 51, 29, -1, -1, -1, 814 33, 34, 35, 36, 37, 8, 9, 40, -1, -1, 815 43, 29, -1, -1, -1, 48, -1, -1, 51, -1, 816 38, 39, -1, 41, -1, 43, 29, -1, 8, 9, 817 48, 34, -1, 51, 8, 9, -1, 40, -1, -1, 818 43, -1, -1, 8, 9, 48, -1, -1, 51, 29, 819 -1, -1, -1, -1, -1, 29, -1, -1, 8, 9, 820 -1, 41, 42, 43, 29, -1, -1, 41, 48, 43, 821 -1, 51, -1, 38, 48, 8, 9, 51, 43, 29, 822 -1, 8, 9, 48, -1, -1, 51, 8, 9, -1, 823 -1, -1, -1, 43, -1, -1, 29, -1, 48, -1, 824 50, 51, 29, -1, -1, -1, -1, -1, 29, -1, 825 43, 38, -1, -1, -1, 48, 43, 50, 51, -1, 826 -1, 48, 43, -1, 51, -1, -1, 48, -1, -1, 827 51, 4, 5, 6, 7, 8, 9, 10, 11, 12, 828 5, 6, 7, 8, 9, 10, 11, 12 829 }; 830 831 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 832 symbol of state STATE-NUM. */ 833 static const yytype_uint8 yystos[] = 834 { 835 0, 53, 0, 54, 1, 13, 14, 15, 16, 17, 836 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 837 28, 41, 42, 43, 45, 55, 58, 45, 47, 59, 838 8, 9, 29, 33, 34, 35, 36, 37, 40, 41, 839 43, 47, 48, 51, 63, 75, 79, 83, 84, 85, 840 86, 89, 50, 62, 75, 77, 80, 60, 77, 61, 841 75, 10, 41, 42, 47, 67, 76, 78, 79, 80, 842 84, 85, 89, 65, 86, 47, 59, 63, 68, 41, 843 47, 48, 64, 78, 80, 89, 66, 83, 69, 77, 844 70, 77, 71, 77, 72, 83, 73, 79, 74, 80, 845 44, 46, 44, 46, 45, 89, 89, 6, 8, 9, 846 87, 75, 34, 40, 89, 90, 89, 48, 48, 9, 847 38, 39, 48, 86, 89, 47, 47, 47, 79, 84, 848 86, 87, 87, 10, 76, 48, 11, 87, 78, 47, 849 48, 47, 47, 47, 47, 47, 47, 47, 57, 90, 850 56, 90, 7, 89, 89, 48, 10, 49, 49, 3, 851 4, 5, 6, 7, 8, 9, 10, 11, 12, 49, 852 34, 34, 35, 40, 38, 9, 38, 75, 77, 31, 853 89, 78, 50, 81, 89, 75, 75, 75, 80, 89, 854 75, 75, 55, 55, 87, 30, 32, 40, 88, 89, 855 48, 90, 90, 90, 6, 7, 90, 90, 90, 90, 856 90, 10, 10, 49, 49, 49, 38, 49, 49, 47, 857 9, 29, 82, 47, 44, 44, 47, 47, 47, 48, 858 49, 49, 34, 90, 90, 89, 89, 48, 49, 80, 859 29, 9, 81, 34, 35, 80, 89, 79, 32, 10, 860 49, 49, 34, 35, 9, 29, 49, 89, 10, 10, 861 29, 49, 89, 89, 49, 49 862 }; 863 864 #define yyerrok (yyerrstatus = 0) 865 #define yyclearin (yychar = YYEMPTY) 866 #define YYEMPTY (-2) 867 #define YYEOF 0 868 869 #define YYACCEPT goto yyacceptlab 870 #define YYABORT goto yyabortlab 871 #define YYERROR goto yyerrorlab 872 873 874 /* Like YYERROR except do call yyerror. This remains here temporarily 875 to ease the transition to the new meaning of YYERROR, for GCC. 876 Once GCC version 2 has supplanted version 1, this can go. */ 877 878 #define YYFAIL goto yyerrlab 879 880 #define YYRECOVERING() (!!yyerrstatus) 881 882 #define YYBACKUP(Token, Value) \ 883 do \ 884 if (yychar == YYEMPTY && yylen == 1) \ 885 { \ 886 yychar = (Token); \ 887 yylval = (Value); \ 888 yytoken = YYTRANSLATE (yychar); \ 889 YYPOPSTACK (1); \ 890 goto yybackup; \ 891 } \ 892 else \ 893 { \ 894 yyerror (YY_("syntax error: cannot back up")); \ 895 YYERROR; \ 896 } \ 897 while (YYID (0)) 898 899 900 #define YYTERROR 1 901 #define YYERRCODE 256 902 903 904 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 905 If N is 0, then set CURRENT to the empty location which ends 906 the previous symbol: RHS[0] (always defined). */ 907 908 #define YYRHSLOC(Rhs, K) ((Rhs)[K]) 909 #ifndef YYLLOC_DEFAULT 910 # define YYLLOC_DEFAULT(Current, Rhs, N) \ 911 do \ 912 if (YYID (N)) \ 913 { \ 914 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ 915 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ 916 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ 917 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ 918 } \ 919 else \ 920 { \ 921 (Current).first_line = (Current).last_line = \ 922 YYRHSLOC (Rhs, 0).last_line; \ 923 (Current).first_column = (Current).last_column = \ 924 YYRHSLOC (Rhs, 0).last_column; \ 925 } \ 926 while (YYID (0)) 927 #endif 928 929 930 /* YY_LOCATION_PRINT -- Print the location on the stream. 931 This macro was not mandated originally: define only if we know 932 we won't break user code: when these are the locations we know. */ 933 934 #ifndef YY_LOCATION_PRINT 935 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL 936 # define YY_LOCATION_PRINT(File, Loc) \ 937 fprintf (File, "%d.%d-%d.%d", \ 938 (Loc).first_line, (Loc).first_column, \ 939 (Loc).last_line, (Loc).last_column) 940 # else 941 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 942 # endif 943 #endif 944 945 946 /* YYLEX -- calling `yylex' with the right arguments. */ 947 948 #ifdef YYLEX_PARAM 949 # define YYLEX yylex (YYLEX_PARAM) 950 #else 951 # define YYLEX yylex () 952 #endif 953 954 /* Enable debugging if requested. */ 955 #if YYDEBUG 956 957 # ifndef YYFPRINTF 958 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 959 # define YYFPRINTF fprintf 960 # endif 961 962 # define YYDPRINTF(Args) \ 963 do { \ 964 if (yydebug) \ 965 YYFPRINTF Args; \ 966 } while (YYID (0)) 967 968 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 969 do { \ 970 if (yydebug) \ 971 { \ 972 YYFPRINTF (stderr, "%s ", Title); \ 973 yy_symbol_print (stderr, \ 974 Type, Value); \ 975 YYFPRINTF (stderr, "\n"); \ 976 } \ 977 } while (YYID (0)) 978 979 980 /*--------------------------------. 981 | Print this symbol on YYOUTPUT. | 982 `--------------------------------*/ 983 984 /*ARGSUSED*/ 985 #if (defined __STDC__ || defined __C99__FUNC__ \ 986 || defined __cplusplus || defined _MSC_VER) 987 static void 988 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 989 #else 990 static void 991 yy_symbol_value_print (yyoutput, yytype, yyvaluep) 992 FILE *yyoutput; 993 int yytype; 994 YYSTYPE const * const yyvaluep; 995 #endif 996 { 997 if (!yyvaluep) 998 return; 999 # ifdef YYPRINT 1000 if (yytype < YYNTOKENS) 1001 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 1002 # else 1003 YYUSE (yyoutput); 1004 # endif 1005 switch (yytype) 1006 { 1007 default: 1008 break; 1009 } 1010 } 1011 1012 1013 /*--------------------------------. 1014 | Print this symbol on YYOUTPUT. | 1015 `--------------------------------*/ 1016 1017 #if (defined __STDC__ || defined __C99__FUNC__ \ 1018 || defined __cplusplus || defined _MSC_VER) 1019 static void 1020 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 1021 #else 1022 static void 1023 yy_symbol_print (yyoutput, yytype, yyvaluep) 1024 FILE *yyoutput; 1025 int yytype; 1026 YYSTYPE const * const yyvaluep; 1027 #endif 1028 { 1029 if (yytype < YYNTOKENS) 1030 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 1031 else 1032 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 1033 1034 yy_symbol_value_print (yyoutput, yytype, yyvaluep); 1035 YYFPRINTF (yyoutput, ")"); 1036 } 1037 1038 /*------------------------------------------------------------------. 1039 | yy_stack_print -- Print the state stack from its BOTTOM up to its | 1040 | TOP (included). | 1041 `------------------------------------------------------------------*/ 1042 1043 #if (defined __STDC__ || defined __C99__FUNC__ \ 1044 || defined __cplusplus || defined _MSC_VER) 1045 static void 1046 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) 1047 #else 1048 static void 1049 yy_stack_print (bottom, top) 1050 yytype_int16 *bottom; 1051 yytype_int16 *top; 1052 #endif 1053 { 1054 YYFPRINTF (stderr, "Stack now"); 1055 for (; bottom <= top; ++bottom) 1056 YYFPRINTF (stderr, " %d", *bottom); 1057 YYFPRINTF (stderr, "\n"); 1058 } 1059 1060 # define YY_STACK_PRINT(Bottom, Top) \ 1061 do { \ 1062 if (yydebug) \ 1063 yy_stack_print ((Bottom), (Top)); \ 1064 } while (YYID (0)) 1065 1066 1067 /*------------------------------------------------. 1068 | Report that the YYRULE is going to be reduced. | 1069 `------------------------------------------------*/ 1070 1071 #if (defined __STDC__ || defined __C99__FUNC__ \ 1072 || defined __cplusplus || defined _MSC_VER) 1073 static void 1074 yy_reduce_print (YYSTYPE *yyvsp, int yyrule) 1075 #else 1076 static void 1077 yy_reduce_print (yyvsp, yyrule) 1078 YYSTYPE *yyvsp; 1079 int yyrule; 1080 #endif 1081 { 1082 int yynrhs = yyr2[yyrule]; 1083 int yyi; 1084 unsigned long int yylno = yyrline[yyrule]; 1085 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 1086 yyrule - 1, yylno); 1087 /* The symbols being reduced. */ 1088 for (yyi = 0; yyi < yynrhs; yyi++) 1089 { 1090 fprintf (stderr, " $%d = ", yyi + 1); 1091 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 1092 &(yyvsp[(yyi + 1) - (yynrhs)]) 1093 ); 1094 fprintf (stderr, "\n"); 1095 } 1096 } 1097 1098 # define YY_REDUCE_PRINT(Rule) \ 1099 do { \ 1100 if (yydebug) \ 1101 yy_reduce_print (yyvsp, Rule); \ 1102 } while (YYID (0)) 1103 1104 /* Nonzero means print parse trace. It is left uninitialized so that 1105 multiple parsers can coexist. */ 1106 int yydebug; 1107 #else /* !YYDEBUG */ 1108 # define YYDPRINTF(Args) 1109 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 1110 # define YY_STACK_PRINT(Bottom, Top) 1111 # define YY_REDUCE_PRINT(Rule) 1112 #endif /* !YYDEBUG */ 1113 1114 1115 /* YYINITDEPTH -- initial size of the parser's stacks. */ 1116 #ifndef YYINITDEPTH 1117 # define YYINITDEPTH 200 1118 #endif 1119 1120 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 1121 if the built-in stack extension method is used). 1122 1123 Do not make this value too large; the results are undefined if 1124 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 1125 evaluated with infinite-precision integer arithmetic. */ 1126 1127 #ifndef YYMAXDEPTH 1128 # define YYMAXDEPTH 10000 1129 #endif 1130 1131 1132 1133 #if YYERROR_VERBOSE 1134 1135 # ifndef yystrlen 1136 # if defined __GLIBC__ && defined _STRING_H 1137 # define yystrlen strlen 1138 # else 1139 /* Return the length of YYSTR. */ 1140 #if (defined __STDC__ || defined __C99__FUNC__ \ 1141 || defined __cplusplus || defined _MSC_VER) 1142 static YYSIZE_T 1143 yystrlen (const char *yystr) 1144 #else 1145 static YYSIZE_T 1146 yystrlen (yystr) 1147 const char *yystr; 1148 #endif 1149 { 1150 YYSIZE_T yylen; 1151 for (yylen = 0; yystr[yylen]; yylen++) 1152 continue; 1153 return yylen; 1154 } 1155 # endif 1156 # endif 1157 1158 # ifndef yystpcpy 1159 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 1160 # define yystpcpy stpcpy 1161 # else 1162 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 1163 YYDEST. */ 1164 #if (defined __STDC__ || defined __C99__FUNC__ \ 1165 || defined __cplusplus || defined _MSC_VER) 1166 static char * 1167 yystpcpy (char *yydest, const char *yysrc) 1168 #else 1169 static char * 1170 yystpcpy (yydest, yysrc) 1171 char *yydest; 1172 const char *yysrc; 1173 #endif 1174 { 1175 char *yyd = yydest; 1176 const char *yys = yysrc; 1177 1178 while ((*yyd++ = *yys++) != '\0') 1179 continue; 1180 1181 return yyd - 1; 1182 } 1183 # endif 1184 # endif 1185 1186 # ifndef yytnamerr 1187 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary 1188 quotes and backslashes, so that it's suitable for yyerror. The 1189 heuristic is that double-quoting is unnecessary unless the string 1190 contains an apostrophe, a comma, or backslash (other than 1191 backslash-backslash). YYSTR is taken from yytname. If YYRES is 1192 null, do not copy; instead, return the length of what the result 1193 would have been. */ 1194 static YYSIZE_T 1195 yytnamerr (char *yyres, const char *yystr) 1196 { 1197 if (*yystr == '"') 1198 { 1199 YYSIZE_T yyn = 0; 1200 char const *yyp = yystr; 1201 1202 for (;;) 1203 switch (*++yyp) 1204 { 1205 case '\'': 1206 case ',': 1207 goto do_not_strip_quotes; 1208 1209 case '\\': 1210 if (*++yyp != '\\') 1211 goto do_not_strip_quotes; 1212 /* Fall through. */ 1213 default: 1214 if (yyres) 1215 yyres[yyn] = *yyp; 1216 yyn++; 1217 break; 1218 1219 case '"': 1220 if (yyres) 1221 yyres[yyn] = '\0'; 1222 return yyn; 1223 } 1224 do_not_strip_quotes: ; 1225 } 1226 1227 if (! yyres) 1228 return yystrlen (yystr); 1229 1230 return yystpcpy (yyres, yystr) - yyres; 1231 } 1232 # endif 1233 1234 /* Copy into YYRESULT an error message about the unexpected token 1235 YYCHAR while in state YYSTATE. Return the number of bytes copied, 1236 including the terminating null byte. If YYRESULT is null, do not 1237 copy anything; just return the number of bytes that would be 1238 copied. As a special case, return 0 if an ordinary "syntax error" 1239 message will do. Return YYSIZE_MAXIMUM if overflow occurs during 1240 size calculation. */ 1241 static YYSIZE_T 1242 yysyntax_error (char *yyresult, int yystate, int yychar) 1243 { 1244 int yyn = yypact[yystate]; 1245 1246 if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) 1247 return 0; 1248 else 1249 { 1250 int yytype = YYTRANSLATE (yychar); 1251 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); 1252 YYSIZE_T yysize = yysize0; 1253 YYSIZE_T yysize1; 1254 int yysize_overflow = 0; 1255 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 1256 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 1257 int yyx; 1258 1259 # if 0 1260 /* This is so xgettext sees the translatable formats that are 1261 constructed on the fly. */ 1262 YY_("syntax error, unexpected %s"); 1263 YY_("syntax error, unexpected %s, expecting %s"); 1264 YY_("syntax error, unexpected %s, expecting %s or %s"); 1265 YY_("syntax error, unexpected %s, expecting %s or %s or %s"); 1266 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); 1267 # endif 1268 char *yyfmt; 1269 char const *yyf; 1270 static char const yyunexpected[] = "syntax error, unexpected %s"; 1271 static char const yyexpecting[] = ", expecting %s"; 1272 static char const yyor[] = " or %s"; 1273 char yyformat[sizeof yyunexpected 1274 + sizeof yyexpecting - 1 1275 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) 1276 * (sizeof yyor - 1))]; 1277 char const *yyprefix = yyexpecting; 1278 1279 /* Start YYX at -YYN if negative to avoid negative indexes in 1280 YYCHECK. */ 1281 int yyxbegin = yyn < 0 ? -yyn : 0; 1282 1283 /* Stay within bounds of both yycheck and yytname. */ 1284 int yychecklim = YYLAST - yyn + 1; 1285 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 1286 int yycount = 1; 1287 1288 yyarg[0] = yytname[yytype]; 1289 yyfmt = yystpcpy (yyformat, yyunexpected); 1290 1291 for (yyx = yyxbegin; yyx < yyxend; ++yyx) 1292 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) 1293 { 1294 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 1295 { 1296 yycount = 1; 1297 yysize = yysize0; 1298 yyformat[sizeof yyunexpected - 1] = '\0'; 1299 break; 1300 } 1301 yyarg[yycount++] = yytname[yyx]; 1302 yysize1 = yysize + yytnamerr (0, yytname[yyx]); 1303 yysize_overflow |= (yysize1 < yysize); 1304 yysize = yysize1; 1305 yyfmt = yystpcpy (yyfmt, yyprefix); 1306 yyprefix = yyor; 1307 } 1308 1309 yyf = YY_(yyformat); 1310 yysize1 = yysize + yystrlen (yyf); 1311 yysize_overflow |= (yysize1 < yysize); 1312 yysize = yysize1; 1313 1314 if (yysize_overflow) 1315 return YYSIZE_MAXIMUM; 1316 1317 if (yyresult) 1318 { 1319 /* Avoid sprintf, as that infringes on the user's name space. 1320 Don't have undefined behavior even if the translation 1321 produced a string with the wrong number of "%s"s. */ 1322 char *yyp = yyresult; 1323 int yyi = 0; 1324 while ((*yyp = *yyf) != '\0') 1325 { 1326 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) 1327 { 1328 yyp += yytnamerr (yyp, yyarg[yyi++]); 1329 yyf += 2; 1330 } 1331 else 1332 { 1333 yyp++; 1334 yyf++; 1335 } 1336 } 1337 } 1338 return yysize; 1339 } 1340 } 1341 #endif /* YYERROR_VERBOSE */ 1342 1343 1344 /*-----------------------------------------------. 1345 | Release the memory associated to this symbol. | 1346 `-----------------------------------------------*/ 1347 1348 /*ARGSUSED*/ 1349 #if (defined __STDC__ || defined __C99__FUNC__ \ 1350 || defined __cplusplus || defined _MSC_VER) 1351 static void 1352 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 1353 #else 1354 static void 1355 yydestruct (yymsg, yytype, yyvaluep) 1356 const char *yymsg; 1357 int yytype; 1358 YYSTYPE *yyvaluep; 1359 #endif 1360 { 1361 YYUSE (yyvaluep); 1362 1363 if (!yymsg) 1364 yymsg = "Deleting"; 1365 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 1366 1367 switch (yytype) 1368 { 1369 1370 default: 1371 break; 1372 } 1373 } 1374 1375 1376 /* Prevent warnings from -Wmissing-prototypes. */ 1377 1378 #ifdef YYPARSE_PARAM 1379 #if defined __STDC__ || defined __cplusplus 1380 int yyparse (void *YYPARSE_PARAM); 1381 #else 1382 int yyparse (); 1383 #endif 1384 #else /* ! YYPARSE_PARAM */ 1385 #if defined __STDC__ || defined __cplusplus 1386 int yyparse (void); 1387 #else 1388 int yyparse (); 1389 #endif 1390 #endif /* ! YYPARSE_PARAM */ 1391 1392 1393 1394 /* The look-ahead symbol. */ 1395 int yychar; 1396 1397 /* The semantic value of the look-ahead symbol. */ 1398 YYSTYPE yylval; 1399 1400 /* Number of syntax errors so far. */ 1401 int yynerrs; 1402 1403 1404 1405 /*----------. 1406 | yyparse. | 1407 `----------*/ 1408 1409 #ifdef YYPARSE_PARAM 1410 #if (defined __STDC__ || defined __C99__FUNC__ \ 1411 || defined __cplusplus || defined _MSC_VER) 1412 int 1413 yyparse (void *YYPARSE_PARAM) 1414 #else 1415 int 1416 yyparse (YYPARSE_PARAM) 1417 void *YYPARSE_PARAM; 1418 #endif 1419 #else /* ! YYPARSE_PARAM */ 1420 #if (defined __STDC__ || defined __C99__FUNC__ \ 1421 || defined __cplusplus || defined _MSC_VER) 1422 int 1423 yyparse (void) 1424 #else 1425 int 1426 yyparse () 1427 1428 #endif 1429 #endif 1430 { 1431 1432 int yystate; 1433 int yyn; 1434 int yyresult; 1435 /* Number of tokens to shift before error messages enabled. */ 1436 int yyerrstatus; 1437 /* Look-ahead token as an internal (translated) token number. */ 1438 int yytoken = 0; 1439 #if YYERROR_VERBOSE 1440 /* Buffer for error messages, and its allocated size. */ 1441 char yymsgbuf[128]; 1442 char *yymsg = yymsgbuf; 1443 YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 1444 #endif 1445 1446 /* Three stacks and their tools: 1447 `yyss': related to states, 1448 `yyvs': related to semantic values, 1449 `yyls': related to locations. 1450 1451 Refer to the stacks thru separate pointers, to allow yyoverflow 1452 to reallocate them elsewhere. */ 1453 1454 /* The state stack. */ 1455 yytype_int16 yyssa[YYINITDEPTH]; 1456 yytype_int16 *yyss = yyssa; 1457 yytype_int16 *yyssp; 1458 1459 /* The semantic value stack. */ 1460 YYSTYPE yyvsa[YYINITDEPTH]; 1461 YYSTYPE *yyvs = yyvsa; 1462 YYSTYPE *yyvsp; 1463 1464 1465 1466 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1467 1468 YYSIZE_T yystacksize = YYINITDEPTH; 1469 1470 /* The variables used to return semantic value and location from the 1471 action routines. */ 1472 YYSTYPE yyval; 1473 1474 1475 /* The number of symbols on the RHS of the reduced rule. 1476 Keep to zero when no symbol should be popped. */ 1477 int yylen = 0; 1478 1479 YYDPRINTF ((stderr, "Starting parse\n")); 1480 1481 yystate = 0; 1482 yyerrstatus = 0; 1483 yynerrs = 0; 1484 yychar = YYEMPTY; /* Cause a token to be read. */ 1485 1486 /* Initialize stack pointers. 1487 Waste one element of value and location stack 1488 so that they stay on the same level as the state stack. 1489 The wasted elements are never initialized. */ 1490 1491 yyssp = yyss; 1492 yyvsp = yyvs; 1493 1494 goto yysetstate; 1495 1496 /*------------------------------------------------------------. 1497 | yynewstate -- Push a new state, which is found in yystate. | 1498 `------------------------------------------------------------*/ 1499 yynewstate: 1500 /* In all cases, when you get here, the value and location stacks 1501 have just been pushed. So pushing a state here evens the stacks. */ 1502 yyssp++; 1503 1504 yysetstate: 1505 *yyssp = yystate; 1506 1507 if (yyss + yystacksize - 1 <= yyssp) 1508 { 1509 /* Get the current used size of the three stacks, in elements. */ 1510 YYSIZE_T yysize = yyssp - yyss + 1; 1511 1512 #ifdef yyoverflow 1513 { 1514 /* Give user a chance to reallocate the stack. Use copies of 1515 these so that the &'s don't force the real ones into 1516 memory. */ 1517 YYSTYPE *yyvs1 = yyvs; 1518 yytype_int16 *yyss1 = yyss; 1519 1520 1521 /* Each stack pointer address is followed by the size of the 1522 data in use in that stack, in bytes. This used to be a 1523 conditional around just the two extra args, but that might 1524 be undefined if yyoverflow is a macro. */ 1525 yyoverflow (YY_("memory exhausted"), 1526 &yyss1, yysize * sizeof (*yyssp), 1527 &yyvs1, yysize * sizeof (*yyvsp), 1528 1529 &yystacksize); 1530 1531 yyss = yyss1; 1532 yyvs = yyvs1; 1533 } 1534 #else /* no yyoverflow */ 1535 # ifndef YYSTACK_RELOCATE 1536 goto yyexhaustedlab; 1537 # else 1538 /* Extend the stack our own way. */ 1539 if (YYMAXDEPTH <= yystacksize) 1540 goto yyexhaustedlab; 1541 yystacksize *= 2; 1542 if (YYMAXDEPTH < yystacksize) 1543 yystacksize = YYMAXDEPTH; 1544 1545 { 1546 yytype_int16 *yyss1 = yyss; 1547 union yyalloc *yyptr = 1548 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1549 if (! yyptr) 1550 goto yyexhaustedlab; 1551 YYSTACK_RELOCATE (yyss); 1552 YYSTACK_RELOCATE (yyvs); 1553 1554 # undef YYSTACK_RELOCATE 1555 if (yyss1 != yyssa) 1556 YYSTACK_FREE (yyss1); 1557 } 1558 # endif 1559 #endif /* no yyoverflow */ 1560 1561 yyssp = yyss + yysize - 1; 1562 yyvsp = yyvs + yysize - 1; 1563 1564 1565 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1566 (unsigned long int) yystacksize)); 1567 1568 if (yyss + yystacksize - 1 <= yyssp) 1569 YYABORT; 1570 } 1571 1572 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 1573 1574 goto yybackup; 1575 1576 /*-----------. 1577 | yybackup. | 1578 `-----------*/ 1579 yybackup: 1580 1581 /* Do appropriate processing given the current state. Read a 1582 look-ahead token if we need one and don't already have one. */ 1583 1584 /* First try to decide what to do without reference to look-ahead token. */ 1585 yyn = yypact[yystate]; 1586 if (yyn == YYPACT_NINF) 1587 goto yydefault; 1588 1589 /* Not known => get a look-ahead token if don't already have one. */ 1590 1591 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ 1592 if (yychar == YYEMPTY) 1593 { 1594 YYDPRINTF ((stderr, "Reading a token: ")); 1595 yychar = YYLEX; 1596 } 1597 1598 if (yychar <= YYEOF) 1599 { 1600 yychar = yytoken = YYEOF; 1601 YYDPRINTF ((stderr, "Now at end of input.\n")); 1602 } 1603 else 1604 { 1605 yytoken = YYTRANSLATE (yychar); 1606 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 1607 } 1608 1609 /* If the proper action on seeing token YYTOKEN is to reduce or to 1610 detect an error, take that action. */ 1611 yyn += yytoken; 1612 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 1613 goto yydefault; 1614 yyn = yytable[yyn]; 1615 if (yyn <= 0) 1616 { 1617 if (yyn == 0 || yyn == YYTABLE_NINF) 1618 goto yyerrlab; 1619 yyn = -yyn; 1620 goto yyreduce; 1621 } 1622 1623 if (yyn == YYFINAL) 1624 YYACCEPT; 1625 1626 /* Count tokens shifted since error; after three, turn off error 1627 status. */ 1628 if (yyerrstatus) 1629 yyerrstatus--; 1630 1631 /* Shift the look-ahead token. */ 1632 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 1633 1634 /* Discard the shifted token unless it is eof. */ 1635 if (yychar != YYEOF) 1636 yychar = YYEMPTY; 1637 1638 yystate = yyn; 1639 *++yyvsp = yylval; 1640 1641 goto yynewstate; 1642 1643 1644 /*-----------------------------------------------------------. 1645 | yydefault -- do the default action for the current state. | 1646 `-----------------------------------------------------------*/ 1647 yydefault: 1648 yyn = yydefact[yystate]; 1649 if (yyn == 0) 1650 goto yyerrlab; 1651 goto yyreduce; 1652 1653 1654 /*-----------------------------. 1655 | yyreduce -- Do a reduction. | 1656 `-----------------------------*/ 1657 yyreduce: 1658 /* yyn is the number of a rule to reduce with. */ 1659 yylen = yyr2[yyn]; 1660 1661 /* If YYLEN is nonzero, implement the default value of the action: 1662 `$$ = $1'. 1663 1664 Otherwise, the following line sets YYVAL to garbage. 1665 This behavior is undocumented and Bison 1666 users should not rely upon it. Assigning to YYVAL 1667 unconditionally makes the parser a bit smaller, and it avoids a 1668 GCC warning that YYVAL may be used uninitialized. */ 1669 yyval = yyvsp[1-yylen]; 1670 1671 1672 YY_REDUCE_PRINT (yyn); 1673 switch (yyn) 1674 { 1675 case 3: 1676 #line 70 "a.y" 1677 { 1678 stmtline = lineno; 1679 } 1680 break; 1681 1682 case 5: 1683 #line 77 "a.y" 1684 { 1685 if((yyvsp[(1) - (2)].sym)->value != pc) 1686 yyerror("redeclaration of %s", (yyvsp[(1) - (2)].sym)->name); 1687 (yyvsp[(1) - (2)].sym)->value = pc; 1688 } 1689 break; 1690 1691 case 7: 1692 #line 84 "a.y" 1693 { 1694 (yyvsp[(1) - (2)].sym)->type = LLAB; 1695 (yyvsp[(1) - (2)].sym)->value = pc; 1696 } 1697 break; 1698 1699 case 12: 1700 #line 95 "a.y" 1701 { 1702 (yyvsp[(1) - (3)].sym)->type = LVAR; 1703 (yyvsp[(1) - (3)].sym)->value = (yyvsp[(3) - (3)].lval); 1704 } 1705 break; 1706 1707 case 13: 1708 #line 100 "a.y" 1709 { 1710 if((yyvsp[(1) - (3)].sym)->value != (yyvsp[(3) - (3)].lval)) 1711 yyerror("redeclaration of %s", (yyvsp[(1) - (3)].sym)->name); 1712 (yyvsp[(1) - (3)].sym)->value = (yyvsp[(3) - (3)].lval); 1713 } 1714 break; 1715 1716 case 14: 1717 #line 105 "a.y" 1718 { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } 1719 break; 1720 1721 case 15: 1722 #line 106 "a.y" 1723 { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } 1724 break; 1725 1726 case 16: 1727 #line 107 "a.y" 1728 { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } 1729 break; 1730 1731 case 17: 1732 #line 108 "a.y" 1733 { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } 1734 break; 1735 1736 case 18: 1737 #line 109 "a.y" 1738 { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } 1739 break; 1740 1741 case 19: 1742 #line 110 "a.y" 1743 { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } 1744 break; 1745 1746 case 20: 1747 #line 111 "a.y" 1748 { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } 1749 break; 1750 1751 case 21: 1752 #line 112 "a.y" 1753 { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } 1754 break; 1755 1756 case 22: 1757 #line 113 "a.y" 1758 { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } 1759 break; 1760 1761 case 23: 1762 #line 114 "a.y" 1763 { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } 1764 break; 1765 1766 case 24: 1767 #line 115 "a.y" 1768 { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } 1769 break; 1770 1771 case 25: 1772 #line 116 "a.y" 1773 { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } 1774 break; 1775 1776 case 26: 1777 #line 117 "a.y" 1778 { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } 1779 break; 1780 1781 case 27: 1782 #line 118 "a.y" 1783 { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } 1784 break; 1785 1786 case 28: 1787 #line 119 "a.y" 1788 { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } 1789 break; 1790 1791 case 29: 1792 #line 120 "a.y" 1793 { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); } 1794 break; 1795 1796 case 30: 1797 #line 123 "a.y" 1798 { 1799 (yyval.gen2).from = nullgen; 1800 (yyval.gen2).to = nullgen; 1801 } 1802 break; 1803 1804 case 31: 1805 #line 128 "a.y" 1806 { 1807 (yyval.gen2).from = nullgen; 1808 (yyval.gen2).to = nullgen; 1809 } 1810 break; 1811 1812 case 32: 1813 #line 135 "a.y" 1814 { 1815 (yyval.gen2).from = (yyvsp[(1) - (3)].gen); 1816 (yyval.gen2).to = (yyvsp[(3) - (3)].gen); 1817 } 1818 break; 1819 1820 case 33: 1821 #line 142 "a.y" 1822 { 1823 (yyval.gen2).from = (yyvsp[(1) - (3)].gen); 1824 (yyval.gen2).to = (yyvsp[(3) - (3)].gen); 1825 } 1826 break; 1827 1828 case 34: 1829 #line 149 "a.y" 1830 { 1831 (yyval.gen2).from = (yyvsp[(1) - (2)].gen); 1832 (yyval.gen2).to = nullgen; 1833 } 1834 break; 1835 1836 case 35: 1837 #line 154 "a.y" 1838 { 1839 (yyval.gen2).from = (yyvsp[(1) - (1)].gen); 1840 (yyval.gen2).to = nullgen; 1841 } 1842 break; 1843 1844 case 36: 1845 #line 161 "a.y" 1846 { 1847 (yyval.gen2).from = nullgen; 1848 (yyval.gen2).to = (yyvsp[(2) - (2)].gen); 1849 } 1850 break; 1851 1852 case 37: 1853 #line 166 "a.y" 1854 { 1855 (yyval.gen2).from = nullgen; 1856 (yyval.gen2).to = (yyvsp[(1) - (1)].gen); 1857 } 1858 break; 1859 1860 case 38: 1861 #line 173 "a.y" 1862 { 1863 (yyval.gen2).from = nullgen; 1864 (yyval.gen2).to = (yyvsp[(2) - (2)].gen); 1865 } 1866 break; 1867 1868 case 39: 1869 #line 178 "a.y" 1870 { 1871 (yyval.gen2).from = nullgen; 1872 (yyval.gen2).to = (yyvsp[(1) - (1)].gen); 1873 } 1874 break; 1875 1876 case 40: 1877 #line 183 "a.y" 1878 { 1879 (yyval.gen2).from = (yyvsp[(1) - (3)].gen); 1880 (yyval.gen2).to = (yyvsp[(3) - (3)].gen); 1881 } 1882 break; 1883 1884 case 41: 1885 #line 190 "a.y" 1886 { 1887 (yyval.gen2).from = (yyvsp[(1) - (5)].gen); 1888 (yyval.gen2).from.scale = (yyvsp[(3) - (5)].lval); 1889 (yyval.gen2).to = (yyvsp[(5) - (5)].gen); 1890 } 1891 break; 1892 1893 case 42: 1894 #line 198 "a.y" 1895 { 1896 (yyval.gen2).from = (yyvsp[(1) - (3)].gen); 1897 (yyval.gen2).to = (yyvsp[(3) - (3)].gen); 1898 } 1899 break; 1900 1901 case 43: 1902 #line 203 "a.y" 1903 { 1904 (yyval.gen2).from = (yyvsp[(1) - (5)].gen); 1905 (yyval.gen2).from.scale = (yyvsp[(3) - (5)].lval); 1906 (yyval.gen2).to = (yyvsp[(5) - (5)].gen); 1907 } 1908 break; 1909 1910 case 44: 1911 #line 211 "a.y" 1912 { 1913 (yyval.gen2).from = nullgen; 1914 (yyval.gen2).to = (yyvsp[(2) - (2)].gen); 1915 } 1916 break; 1917 1918 case 45: 1919 #line 216 "a.y" 1920 { 1921 (yyval.gen2).from = nullgen; 1922 (yyval.gen2).to = (yyvsp[(1) - (1)].gen); 1923 } 1924 break; 1925 1926 case 46: 1927 #line 221 "a.y" 1928 { 1929 (yyval.gen2).from = nullgen; 1930 (yyval.gen2).to = (yyvsp[(2) - (2)].gen); 1931 (yyval.gen2).to.index = (yyvsp[(2) - (2)].gen).type; 1932 (yyval.gen2).to.type = D_INDIR+D_ADDR; 1933 } 1934 break; 1935 1936 case 49: 1937 #line 234 "a.y" 1938 { 1939 (yyval.gen2).from = (yyvsp[(1) - (3)].gen); 1940 (yyval.gen2).to = (yyvsp[(3) - (3)].gen); 1941 } 1942 break; 1943 1944 case 50: 1945 #line 239 "a.y" 1946 { 1947 (yyval.gen2).from = (yyvsp[(1) - (5)].gen); 1948 (yyval.gen2).to = (yyvsp[(3) - (5)].gen); 1949 if((yyval.gen2).from.index != D_NONE) 1950 yyerror("dp shift with lhs index"); 1951 (yyval.gen2).from.index = (yyvsp[(5) - (5)].lval); 1952 } 1953 break; 1954 1955 case 51: 1956 #line 249 "a.y" 1957 { 1958 (yyval.gen2).from = (yyvsp[(1) - (3)].gen); 1959 (yyval.gen2).to = (yyvsp[(3) - (3)].gen); 1960 } 1961 break; 1962 1963 case 52: 1964 #line 254 "a.y" 1965 { 1966 (yyval.gen2).from = (yyvsp[(1) - (5)].gen); 1967 (yyval.gen2).to = (yyvsp[(3) - (5)].gen); 1968 if((yyval.gen2).to.index != D_NONE) 1969 yyerror("dp move with lhs index"); 1970 (yyval.gen2).to.index = (yyvsp[(5) - (5)].lval); 1971 } 1972 break; 1973 1974 case 53: 1975 #line 264 "a.y" 1976 { 1977 (yyval.gen2).from = (yyvsp[(1) - (2)].gen); 1978 (yyval.gen2).to = nullgen; 1979 } 1980 break; 1981 1982 case 54: 1983 #line 269 "a.y" 1984 { 1985 (yyval.gen2).from = (yyvsp[(1) - (1)].gen); 1986 (yyval.gen2).to = nullgen; 1987 } 1988 break; 1989 1990 case 55: 1991 #line 274 "a.y" 1992 { 1993 (yyval.gen2).from = (yyvsp[(1) - (3)].gen); 1994 (yyval.gen2).to = (yyvsp[(3) - (3)].gen); 1995 } 1996 break; 1997 1998 case 56: 1999 #line 281 "a.y" 2000 { 2001 (yyval.gen2).from = (yyvsp[(1) - (3)].gen); 2002 (yyval.gen2).to = (yyvsp[(3) - (3)].gen); 2003 } 2004 break; 2005 2006 case 57: 2007 #line 286 "a.y" 2008 { 2009 (yyval.gen2).from = (yyvsp[(1) - (5)].gen); 2010 (yyval.gen2).from.scale = (yyvsp[(3) - (5)].lval); 2011 (yyval.gen2).to = (yyvsp[(5) - (5)].gen); 2012 } 2013 break; 2014 2015 case 58: 2016 #line 294 "a.y" 2017 { 2018 (yyval.gen2).from = (yyvsp[(1) - (5)].gen); 2019 (yyval.gen2).to = (yyvsp[(3) - (5)].gen); 2020 (yyval.gen2).to.offset = (yyvsp[(5) - (5)].lval); 2021 } 2022 break; 2023 2024 case 59: 2025 #line 302 "a.y" 2026 { 2027 (yyval.gen2).from = (yyvsp[(3) - (5)].gen); 2028 (yyval.gen2).to = (yyvsp[(5) - (5)].gen); 2029 if((yyvsp[(1) - (5)].gen).type != D_CONST) 2030 yyerror("illegal constant"); 2031 (yyval.gen2).to.offset = (yyvsp[(1) - (5)].gen).offset; 2032 } 2033 break; 2034 2035 case 64: 2036 #line 318 "a.y" 2037 { 2038 (yyval.gen) = (yyvsp[(2) - (2)].gen); 2039 } 2040 break; 2041 2042 case 65: 2043 #line 322 "a.y" 2044 { 2045 (yyval.gen) = (yyvsp[(2) - (2)].gen); 2046 } 2047 break; 2048 2049 case 71: 2050 #line 335 "a.y" 2051 { 2052 (yyval.gen) = nullgen; 2053 (yyval.gen).type = D_BRANCH; 2054 (yyval.gen).offset = (yyvsp[(1) - (4)].lval) + pc; 2055 } 2056 break; 2057 2058 case 72: 2059 #line 341 "a.y" 2060 { 2061 (yyval.gen) = nullgen; 2062 if(pass == 2) 2063 yyerror("undefined label: %s", (yyvsp[(1) - (2)].sym)->name); 2064 (yyval.gen).type = D_BRANCH; 2065 (yyval.gen).sym = (yyvsp[(1) - (2)].sym); 2066 (yyval.gen).offset = (yyvsp[(2) - (2)].lval); 2067 } 2068 break; 2069 2070 case 73: 2071 #line 350 "a.y" 2072 { 2073 (yyval.gen) = nullgen; 2074 (yyval.gen).type = D_BRANCH; 2075 (yyval.gen).sym = (yyvsp[(1) - (2)].sym); 2076 (yyval.gen).offset = (yyvsp[(1) - (2)].sym)->value + (yyvsp[(2) - (2)].lval); 2077 } 2078 break; 2079 2080 case 74: 2081 #line 359 "a.y" 2082 { 2083 (yyval.gen) = nullgen; 2084 (yyval.gen).type = (yyvsp[(1) - (1)].lval); 2085 } 2086 break; 2087 2088 case 75: 2089 #line 364 "a.y" 2090 { 2091 (yyval.gen) = nullgen; 2092 (yyval.gen).type = (yyvsp[(1) - (1)].lval); 2093 } 2094 break; 2095 2096 case 76: 2097 #line 369 "a.y" 2098 { 2099 (yyval.gen) = nullgen; 2100 (yyval.gen).type = (yyvsp[(1) - (1)].lval); 2101 } 2102 break; 2103 2104 case 77: 2105 #line 374 "a.y" 2106 { 2107 (yyval.gen) = nullgen; 2108 (yyval.gen).type = (yyvsp[(1) - (1)].lval); 2109 } 2110 break; 2111 2112 case 78: 2113 #line 379 "a.y" 2114 { 2115 (yyval.gen) = nullgen; 2116 (yyval.gen).type = D_SP; 2117 } 2118 break; 2119 2120 case 79: 2121 #line 384 "a.y" 2122 { 2123 (yyval.gen) = nullgen; 2124 (yyval.gen).type = (yyvsp[(1) - (1)].lval); 2125 } 2126 break; 2127 2128 case 80: 2129 #line 391 "a.y" 2130 { 2131 (yyval.gen) = nullgen; 2132 (yyval.gen).type = D_CONST; 2133 (yyval.gen).offset = (yyvsp[(2) - (2)].lval); 2134 } 2135 break; 2136 2137 case 81: 2138 #line 397 "a.y" 2139 { 2140 (yyval.gen) = (yyvsp[(2) - (2)].gen); 2141 (yyval.gen).index = (yyvsp[(2) - (2)].gen).type; 2142 (yyval.gen).type = D_ADDR; 2143 /* 2144 if($2.type == D_AUTO || $2.type == D_PARAM) 2145 yyerror("constant cannot be automatic: %s", 2146 $2.sym->name); 2147 */ 2148 } 2149 break; 2150 2151 case 82: 2152 #line 408 "a.y" 2153 { 2154 (yyval.gen) = nullgen; 2155 (yyval.gen).type = D_SCONST; 2156 memcpy((yyval.gen).sval, (yyvsp[(2) - (2)].sval), sizeof((yyval.gen).sval)); 2157 } 2158 break; 2159 2160 case 83: 2161 #line 414 "a.y" 2162 { 2163 (yyval.gen) = nullgen; 2164 (yyval.gen).type = D_FCONST; 2165 (yyval.gen).dval = (yyvsp[(2) - (2)].dval); 2166 } 2167 break; 2168 2169 case 84: 2170 #line 420 "a.y" 2171 { 2172 (yyval.gen) = nullgen; 2173 (yyval.gen).type = D_FCONST; 2174 (yyval.gen).dval = (yyvsp[(3) - (4)].dval); 2175 } 2176 break; 2177 2178 case 85: 2179 #line 426 "a.y" 2180 { 2181 (yyval.gen) = nullgen; 2182 (yyval.gen).type = D_FCONST; 2183 (yyval.gen).dval = -(yyvsp[(4) - (5)].dval); 2184 } 2185 break; 2186 2187 case 86: 2188 #line 432 "a.y" 2189 { 2190 (yyval.gen) = nullgen; 2191 (yyval.gen).type = D_FCONST; 2192 (yyval.gen).dval = -(yyvsp[(3) - (3)].dval); 2193 } 2194 break; 2195 2196 case 87: 2197 #line 440 "a.y" 2198 { 2199 (yyval.gen) = nullgen; 2200 (yyval.gen).type = D_CONST2; 2201 (yyval.gen).offset = (yyvsp[(2) - (2)].con2).v1; 2202 (yyval.gen).offset2 = (yyvsp[(2) - (2)].con2).v2; 2203 } 2204 break; 2205 2206 case 88: 2207 #line 449 "a.y" 2208 { 2209 (yyval.con2).v1 = (yyvsp[(1) - (1)].lval); 2210 (yyval.con2).v2 = 0; 2211 } 2212 break; 2213 2214 case 89: 2215 #line 454 "a.y" 2216 { 2217 (yyval.con2).v1 = -(yyvsp[(2) - (2)].lval); 2218 (yyval.con2).v2 = 0; 2219 } 2220 break; 2221 2222 case 90: 2223 #line 459 "a.y" 2224 { 2225 (yyval.con2).v1 = (yyvsp[(1) - (3)].lval); 2226 (yyval.con2).v2 = (yyvsp[(3) - (3)].lval); 2227 } 2228 break; 2229 2230 case 91: 2231 #line 464 "a.y" 2232 { 2233 (yyval.con2).v1 = -(yyvsp[(2) - (4)].lval); 2234 (yyval.con2).v2 = (yyvsp[(4) - (4)].lval); 2235 } 2236 break; 2237 2238 case 94: 2239 #line 475 "a.y" 2240 { 2241 (yyval.gen) = nullgen; 2242 (yyval.gen).type = D_INDIR+D_NONE; 2243 (yyval.gen).offset = (yyvsp[(1) - (1)].lval); 2244 } 2245 break; 2246 2247 case 95: 2248 #line 481 "a.y" 2249 { 2250 (yyval.gen) = nullgen; 2251 (yyval.gen).type = D_INDIR+(yyvsp[(3) - (4)].lval); 2252 (yyval.gen).offset = (yyvsp[(1) - (4)].lval); 2253 } 2254 break; 2255 2256 case 96: 2257 #line 487 "a.y" 2258 { 2259 (yyval.gen) = nullgen; 2260 (yyval.gen).type = D_INDIR+D_SP; 2261 (yyval.gen).offset = (yyvsp[(1) - (4)].lval); 2262 } 2263 break; 2264 2265 case 97: 2266 #line 493 "a.y" 2267 { 2268 (yyval.gen) = nullgen; 2269 (yyval.gen).type = D_INDIR+D_NONE; 2270 (yyval.gen).offset = (yyvsp[(1) - (6)].lval); 2271 (yyval.gen).index = (yyvsp[(3) - (6)].lval); 2272 (yyval.gen).scale = (yyvsp[(5) - (6)].lval); 2273 checkscale((yyval.gen).scale); 2274 } 2275 break; 2276 2277 case 98: 2278 #line 502 "a.y" 2279 { 2280 (yyval.gen) = nullgen; 2281 (yyval.gen).type = D_INDIR+(yyvsp[(3) - (9)].lval); 2282 (yyval.gen).offset = (yyvsp[(1) - (9)].lval); 2283 (yyval.gen).index = (yyvsp[(6) - (9)].lval); 2284 (yyval.gen).scale = (yyvsp[(8) - (9)].lval); 2285 checkscale((yyval.gen).scale); 2286 } 2287 break; 2288 2289 case 99: 2290 #line 511 "a.y" 2291 { 2292 (yyval.gen) = nullgen; 2293 (yyval.gen).type = D_INDIR+(yyvsp[(3) - (9)].lval); 2294 (yyval.gen).offset = (yyvsp[(1) - (9)].lval); 2295 (yyval.gen).index = (yyvsp[(6) - (9)].lval); 2296 (yyval.gen).scale = (yyvsp[(8) - (9)].lval); 2297 checkscale((yyval.gen).scale); 2298 } 2299 break; 2300 2301 case 100: 2302 #line 520 "a.y" 2303 { 2304 (yyval.gen) = nullgen; 2305 (yyval.gen).type = D_INDIR+(yyvsp[(2) - (3)].lval); 2306 } 2307 break; 2308 2309 case 101: 2310 #line 525 "a.y" 2311 { 2312 (yyval.gen) = nullgen; 2313 (yyval.gen).type = D_INDIR+D_SP; 2314 } 2315 break; 2316 2317 case 102: 2318 #line 530 "a.y" 2319 { 2320 (yyval.gen) = nullgen; 2321 (yyval.gen).type = D_INDIR+(yyvsp[(3) - (4)].lval); 2322 (yyval.gen).offset = (yyvsp[(1) - (4)].lval); 2323 } 2324 break; 2325 2326 case 103: 2327 #line 536 "a.y" 2328 { 2329 (yyval.gen) = nullgen; 2330 (yyval.gen).type = D_INDIR+D_NONE; 2331 (yyval.gen).index = (yyvsp[(2) - (5)].lval); 2332 (yyval.gen).scale = (yyvsp[(4) - (5)].lval); 2333 checkscale((yyval.gen).scale); 2334 } 2335 break; 2336 2337 case 104: 2338 #line 544 "a.y" 2339 { 2340 (yyval.gen) = nullgen; 2341 (yyval.gen).type = D_INDIR+(yyvsp[(2) - (8)].lval); 2342 (yyval.gen).index = (yyvsp[(5) - (8)].lval); 2343 (yyval.gen).scale = (yyvsp[(7) - (8)].lval); 2344 checkscale((yyval.gen).scale); 2345 } 2346 break; 2347 2348 case 105: 2349 #line 554 "a.y" 2350 { 2351 (yyval.gen) = (yyvsp[(1) - (1)].gen); 2352 } 2353 break; 2354 2355 case 106: 2356 #line 558 "a.y" 2357 { 2358 (yyval.gen) = (yyvsp[(1) - (6)].gen); 2359 (yyval.gen).index = (yyvsp[(3) - (6)].lval); 2360 (yyval.gen).scale = (yyvsp[(5) - (6)].lval); 2361 checkscale((yyval.gen).scale); 2362 } 2363 break; 2364 2365 case 107: 2366 #line 567 "a.y" 2367 { 2368 (yyval.gen) = nullgen; 2369 (yyval.gen).type = (yyvsp[(4) - (5)].lval); 2370 (yyval.gen).sym = (yyvsp[(1) - (5)].sym); 2371 (yyval.gen).offset = (yyvsp[(2) - (5)].lval); 2372 } 2373 break; 2374 2375 case 108: 2376 #line 574 "a.y" 2377 { 2378 (yyval.gen) = nullgen; 2379 (yyval.gen).type = D_STATIC; 2380 (yyval.gen).sym = (yyvsp[(1) - (7)].sym); 2381 (yyval.gen).offset = (yyvsp[(4) - (7)].lval); 2382 } 2383 break; 2384 2385 case 109: 2386 #line 582 "a.y" 2387 { 2388 (yyval.lval) = 0; 2389 } 2390 break; 2391 2392 case 110: 2393 #line 586 "a.y" 2394 { 2395 (yyval.lval) = (yyvsp[(2) - (2)].lval); 2396 } 2397 break; 2398 2399 case 111: 2400 #line 590 "a.y" 2401 { 2402 (yyval.lval) = -(yyvsp[(2) - (2)].lval); 2403 } 2404 break; 2405 2406 case 113: 2407 #line 597 "a.y" 2408 { 2409 (yyval.lval) = D_AUTO; 2410 } 2411 break; 2412 2413 case 116: 2414 #line 605 "a.y" 2415 { 2416 (yyval.lval) = (yyvsp[(1) - (1)].sym)->value; 2417 } 2418 break; 2419 2420 case 117: 2421 #line 609 "a.y" 2422 { 2423 (yyval.lval) = -(yyvsp[(2) - (2)].lval); 2424 } 2425 break; 2426 2427 case 118: 2428 #line 613 "a.y" 2429 { 2430 (yyval.lval) = (yyvsp[(2) - (2)].lval); 2431 } 2432 break; 2433 2434 case 119: 2435 #line 617 "a.y" 2436 { 2437 (yyval.lval) = ~(yyvsp[(2) - (2)].lval); 2438 } 2439 break; 2440 2441 case 120: 2442 #line 621 "a.y" 2443 { 2444 (yyval.lval) = (yyvsp[(2) - (3)].lval); 2445 } 2446 break; 2447 2448 case 122: 2449 #line 628 "a.y" 2450 { 2451 (yyval.lval) = (yyvsp[(1) - (3)].lval) + (yyvsp[(3) - (3)].lval); 2452 } 2453 break; 2454 2455 case 123: 2456 #line 632 "a.y" 2457 { 2458 (yyval.lval) = (yyvsp[(1) - (3)].lval) - (yyvsp[(3) - (3)].lval); 2459 } 2460 break; 2461 2462 case 124: 2463 #line 636 "a.y" 2464 { 2465 (yyval.lval) = (yyvsp[(1) - (3)].lval) * (yyvsp[(3) - (3)].lval); 2466 } 2467 break; 2468 2469 case 125: 2470 #line 640 "a.y" 2471 { 2472 (yyval.lval) = (yyvsp[(1) - (3)].lval) / (yyvsp[(3) - (3)].lval); 2473 } 2474 break; 2475 2476 case 126: 2477 #line 644 "a.y" 2478 { 2479 (yyval.lval) = (yyvsp[(1) - (3)].lval) % (yyvsp[(3) - (3)].lval); 2480 } 2481 break; 2482 2483 case 127: 2484 #line 648 "a.y" 2485 { 2486 (yyval.lval) = (yyvsp[(1) - (4)].lval) << (yyvsp[(4) - (4)].lval); 2487 } 2488 break; 2489 2490 case 128: 2491 #line 652 "a.y" 2492 { 2493 (yyval.lval) = (yyvsp[(1) - (4)].lval) >> (yyvsp[(4) - (4)].lval); 2494 } 2495 break; 2496 2497 case 129: 2498 #line 656 "a.y" 2499 { 2500 (yyval.lval) = (yyvsp[(1) - (3)].lval) & (yyvsp[(3) - (3)].lval); 2501 } 2502 break; 2503 2504 case 130: 2505 #line 660 "a.y" 2506 { 2507 (yyval.lval) = (yyvsp[(1) - (3)].lval) ^ (yyvsp[(3) - (3)].lval); 2508 } 2509 break; 2510 2511 case 131: 2512 #line 664 "a.y" 2513 { 2514 (yyval.lval) = (yyvsp[(1) - (3)].lval) | (yyvsp[(3) - (3)].lval); 2515 } 2516 break; 2517 2518 2519 /* Line 1267 of yacc.c. */ 2520 #line 2521 "y.tab.c" 2521 default: break; 2522 } 2523 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 2524 2525 YYPOPSTACK (yylen); 2526 yylen = 0; 2527 YY_STACK_PRINT (yyss, yyssp); 2528 2529 *++yyvsp = yyval; 2530 2531 2532 /* Now `shift' the result of the reduction. Determine what state 2533 that goes to, based on the state we popped back to and the rule 2534 number reduced by. */ 2535 2536 yyn = yyr1[yyn]; 2537 2538 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 2539 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 2540 yystate = yytable[yystate]; 2541 else 2542 yystate = yydefgoto[yyn - YYNTOKENS]; 2543 2544 goto yynewstate; 2545 2546 2547 /*------------------------------------. 2548 | yyerrlab -- here on detecting error | 2549 `------------------------------------*/ 2550 yyerrlab: 2551 /* If not already recovering from an error, report this error. */ 2552 if (!yyerrstatus) 2553 { 2554 ++yynerrs; 2555 #if ! YYERROR_VERBOSE 2556 yyerror (YY_("syntax error")); 2557 #else 2558 { 2559 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); 2560 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) 2561 { 2562 YYSIZE_T yyalloc = 2 * yysize; 2563 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) 2564 yyalloc = YYSTACK_ALLOC_MAXIMUM; 2565 if (yymsg != yymsgbuf) 2566 YYSTACK_FREE (yymsg); 2567 yymsg = (char *) YYSTACK_ALLOC (yyalloc); 2568 if (yymsg) 2569 yymsg_alloc = yyalloc; 2570 else 2571 { 2572 yymsg = yymsgbuf; 2573 yymsg_alloc = sizeof yymsgbuf; 2574 } 2575 } 2576 2577 if (0 < yysize && yysize <= yymsg_alloc) 2578 { 2579 (void) yysyntax_error (yymsg, yystate, yychar); 2580 yyerror (yymsg); 2581 } 2582 else 2583 { 2584 yyerror (YY_("syntax error")); 2585 if (yysize != 0) 2586 goto yyexhaustedlab; 2587 } 2588 } 2589 #endif 2590 } 2591 2592 2593 2594 if (yyerrstatus == 3) 2595 { 2596 /* If just tried and failed to reuse look-ahead token after an 2597 error, discard it. */ 2598 2599 if (yychar <= YYEOF) 2600 { 2601 /* Return failure if at end of input. */ 2602 if (yychar == YYEOF) 2603 YYABORT; 2604 } 2605 else 2606 { 2607 yydestruct ("Error: discarding", 2608 yytoken, &yylval); 2609 yychar = YYEMPTY; 2610 } 2611 } 2612 2613 /* Else will try to reuse look-ahead token after shifting the error 2614 token. */ 2615 goto yyerrlab1; 2616 2617 2618 /*---------------------------------------------------. 2619 | yyerrorlab -- error raised explicitly by YYERROR. | 2620 `---------------------------------------------------*/ 2621 yyerrorlab: 2622 2623 /* Pacify compilers like GCC when the user code never invokes 2624 YYERROR and the label yyerrorlab therefore never appears in user 2625 code. */ 2626 if (/*CONSTCOND*/ 0) 2627 goto yyerrorlab; 2628 2629 /* Do not reclaim the symbols of the rule which action triggered 2630 this YYERROR. */ 2631 YYPOPSTACK (yylen); 2632 yylen = 0; 2633 YY_STACK_PRINT (yyss, yyssp); 2634 yystate = *yyssp; 2635 goto yyerrlab1; 2636 2637 2638 /*-------------------------------------------------------------. 2639 | yyerrlab1 -- common code for both syntax error and YYERROR. | 2640 `-------------------------------------------------------------*/ 2641 yyerrlab1: 2642 yyerrstatus = 3; /* Each real token shifted decrements this. */ 2643 2644 for (;;) 2645 { 2646 yyn = yypact[yystate]; 2647 if (yyn != YYPACT_NINF) 2648 { 2649 yyn += YYTERROR; 2650 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 2651 { 2652 yyn = yytable[yyn]; 2653 if (0 < yyn) 2654 break; 2655 } 2656 } 2657 2658 /* Pop the current state because it cannot handle the error token. */ 2659 if (yyssp == yyss) 2660 YYABORT; 2661 2662 2663 yydestruct ("Error: popping", 2664 yystos[yystate], yyvsp); 2665 YYPOPSTACK (1); 2666 yystate = *yyssp; 2667 YY_STACK_PRINT (yyss, yyssp); 2668 } 2669 2670 if (yyn == YYFINAL) 2671 YYACCEPT; 2672 2673 *++yyvsp = yylval; 2674 2675 2676 /* Shift the error token. */ 2677 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 2678 2679 yystate = yyn; 2680 goto yynewstate; 2681 2682 2683 /*-------------------------------------. 2684 | yyacceptlab -- YYACCEPT comes here. | 2685 `-------------------------------------*/ 2686 yyacceptlab: 2687 yyresult = 0; 2688 goto yyreturn; 2689 2690 /*-----------------------------------. 2691 | yyabortlab -- YYABORT comes here. | 2692 `-----------------------------------*/ 2693 yyabortlab: 2694 yyresult = 1; 2695 goto yyreturn; 2696 2697 #ifndef yyoverflow 2698 /*-------------------------------------------------. 2699 | yyexhaustedlab -- memory exhaustion comes here. | 2700 `-------------------------------------------------*/ 2701 yyexhaustedlab: 2702 yyerror (YY_("memory exhausted")); 2703 yyresult = 2; 2704 /* Fall through. */ 2705 #endif 2706 2707 yyreturn: 2708 if (yychar != YYEOF && yychar != YYEMPTY) 2709 yydestruct ("Cleanup: discarding lookahead", 2710 yytoken, &yylval); 2711 /* Do not reclaim the symbols of the rule which action triggered 2712 this YYABORT or YYACCEPT. */ 2713 YYPOPSTACK (yylen); 2714 YY_STACK_PRINT (yyss, yyssp); 2715 while (yyssp != yyss) 2716 { 2717 yydestruct ("Cleanup: popping", 2718 yystos[*yyssp], yyvsp); 2719 YYPOPSTACK (1); 2720 } 2721 #ifndef yyoverflow 2722 if (yyss != yyssa) 2723 YYSTACK_FREE (yyss); 2724 #endif 2725 #if YYERROR_VERBOSE 2726 if (yymsg != yymsgbuf) 2727 YYSTACK_FREE (yymsg); 2728 #endif 2729 /* Make sure YYID is used. */ 2730 return YYID (yyresult); 2731 } 2732 2733 2734