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