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