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