1 2 /* A Bison parser, made by GNU Bison 2.4.1. */ 3 4 /* Skeleton implementation for Bison's Yacc-like parsers in C 5 6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 7 Free Software Foundation, Inc. 8 9 This program is free software: you can redistribute it and/or modify 10 it under the terms of the GNU General Public License as published by 11 the Free Software Foundation, either version 3 of the License, or 12 (at your option) any later version. 13 14 This program is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 GNU General Public License for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 21 22 /* As a special exception, you may create a larger work that contains 23 part or all of the Bison parser skeleton and distribute that work 24 under terms of your choice, so long as that work isn't itself a 25 parser generator using the skeleton or a modified version thereof 26 as a parser skeleton. Alternatively, if you modify or redistribute 27 the parser skeleton itself, you may (at your option) remove this 28 special exception, which will cause the skeleton and the resulting 29 Bison output files to be licensed under the GNU General Public 30 License without this special exception. 31 32 This special exception was added by the Free Software Foundation in 33 version 2.2 of Bison. */ 34 35 /* C LALR(1) parser skeleton written by Richard Stallman, by 36 simplifying the original so-called "semantic" parser. */ 37 38 /* All symbols defined below should begin with yy or YY, to avoid 39 infringing on user name space. This should be done even for local 40 variables, as they might otherwise be expanded by user macros. 41 There are some unavoidable exceptions within include files to 42 define necessary library symbols; they are noted "INFRINGES ON 43 USER NAME SPACE" below. */ 44 45 /* Identify Bison output. */ 46 #define YYBISON 1 47 48 /* Bison version. */ 49 #define YYBISON_VERSION "2.4.1" 50 51 /* Skeleton name. */ 52 #define YYSKELETON_NAME "yacc.c" 53 54 /* Pure parsers. */ 55 #define YYPURE 0 56 57 /* Push parsers. */ 58 #define YYPUSH 0 59 60 /* Pull parsers. */ 61 #define YYPULL 1 62 63 /* Using locations. */ 64 #define YYLSP_NEEDED 0 65 66 67 68 /* Copy the first part of user declarations. */ 69 70 /* Line 189 of yacc.c */ 71 #line 1 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 72 73 /****************************************************************************** 74 * 75 * Module Name: dtparser.y - Bison input file for table compiler parser 76 * 77 *****************************************************************************/ 78 79 /* 80 * Copyright (C) 2000 - 2025, Intel Corp. 81 * All rights reserved. 82 * 83 * Redistribution and use in source and binary forms, with or without 84 * modification, are permitted provided that the following conditions 85 * are met: 86 * 1. Redistributions of source code must retain the above copyright 87 * notice, this list of conditions, and the following disclaimer, 88 * without modification. 89 * 2. Redistributions in binary form must reproduce at minimum a disclaimer 90 * substantially similar to the "NO WARRANTY" disclaimer below 91 * ("Disclaimer") and any redistribution must be conditioned upon 92 * including a substantially similar Disclaimer requirement for further 93 * binary redistribution. 94 * 3. Neither the names of the above-listed copyright holders nor the names 95 * of any contributors may be used to endorse or promote products derived 96 * from this software without specific prior written permission. 97 * 98 * Alternatively, this software may be distributed under the terms of the 99 * GNU General Public License ("GPL") version 2 as published by the Free 100 * Software Foundation. 101 * 102 * NO WARRANTY 103 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 104 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 105 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 106 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 107 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 108 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 109 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 110 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 111 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 112 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 113 * POSSIBILITY OF SUCH DAMAGES. 114 */ 115 116 #include "aslcompiler.h" 117 118 #define _COMPONENT DT_COMPILER 119 ACPI_MODULE_NAME ("dtparser") 120 121 void * AslLocalAllocate (unsigned int Size); 122 123 /* Bison/yacc configuration */ 124 125 #undef alloca 126 #define alloca AslLocalAllocate 127 128 int DtParserlex (void); 129 int DtParserparse (void); 130 void DtParsererror (char const *msg); 131 extern char *DtParsertext; 132 extern DT_FIELD *AslGbl_CurrentField; 133 134 UINT64 DtParserResult; /* Expression return value */ 135 136 /* Bison/yacc configuration */ 137 138 #define yytname DtParsername 139 #define YYDEBUG 1 /* Enable debug output */ 140 #define YYERROR_VERBOSE 1 /* Verbose error messages */ 141 #define YYFLAG -32768 142 143 /* Define YYMALLOC/YYFREE to prevent redefinition errors */ 144 145 #define YYMALLOC malloc 146 #define YYFREE free 147 148 149 /* Line 189 of yacc.c */ 150 #line 259 "dtparser.tab.c" 151 152 /* Enabling traces. */ 153 #ifndef YYDEBUG 154 # define YYDEBUG 0 155 #endif 156 157 /* Enabling verbose error messages. */ 158 #ifdef YYERROR_VERBOSE 159 # undef YYERROR_VERBOSE 160 # define YYERROR_VERBOSE 1 161 #else 162 # define YYERROR_VERBOSE 0 163 #endif 164 165 /* Enabling the token table. */ 166 #ifndef YYTOKEN_TABLE 167 # define YYTOKEN_TABLE 0 168 #endif 169 170 171 /* Tokens. */ 172 #ifndef YYTOKENTYPE 173 # define YYTOKENTYPE 174 /* Put the tokens into the symbol table, so that GDB and other debuggers 175 know about them. */ 176 enum yytokentype { 177 OP_EXP_EOF = 258, 178 OP_EXP_NEW_LINE = 259, 179 OP_EXP_NUMBER = 260, 180 OP_EXP_HEX_NUMBER = 261, 181 OP_EXP_DECIMAL_NUMBER = 262, 182 OP_EXP_LABEL = 263, 183 OP_EXP_PAREN_OPEN = 264, 184 OP_EXP_PAREN_CLOSE = 265, 185 OP_EXP_LOGICAL_OR = 266, 186 OP_EXP_LOGICAL_AND = 267, 187 OP_EXP_OR = 268, 188 OP_EXP_XOR = 269, 189 OP_EXP_AND = 270, 190 OP_EXP_NOT_EQUAL = 271, 191 OP_EXP_EQUAL = 272, 192 OP_EXP_LESS_EQUAL = 273, 193 OP_EXP_GREATER_EQUAL = 274, 194 OP_EXP_LESS = 275, 195 OP_EXP_GREATER = 276, 196 OP_EXP_SHIFT_LEFT = 277, 197 OP_EXP_SHIFT_RIGHT = 278, 198 OP_EXP_SUBTRACT = 279, 199 OP_EXP_ADD = 280, 200 OP_EXP_MODULO = 281, 201 OP_EXP_DIVIDE = 282, 202 OP_EXP_MULTIPLY = 283, 203 OP_EXP_LOGICAL_NOT = 284, 204 OP_EXP_ONES_COMPLIMENT = 285 205 }; 206 #endif 207 208 209 210 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 211 typedef union YYSTYPE 212 { 213 214 /* Line 214 of yacc.c */ 215 #line 187 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 216 217 UINT64 value; 218 UINT32 op; 219 220 221 222 /* Line 214 of yacc.c */ 223 #line 332 "dtparser.tab.c" 224 } YYSTYPE; 225 # define YYSTYPE_IS_TRIVIAL 1 226 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ 227 # define YYSTYPE_IS_DECLARED 1 228 #endif 229 230 231 /* Copy the second part of user declarations. */ 232 233 234 /* Line 264 of yacc.c */ 235 #line 344 "dtparser.tab.c" 236 237 #ifdef short 238 # undef short 239 #endif 240 241 #ifdef YYTYPE_UINT8 242 typedef YYTYPE_UINT8 yytype_uint8; 243 #else 244 typedef unsigned char yytype_uint8; 245 #endif 246 247 #ifdef YYTYPE_INT8 248 typedef YYTYPE_INT8 yytype_int8; 249 #elif (defined __STDC__ || defined __C99__FUNC__ \ 250 || defined __cplusplus || defined _MSC_VER) 251 typedef signed char yytype_int8; 252 #else 253 typedef short int yytype_int8; 254 #endif 255 256 #ifdef YYTYPE_UINT16 257 typedef YYTYPE_UINT16 yytype_uint16; 258 #else 259 typedef unsigned short int yytype_uint16; 260 #endif 261 262 #ifdef YYTYPE_INT16 263 typedef YYTYPE_INT16 yytype_int16; 264 #else 265 typedef short int yytype_int16; 266 #endif 267 268 #ifndef YYSIZE_T 269 # ifdef __SIZE_TYPE__ 270 # define YYSIZE_T __SIZE_TYPE__ 271 # elif defined size_t 272 # define YYSIZE_T size_t 273 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ 274 || defined __cplusplus || defined _MSC_VER) 275 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 276 # define YYSIZE_T size_t 277 # else 278 # define YYSIZE_T unsigned int 279 # endif 280 #endif 281 282 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) 283 284 #ifndef YY_ 285 # if YYENABLE_NLS 286 # if ENABLE_NLS 287 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 288 # define YY_(msgid) dgettext ("bison-runtime", msgid) 289 # endif 290 # endif 291 # ifndef YY_ 292 # define YY_(msgid) msgid 293 # endif 294 #endif 295 296 /* Suppress unused-variable warnings by "using" E. */ 297 #if ! defined lint || defined __GNUC__ 298 # define YYUSE(e) ((void) (e)) 299 #else 300 # define YYUSE(e) /* empty */ 301 #endif 302 303 /* Identity function, used to suppress warnings about constant conditions. */ 304 #ifndef lint 305 # define YYID(n) (n) 306 #else 307 #if (defined __STDC__ || defined __C99__FUNC__ \ 308 || defined __cplusplus || defined _MSC_VER) 309 static int 310 YYID (int yyi) 311 #else 312 static int 313 YYID (yyi) 314 int yyi; 315 #endif 316 { 317 return yyi; 318 } 319 #endif 320 321 #if ! defined yyoverflow || YYERROR_VERBOSE 322 323 /* The parser invokes alloca or malloc; define the necessary symbols. */ 324 325 # ifdef YYSTACK_USE_ALLOCA 326 # if YYSTACK_USE_ALLOCA 327 # ifdef __GNUC__ 328 # define YYSTACK_ALLOC __builtin_alloca 329 # elif defined __BUILTIN_VA_ARG_INCR 330 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ 331 # elif defined _AIX 332 # define YYSTACK_ALLOC __alloca 333 # elif defined _MSC_VER 334 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ 335 # define alloca _alloca 336 # else 337 # define YYSTACK_ALLOC alloca 338 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 339 || defined __cplusplus || defined _MSC_VER) 340 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 341 # ifndef _STDLIB_H 342 # define _STDLIB_H 1 343 # endif 344 # endif 345 # endif 346 # endif 347 # endif 348 349 # ifdef YYSTACK_ALLOC 350 /* Pacify GCC's `empty if-body' warning. */ 351 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) 352 # ifndef YYSTACK_ALLOC_MAXIMUM 353 /* The OS might guarantee only one guard page at the bottom of the stack, 354 and a page size can be as small as 4096 bytes. So we cannot safely 355 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number 356 to allow for a few compiler-allocated temporary stack slots. */ 357 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ 358 # endif 359 # else 360 # define YYSTACK_ALLOC YYMALLOC 361 # define YYSTACK_FREE YYFREE 362 # ifndef YYSTACK_ALLOC_MAXIMUM 363 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 364 # endif 365 # if (defined __cplusplus && ! defined _STDLIB_H \ 366 && ! ((defined YYMALLOC || defined malloc) \ 367 && (defined YYFREE || defined free))) 368 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 369 # ifndef _STDLIB_H 370 # define _STDLIB_H 1 371 # endif 372 # endif 373 # ifndef YYMALLOC 374 # define YYMALLOC malloc 375 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 376 || defined __cplusplus || defined _MSC_VER) 377 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 378 # endif 379 # endif 380 # ifndef YYFREE 381 # define YYFREE free 382 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 383 || defined __cplusplus || defined _MSC_VER) 384 void free (void *); /* INFRINGES ON USER NAME SPACE */ 385 # endif 386 # endif 387 # endif 388 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ 389 390 391 #if (! defined yyoverflow \ 392 && (! defined __cplusplus \ 393 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 394 395 /* A type that is properly aligned for any stack member. */ 396 union yyalloc 397 { 398 yytype_int16 yyss_alloc; 399 YYSTYPE yyvs_alloc; 400 }; 401 402 /* The size of the maximum gap between one aligned stack and the next. */ 403 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 404 405 /* The size of an array large to enough to hold all stacks, each with 406 N elements. */ 407 # define YYSTACK_BYTES(N) \ 408 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ 409 + YYSTACK_GAP_MAXIMUM) 410 411 /* Copy COUNT objects from FROM to TO. The source and destination do 412 not overlap. */ 413 # ifndef YYCOPY 414 # if defined __GNUC__ && 1 < __GNUC__ 415 # define YYCOPY(To, From, Count) \ 416 __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 417 # else 418 # define YYCOPY(To, From, Count) \ 419 do \ 420 { \ 421 YYSIZE_T yyi; \ 422 for (yyi = 0; yyi < (Count); yyi++) \ 423 (To)[yyi] = (From)[yyi]; \ 424 } \ 425 while (YYID (0)) 426 # endif 427 # endif 428 429 /* Relocate STACK from its old location to the new one. The 430 local variables YYSIZE and YYSTACKSIZE give the old and new number of 431 elements in the stack, and YYPTR gives the new location of the 432 stack. Advance YYPTR to a properly aligned location for the next 433 stack. */ 434 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ 435 do \ 436 { \ 437 YYSIZE_T yynewbytes; \ 438 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ 439 Stack = &yyptr->Stack_alloc; \ 440 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 441 yyptr += yynewbytes / sizeof (*yyptr); \ 442 } \ 443 while (YYID (0)) 444 445 #endif 446 447 /* YYFINAL -- State number of the termination state. */ 448 #define YYFINAL 13 449 /* YYLAST -- Last index in YYTABLE. */ 450 #define YYLAST 170 451 452 /* YYNTOKENS -- Number of terminals. */ 453 #define YYNTOKENS 31 454 /* YYNNTS -- Number of nonterminals. */ 455 #define YYNNTS 3 456 /* YYNRULES -- Number of rules. */ 457 #define YYNRULES 28 458 /* YYNRULES -- Number of states. */ 459 #define YYNSTATES 53 460 461 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 462 #define YYUNDEFTOK 2 463 #define YYMAXUTOK 285 464 465 #define YYTRANSLATE(YYX) \ 466 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 467 468 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 469 static const yytype_uint8 yytranslate[] = 470 { 471 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 472 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 473 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 474 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 475 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 476 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 477 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 478 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 479 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 480 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 481 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 482 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 483 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 484 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 485 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 486 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 487 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 488 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 489 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 490 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 491 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 492 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 493 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 494 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 495 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 496 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 497 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 498 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 499 25, 26, 27, 28, 29, 30 500 }; 501 502 #if YYDEBUG 503 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 504 YYRHS. */ 505 static const yytype_uint8 yyprhs[] = 506 { 507 0, 0, 3, 6, 9, 12, 15, 19, 23, 27, 508 31, 35, 39, 43, 47, 51, 55, 59, 63, 67, 509 71, 75, 79, 83, 87, 91, 93, 95, 97 510 }; 511 512 /* YYRHS -- A `-1'-separated list of the rules' RHS. */ 513 static const yytype_int8 yyrhs[] = 514 { 515 32, 0, -1, 33, 4, -1, 33, 3, -1, 29, 516 33, -1, 30, 33, -1, 33, 28, 33, -1, 33, 517 27, 33, -1, 33, 26, 33, -1, 33, 25, 33, 518 -1, 33, 24, 33, -1, 33, 23, 33, -1, 33, 519 22, 33, -1, 33, 21, 33, -1, 33, 20, 33, 520 -1, 33, 19, 33, -1, 33, 18, 33, -1, 33, 521 17, 33, -1, 33, 16, 33, -1, 33, 15, 33, 522 -1, 33, 14, 33, -1, 33, 13, 33, -1, 33, 523 12, 33, -1, 33, 11, 33, -1, 9, 33, 10, 524 -1, 8, -1, 5, -1, 6, -1, 7, -1 525 }; 526 527 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 528 static const yytype_uint16 yyrline[] = 529 { 530 0, 236, 236, 237, 244, 245, 249, 250, 251, 252, 531 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 532 263, 264, 265, 266, 270, 275, 286, 290, 294 533 }; 534 #endif 535 536 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 537 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 538 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 539 static const char *const yytname[] = 540 { 541 "$end", "error", "$undefined", "OP_EXP_EOF", "OP_EXP_NEW_LINE", 542 "OP_EXP_NUMBER", "OP_EXP_HEX_NUMBER", "OP_EXP_DECIMAL_NUMBER", 543 "OP_EXP_LABEL", "OP_EXP_PAREN_OPEN", "OP_EXP_PAREN_CLOSE", 544 "OP_EXP_LOGICAL_OR", "OP_EXP_LOGICAL_AND", "OP_EXP_OR", "OP_EXP_XOR", 545 "OP_EXP_AND", "OP_EXP_NOT_EQUAL", "OP_EXP_EQUAL", "OP_EXP_LESS_EQUAL", 546 "OP_EXP_GREATER_EQUAL", "OP_EXP_LESS", "OP_EXP_GREATER", 547 "OP_EXP_SHIFT_LEFT", "OP_EXP_SHIFT_RIGHT", "OP_EXP_SUBTRACT", 548 "OP_EXP_ADD", "OP_EXP_MODULO", "OP_EXP_DIVIDE", "OP_EXP_MULTIPLY", 549 "OP_EXP_LOGICAL_NOT", "OP_EXP_ONES_COMPLIMENT", "$accept", "Value", 550 "Expression", 0 551 }; 552 #endif 553 554 # ifdef YYPRINT 555 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 556 token YYLEX-NUM. */ 557 static const yytype_uint16 yytoknum[] = 558 { 559 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 560 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 561 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 562 285 563 }; 564 # endif 565 566 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 567 static const yytype_uint8 yyr1[] = 568 { 569 0, 31, 32, 32, 33, 33, 33, 33, 33, 33, 570 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 571 33, 33, 33, 33, 33, 33, 33, 33, 33 572 }; 573 574 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 575 static const yytype_uint8 yyr2[] = 576 { 577 0, 2, 2, 2, 2, 2, 3, 3, 3, 3, 578 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 579 3, 3, 3, 3, 3, 1, 1, 1, 1 580 }; 581 582 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state 583 STATE-NUM when YYTABLE doesn't specify something else to do. Zero 584 means the default is an error. */ 585 static const yytype_uint8 yydefact[] = 586 { 587 0, 26, 27, 28, 25, 0, 0, 0, 0, 0, 588 0, 4, 5, 1, 3, 2, 0, 0, 0, 0, 589 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 590 0, 0, 0, 0, 24, 23, 22, 21, 20, 19, 591 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 592 8, 7, 6 593 }; 594 595 /* YYDEFGOTO[NTERM-NUM]. */ 596 static const yytype_int8 yydefgoto[] = 597 { 598 -1, 8, 9 599 }; 600 601 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 602 STATE-NUM. */ 603 #define YYPACT_NINF -20 604 static const yytype_int16 yypact[] = 605 { 606 27, -20, -20, -20, -20, 27, 27, 27, 10, 26, 607 48, -20, -20, -20, -20, -20, 27, 27, 27, 27, 608 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 609 27, 27, 27, 27, -20, 65, 81, 96, 110, 123, 610 134, 134, -19, -19, -19, -19, 139, 139, 142, 142, 611 -20, -20, -20 612 }; 613 614 /* YYPGOTO[NTERM-NUM]. */ 615 static const yytype_int8 yypgoto[] = 616 { 617 -20, -20, -5 618 }; 619 620 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 621 positive, shift that token. If negative, reduce the rule which 622 number is the opposite. If zero, do what YYDEFACT says. 623 If YYTABLE_NINF, syntax error. */ 624 #define YYTABLE_NINF -1 625 static const yytype_uint8 yytable[] = 626 { 627 10, 11, 12, 27, 28, 29, 30, 31, 32, 33, 628 13, 35, 36, 37, 38, 39, 40, 41, 42, 43, 629 44, 45, 46, 47, 48, 49, 50, 51, 52, 14, 630 15, 0, 1, 2, 3, 4, 5, 16, 17, 18, 631 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 632 29, 30, 31, 32, 33, 0, 6, 7, 34, 16, 633 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 634 27, 28, 29, 30, 31, 32, 33, 17, 18, 19, 635 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 636 30, 31, 32, 33, 18, 19, 20, 21, 22, 23, 637 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 638 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 639 29, 30, 31, 32, 33, 20, 21, 22, 23, 24, 640 25, 26, 27, 28, 29, 30, 31, 32, 33, 21, 641 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 642 32, 33, 23, 24, 25, 26, 27, 28, 29, 30, 643 31, 32, 33, 29, 30, 31, 32, 33, 31, 32, 644 33 645 }; 646 647 static const yytype_int8 yycheck[] = 648 { 649 5, 6, 7, 22, 23, 24, 25, 26, 27, 28, 650 0, 16, 17, 18, 19, 20, 21, 22, 23, 24, 651 25, 26, 27, 28, 29, 30, 31, 32, 33, 3, 652 4, -1, 5, 6, 7, 8, 9, 11, 12, 13, 653 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 654 24, 25, 26, 27, 28, -1, 29, 30, 10, 11, 655 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 656 22, 23, 24, 25, 26, 27, 28, 12, 13, 14, 657 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 658 25, 26, 27, 28, 13, 14, 15, 16, 17, 18, 659 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 660 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 661 24, 25, 26, 27, 28, 15, 16, 17, 18, 19, 662 20, 21, 22, 23, 24, 25, 26, 27, 28, 16, 663 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 664 27, 28, 18, 19, 20, 21, 22, 23, 24, 25, 665 26, 27, 28, 24, 25, 26, 27, 28, 26, 27, 666 28 667 }; 668 669 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 670 symbol of state STATE-NUM. */ 671 static const yytype_uint8 yystos[] = 672 { 673 0, 5, 6, 7, 8, 9, 29, 30, 32, 33, 674 33, 33, 33, 0, 3, 4, 11, 12, 13, 14, 675 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 676 25, 26, 27, 28, 10, 33, 33, 33, 33, 33, 677 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 678 33, 33, 33 679 }; 680 681 #define yyerrok (yyerrstatus = 0) 682 #define yyclearin (yychar = YYEMPTY) 683 #define YYEMPTY (-2) 684 #define YYEOF 0 685 686 #define YYACCEPT goto yyacceptlab 687 #define YYABORT goto yyabortlab 688 #define YYERROR goto yyerrorlab 689 690 691 /* Like YYERROR except do call yyerror. This remains here temporarily 692 to ease the transition to the new meaning of YYERROR, for GCC. 693 Once GCC version 2 has supplanted version 1, this can go. */ 694 695 #define YYFAIL goto yyerrlab 696 697 #define YYRECOVERING() (!!yyerrstatus) 698 699 #define YYBACKUP(Token, Value) \ 700 do \ 701 if (yychar == YYEMPTY && yylen == 1) \ 702 { \ 703 yychar = (Token); \ 704 yylval = (Value); \ 705 yytoken = YYTRANSLATE (yychar); \ 706 YYPOPSTACK (1); \ 707 goto yybackup; \ 708 } \ 709 else \ 710 { \ 711 yyerror (YY_("syntax error: cannot back up")); \ 712 YYERROR; \ 713 } \ 714 while (YYID (0)) 715 716 717 #define YYTERROR 1 718 #define YYERRCODE 256 719 720 721 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 722 If N is 0, then set CURRENT to the empty location which ends 723 the previous symbol: RHS[0] (always defined). */ 724 725 #define YYRHSLOC(Rhs, K) ((Rhs)[K]) 726 #ifndef YYLLOC_DEFAULT 727 # define YYLLOC_DEFAULT(Current, Rhs, N) \ 728 do \ 729 if (YYID (N)) \ 730 { \ 731 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ 732 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ 733 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ 734 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ 735 } \ 736 else \ 737 { \ 738 (Current).first_line = (Current).last_line = \ 739 YYRHSLOC (Rhs, 0).last_line; \ 740 (Current).first_column = (Current).last_column = \ 741 YYRHSLOC (Rhs, 0).last_column; \ 742 } \ 743 while (YYID (0)) 744 #endif 745 746 747 /* YY_LOCATION_PRINT -- Print the location on the stream. 748 This macro was not mandated originally: define only if we know 749 we won't break user code: when these are the locations we know. */ 750 751 #ifndef YY_LOCATION_PRINT 752 # if YYLTYPE_IS_TRIVIAL 753 # define YY_LOCATION_PRINT(File, Loc) \ 754 fprintf (File, "%d.%d-%d.%d", \ 755 (Loc).first_line, (Loc).first_column, \ 756 (Loc).last_line, (Loc).last_column) 757 # else 758 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) 759 # endif 760 #endif 761 762 763 /* YYLEX -- calling `yylex' with the right arguments. */ 764 765 #ifdef YYLEX_PARAM 766 # define YYLEX yylex (YYLEX_PARAM) 767 #else 768 # define YYLEX yylex () 769 #endif 770 771 /* Enable debugging if requested. */ 772 #if YYDEBUG 773 774 # ifndef YYFPRINTF 775 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 776 # define YYFPRINTF fprintf 777 # endif 778 779 # define YYDPRINTF(Args) \ 780 do { \ 781 if (yydebug) \ 782 YYFPRINTF Args; \ 783 } while (YYID (0)) 784 785 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 786 do { \ 787 if (yydebug) \ 788 { \ 789 YYFPRINTF (stderr, "%s ", Title); \ 790 yy_symbol_print (stderr, \ 791 Type, Value); \ 792 YYFPRINTF (stderr, "\n"); \ 793 } \ 794 } while (YYID (0)) 795 796 797 /*--------------------------------. 798 | Print this symbol on YYOUTPUT. | 799 `--------------------------------*/ 800 801 /*ARGSUSED*/ 802 #if (defined __STDC__ || defined __C99__FUNC__ \ 803 || defined __cplusplus || defined _MSC_VER) 804 static void 805 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 806 #else 807 static void 808 yy_symbol_value_print (yyoutput, yytype, yyvaluep) 809 FILE *yyoutput; 810 int yytype; 811 YYSTYPE const * const yyvaluep; 812 #endif 813 { 814 if (!yyvaluep) 815 return; 816 # ifdef YYPRINT 817 if (yytype < YYNTOKENS) 818 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 819 # else 820 YYUSE (yyoutput); 821 # endif 822 switch (yytype) 823 { 824 default: 825 break; 826 } 827 } 828 829 830 /*--------------------------------. 831 | Print this symbol on YYOUTPUT. | 832 `--------------------------------*/ 833 834 #if (defined __STDC__ || defined __C99__FUNC__ \ 835 || defined __cplusplus || defined _MSC_VER) 836 static void 837 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 838 #else 839 static void 840 yy_symbol_print (yyoutput, yytype, yyvaluep) 841 FILE *yyoutput; 842 int yytype; 843 YYSTYPE const * const yyvaluep; 844 #endif 845 { 846 if (yytype < YYNTOKENS) 847 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 848 else 849 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 850 851 yy_symbol_value_print (yyoutput, yytype, yyvaluep); 852 YYFPRINTF (yyoutput, ")"); 853 } 854 855 /*------------------------------------------------------------------. 856 | yy_stack_print -- Print the state stack from its BOTTOM up to its | 857 | TOP (included). | 858 `------------------------------------------------------------------*/ 859 860 #if (defined __STDC__ || defined __C99__FUNC__ \ 861 || defined __cplusplus || defined _MSC_VER) 862 static void 863 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) 864 #else 865 static void 866 yy_stack_print (yybottom, yytop) 867 yytype_int16 *yybottom; 868 yytype_int16 *yytop; 869 #endif 870 { 871 YYFPRINTF (stderr, "Stack now"); 872 for (; yybottom <= yytop; yybottom++) 873 { 874 int yybot = *yybottom; 875 YYFPRINTF (stderr, " %d", yybot); 876 } 877 YYFPRINTF (stderr, "\n"); 878 } 879 880 # define YY_STACK_PRINT(Bottom, Top) \ 881 do { \ 882 if (yydebug) \ 883 yy_stack_print ((Bottom), (Top)); \ 884 } while (YYID (0)) 885 886 887 /*------------------------------------------------. 888 | Report that the YYRULE is going to be reduced. | 889 `------------------------------------------------*/ 890 891 #if (defined __STDC__ || defined __C99__FUNC__ \ 892 || defined __cplusplus || defined _MSC_VER) 893 static void 894 yy_reduce_print (YYSTYPE *yyvsp, int yyrule) 895 #else 896 static void 897 yy_reduce_print (yyvsp, yyrule) 898 YYSTYPE *yyvsp; 899 int yyrule; 900 #endif 901 { 902 int yynrhs = yyr2[yyrule]; 903 int yyi; 904 unsigned long int yylno = yyrline[yyrule]; 905 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 906 yyrule - 1, yylno); 907 /* The symbols being reduced. */ 908 for (yyi = 0; yyi < yynrhs; yyi++) 909 { 910 YYFPRINTF (stderr, " $%d = ", yyi + 1); 911 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 912 &(yyvsp[(yyi + 1) - (yynrhs)]) 913 ); 914 YYFPRINTF (stderr, "\n"); 915 } 916 } 917 918 # define YY_REDUCE_PRINT(Rule) \ 919 do { \ 920 if (yydebug) \ 921 yy_reduce_print (yyvsp, Rule); \ 922 } while (YYID (0)) 923 924 /* Nonzero means print parse trace. It is left uninitialized so that 925 multiple parsers can coexist. */ 926 int yydebug; 927 #else /* !YYDEBUG */ 928 # define YYDPRINTF(Args) 929 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 930 # define YY_STACK_PRINT(Bottom, Top) 931 # define YY_REDUCE_PRINT(Rule) 932 #endif /* !YYDEBUG */ 933 934 935 /* YYINITDEPTH -- initial size of the parser's stacks. */ 936 #ifndef YYINITDEPTH 937 # define YYINITDEPTH 200 938 #endif 939 940 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 941 if the built-in stack extension method is used). 942 943 Do not make this value too large; the results are undefined if 944 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) 945 evaluated with infinite-precision integer arithmetic. */ 946 947 #ifndef YYMAXDEPTH 948 # define YYMAXDEPTH 10000 949 #endif 950 951 952 954 #if YYERROR_VERBOSE 955 956 # ifndef yystrlen 957 # if defined __GLIBC__ && defined _STRING_H 958 # define yystrlen strlen 959 # else 960 /* Return the length of YYSTR. */ 961 #if (defined __STDC__ || defined __C99__FUNC__ \ 962 || defined __cplusplus || defined _MSC_VER) 963 static YYSIZE_T 964 yystrlen (const char *yystr) 965 #else 966 static YYSIZE_T 967 yystrlen (yystr) 968 const char *yystr; 969 #endif 970 { 971 YYSIZE_T yylen; 972 for (yylen = 0; yystr[yylen]; yylen++) 973 continue; 974 return yylen; 975 } 976 # endif 977 # endif 978 979 # ifndef yystpcpy 980 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE 981 # define yystpcpy stpcpy 982 # else 983 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 984 YYDEST. */ 985 #if (defined __STDC__ || defined __C99__FUNC__ \ 986 || defined __cplusplus || defined _MSC_VER) 987 static char * 988 yystpcpy (char *yydest, const char *yysrc) 989 #else 990 static char * 991 yystpcpy (yydest, yysrc) 992 char *yydest; 993 const char *yysrc; 994 #endif 995 { 996 char *yyd = yydest; 997 const char *yys = yysrc; 998 999 while ((*yyd++ = *yys++) != '\0') 1000 continue; 1001 1002 return yyd - 1; 1003 } 1004 # endif 1005 # endif 1006 1007 # ifndef yytnamerr 1008 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary 1009 quotes and backslashes, so that it's suitable for yyerror. The 1010 heuristic is that double-quoting is unnecessary unless the string 1011 contains an apostrophe, a comma, or backslash (other than 1012 backslash-backslash). YYSTR is taken from yytname. If YYRES is 1013 null, do not copy; instead, return the length of what the result 1014 would have been. */ 1015 static YYSIZE_T 1016 yytnamerr (char *yyres, const char *yystr) 1017 { 1018 if (*yystr == '"') 1019 { 1020 YYSIZE_T yyn = 0; 1021 char const *yyp = yystr; 1022 1023 for (;;) 1024 switch (*++yyp) 1025 { 1026 case '\'': 1027 case ',': 1028 goto do_not_strip_quotes; 1029 1030 case '\\': 1031 if (*++yyp != '\\') 1032 goto do_not_strip_quotes; 1033 /* Fall through. */ 1034 default: 1035 if (yyres) 1036 yyres[yyn] = *yyp; 1037 yyn++; 1038 break; 1039 1040 case '"': 1041 if (yyres) 1042 yyres[yyn] = '\0'; 1043 return yyn; 1044 } 1045 do_not_strip_quotes: ; 1046 } 1047 1048 if (! yyres) 1049 return yystrlen (yystr); 1050 1051 return yystpcpy (yyres, yystr) - yyres; 1052 } 1053 # endif 1054 1055 /* Copy into YYRESULT an error message about the unexpected token 1056 YYCHAR while in state YYSTATE. Return the number of bytes copied, 1057 including the terminating null byte. If YYRESULT is null, do not 1058 copy anything; just return the number of bytes that would be 1059 copied. As a special case, return 0 if an ordinary "syntax error" 1060 message will do. Return YYSIZE_MAXIMUM if overflow occurs during 1061 size calculation. */ 1062 static YYSIZE_T 1063 yysyntax_error (char *yyresult, int yystate, int yychar) 1064 { 1065 int yyn = yypact[yystate]; 1066 1067 if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) 1068 return 0; 1069 else 1070 { 1071 int yytype = YYTRANSLATE (yychar); 1072 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); 1073 YYSIZE_T yysize = yysize0; 1074 YYSIZE_T yysize1; 1075 int yysize_overflow = 0; 1076 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 1077 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 1078 int yyx; 1079 1080 # if 0 1081 /* This is so xgettext sees the translatable formats that are 1082 constructed on the fly. */ 1083 YY_("syntax error, unexpected %s"); 1084 YY_("syntax error, unexpected %s, expecting %s"); 1085 YY_("syntax error, unexpected %s, expecting %s or %s"); 1086 YY_("syntax error, unexpected %s, expecting %s or %s or %s"); 1087 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); 1088 # endif 1089 char *yyfmt; 1090 char const *yyf; 1091 static char const yyunexpected[] = "syntax error, unexpected %s"; 1092 static char const yyexpecting[] = ", expecting %s"; 1093 static char const yyor[] = " or %s"; 1094 char yyformat[sizeof yyunexpected 1095 + sizeof yyexpecting - 1 1096 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) 1097 * (sizeof yyor - 1))]; 1098 char const *yyprefix = yyexpecting; 1099 1100 /* Start YYX at -YYN if negative to avoid negative indexes in 1101 YYCHECK. */ 1102 int yyxbegin = yyn < 0 ? -yyn : 0; 1103 1104 /* Stay within bounds of both yycheck and yytname. */ 1105 int yychecklim = YYLAST - yyn + 1; 1106 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 1107 int yycount = 1; 1108 1109 yyarg[0] = yytname[yytype]; 1110 yyfmt = yystpcpy (yyformat, yyunexpected); 1111 1112 for (yyx = yyxbegin; yyx < yyxend; ++yyx) 1113 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) 1114 { 1115 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 1116 { 1117 yycount = 1; 1118 yysize = yysize0; 1119 yyformat[sizeof yyunexpected - 1] = '\0'; 1120 break; 1121 } 1122 yyarg[yycount++] = yytname[yyx]; 1123 yysize1 = yysize + yytnamerr (0, yytname[yyx]); 1124 yysize_overflow |= (yysize1 < yysize); 1125 yysize = yysize1; 1126 yyfmt = yystpcpy (yyfmt, yyprefix); 1127 yyprefix = yyor; 1128 } 1129 1130 yyf = YY_(yyformat); 1131 yysize1 = yysize + yystrlen (yyf); 1132 yysize_overflow |= (yysize1 < yysize); 1133 yysize = yysize1; 1134 1135 if (yysize_overflow) 1136 return YYSIZE_MAXIMUM; 1137 1138 if (yyresult) 1139 { 1140 /* Avoid sprintf, as that infringes on the user's name space. 1141 Don't have undefined behavior even if the translation 1142 produced a string with the wrong number of "%s"s. */ 1143 char *yyp = yyresult; 1144 int yyi = 0; 1145 while ((*yyp = *yyf) != '\0') 1146 { 1147 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) 1148 { 1149 yyp += yytnamerr (yyp, yyarg[yyi++]); 1150 yyf += 2; 1151 } 1152 else 1153 { 1154 yyp++; 1155 yyf++; 1156 } 1157 } 1158 } 1159 return yysize; 1160 } 1161 } 1162 #endif /* YYERROR_VERBOSE */ 1163 1164 1166 /*-----------------------------------------------. 1167 | Release the memory associated to this symbol. | 1168 `-----------------------------------------------*/ 1169 1170 /*ARGSUSED*/ 1171 #if (defined __STDC__ || defined __C99__FUNC__ \ 1172 || defined __cplusplus || defined _MSC_VER) 1173 static void 1174 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 1175 #else 1176 static void 1177 yydestruct (yymsg, yytype, yyvaluep) 1178 const char *yymsg; 1179 int yytype; 1180 YYSTYPE *yyvaluep; 1181 #endif 1182 { 1183 YYUSE (yyvaluep); 1184 1185 if (!yymsg) 1186 yymsg = "Deleting"; 1187 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 1188 1189 switch (yytype) 1190 { 1191 1192 default: 1193 break; 1194 } 1195 } 1196 1197 /* Prevent warnings from -Wmissing-prototypes. */ 1198 #ifdef YYPARSE_PARAM 1199 #if defined __STDC__ || defined __cplusplus 1200 int yyparse (void *YYPARSE_PARAM); 1201 #else 1202 int yyparse (); 1203 #endif 1204 #else /* ! YYPARSE_PARAM */ 1205 #if defined __STDC__ || defined __cplusplus 1206 int yyparse (void); 1207 #else 1208 int yyparse (); 1209 #endif 1210 #endif /* ! YYPARSE_PARAM */ 1211 1212 1213 /* The lookahead symbol. */ 1214 int yychar; 1215 1216 /* The semantic value of the lookahead symbol. */ 1217 YYSTYPE yylval; 1218 1219 /* Number of syntax errors so far. */ 1220 int yynerrs; 1221 1222 1223 1224 /*-------------------------. 1225 | yyparse or yypush_parse. | 1226 `-------------------------*/ 1227 1228 #ifdef YYPARSE_PARAM 1229 #if (defined __STDC__ || defined __C99__FUNC__ \ 1230 || defined __cplusplus || defined _MSC_VER) 1231 int 1232 yyparse (void *YYPARSE_PARAM) 1233 #else 1234 int 1235 yyparse (YYPARSE_PARAM) 1236 void *YYPARSE_PARAM; 1237 #endif 1238 #else /* ! YYPARSE_PARAM */ 1239 #if (defined __STDC__ || defined __C99__FUNC__ \ 1240 || defined __cplusplus || defined _MSC_VER) 1241 int 1242 yyparse (void) 1243 #else 1244 int 1245 yyparse () 1246 1247 #endif 1248 #endif 1249 { 1250 1251 1252 int yystate; 1253 /* Number of tokens to shift before error messages enabled. */ 1254 int yyerrstatus; 1255 1256 /* The stacks and their tools: 1257 `yyss': related to states. 1258 `yyvs': related to semantic values. 1259 1260 Refer to the stacks thru separate pointers, to allow yyoverflow 1261 to reallocate them elsewhere. */ 1262 1263 /* The state stack. */ 1264 yytype_int16 yyssa[YYINITDEPTH]; 1265 yytype_int16 *yyss; 1266 yytype_int16 *yyssp; 1267 1268 /* The semantic value stack. */ 1269 YYSTYPE yyvsa[YYINITDEPTH]; 1270 YYSTYPE *yyvs; 1271 YYSTYPE *yyvsp; 1272 1273 YYSIZE_T yystacksize; 1274 1275 int yyn; 1276 int yyresult; 1277 /* Lookahead token as an internal (translated) token number. */ 1278 int yytoken; 1279 /* The variables used to return semantic value and location from the 1280 action routines. */ 1281 YYSTYPE yyval; 1282 1283 #if YYERROR_VERBOSE 1284 /* Buffer for error messages, and its allocated size. */ 1285 char yymsgbuf[128]; 1286 char *yymsg = yymsgbuf; 1287 YYSIZE_T yymsg_alloc = sizeof yymsgbuf; 1288 #endif 1289 1290 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) 1291 1292 /* The number of symbols on the RHS of the reduced rule. 1293 Keep to zero when no symbol should be popped. */ 1294 int yylen = 0; 1295 1296 yytoken = 0; 1297 yyss = yyssa; 1298 yyvs = yyvsa; 1299 yystacksize = YYINITDEPTH; 1300 1301 YYDPRINTF ((stderr, "Starting parse\n")); 1302 1303 yystate = 0; 1304 yyerrstatus = 0; 1305 yynerrs = 0; 1306 yychar = YYEMPTY; /* Cause a token to be read. */ 1307 1308 /* Initialize stack pointers. 1309 Waste one element of value and location stack 1310 so that they stay on the same level as the state stack. 1311 The wasted elements are never initialized. */ 1312 yyssp = yyss; 1313 yyvsp = yyvs; 1314 1315 goto yysetstate; 1316 1317 /*------------------------------------------------------------. 1318 | yynewstate -- Push a new state, which is found in yystate. | 1319 `------------------------------------------------------------*/ 1320 yynewstate: 1321 /* In all cases, when you get here, the value and location stacks 1322 have just been pushed. So pushing a state here evens the stacks. */ 1323 yyssp++; 1324 1325 yysetstate: 1326 *yyssp = yystate; 1327 1328 if (yyss + yystacksize - 1 <= yyssp) 1329 { 1330 /* Get the current used size of the three stacks, in elements. */ 1331 YYSIZE_T yysize = yyssp - yyss + 1; 1332 1333 #ifdef yyoverflow 1334 { 1335 /* Give user a chance to reallocate the stack. Use copies of 1336 these so that the &'s don't force the real ones into 1337 memory. */ 1338 YYSTYPE *yyvs1 = yyvs; 1339 yytype_int16 *yyss1 = yyss; 1340 1341 /* Each stack pointer address is followed by the size of the 1342 data in use in that stack, in bytes. This used to be a 1343 conditional around just the two extra args, but that might 1344 be undefined if yyoverflow is a macro. */ 1345 yyoverflow (YY_("memory exhausted"), 1346 &yyss1, yysize * sizeof (*yyssp), 1347 &yyvs1, yysize * sizeof (*yyvsp), 1348 &yystacksize); 1349 1350 yyss = yyss1; 1351 yyvs = yyvs1; 1352 } 1353 #else /* no yyoverflow */ 1354 # ifndef YYSTACK_RELOCATE 1355 goto yyexhaustedlab; 1356 # else 1357 /* Extend the stack our own way. */ 1358 if (YYMAXDEPTH <= yystacksize) 1359 goto yyexhaustedlab; 1360 yystacksize *= 2; 1361 if (YYMAXDEPTH < yystacksize) 1362 yystacksize = YYMAXDEPTH; 1363 1364 { 1365 yytype_int16 *yyss1 = yyss; 1366 union yyalloc *yyptr = 1367 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1368 if (! yyptr) 1369 goto yyexhaustedlab; 1370 YYSTACK_RELOCATE (yyss_alloc, yyss); 1371 YYSTACK_RELOCATE (yyvs_alloc, yyvs); 1372 # undef YYSTACK_RELOCATE 1373 if (yyss1 != yyssa) 1374 YYSTACK_FREE (yyss1); 1375 } 1376 # endif 1377 #endif /* no yyoverflow */ 1378 1379 yyssp = yyss + yysize - 1; 1380 yyvsp = yyvs + yysize - 1; 1381 1382 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1383 (unsigned long int) yystacksize)); 1384 1385 if (yyss + yystacksize - 1 <= yyssp) 1386 YYABORT; 1387 } 1388 1389 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 1390 1391 if (yystate == YYFINAL) 1392 YYACCEPT; 1393 1394 goto yybackup; 1395 1396 /*-----------. 1397 | yybackup. | 1398 `-----------*/ 1399 yybackup: 1400 1401 /* Do appropriate processing given the current state. Read a 1402 lookahead token if we need one and don't already have one. */ 1403 1404 /* First try to decide what to do without reference to lookahead token. */ 1405 yyn = yypact[yystate]; 1406 if (yyn == YYPACT_NINF) 1407 goto yydefault; 1408 1409 /* Not known => get a lookahead token if don't already have one. */ 1410 1411 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ 1412 if (yychar == YYEMPTY) 1413 { 1414 YYDPRINTF ((stderr, "Reading a token: ")); 1415 yychar = YYLEX; 1416 } 1417 1418 if (yychar <= YYEOF) 1419 { 1420 yychar = yytoken = YYEOF; 1421 YYDPRINTF ((stderr, "Now at end of input.\n")); 1422 } 1423 else 1424 { 1425 yytoken = YYTRANSLATE (yychar); 1426 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 1427 } 1428 1429 /* If the proper action on seeing token YYTOKEN is to reduce or to 1430 detect an error, take that action. */ 1431 yyn += yytoken; 1432 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 1433 goto yydefault; 1434 yyn = yytable[yyn]; 1435 if (yyn <= 0) 1436 { 1437 if (yyn == 0 || yyn == YYTABLE_NINF) 1438 goto yyerrlab; 1439 yyn = -yyn; 1440 goto yyreduce; 1441 } 1442 1443 /* Count tokens shifted since error; after three, turn off error 1444 status. */ 1445 if (yyerrstatus) 1446 yyerrstatus--; 1447 1448 /* Shift the lookahead token. */ 1449 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 1450 1451 /* Discard the shifted token. */ 1452 yychar = YYEMPTY; 1453 1454 yystate = yyn; 1455 *++yyvsp = yylval; 1456 1457 goto yynewstate; 1458 1459 1460 /*-----------------------------------------------------------. 1461 | yydefault -- do the default action for the current state. | 1462 `-----------------------------------------------------------*/ 1463 yydefault: 1464 yyn = yydefact[yystate]; 1465 if (yyn == 0) 1466 goto yyerrlab; 1467 goto yyreduce; 1468 1469 1470 /*-----------------------------. 1471 | yyreduce -- Do a reduction. | 1472 `-----------------------------*/ 1473 yyreduce: 1474 /* yyn is the number of a rule to reduce with. */ 1475 yylen = yyr2[yyn]; 1476 1477 /* If YYLEN is nonzero, implement the default value of the action: 1478 `$$ = $1'. 1479 1480 Otherwise, the following line sets YYVAL to garbage. 1481 This behavior is undocumented and Bison 1482 users should not rely upon it. Assigning to YYVAL 1483 unconditionally makes the parser a bit smaller, and it avoids a 1484 GCC warning that YYVAL may be used uninitialized. */ 1485 yyval = yyvsp[1-yylen]; 1486 1487 1488 YY_REDUCE_PRINT (yyn); 1489 switch (yyn) 1490 { 1491 case 2: 1492 1493 /* Line 1455 of yacc.c */ 1494 #line 236 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1495 { DtParserResult=(yyvsp[(1) - (2)].value); return 0; ;} 1496 break; 1497 1498 case 3: 1499 1500 /* Line 1455 of yacc.c */ 1501 #line 237 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1502 { DtParserResult=(yyvsp[(1) - (2)].value); return 0; ;} 1503 break; 1504 1505 case 4: 1506 1507 /* Line 1455 of yacc.c */ 1508 #line 244 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1509 { (yyval.value) = DtDoOperator ((yyvsp[(2) - (2)].value), OP_EXP_LOGICAL_NOT, (yyvsp[(2) - (2)].value));;} 1510 break; 1511 1512 case 5: 1513 1514 /* Line 1455 of yacc.c */ 1515 #line 245 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1516 { (yyval.value) = DtDoOperator ((yyvsp[(2) - (2)].value), OP_EXP_ONES_COMPLIMENT, (yyvsp[(2) - (2)].value));;} 1517 break; 1518 1519 case 6: 1520 1521 /* Line 1455 of yacc.c */ 1522 #line 249 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1523 { (yyval.value) = DtDoOperator ((yyvsp[(1) - (3)].value), OP_EXP_MULTIPLY, (yyvsp[(3) - (3)].value));;} 1524 break; 1525 1526 case 7: 1527 1528 /* Line 1455 of yacc.c */ 1529 #line 250 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1530 { (yyval.value) = DtDoOperator ((yyvsp[(1) - (3)].value), OP_EXP_DIVIDE, (yyvsp[(3) - (3)].value));;} 1531 break; 1532 1533 case 8: 1534 1535 /* Line 1455 of yacc.c */ 1536 #line 251 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1537 { (yyval.value) = DtDoOperator ((yyvsp[(1) - (3)].value), OP_EXP_MODULO, (yyvsp[(3) - (3)].value));;} 1538 break; 1539 1540 case 9: 1541 1542 /* Line 1455 of yacc.c */ 1543 #line 252 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1544 { (yyval.value) = DtDoOperator ((yyvsp[(1) - (3)].value), OP_EXP_ADD, (yyvsp[(3) - (3)].value));;} 1545 break; 1546 1547 case 10: 1548 1549 /* Line 1455 of yacc.c */ 1550 #line 253 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1551 { (yyval.value) = DtDoOperator ((yyvsp[(1) - (3)].value), OP_EXP_SUBTRACT, (yyvsp[(3) - (3)].value));;} 1552 break; 1553 1554 case 11: 1555 1556 /* Line 1455 of yacc.c */ 1557 #line 254 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1558 { (yyval.value) = DtDoOperator ((yyvsp[(1) - (3)].value), OP_EXP_SHIFT_RIGHT, (yyvsp[(3) - (3)].value));;} 1559 break; 1560 1561 case 12: 1562 1563 /* Line 1455 of yacc.c */ 1564 #line 255 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1565 { (yyval.value) = DtDoOperator ((yyvsp[(1) - (3)].value), OP_EXP_SHIFT_LEFT, (yyvsp[(3) - (3)].value));;} 1566 break; 1567 1568 case 13: 1569 1570 /* Line 1455 of yacc.c */ 1571 #line 256 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1572 { (yyval.value) = DtDoOperator ((yyvsp[(1) - (3)].value), OP_EXP_GREATER, (yyvsp[(3) - (3)].value));;} 1573 break; 1574 1575 case 14: 1576 1577 /* Line 1455 of yacc.c */ 1578 #line 257 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1579 { (yyval.value) = DtDoOperator ((yyvsp[(1) - (3)].value), OP_EXP_LESS, (yyvsp[(3) - (3)].value));;} 1580 break; 1581 1582 case 15: 1583 1584 /* Line 1455 of yacc.c */ 1585 #line 258 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1586 { (yyval.value) = DtDoOperator ((yyvsp[(1) - (3)].value), OP_EXP_GREATER_EQUAL, (yyvsp[(3) - (3)].value));;} 1587 break; 1588 1589 case 16: 1590 1591 /* Line 1455 of yacc.c */ 1592 #line 259 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1593 { (yyval.value) = DtDoOperator ((yyvsp[(1) - (3)].value), OP_EXP_LESS_EQUAL, (yyvsp[(3) - (3)].value));;} 1594 break; 1595 1596 case 17: 1597 1598 /* Line 1455 of yacc.c */ 1599 #line 260 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1600 { (yyval.value) = DtDoOperator ((yyvsp[(1) - (3)].value), OP_EXP_EQUAL, (yyvsp[(3) - (3)].value));;} 1601 break; 1602 1603 case 18: 1604 1605 /* Line 1455 of yacc.c */ 1606 #line 261 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1607 { (yyval.value) = DtDoOperator ((yyvsp[(1) - (3)].value), OP_EXP_NOT_EQUAL, (yyvsp[(3) - (3)].value));;} 1608 break; 1609 1610 case 19: 1611 1612 /* Line 1455 of yacc.c */ 1613 #line 262 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1614 { (yyval.value) = DtDoOperator ((yyvsp[(1) - (3)].value), OP_EXP_AND, (yyvsp[(3) - (3)].value));;} 1615 break; 1616 1617 case 20: 1618 1619 /* Line 1455 of yacc.c */ 1620 #line 263 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1621 { (yyval.value) = DtDoOperator ((yyvsp[(1) - (3)].value), OP_EXP_XOR, (yyvsp[(3) - (3)].value));;} 1622 break; 1623 1624 case 21: 1625 1626 /* Line 1455 of yacc.c */ 1627 #line 264 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1628 { (yyval.value) = DtDoOperator ((yyvsp[(1) - (3)].value), OP_EXP_OR, (yyvsp[(3) - (3)].value));;} 1629 break; 1630 1631 case 22: 1632 1633 /* Line 1455 of yacc.c */ 1634 #line 265 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1635 { (yyval.value) = DtDoOperator ((yyvsp[(1) - (3)].value), OP_EXP_LOGICAL_AND, (yyvsp[(3) - (3)].value));;} 1636 break; 1637 1638 case 23: 1639 1640 /* Line 1455 of yacc.c */ 1641 #line 266 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1642 { (yyval.value) = DtDoOperator ((yyvsp[(1) - (3)].value), OP_EXP_LOGICAL_OR, (yyvsp[(3) - (3)].value));;} 1643 break; 1644 1645 case 24: 1646 1647 /* Line 1455 of yacc.c */ 1648 #line 271 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1649 { (yyval.value) = (yyvsp[(2) - (3)].value);;} 1650 break; 1651 1652 case 25: 1653 1654 /* Line 1455 of yacc.c */ 1655 #line 275 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1656 { (yyval.value) = DtResolveLabel (DtParsertext);;} 1657 break; 1658 1659 case 26: 1660 1661 /* Line 1455 of yacc.c */ 1662 #line 286 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1663 { (yyval.value) = DtDoConstant (DtParsertext);;} 1664 break; 1665 1666 case 27: 1667 1668 /* Line 1455 of yacc.c */ 1669 #line 290 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1670 { (yyval.value) = DtDoConstant (DtParsertext);;} 1671 break; 1672 1673 case 28: 1674 1675 /* Line 1455 of yacc.c */ 1676 #line 294 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1677 { (yyval.value) = DtDoConstant (DtParsertext);;} 1678 break; 1679 1680 1681 1682 /* Line 1455 of yacc.c */ 1683 #line 1790 "dtparser.tab.c" 1684 default: break; 1685 } 1686 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 1687 1688 YYPOPSTACK (yylen); 1689 yylen = 0; 1690 YY_STACK_PRINT (yyss, yyssp); 1691 1692 *++yyvsp = yyval; 1693 1694 /* Now `shift' the result of the reduction. Determine what state 1695 that goes to, based on the state we popped back to and the rule 1696 number reduced by. */ 1697 1698 yyn = yyr1[yyn]; 1699 1700 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 1701 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 1702 yystate = yytable[yystate]; 1703 else 1704 yystate = yydefgoto[yyn - YYNTOKENS]; 1705 1706 goto yynewstate; 1707 1708 1709 /*------------------------------------. 1710 | yyerrlab -- here on detecting error | 1711 `------------------------------------*/ 1712 yyerrlab: 1713 /* If not already recovering from an error, report this error. */ 1714 if (!yyerrstatus) 1715 { 1716 ++yynerrs; 1717 #if ! YYERROR_VERBOSE 1718 yyerror (YY_("syntax error")); 1719 #else 1720 { 1721 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); 1722 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) 1723 { 1724 YYSIZE_T yyalloc = 2 * yysize; 1725 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) 1726 yyalloc = YYSTACK_ALLOC_MAXIMUM; 1727 if (yymsg != yymsgbuf) 1728 YYSTACK_FREE (yymsg); 1729 yymsg = (char *) YYSTACK_ALLOC (yyalloc); 1730 if (yymsg) 1731 yymsg_alloc = yyalloc; 1732 else 1733 { 1734 yymsg = yymsgbuf; 1735 yymsg_alloc = sizeof yymsgbuf; 1736 } 1737 } 1738 1739 if (0 < yysize && yysize <= yymsg_alloc) 1740 { 1741 (void) yysyntax_error (yymsg, yystate, yychar); 1742 yyerror (yymsg); 1743 } 1744 else 1745 { 1746 yyerror (YY_("syntax error")); 1747 if (yysize != 0) 1748 goto yyexhaustedlab; 1749 } 1750 } 1751 #endif 1752 } 1753 1754 1755 1756 if (yyerrstatus == 3) 1757 { 1758 /* If just tried and failed to reuse lookahead token after an 1759 error, discard it. */ 1760 1761 if (yychar <= YYEOF) 1762 { 1763 /* Return failure if at end of input. */ 1764 if (yychar == YYEOF) 1765 YYABORT; 1766 } 1767 else 1768 { 1769 yydestruct ("Error: discarding", 1770 yytoken, &yylval); 1771 yychar = YYEMPTY; 1772 } 1773 } 1774 1775 /* Else will try to reuse lookahead token after shifting the error 1776 token. */ 1777 goto yyerrlab1; 1778 1779 1780 /*---------------------------------------------------. 1781 | yyerrorlab -- error raised explicitly by YYERROR. | 1782 `---------------------------------------------------*/ 1783 yyerrorlab: 1784 1785 /* Pacify compilers like GCC when the user code never invokes 1786 YYERROR and the label yyerrorlab therefore never appears in user 1787 code. */ 1788 if (/*CONSTCOND*/ 0) 1789 goto yyerrorlab; 1790 1791 /* Do not reclaim the symbols of the rule which action triggered 1792 this YYERROR. */ 1793 YYPOPSTACK (yylen); 1794 yylen = 0; 1795 YY_STACK_PRINT (yyss, yyssp); 1796 yystate = *yyssp; 1797 goto yyerrlab1; 1798 1799 1800 /*-------------------------------------------------------------. 1801 | yyerrlab1 -- common code for both syntax error and YYERROR. | 1802 `-------------------------------------------------------------*/ 1803 yyerrlab1: 1804 yyerrstatus = 3; /* Each real token shifted decrements this. */ 1805 1806 for (;;) 1807 { 1808 yyn = yypact[yystate]; 1809 if (yyn != YYPACT_NINF) 1810 { 1811 yyn += YYTERROR; 1812 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 1813 { 1814 yyn = yytable[yyn]; 1815 if (0 < yyn) 1816 break; 1817 } 1818 } 1819 1820 /* Pop the current state because it cannot handle the error token. */ 1821 if (yyssp == yyss) 1822 YYABORT; 1823 1824 1825 yydestruct ("Error: popping", 1826 yystos[yystate], yyvsp); 1827 YYPOPSTACK (1); 1828 yystate = *yyssp; 1829 YY_STACK_PRINT (yyss, yyssp); 1830 } 1831 1832 *++yyvsp = yylval; 1833 1834 1835 /* Shift the error token. */ 1836 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); 1837 1838 yystate = yyn; 1839 goto yynewstate; 1840 1841 1842 /*-------------------------------------. 1843 | yyacceptlab -- YYACCEPT comes here. | 1844 `-------------------------------------*/ 1845 yyacceptlab: 1846 yyresult = 0; 1847 goto yyreturn; 1848 1849 /*-----------------------------------. 1850 | yyabortlab -- YYABORT comes here. | 1851 `-----------------------------------*/ 1852 yyabortlab: 1853 yyresult = 1; 1854 goto yyreturn; 1855 1856 #if !defined(yyoverflow) || YYERROR_VERBOSE 1857 /*-------------------------------------------------. 1858 | yyexhaustedlab -- memory exhaustion comes here. | 1859 `-------------------------------------------------*/ 1860 yyexhaustedlab: 1861 yyerror (YY_("memory exhausted")); 1862 yyresult = 2; 1863 /* Fall through. */ 1864 #endif 1865 1866 yyreturn: 1867 if (yychar != YYEMPTY) 1868 yydestruct ("Cleanup: discarding lookahead", 1869 yytoken, &yylval); 1870 /* Do not reclaim the symbols of the rule which action triggered 1871 this YYABORT or YYACCEPT. */ 1872 YYPOPSTACK (yylen); 1873 YY_STACK_PRINT (yyss, yyssp); 1874 while (yyssp != yyss) 1875 { 1876 yydestruct ("Cleanup: popping", 1877 yystos[*yyssp], yyvsp); 1878 YYPOPSTACK (1); 1879 } 1880 #ifndef yyoverflow 1881 if (yyss != yyssa) 1882 YYSTACK_FREE (yyss); 1883 #endif 1884 #if YYERROR_VERBOSE 1885 if (yymsg != yymsgbuf) 1886 YYSTACK_FREE (yymsg); 1887 #endif 1888 /* Make sure YYID is used. */ 1889 return YYID (yyresult); 1890 } 1891 1892 1893 1894 /* Line 1675 of yacc.c */ 1895 #line 296 "C:\\Users\\sdumbre\\testclone\\source\\compiler\\dtparser.y" 1896 1897 1898 /*! [End] no source code translation !*/ 1899 1900 /* 1901 * Local support functions, including parser entry point 1902 */ 1903 #define PR_FIRST_PARSE_OPCODE OP_EXP_EOF 1904 #define PR_YYTNAME_START 3 1905 1906 1907 /****************************************************************************** 1908 * 1909 * FUNCTION: DtParsererror 1910 * 1911 * PARAMETERS: Message - Parser-generated error message 1912 * 1913 * RETURN: None 1914 * 1915 * DESCRIPTION: Handler for parser errors 1916 * 1917 *****************************************************************************/ 1918 1919 void 1920 DtParsererror ( 1921 char const *Message) 1922 { 1923 DtError (ASL_ERROR, ASL_MSG_SYNTAX, 1924 AslGbl_CurrentField, (char *) Message); 1925 } 1926 1927 1928 /****************************************************************************** 1929 * 1930 * FUNCTION: DtGetOpName 1931 * 1932 * PARAMETERS: ParseOpcode - Parser token (OP_EXP_*) 1933 * 1934 * RETURN: Pointer to the opcode name 1935 * 1936 * DESCRIPTION: Get the ascii name of the parse opcode for debug output 1937 * 1938 *****************************************************************************/ 1939 1940 char * 1941 DtGetOpName ( 1942 UINT32 ParseOpcode) 1943 { 1944 #ifdef ASL_YYTNAME_START 1945 /* 1946 * First entries (PR_YYTNAME_START) in yytname are special reserved names. 1947 * Ignore first 6 characters of name (OP_EXP_) 1948 */ 1949 return ((char *) yytname 1950 [(ParseOpcode - PR_FIRST_PARSE_OPCODE) + PR_YYTNAME_START] + 6); 1951 #else 1952 return ("[Unknown parser generator]"); 1953 #endif 1954 } 1955 1956 1957 /****************************************************************************** 1958 * 1959 * FUNCTION: DtEvaluateExpression 1960 * 1961 * PARAMETERS: ExprString - Expression to be evaluated. Must be 1962 * terminated by either a newline or a NUL 1963 * string terminator 1964 * 1965 * RETURN: 64-bit value for the expression 1966 * 1967 * DESCRIPTION: Main entry point for the DT expression parser 1968 * 1969 *****************************************************************************/ 1970 1971 UINT64 1972 DtEvaluateExpression ( 1973 char *ExprString) 1974 { 1975 1976 DbgPrint (ASL_DEBUG_OUTPUT, 1977 "**** Input expression: %s (Base 16)\n", ExprString); 1978 1979 /* Point lexer to the input string */ 1980 1981 if (DtInitLexer (ExprString)) 1982 { 1983 DtError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, 1984 AslGbl_CurrentField, "Could not initialize lexer"); 1985 return (0); 1986 } 1987 1988 /* Parse/Evaluate the input string (value returned in DtParserResult) */ 1989 1990 DtParserparse (); 1991 DtTerminateLexer (); 1992 1993 DbgPrint (ASL_DEBUG_OUTPUT, 1994 "**** Parser returned value: %u (%8.8X%8.8X)\n", 1995 (UINT32) DtParserResult, ACPI_FORMAT_UINT64 (DtParserResult)); 1996 1997 return (DtParserResult); 1998 } 1999 2000