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