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