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