LCOV - code coverage report
Current view: top level - bin/default/libcli/wsp - wsp_aqs_parser.tab.c (source / functions) Hit Total Coverage
Test: coverage report for master 2f515e9b Lines: 178 378 47.1 %
Date: 2024-04-21 15:09:00 Functions: 1 1 100.0 %

          Line data    Source code
       1             : /* A Bison parser, made by GNU Bison 3.8.2.  */
       2             : 
       3             : /* Bison implementation for Yacc-like parsers in C
       4             : 
       5             :    Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
       6             :    Inc.
       7             : 
       8             :    This program is free software: you can redistribute it and/or modify
       9             :    it under the terms of the GNU General Public License as published by
      10             :    the Free Software Foundation, either version 3 of the License, or
      11             :    (at your option) any later version.
      12             : 
      13             :    This program is distributed in the hope that it will be useful,
      14             :    but WITHOUT ANY WARRANTY; without even the implied warranty of
      15             :    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      16             :    GNU General Public License for more details.
      17             : 
      18             :    You should have received a copy of the GNU General Public License
      19             :    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
      20             : 
      21             : /* As a special exception, you may create a larger work that contains
      22             :    part or all of the Bison parser skeleton and distribute that work
      23             :    under terms of your choice, so long as that work isn't itself a
      24             :    parser generator using the skeleton or a modified version thereof
      25             :    as a parser skeleton.  Alternatively, if you modify or redistribute
      26             :    the parser skeleton itself, you may (at your option) remove this
      27             :    special exception, which will cause the skeleton and the resulting
      28             :    Bison output files to be licensed under the GNU General Public
      29             :    License without this special exception.
      30             : 
      31             :    This special exception was added by the Free Software Foundation in
      32             :    version 2.2 of Bison.  */
      33             : 
      34             : /* C LALR(1) parser skeleton written by Richard Stallman, by
      35             :    simplifying the original so-called "semantic" parser.  */
      36             : 
      37             : /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
      38             :    especially those whose name start with YY_ or yy_.  They are
      39             :    private implementation details that can be changed or removed.  */
      40             : 
      41             : /* All symbols defined below should begin with yy or YY, to avoid
      42             :    infringing on user name space.  This should be done even for local
      43             :    variables, as they might otherwise be expanded by user macros.
      44             :    There are some unavoidable exceptions within include files to
      45             :    define necessary library symbols; they are noted "INFRINGES ON
      46             :    USER NAME SPACE" below.  */
      47             : 
      48             : /* Identify Bison output, and Bison version.  */
      49             : #define YYBISON 30802
      50             : 
      51             : /* Bison version string.  */
      52             : #define YYBISON_VERSION "3.8.2"
      53             : 
      54             : /* Skeleton name.  */
      55             : #define YYSKELETON_NAME "yacc.c"
      56             : 
      57             : /* Pure parsers.  */
      58             : #define YYPURE 1
      59             : 
      60             : /* Push parsers.  */
      61             : #define YYPUSH 0
      62             : 
      63             : /* Pull parsers.  */
      64             : #define YYPULL 1
      65             : 
      66             : 
      67             : 
      68             : 
      69             : /* First part of user prologue.  */
      70             : 
      71             : 
      72             : #include "includes.h"
      73             : #include "libcli/wsp/wsp_aqs.h"
      74             : #include "libcli/wsp/wsp_aqs_parser.tab.h"
      75             : #include "libcli/wsp/wsp_aqs_lexer.h"
      76             : 
      77           0 : static int yyerror(t_select_stmt **stmt, yyscan_t scanner, const char *msg)
      78             : {
      79           0 :         fprintf(stderr,"Error :%s\n",msg); return 0;
      80             : }
      81             : 
      82             : 
      83             : # ifndef YY_CAST
      84             : #  ifdef __cplusplus
      85             : #   define YY_CAST(Type, Val) static_cast<Type> (Val)
      86             : #   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
      87             : #  else
      88             : #   define YY_CAST(Type, Val) ((Type) (Val))
      89             : #   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
      90             : #  endif
      91             : # endif
      92             : # ifndef YY_NULLPTR
      93             : #  if defined __cplusplus
      94             : #   if 201103L <= __cplusplus
      95             : #    define YY_NULLPTR nullptr
      96             : #   else
      97             : #    define YY_NULLPTR 0
      98             : #   endif
      99             : #  else
     100             : #   define YY_NULLPTR ((void*)0)
     101             : #  endif
     102             : # endif
     103             : 
     104             : #include "wsp_aqs_parser.tab.h"
     105             : /* Symbol kind.  */
     106             : enum yysymbol_kind_t
     107             : {
     108             :   YYSYMBOL_YYEMPTY = -2,
     109             :   YYSYMBOL_YYEOF = 0,                      /* "end of file"  */
     110             :   YYSYMBOL_YYerror = 1,                    /* error  */
     111             :   YYSYMBOL_YYUNDEF = 2,                    /* "invalid token"  */
     112             :   YYSYMBOL_3_AND_ = 3,                     /* "AND"  */
     113             :   YYSYMBOL_4_OR_ = 4,                      /* "OR"  */
     114             :   YYSYMBOL_5_ = 5,                         /* "!="  */
     115             :   YYSYMBOL_TOKEN_NE = 6,                   /* TOKEN_NE  */
     116             :   YYSYMBOL_7_ = 7,                         /* ">="  */
     117             :   YYSYMBOL_TOKEN_GE = 8,                   /* TOKEN_GE  */
     118             :   YYSYMBOL_9_ = 9,                         /* "<="  */
     119             :   YYSYMBOL_TOKEN_LE = 10,                  /* TOKEN_LE  */
     120             :   YYSYMBOL_11_ = 11,                       /* "<"  */
     121             :   YYSYMBOL_TOKEN_LT = 12,                  /* TOKEN_LT  */
     122             :   YYSYMBOL_13_ = 13,                       /* ">"  */
     123             :   YYSYMBOL_TOKEN_GT = 14,                  /* TOKEN_GT  */
     124             :   YYSYMBOL_15_NOT_ = 15,                   /* "NOT"  */
     125             :   YYSYMBOL_TOKEN_NOT = 16,                 /* TOKEN_NOT  */
     126             :   YYSYMBOL_17_ = 17,                       /* "=="  */
     127             :   YYSYMBOL_TOKEN_EQ = 18,                  /* TOKEN_EQ  */
     128             :   YYSYMBOL_19_ = 19,                       /* ":"  */
     129             :   YYSYMBOL_TOKEN_PROP_EQUALS = 20,         /* TOKEN_PROP_EQUALS  */
     130             :   YYSYMBOL_21_ = 21,                       /* "$<"  */
     131             :   YYSYMBOL_22_ = 22,                       /* "$="  */
     132             :   YYSYMBOL_TOKEN_LPAREN = 23,              /* TOKEN_LPAREN  */
     133             :   YYSYMBOL_TOKEN_RPAREN = 24,              /* TOKEN_RPAREN  */
     134             :   YYSYMBOL_TOKEN_AND = 25,                 /* TOKEN_AND  */
     135             :   YYSYMBOL_TOKEN_OR = 26,                  /* TOKEN_OR  */
     136             :   YYSYMBOL_TOKEN_WHERE = 27,               /* TOKEN_WHERE  */
     137             :   YYSYMBOL_TOKEN_SELECT = 28,              /* TOKEN_SELECT  */
     138             :   YYSYMBOL_TOKEN_TRUE = 29,                /* TOKEN_TRUE  */
     139             :   YYSYMBOL_TOKEN_FALSE = 30,               /* TOKEN_FALSE  */
     140             :   YYSYMBOL_TOKEN_COMMA = 31,               /* TOKEN_COMMA  */
     141             :   YYSYMBOL_TOKEN_STARTS_WITH = 32,         /* TOKEN_STARTS_WITH  */
     142             :   YYSYMBOL_TOKEN_EQUALS = 33,              /* TOKEN_EQUALS  */
     143             :   YYSYMBOL_TOKEN_MATCHES = 34,             /* TOKEN_MATCHES  */
     144             :   YYSYMBOL_TOKEN_K = 35,                   /* TOKEN_K  */
     145             :   YYSYMBOL_TOKEN_M = 36,                   /* TOKEN_M  */
     146             :   YYSYMBOL_TOKEN_G = 37,                   /* TOKEN_G  */
     147             :   YYSYMBOL_TOKEN_T = 38,                   /* TOKEN_T  */
     148             :   YYSYMBOL_TOKEN_KB = 39,                  /* TOKEN_KB  */
     149             :   YYSYMBOL_TOKEN_MB = 40,                  /* TOKEN_MB  */
     150             :   YYSYMBOL_TOKEN_GB = 41,                  /* TOKEN_GB  */
     151             :   YYSYMBOL_TOKEN_TB = 42,                  /* TOKEN_TB  */
     152             :   YYSYMBOL_TOKEN_RANGE = 43,               /* TOKEN_RANGE  */
     153             :   YYSYMBOL_TOKEN_TODAY = 44,               /* TOKEN_TODAY  */
     154             :   YYSYMBOL_TOKEN_YESTERDAY = 45,           /* TOKEN_YESTERDAY  */
     155             :   YYSYMBOL_TOKEN_THISWEEK = 46,            /* TOKEN_THISWEEK  */
     156             :   YYSYMBOL_TOKEN_LASTWEEK = 47,            /* TOKEN_LASTWEEK  */
     157             :   YYSYMBOL_TOKEN_THISMONTH = 48,           /* TOKEN_THISMONTH  */
     158             :   YYSYMBOL_TOKEN_LASTMONTH = 49,           /* TOKEN_LASTMONTH  */
     159             :   YYSYMBOL_TOKEN_THISYEAR = 50,            /* TOKEN_THISYEAR  */
     160             :   YYSYMBOL_TOKEN_LASTYEAR = 51,            /* TOKEN_LASTYEAR  */
     161             :   YYSYMBOL_TOKEN_EMPTY = 52,               /* TOKEN_EMPTY  */
     162             :   YYSYMBOL_TOKEN_TINY = 53,                /* TOKEN_TINY  */
     163             :   YYSYMBOL_TOKEN_SMALL = 54,               /* TOKEN_SMALL  */
     164             :   YYSYMBOL_TOKEN_MEDIUM = 55,              /* TOKEN_MEDIUM  */
     165             :   YYSYMBOL_TOKEN_LARGE = 56,               /* TOKEN_LARGE  */
     166             :   YYSYMBOL_TOKEN_HUGE = 57,                /* TOKEN_HUGE  */
     167             :   YYSYMBOL_TOKEN_GIGANTIC = 58,            /* TOKEN_GIGANTIC  */
     168             :   YYSYMBOL_TOKEN_NUMBER = 59,              /* TOKEN_NUMBER  */
     169             :   YYSYMBOL_TOKEN_IDENTIFIER = 60,          /* TOKEN_IDENTIFIER  */
     170             :   YYSYMBOL_TOKEN_STRING_LITERAL = 61,      /* TOKEN_STRING_LITERAL  */
     171             :   YYSYMBOL_YYACCEPT = 62,                  /* $accept  */
     172             :   YYSYMBOL_input = 63,                     /* input  */
     173             :   YYSYMBOL_select_stmt = 64,               /* select_stmt  */
     174             :   YYSYMBOL_cols = 65,                      /* cols  */
     175             :   YYSYMBOL_col = 66,                       /* col  */
     176             :   YYSYMBOL_query = 67,                     /* query  */
     177             :   YYSYMBOL_basic_query = 68,               /* basic_query  */
     178             :   YYSYMBOL_prop = 69,                      /* prop  */
     179             :   YYSYMBOL_basic_restr = 70,               /* basic_restr  */
     180             :   YYSYMBOL_property_op = 71,               /* property_op  */
     181             :   YYSYMBOL_content_op = 72,                /* content_op  */
     182             :   YYSYMBOL_value = 73,                     /* value  */
     183             :   YYSYMBOL_date_shortcut = 74,             /* date_shortcut  */
     184             :   YYSYMBOL_size_shortcut = 75,             /* size_shortcut  */
     185             :   YYSYMBOL_simple_value = 76,              /* simple_value  */
     186             :   YYSYMBOL_restr = 77                      /* restr  */
     187             : };
     188             : typedef enum yysymbol_kind_t yysymbol_kind_t;
     189             : 
     190             : 
     191             : 
     192             : 
     193             : #ifdef short
     194             : # undef short
     195             : #endif
     196             : 
     197             : /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
     198             :    <limits.h> and (if available) <stdint.h> are included
     199             :    so that the code can choose integer types of a good width.  */
     200             : 
     201             : #ifndef __PTRDIFF_MAX__
     202             : # include <limits.h> /* INFRINGES ON USER NAME SPACE */
     203             : # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
     204             : #  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
     205             : #  define YY_STDINT_H
     206             : # endif
     207             : #endif
     208             : 
     209             : /* Narrow types that promote to a signed type and that can represent a
     210             :    signed or unsigned integer of at least N bits.  In tables they can
     211             :    save space and decrease cache pressure.  Promoting to a signed type
     212             :    helps avoid bugs in integer arithmetic.  */
     213             : 
     214             : #ifdef __INT_LEAST8_MAX__
     215             : typedef __INT_LEAST8_TYPE__ yytype_int8;
     216             : #elif defined YY_STDINT_H
     217             : typedef int_least8_t yytype_int8;
     218             : #else
     219             : typedef signed char yytype_int8;
     220             : #endif
     221             : 
     222             : #ifdef __INT_LEAST16_MAX__
     223             : typedef __INT_LEAST16_TYPE__ yytype_int16;
     224             : #elif defined YY_STDINT_H
     225             : typedef int_least16_t yytype_int16;
     226             : #else
     227             : typedef short yytype_int16;
     228             : #endif
     229             : 
     230             : /* Work around bug in HP-UX 11.23, which defines these macros
     231             :    incorrectly for preprocessor constants.  This workaround can likely
     232             :    be removed in 2023, as HPE has promised support for HP-UX 11.23
     233             :    (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
     234             :    <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>.  */
     235             : #ifdef __hpux
     236             : # undef UINT_LEAST8_MAX
     237             : # undef UINT_LEAST16_MAX
     238             : # define UINT_LEAST8_MAX 255
     239             : # define UINT_LEAST16_MAX 65535
     240             : #endif
     241             : 
     242             : #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
     243             : typedef __UINT_LEAST8_TYPE__ yytype_uint8;
     244             : #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
     245             :        && UINT_LEAST8_MAX <= INT_MAX)
     246             : typedef uint_least8_t yytype_uint8;
     247             : #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
     248             : typedef unsigned char yytype_uint8;
     249             : #else
     250             : typedef short yytype_uint8;
     251             : #endif
     252             : 
     253             : #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
     254             : typedef __UINT_LEAST16_TYPE__ yytype_uint16;
     255             : #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
     256             :        && UINT_LEAST16_MAX <= INT_MAX)
     257             : typedef uint_least16_t yytype_uint16;
     258             : #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
     259             : typedef unsigned short yytype_uint16;
     260             : #else
     261             : typedef int yytype_uint16;
     262             : #endif
     263             : 
     264             : #ifndef YYPTRDIFF_T
     265             : # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
     266             : #  define YYPTRDIFF_T __PTRDIFF_TYPE__
     267             : #  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
     268             : # elif defined PTRDIFF_MAX
     269             : #  ifndef ptrdiff_t
     270             : #   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
     271             : #  endif
     272             : #  define YYPTRDIFF_T ptrdiff_t
     273             : #  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
     274             : # else
     275             : #  define YYPTRDIFF_T long
     276             : #  define YYPTRDIFF_MAXIMUM LONG_MAX
     277             : # endif
     278             : #endif
     279             : 
     280             : #ifndef YYSIZE_T
     281             : # ifdef __SIZE_TYPE__
     282             : #  define YYSIZE_T __SIZE_TYPE__
     283             : # elif defined size_t
     284             : #  define YYSIZE_T size_t
     285             : # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
     286             : #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
     287             : #  define YYSIZE_T size_t
     288             : # else
     289             : #  define YYSIZE_T unsigned
     290             : # endif
     291             : #endif
     292             : 
     293             : #define YYSIZE_MAXIMUM                                  \
     294             :   YY_CAST (YYPTRDIFF_T,                                 \
     295             :            (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
     296             :             ? YYPTRDIFF_MAXIMUM                         \
     297             :             : YY_CAST (YYSIZE_T, -1)))
     298             : 
     299             : #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
     300             : 
     301             : 
     302             : /* Stored state numbers (used for stacks). */
     303             : typedef yytype_int8 yy_state_t;
     304             : 
     305             : /* State numbers in computations.  */
     306             : typedef int yy_state_fast_t;
     307             : 
     308             : #ifndef YY_
     309             : # if defined YYENABLE_NLS && YYENABLE_NLS
     310             : #  if ENABLE_NLS
     311             : #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
     312             : #   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
     313             : #  endif
     314             : # endif
     315             : # ifndef YY_
     316             : #  define YY_(Msgid) Msgid
     317             : # endif
     318             : #endif
     319             : 
     320             : 
     321             : #ifndef YY_ATTRIBUTE_PURE
     322             : # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
     323             : #  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
     324             : # else
     325             : #  define YY_ATTRIBUTE_PURE
     326             : # endif
     327             : #endif
     328             : 
     329             : #ifndef YY_ATTRIBUTE_UNUSED
     330             : # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
     331             : #  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
     332             : # else
     333             : #  define YY_ATTRIBUTE_UNUSED
     334             : # endif
     335             : #endif
     336             : 
     337             : /* Suppress unused-variable warnings by "using" E.  */
     338             : #if ! defined lint || defined __GNUC__
     339             : # define YY_USE(E) ((void) (E))
     340             : #else
     341             : # define YY_USE(E) /* empty */
     342             : #endif
     343             : 
     344             : /* Suppress an incorrect diagnostic about yylval being uninitialized.  */
     345             : #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
     346             : # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
     347             : #  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
     348             :     _Pragma ("GCC diagnostic push")                                     \
     349             :     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
     350             : # else
     351             : #  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
     352             :     _Pragma ("GCC diagnostic push")                                     \
     353             :     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
     354             :     _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
     355             : # endif
     356             : # define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
     357             :     _Pragma ("GCC diagnostic pop")
     358             : #else
     359             : # define YY_INITIAL_VALUE(Value) Value
     360             : #endif
     361             : #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
     362             : # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
     363             : # define YY_IGNORE_MAYBE_UNINITIALIZED_END
     364             : #endif
     365             : #ifndef YY_INITIAL_VALUE
     366             : # define YY_INITIAL_VALUE(Value) /* Nothing. */
     367             : #endif
     368             : 
     369             : #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
     370             : # define YY_IGNORE_USELESS_CAST_BEGIN                          \
     371             :     _Pragma ("GCC diagnostic push")                            \
     372             :     _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
     373             : # define YY_IGNORE_USELESS_CAST_END            \
     374             :     _Pragma ("GCC diagnostic pop")
     375             : #endif
     376             : #ifndef YY_IGNORE_USELESS_CAST_BEGIN
     377             : # define YY_IGNORE_USELESS_CAST_BEGIN
     378             : # define YY_IGNORE_USELESS_CAST_END
     379             : #endif
     380             : 
     381             : 
     382             : #define YY_ASSERT(E) ((void) (0 && (E)))
     383             : 
     384             : #if !defined yyoverflow
     385             : 
     386             : /* The parser invokes alloca or malloc; define the necessary symbols.  */
     387             : 
     388             : # ifdef YYSTACK_USE_ALLOCA
     389             : #  if YYSTACK_USE_ALLOCA
     390             : #   ifdef __GNUC__
     391             : #    define YYSTACK_ALLOC __builtin_alloca
     392             : #   elif defined __BUILTIN_VA_ARG_INCR
     393             : #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
     394             : #   elif defined _AIX
     395             : #    define YYSTACK_ALLOC __alloca
     396             : #   elif defined _MSC_VER
     397             : #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
     398             : #    define alloca _alloca
     399             : #   else
     400             : #    define YYSTACK_ALLOC alloca
     401             : #    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
     402             : #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
     403             :       /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
     404             : #     ifndef EXIT_SUCCESS
     405             : #      define EXIT_SUCCESS 0
     406             : #     endif
     407             : #    endif
     408             : #   endif
     409             : #  endif
     410             : # endif
     411             : 
     412             : # ifdef YYSTACK_ALLOC
     413             :    /* Pacify GCC's 'empty if-body' warning.  */
     414             : #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
     415             : #  ifndef YYSTACK_ALLOC_MAXIMUM
     416             :     /* The OS might guarantee only one guard page at the bottom of the stack,
     417             :        and a page size can be as small as 4096 bytes.  So we cannot safely
     418             :        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
     419             :        to allow for a few compiler-allocated temporary stack slots.  */
     420             : #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
     421             : #  endif
     422             : # else
     423             : #  define YYSTACK_ALLOC YYMALLOC
     424             : #  define YYSTACK_FREE YYFREE
     425             : #  ifndef YYSTACK_ALLOC_MAXIMUM
     426             : #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
     427             : #  endif
     428             : #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
     429             :        && ! ((defined YYMALLOC || defined malloc) \
     430             :              && (defined YYFREE || defined free)))
     431             : #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
     432             : #   ifndef EXIT_SUCCESS
     433             : #    define EXIT_SUCCESS 0
     434             : #   endif
     435             : #  endif
     436             : #  ifndef YYMALLOC
     437             : #   define YYMALLOC malloc
     438             : #   if ! defined malloc && ! defined EXIT_SUCCESS
     439             : void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
     440             : #   endif
     441             : #  endif
     442             : #  ifndef YYFREE
     443             : #   define YYFREE free
     444             : #   if ! defined free && ! defined EXIT_SUCCESS
     445             : void free (void *); /* INFRINGES ON USER NAME SPACE */
     446             : #   endif
     447             : #  endif
     448             : # endif
     449             : #endif /* !defined yyoverflow */
     450             : 
     451             : #if (! defined yyoverflow \
     452             :      && (! defined __cplusplus \
     453             :          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
     454             : 
     455             : /* A type that is properly aligned for any stack member.  */
     456             : union yyalloc
     457             : {
     458             :   yy_state_t yyss_alloc;
     459             :   YYSTYPE yyvs_alloc;
     460             : };
     461             : 
     462             : /* The size of the maximum gap between one aligned stack and the next.  */
     463             : # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
     464             : 
     465             : /* The size of an array large to enough to hold all stacks, each with
     466             :    N elements.  */
     467             : # define YYSTACK_BYTES(N) \
     468             :      ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
     469             :       + YYSTACK_GAP_MAXIMUM)
     470             : 
     471             : # define YYCOPY_NEEDED 1
     472             : 
     473             : /* Relocate STACK from its old location to the new one.  The
     474             :    local variables YYSIZE and YYSTACKSIZE give the old and new number of
     475             :    elements in the stack, and YYPTR gives the new location of the
     476             :    stack.  Advance YYPTR to a properly aligned location for the next
     477             :    stack.  */
     478             : # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
     479             :     do                                                                  \
     480             :       {                                                                 \
     481             :         YYPTRDIFF_T yynewbytes;                                         \
     482             :         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
     483             :         Stack = &yyptr->Stack_alloc;                                    \
     484             :         yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
     485             :         yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
     486             :       }                                                                 \
     487             :     while (0)
     488             : 
     489             : #endif
     490             : 
     491             : #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
     492             : /* Copy COUNT objects from SRC to DST.  The source and destination do
     493             :    not overlap.  */
     494             : # ifndef YYCOPY
     495             : #  if defined __GNUC__ && 1 < __GNUC__
     496             : #   define YYCOPY(Dst, Src, Count) \
     497             :       __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
     498             : #  else
     499             : #   define YYCOPY(Dst, Src, Count)              \
     500             :       do                                        \
     501             :         {                                       \
     502             :           YYPTRDIFF_T yyi;                      \
     503             :           for (yyi = 0; yyi < (Count); yyi++)   \
     504             :             (Dst)[yyi] = (Src)[yyi];            \
     505             :         }                                       \
     506             :       while (0)
     507             : #  endif
     508             : # endif
     509             : #endif /* !YYCOPY_NEEDED */
     510             : 
     511             : /* YYFINAL -- State number of the termination state.  */
     512             : #define YYFINAL  15
     513             : /* YYLAST -- Last index in YYTABLE.  */
     514             : #define YYLAST   96
     515             : 
     516             : /* YYNTOKENS -- Number of terminals.  */
     517             : #define YYNTOKENS  62
     518             : /* YYNNTS -- Number of nonterminals.  */
     519             : #define YYNNTS  16
     520             : /* YYNRULES -- Number of rules.  */
     521             : #define YYNRULES  61
     522             : /* YYNSTATES -- Number of states.  */
     523             : #define YYNSTATES  81
     524             : 
     525             : /* YYMAXUTOK -- Last valid token kind.  */
     526             : #define YYMAXUTOK   316
     527             : 
     528             : 
     529             : /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
     530             :    as returned by yylex, with out-of-bounds checking.  */
     531             : #define YYTRANSLATE(YYX)                                \
     532             :   (0 <= (YYX) && (YYX) <= YYMAXUTOK                     \
     533             :    ? YY_CAST (yysymbol_kind_t, yytranslate[YYX])        \
     534             :    : YYSYMBOL_YYUNDEF)
     535             : 
     536             : /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
     537             :    as returned by yylex.  */
     538             : static const yytype_int8 yytranslate[] =
     539             : {
     540             :        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     541             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     542             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     543             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     544             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     545             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     546             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     547             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     548             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     549             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     550             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     551             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     552             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     553             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     554             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     555             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     556             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     557             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     558             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     559             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     560             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     561             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     562             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     563             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     564             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     565             :        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
     566             :        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
     567             :       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
     568             :       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
     569             :       35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
     570             :       45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
     571             :       55,    56,    57,    58,    59,    60,    61
     572             : };
     573             : 
     574             : #if YYDEBUG
     575             : /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
     576             : static const yytype_int16 yyrline[] =
     577             : {
     578             :        0,   137,   137,   143,   149,   158,   164,   173,   182,   188,
     579             :      194,   200,   206,   215,   223,   232,   238,   244,   250,   262,
     580             :      263,   264,   265,   266,   267,   271,   272,   276,   277,   283,
     581             :      289,   298,   299,   300,   301,   302,   303,   304,   305,   309,
     582             :      310,   311,   312,   313,   314,   315,   319,   325,   331,   337,
     583             :      343,   350,   356,   362,   368,   375,   381,   387,   395,   403,
     584             :      409,   415
     585             : };
     586             : #endif
     587             : 
     588             : /** Accessing symbol of state STATE.  */
     589             : #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
     590             : 
     591             : #if YYDEBUG || 0
     592             : /* The user-facing name of the symbol whose (internal) number is
     593             :    YYSYMBOL.  No bounds checking.  */
     594             : static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
     595             : 
     596             : /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
     597             :    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
     598             : static const char *const yytname[] =
     599             : {
     600             :   "\"end of file\"", "error", "\"invalid token\"", "\"AND\"", "\"OR\"",
     601             :   "\"!=\"", "TOKEN_NE", "\">=\"", "TOKEN_GE", "\"<=\"", "TOKEN_LE",
     602             :   "\"<\"", "TOKEN_LT", "\">\"", "TOKEN_GT", "\"NOT\"", "TOKEN_NOT",
     603             :   "\"==\"", "TOKEN_EQ", "\":\"", "TOKEN_PROP_EQUALS", "\"$<\"", "\"$=\"",
     604             :   "TOKEN_LPAREN", "TOKEN_RPAREN", "TOKEN_AND", "TOKEN_OR", "TOKEN_WHERE",
     605             :   "TOKEN_SELECT", "TOKEN_TRUE", "TOKEN_FALSE", "TOKEN_COMMA",
     606             :   "TOKEN_STARTS_WITH", "TOKEN_EQUALS", "TOKEN_MATCHES", "TOKEN_K",
     607             :   "TOKEN_M", "TOKEN_G", "TOKEN_T", "TOKEN_KB", "TOKEN_MB", "TOKEN_GB",
     608             :   "TOKEN_TB", "TOKEN_RANGE", "TOKEN_TODAY", "TOKEN_YESTERDAY",
     609             :   "TOKEN_THISWEEK", "TOKEN_LASTWEEK", "TOKEN_THISMONTH", "TOKEN_LASTMONTH",
     610             :   "TOKEN_THISYEAR", "TOKEN_LASTYEAR", "TOKEN_EMPTY", "TOKEN_TINY",
     611             :   "TOKEN_SMALL", "TOKEN_MEDIUM", "TOKEN_LARGE", "TOKEN_HUGE",
     612             :   "TOKEN_GIGANTIC", "TOKEN_NUMBER", "TOKEN_IDENTIFIER",
     613             :   "TOKEN_STRING_LITERAL", "$accept", "input", "select_stmt", "cols", "col",
     614             :   "query", "basic_query", "prop", "basic_restr", "property_op",
     615             :   "content_op", "value", "date_shortcut", "size_shortcut", "simple_value",
     616             :   "restr", YY_NULLPTR
     617             : };
     618             : 
     619             : static const char *
     620             : yysymbol_name (yysymbol_kind_t yysymbol)
     621             : {
     622             :   return yytname[yysymbol];
     623             : }
     624             : #endif
     625             : 
     626             : #define YYPACT_NINF (-60)
     627             : 
     628             : #define yypact_value_is_default(Yyn) \
     629             :   ((Yyn) == YYPACT_NINF)
     630             : 
     631             : #define YYTABLE_NINF (-1)
     632             : 
     633             : #define yytable_value_is_error(Yyn) \
     634             :   0
     635             : 
     636             : /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
     637             :    STATE-NUM.  */
     638             : static const yytype_int8 yypact[] =
     639             : {
     640             :       -3,    -2,    -2,   -59,   -60,     3,   -60,   -10,   -60,   -13,
     641             :      -60,   -15,   -60,   -22,    -9,   -60,    -2,    -2,    -6,   -60,
     642             :       -2,   -59,    66,   -60,   -60,   -60,   -60,   -60,   -60,   -60,
     643             :       -6,   -60,   -60,   -60,   -60,   -60,   -60,   -60,   -60,   -60,
     644             :      -60,   -60,   -60,   -60,   -60,   -60,   -60,   -60,   -60,   -60,
     645             :       29,   -60,   -60,   -60,    30,    30,   -60,   -60,   -60,    13,
     646             :      -10,   -60,   -60,     4,   -60,   -60,   -60,   -60,   -60,   -60,
     647             :      -60,   -60,   -60,   -60,     2,   -60,    -6,    -6,   -60,    67,
     648             :      -60
     649             : };
     650             : 
     651             : /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
     652             :    Performed when YYTABLE does not specify something else to do.  Zero
     653             :    means the default is an error.  */
     654             : static const yytype_int8 yydefact[] =
     655             : {
     656             :        0,     0,     0,     0,    14,     0,     2,     4,     8,     0,
     657             :       12,     0,     7,     0,     5,     1,     0,     0,     0,     9,
     658             :        0,     0,    10,    11,    20,    21,    22,    23,    24,    19,
     659             :        0,    55,    56,    25,    26,    31,    32,    33,    34,    35,
     660             :       36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
     661             :       46,    58,    57,    13,     0,     0,    15,    29,    30,    27,
     662             :        3,     6,    59,     0,    47,    48,    49,    50,    51,    52,
     663             :       53,    54,    16,    17,     0,    18,     0,     0,    28,    60,
     664             :       61
     665             : };
     666             : 
     667             : /* YYPGOTO[NTERM-NUM].  */
     668             : static const yytype_int8 yypgoto[] =
     669             : {
     670             :      -60,   -60,   -60,    73,   -60,    17,   -60,   -60,    77,   -60,
     671             :      -60,   -19,   -60,   -60,    22,    -4
     672             : };
     673             : 
     674             : /* YYDEFGOTO[NTERM-NUM].  */
     675             : static const yytype_int8 yydefgoto[] =
     676             : {
     677             :        0,     5,     6,    13,    14,     7,     8,     9,    62,    54,
     678             :       55,    56,    57,    58,    59,    63
     679             : };
     680             : 
     681             : /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
     682             :    positive, shift that token.  If negative, reduce the rule whose
     683             :    number is the opposite.  If YYTABLE_NINF, syntax error.  */
     684             : static const yytype_int8 yytable[] =
     685             : {
     686             :       24,    12,    25,    15,    26,    20,    27,    18,    28,    19,
     687             :       16,    17,    29,     1,     1,    16,    17,    30,    10,    11,
     688             :        2,     2,    21,    31,    32,     3,    33,    34,    75,    76,
     689             :       77,    31,    32,    22,    23,    72,    73,    60,    35,    36,
     690             :       37,    38,    39,    40,    41,    42,    43,    44,    45,    46,
     691             :       47,    48,    49,    50,    51,    52,    74,     4,     4,    31,
     692             :       32,    50,    51,    52,    64,    65,    66,    67,    68,    69,
     693             :       70,    71,    79,    80,    35,    36,    37,    38,    39,    40,
     694             :       41,    42,    43,    44,    45,    46,    47,    48,    49,    50,
     695             :       51,    52,    17,    77,    61,    53,    78
     696             : };
     697             : 
     698             : static const yytype_int8 yycheck[] =
     699             : {
     700             :        6,    60,     8,     0,    10,    27,    12,    20,    14,    24,
     701             :       25,    26,    18,    16,    16,    25,    26,    23,     1,     2,
     702             :       23,    23,    31,    29,    30,    28,    32,    33,    24,    25,
     703             :       26,    29,    30,    16,    17,    54,    55,    20,    44,    45,
     704             :       46,    47,    48,    49,    50,    51,    52,    53,    54,    55,
     705             :       56,    57,    58,    59,    60,    61,    43,    60,    60,    29,
     706             :       30,    59,    60,    61,    35,    36,    37,    38,    39,    40,
     707             :       41,    42,    76,    77,    44,    45,    46,    47,    48,    49,
     708             :       50,    51,    52,    53,    54,    55,    56,    57,    58,    59,
     709             :       60,    61,    26,    26,    21,    18,    74
     710             : };
     711             : 
     712             : /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
     713             :    state STATE-NUM.  */
     714             : static const yytype_int8 yystos[] =
     715             : {
     716             :        0,    16,    23,    28,    60,    63,    64,    67,    68,    69,
     717             :       67,    67,    60,    65,    66,     0,    25,    26,    20,    24,
     718             :       27,    31,    67,    67,     6,     8,    10,    12,    14,    18,
     719             :       23,    29,    30,    32,    33,    44,    45,    46,    47,    48,
     720             :       49,    50,    51,    52,    53,    54,    55,    56,    57,    58,
     721             :       59,    60,    61,    70,    71,    72,    73,    74,    75,    76,
     722             :       67,    65,    70,    77,    35,    36,    37,    38,    39,    40,
     723             :       41,    42,    73,    73,    43,    24,    25,    26,    76,    77,
     724             :       77
     725             : };
     726             : 
     727             : /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.  */
     728             : static const yytype_int8 yyr1[] =
     729             : {
     730             :        0,    62,    63,    64,    64,    65,    65,    66,    67,    67,
     731             :       67,    67,    67,    68,    69,    70,    70,    70,    70,    71,
     732             :       71,    71,    71,    71,    71,    72,    72,    73,    73,    73,
     733             :       73,    74,    74,    74,    74,    74,    74,    74,    74,    75,
     734             :       75,    75,    75,    75,    75,    75,    76,    76,    76,    76,
     735             :       76,    76,    76,    76,    76,    76,    76,    76,    76,    77,
     736             :       77,    77
     737             : };
     738             : 
     739             : /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.  */
     740             : static const yytype_int8 yyr2[] =
     741             : {
     742             :        0,     2,     1,     4,     1,     1,     3,     1,     1,     3,
     743             :        3,     3,     2,     3,     1,     1,     2,     2,     3,     1,
     744             :        1,     1,     1,     1,     1,     1,     1,     1,     3,     1,
     745             :        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
     746             :        1,     1,     1,     1,     1,     1,     1,     2,     2,     2,
     747             :        2,     2,     2,     2,     2,     1,     1,     1,     1,     1,
     748             :        3,     3
     749             : };
     750             : 
     751             : 
     752             : enum { YYENOMEM = -2 };
     753             : 
     754             : #define yyerrok         (yyerrstatus = 0)
     755             : #define yyclearin       (yychar = YYEMPTY)
     756             : 
     757             : #define YYACCEPT        goto yyacceptlab
     758             : #define YYABORT         goto yyabortlab
     759             : #define YYERROR         goto yyerrorlab
     760             : #define YYNOMEM         goto yyexhaustedlab
     761             : 
     762             : 
     763             : #define YYRECOVERING()  (!!yyerrstatus)
     764             : 
     765             : #define YYBACKUP(Token, Value)                                    \
     766             :   do                                                              \
     767             :     if (yychar == YYEMPTY)                                        \
     768             :       {                                                           \
     769             :         yychar = (Token);                                         \
     770             :         yylval = (Value);                                         \
     771             :         YYPOPSTACK (yylen);                                       \
     772             :         yystate = *yyssp;                                         \
     773             :         goto yybackup;                                            \
     774             :       }                                                           \
     775             :     else                                                          \
     776             :       {                                                           \
     777             :         yyerror (select, scanner, YY_("syntax error: cannot back up")); \
     778             :         YYERROR;                                                  \
     779             :       }                                                           \
     780             :   while (0)
     781             : 
     782             : /* Backward compatibility with an undocumented macro.
     783             :    Use YYerror or YYUNDEF. */
     784             : #define YYERRCODE YYUNDEF
     785             : 
     786             : 
     787             : /* Enable debugging if requested.  */
     788             : #if YYDEBUG
     789             : 
     790             : # ifndef YYFPRINTF
     791             : #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
     792             : #  define YYFPRINTF fprintf
     793             : # endif
     794             : 
     795             : # define YYDPRINTF(Args)                        \
     796             : do {                                            \
     797             :   if (yydebug)                                  \
     798             :     YYFPRINTF Args;                             \
     799             : } while (0)
     800             : 
     801             : 
     802             : 
     803             : 
     804             : # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
     805             : do {                                                                      \
     806             :   if (yydebug)                                                            \
     807             :     {                                                                     \
     808             :       YYFPRINTF (stderr, "%s ", Title);                                   \
     809             :       yy_symbol_print (stderr,                                            \
     810             :                   Kind, Value, select, scanner); \
     811             :       YYFPRINTF (stderr, "\n");                                           \
     812             :     }                                                                     \
     813             : } while (0)
     814             : 
     815             : 
     816             : /*-----------------------------------.
     817             : | Print this symbol's value on YYO.  |
     818             : `-----------------------------------*/
     819             : 
     820             : static void
     821             : yy_symbol_value_print (FILE *yyo,
     822             :                        yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, t_select_stmt **select, yyscan_t scanner)
     823             : {
     824             :   FILE *yyoutput = yyo;
     825             :   YY_USE (yyoutput);
     826             :   YY_USE (select);
     827             :   YY_USE (scanner);
     828             :   if (!yyvaluep)
     829             :     return;
     830             :   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
     831             :   YY_USE (yykind);
     832             :   YY_IGNORE_MAYBE_UNINITIALIZED_END
     833             : }
     834             : 
     835             : 
     836             : /*---------------------------.
     837             : | Print this symbol on YYO.  |
     838             : `---------------------------*/
     839             : 
     840             : static void
     841             : yy_symbol_print (FILE *yyo,
     842             :                  yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, t_select_stmt **select, yyscan_t scanner)
     843             : {
     844             :   YYFPRINTF (yyo, "%s %s (",
     845             :              yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
     846             : 
     847             :   yy_symbol_value_print (yyo, yykind, yyvaluep, select, scanner);
     848             :   YYFPRINTF (yyo, ")");
     849             : }
     850             : 
     851             : /*------------------------------------------------------------------.
     852             : | yy_stack_print -- Print the state stack from its BOTTOM up to its |
     853             : | TOP (included).                                                   |
     854             : `------------------------------------------------------------------*/
     855             : 
     856             : static void
     857             : yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
     858             : {
     859             :   YYFPRINTF (stderr, "Stack now");
     860             :   for (; yybottom <= yytop; yybottom++)
     861             :     {
     862             :       int yybot = *yybottom;
     863             :       YYFPRINTF (stderr, " %d", yybot);
     864             :     }
     865             :   YYFPRINTF (stderr, "\n");
     866             : }
     867             : 
     868             : # define YY_STACK_PRINT(Bottom, Top)                            \
     869             : do {                                                            \
     870             :   if (yydebug)                                                  \
     871             :     yy_stack_print ((Bottom), (Top));                           \
     872             : } while (0)
     873             : 
     874             : 
     875             : /*------------------------------------------------.
     876             : | Report that the YYRULE is going to be reduced.  |
     877             : `------------------------------------------------*/
     878             : 
     879             : static void
     880             : yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
     881             :                  int yyrule, t_select_stmt **select, yyscan_t scanner)
     882             : {
     883             :   int yylno = yyrline[yyrule];
     884             :   int yynrhs = yyr2[yyrule];
     885             :   int yyi;
     886             :   YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
     887             :              yyrule - 1, yylno);
     888             :   /* The symbols being reduced.  */
     889             :   for (yyi = 0; yyi < yynrhs; yyi++)
     890             :     {
     891             :       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
     892             :       yy_symbol_print (stderr,
     893             :                        YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
     894             :                        &yyvsp[(yyi + 1) - (yynrhs)], select, scanner);
     895             :       YYFPRINTF (stderr, "\n");
     896             :     }
     897             : }
     898             : 
     899             : # define YY_REDUCE_PRINT(Rule)          \
     900             : do {                                    \
     901             :   if (yydebug)                          \
     902             :     yy_reduce_print (yyssp, yyvsp, Rule, select, scanner); \
     903             : } while (0)
     904             : 
     905             : /* Nonzero means print parse trace.  It is left uninitialized so that
     906             :    multiple parsers can coexist.  */
     907             : int yydebug;
     908             : #else /* !YYDEBUG */
     909             : # define YYDPRINTF(Args) ((void) 0)
     910             : # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
     911             : # define YY_STACK_PRINT(Bottom, Top)
     912             : # define YY_REDUCE_PRINT(Rule)
     913             : #endif /* !YYDEBUG */
     914             : 
     915             : 
     916             : /* YYINITDEPTH -- initial size of the parser's stacks.  */
     917             : #ifndef YYINITDEPTH
     918             : # define YYINITDEPTH 200
     919             : #endif
     920             : 
     921             : /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
     922             :    if the built-in stack extension method is used).
     923             : 
     924             :    Do not make this value too large; the results are undefined if
     925             :    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
     926             :    evaluated with infinite-precision integer arithmetic.  */
     927             : 
     928             : #ifndef YYMAXDEPTH
     929             : # define YYMAXDEPTH 10000
     930             : #endif
     931             : 
     932             : 
     933             : 
     934             : 
     935             : 
     936             : 
     937             : /*-----------------------------------------------.
     938             : | Release the memory associated to this symbol.  |
     939             : `-----------------------------------------------*/
     940             : 
     941             : static void
     942             : yydestruct (const char *yymsg,
     943             :             yysymbol_kind_t yykind, YYSTYPE *yyvaluep, t_select_stmt **select, yyscan_t scanner)
     944             : {
     945             :   YY_USE (yyvaluep);
     946             :   YY_USE (select);
     947             :   YY_USE (scanner);
     948             :   if (!yymsg)
     949             :     yymsg = "Deleting";
     950             :   YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
     951             : 
     952             :   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
     953             :   YY_USE (yykind);
     954             :   YY_IGNORE_MAYBE_UNINITIALIZED_END
     955             : }
     956             : 
     957             : 
     958             : 
     959             : 
     960             : 
     961             : 
     962             : /*----------.
     963             : | yyparse.  |
     964             : `----------*/
     965             : 
     966             : int
     967          24 : yyparse (t_select_stmt **select, yyscan_t scanner)
     968             : {
     969             : /* Lookahead token kind.  */
     970          24 : int yychar;
     971             : 
     972             : 
     973             : /* The semantic value of the lookahead symbol.  */
     974             : /* Default value used for initialization, for pacifying older GCCs
     975             :    or non-GCC compilers.  */
     976             : YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
     977          24 : YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
     978             : 
     979             :     /* Number of syntax errors so far.  */
     980          24 :     int yynerrs = 0;
     981             : 
     982          24 :     yy_state_fast_t yystate = 0;
     983             :     /* Number of tokens to shift before error messages enabled.  */
     984          24 :     int yyerrstatus = 0;
     985             : 
     986             :     /* Refer to the stacks through separate pointers, to allow yyoverflow
     987             :        to reallocate them elsewhere.  */
     988             : 
     989             :     /* Their size.  */
     990          24 :     YYPTRDIFF_T yystacksize = YYINITDEPTH;
     991             : 
     992             :     /* The state stack: array, bottom, top.  */
     993          24 :     yy_state_t yyssa[YYINITDEPTH];
     994          24 :     yy_state_t *yyss = yyssa;
     995          24 :     yy_state_t *yyssp = yyss;
     996             : 
     997             :     /* The semantic value stack: array, bottom, top.  */
     998          24 :     YYSTYPE yyvsa[YYINITDEPTH];
     999          24 :     YYSTYPE *yyvs = yyvsa;
    1000          24 :     YYSTYPE *yyvsp = yyvs;
    1001             : 
    1002          24 :   int yyn;
    1003             :   /* The return value of yyparse.  */
    1004          24 :   int yyresult;
    1005             :   /* Lookahead symbol kind.  */
    1006          24 :   yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
    1007             :   /* The variables used to return semantic value and location from the
    1008             :      action routines.  */
    1009          24 :   YYSTYPE yyval;
    1010             : 
    1011             : 
    1012             : 
    1013             : #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
    1014             : 
    1015             :   /* The number of symbols on the RHS of the reduced rule.
    1016             :      Keep to zero when no symbol should be popped.  */
    1017          24 :   int yylen = 0;
    1018             : 
    1019          24 :   YYDPRINTF ((stderr, "Starting parse\n"));
    1020             : 
    1021          24 :   yychar = YYEMPTY; /* Cause a token to be read.  */
    1022             : 
    1023          24 :   goto yysetstate;
    1024             : 
    1025             : 
    1026             : /*------------------------------------------------------------.
    1027             : | yynewstate -- push a new state, which is found in yystate.  |
    1028             : `------------------------------------------------------------*/
    1029         441 : yynewstate:
    1030             :   /* In all cases, when you get here, the value and location stacks
    1031             :      have just been pushed.  So pushing a state here evens the stacks.  */
    1032         441 :   yyssp++;
    1033             : 
    1034             : 
    1035             : /*--------------------------------------------------------------------.
    1036             : | yysetstate -- set current state (the top of the stack) to yystate.  |
    1037             : `--------------------------------------------------------------------*/
    1038         465 : yysetstate:
    1039         465 :   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
    1040         465 :   YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
    1041             :   YY_IGNORE_USELESS_CAST_BEGIN
    1042         465 :   *yyssp = YY_CAST (yy_state_t, yystate);
    1043             :   YY_IGNORE_USELESS_CAST_END
    1044         465 :   YY_STACK_PRINT (yyss, yyssp);
    1045             : 
    1046         465 :   if (yyss + yystacksize - 1 <= yyssp)
    1047             : #if !defined yyoverflow && !defined YYSTACK_RELOCATE
    1048             :     YYNOMEM;
    1049             : #else
    1050             :     {
    1051             :       /* Get the current used size of the three stacks, in elements.  */
    1052           0 :       YYPTRDIFF_T yysize = yyssp - yyss + 1;
    1053             : 
    1054             : # if defined yyoverflow
    1055             :       {
    1056             :         /* Give user a chance to reallocate the stack.  Use copies of
    1057             :            these so that the &'s don't force the real ones into
    1058             :            memory.  */
    1059             :         yy_state_t *yyss1 = yyss;
    1060             :         YYSTYPE *yyvs1 = yyvs;
    1061             : 
    1062             :         /* Each stack pointer address is followed by the size of the
    1063             :            data in use in that stack, in bytes.  This used to be a
    1064             :            conditional around just the two extra args, but that might
    1065             :            be undefined if yyoverflow is a macro.  */
    1066             :         yyoverflow (YY_("memory exhausted"),
    1067             :                     &yyss1, yysize * YYSIZEOF (*yyssp),
    1068             :                     &yyvs1, yysize * YYSIZEOF (*yyvsp),
    1069             :                     &yystacksize);
    1070             :         yyss = yyss1;
    1071             :         yyvs = yyvs1;
    1072             :       }
    1073             : # else /* defined YYSTACK_RELOCATE */
    1074             :       /* Extend the stack our own way.  */
    1075           0 :       if (YYMAXDEPTH <= yystacksize)
    1076           0 :         YYNOMEM;
    1077           0 :       yystacksize *= 2;
    1078           0 :       if (YYMAXDEPTH < yystacksize)
    1079             :         yystacksize = YYMAXDEPTH;
    1080             : 
    1081             :       {
    1082           0 :         yy_state_t *yyss1 = yyss;
    1083           0 :         union yyalloc *yyptr =
    1084           0 :           YY_CAST (union yyalloc *,
    1085             :                    YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
    1086           0 :         if (! yyptr)
    1087           0 :           YYNOMEM;
    1088           0 :         YYSTACK_RELOCATE (yyss_alloc, yyss);
    1089           0 :         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
    1090             : #  undef YYSTACK_RELOCATE
    1091           0 :         if (yyss1 != yyssa)
    1092           0 :           YYSTACK_FREE (yyss1);
    1093             :       }
    1094             : # endif
    1095             : 
    1096           0 :       yyssp = yyss + yysize - 1;
    1097           0 :       yyvsp = yyvs + yysize - 1;
    1098             : 
    1099             :       YY_IGNORE_USELESS_CAST_BEGIN
    1100           0 :       YYDPRINTF ((stderr, "Stack size increased to %ld\n",
    1101             :                   YY_CAST (long, yystacksize)));
    1102             :       YY_IGNORE_USELESS_CAST_END
    1103             : 
    1104           0 :       if (yyss + yystacksize - 1 <= yyssp)
    1105           0 :         YYABORT;
    1106             :     }
    1107             : #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
    1108             : 
    1109             : 
    1110         465 :   if (yystate == YYFINAL)
    1111          24 :     YYACCEPT;
    1112             : 
    1113         441 :   goto yybackup;
    1114             : 
    1115             : 
    1116             : /*-----------.
    1117             : | yybackup.  |
    1118             : `-----------*/
    1119         441 : yybackup:
    1120             :   /* Do appropriate processing given the current state.  Read a
    1121             :      lookahead token if we need one and don't already have one.  */
    1122             : 
    1123             :   /* First try to decide what to do without reference to lookahead token.  */
    1124         441 :   yyn = yypact[yystate];
    1125         441 :   if (yypact_value_is_default (yyn))
    1126         205 :     goto yydefault;
    1127             : 
    1128             :   /* Not known => get a lookahead token if don't already have one.  */
    1129             : 
    1130             :   /* YYCHAR is either empty, or end-of-input, or a valid lookahead.  */
    1131         236 :   if (yychar == YYEMPTY)
    1132             :     {
    1133         165 :       YYDPRINTF ((stderr, "Reading a token\n"));
    1134         165 :       yychar = yylex (&yylval, scanner);
    1135             :     }
    1136             : 
    1137         236 :   if (yychar <= YYEOF)
    1138             :     {
    1139             :       yychar = YYEOF;
    1140             :       yytoken = YYSYMBOL_YYEOF;
    1141             :       YYDPRINTF ((stderr, "Now at end of input.\n"));
    1142             :     }
    1143         164 :   else if (yychar == YYerror)
    1144             :     {
    1145             :       /* The scanner already issued an error message, process directly
    1146             :          to error recovery.  But do not keep the error token as
    1147             :          lookahead, it is too special and may lead us to an endless
    1148             :          loop in error recovery. */
    1149           0 :       yychar = YYUNDEF;
    1150           0 :       yytoken = YYSYMBOL_YYerror;
    1151           0 :       goto yyerrlab1;
    1152             :     }
    1153             :   else
    1154             :     {
    1155         164 :       yytoken = YYTRANSLATE (yychar);
    1156         236 :       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
    1157             :     }
    1158             : 
    1159             :   /* If the proper action on seeing token YYTOKEN is to reduce or to
    1160             :      detect an error, take that action.  */
    1161         236 :   yyn += yytoken;
    1162         236 :   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
    1163          71 :     goto yydefault;
    1164         165 :   yyn = yytable[yyn];
    1165         165 :   if (yyn <= 0)
    1166             :     {
    1167           0 :       if (yytable_value_is_error (yyn))
    1168             :         goto yyerrlab;
    1169           0 :       yyn = -yyn;
    1170           0 :       goto yyreduce;
    1171             :     }
    1172             : 
    1173             :   /* Count tokens shifted since error; after three, turn off error
    1174             :      status.  */
    1175         165 :   if (yyerrstatus)
    1176           0 :     yyerrstatus--;
    1177             : 
    1178             :   /* Shift the lookahead token.  */
    1179         165 :   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
    1180         165 :   yystate = yyn;
    1181             :   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
    1182         165 :   *++yyvsp = yylval;
    1183             :   YY_IGNORE_MAYBE_UNINITIALIZED_END
    1184             : 
    1185             :   /* Discard the shifted token.  */
    1186         165 :   yychar = YYEMPTY;
    1187         165 :   goto yynewstate;
    1188             : 
    1189             : 
    1190             : /*-----------------------------------------------------------.
    1191             : | yydefault -- do the default action for the current state.  |
    1192             : `-----------------------------------------------------------*/
    1193         276 : yydefault:
    1194         276 :   yyn = yydefact[yystate];
    1195         276 :   if (yyn == 0)
    1196           0 :     goto yyerrlab;
    1197         276 :   goto yyreduce;
    1198             : 
    1199             : 
    1200             : /*-----------------------------.
    1201             : | yyreduce -- do a reduction.  |
    1202             : `-----------------------------*/
    1203         276 : yyreduce:
    1204             :   /* yyn is the number of a rule to reduce with.  */
    1205         276 :   yylen = yyr2[yyn];
    1206             : 
    1207             :   /* If YYLEN is nonzero, implement the default value of the action:
    1208             :      '$$ = $1'.
    1209             : 
    1210             :      Otherwise, the following line sets YYVAL to garbage.
    1211             :      This behavior is undocumented and Bison
    1212             :      users should not rely upon it.  Assigning to YYVAL
    1213             :      unconditionally makes the parser a bit smaller, and it avoids a
    1214             :      GCC warning that YYVAL may be used uninitialized.  */
    1215         276 :   yyval = yyvsp[1-yylen];
    1216             : 
    1217             : 
    1218         276 :   YY_REDUCE_PRINT (yyn);
    1219         276 :   switch (yyn)
    1220             :     {
    1221          24 :   case 2: /* input: select_stmt  */
    1222             :                     {
    1223          24 :                 *select = (yyvsp[0].select_stmt);
    1224             :         }
    1225          24 :     break;
    1226             : 
    1227           1 :   case 3: /* select_stmt: TOKEN_SELECT cols TOKEN_WHERE query  */
    1228             :                                                   {
    1229           1 :                 (yyval.select_stmt) = create_select(talloc_tos(), (yyvsp[-2].columns), (yyvsp[0].query) );
    1230           1 :                 if (!(yyval.select_stmt)) {
    1231           0 :                          YYERROR;
    1232             :                 }
    1233             :         }
    1234             :     break;
    1235             : 
    1236          23 :   case 4: /* select_stmt: query  */
    1237             :                    {
    1238          23 :                 (yyval.select_stmt) = create_select(talloc_tos(), NULL, (yyvsp[0].query) );
    1239          23 :                 if (!(yyval.select_stmt)) {
    1240           0 :                          YYERROR;
    1241             :                 }
    1242             :         }
    1243             :     break;
    1244             : 
    1245           1 :   case 5: /* cols: col  */
    1246             :                {
    1247           1 :                 (yyval.columns) = create_cols(talloc_tos(), (yyvsp[0].strval), NULL);
    1248           1 :                 if (!(yyval.columns)) {
    1249           0 :                          YYERROR;
    1250             :                 }
    1251             :         }
    1252             :     break;
    1253             : 
    1254           2 :   case 6: /* cols: col TOKEN_COMMA cols  */
    1255             :                                        {
    1256           2 :                 (yyval.columns) = create_cols(talloc_tos(), (yyvsp[-2].strval), (yyvsp[0].columns));
    1257           2 :                 if (!(yyval.columns)) {
    1258           0 :                          YYERROR;
    1259             :                 }
    1260             :         }
    1261             :     break;
    1262             : 
    1263           3 :   case 7: /* col: TOKEN_IDENTIFIER  */
    1264             :                             {
    1265           3 :                 (yyval.strval) = (yyvsp[0].strval);
    1266           3 :                 if (!(yyval.strval)) {
    1267           0 :                          YYERROR;
    1268             :                 }
    1269             :         }
    1270             :     break;
    1271             : 
    1272          30 :   case 8: /* query: basic_query  */
    1273             :                     {
    1274          30 :                 (yyval.query) = create_query_node(talloc_tos(), eVALUE, NULL, NULL, (yyvsp[0].bas_query));
    1275          30 :                 if (!(yyval.query)) {
    1276           0 :                          YYERROR;
    1277             :                 }
    1278             :         }
    1279             :     break;
    1280             : 
    1281           1 :   case 9: /* query: TOKEN_LPAREN query TOKEN_RPAREN  */
    1282             :                                              {
    1283           1 :                 (yyval.query) = (yyvsp[-1].query);
    1284           1 :                 if (!(yyval.query)) {
    1285           0 :                          YYERROR;
    1286             :                 }
    1287             :         }
    1288             :     break;
    1289             : 
    1290           3 :   case 10: /* query: query TOKEN_AND query  */
    1291             :                                       {
    1292           3 :                 (yyval.query) = create_query_node(talloc_tos(), eAND, (yyvsp[-2].query), (yyvsp[0].query), NULL);
    1293           3 :                 if (!(yyval.query)) {
    1294           0 :                          YYERROR;
    1295             :                 }
    1296             :         }
    1297             :     break;
    1298             : 
    1299           3 :   case 11: /* query: query TOKEN_OR query  */
    1300             :                                      {
    1301           3 :                 (yyval.query) = create_query_node(talloc_tos(), eOR, (yyvsp[-2].query), (yyvsp[0].query), NULL);
    1302           3 :                 if (!(yyval.query)) {
    1303           0 :                          YYERROR;
    1304             :                 }
    1305             :         }
    1306             :     break;
    1307             : 
    1308           3 :   case 12: /* query: TOKEN_NOT query  */
    1309             :                              {
    1310           3 :                 (yyval.query) = create_query_node(talloc_tos(), eNOT, NULL, (yyvsp[0].query), NULL);
    1311           3 :                 if (!(yyval.query)) {
    1312           0 :                          YYERROR;
    1313             :                 }
    1314             :         }
    1315             :     break;
    1316             : 
    1317          30 :   case 13: /* basic_query: prop TOKEN_PROP_EQUALS basic_restr  */
    1318             :                                                  {
    1319          30 :                 (yyval.bas_query) = create_basic_query(talloc_tos(), (yyvsp[-2].strval), (yyvsp[0].bas_rest));
    1320          30 :                 if (!(yyval.bas_query)) {
    1321           0 :                          YYERROR;
    1322             :                 }
    1323             :         }
    1324             :     break;
    1325             : 
    1326          30 :   case 14: /* prop: TOKEN_IDENTIFIER  */
    1327             :                           {
    1328          30 :                 (yyval.strval) = (yyvsp[0].strval);
    1329          30 :                 if (!(yyval.strval)) {
    1330           0 :                          YYERROR;
    1331             :                 }
    1332             :         }
    1333             :     break;
    1334             : 
    1335          17 :   case 15: /* basic_restr: value  */
    1336             :                  {
    1337          17 :                 (yyval.bas_rest) = create_basic_restr(talloc_tos(), RTPROPERTY, eEQ, (yyvsp[0].value));
    1338          17 :                 if (!(yyval.bas_rest)) {
    1339           0 :                          YYERROR;
    1340             :                 }
    1341             :         }
    1342             :     break;
    1343             : 
    1344          11 :   case 16: /* basic_restr: property_op value  */
    1345             :                                   {
    1346          11 :                 (yyval.bas_rest) = create_basic_restr(talloc_tos(), RTPROPERTY, (yyvsp[-1].prop_op), (yyvsp[0].value));
    1347          11 :                 if (!(yyval.bas_rest)) {
    1348           0 :                          YYERROR;
    1349             :                 }
    1350             :         }
    1351             :     break;
    1352             : 
    1353           2 :   case 17: /* basic_restr: content_op value  */
    1354             :                                  {
    1355           2 :                 (yyval.bas_rest) = create_basic_restr(talloc_tos(), RTCONTENT, (yyvsp[-1].prop_op), (yyvsp[0].value));
    1356           2 :                 if (!(yyval.bas_rest)) {
    1357           0 :                          YYERROR;
    1358             :                 }
    1359             :         }
    1360             :     break;
    1361             : 
    1362           9 :   case 18: /* basic_restr: TOKEN_LPAREN restr TOKEN_RPAREN  */
    1363             :                                              {
    1364           9 :                 t_value_holder *holder = talloc_zero(talloc_tos(), t_value_holder);
    1365           9 :                 holder->type = RESTR;
    1366           9 :                 holder->value.restr_tree = (yyvsp[-1].restr);
    1367           9 :                 (yyval.bas_rest) = create_basic_restr(talloc_tos(), RTNONE, eEQ, holder);
    1368           9 :                 if (!(yyval.bas_rest)) {
    1369           0 :                          YYERROR;
    1370             :                 }
    1371             :         }
    1372             :     break;
    1373             : 
    1374           0 :   case 19: /* property_op: TOKEN_EQ  */
    1375           0 :                  { (yyval.prop_op) = eEQ; }
    1376           0 :     break;
    1377             : 
    1378           2 :   case 20: /* property_op: TOKEN_NE  */
    1379           2 :                    { (yyval.prop_op) = eNE; }
    1380           2 :     break;
    1381             : 
    1382           3 :   case 21: /* property_op: TOKEN_GE  */
    1383           3 :                    { (yyval.prop_op) = eGE; }
    1384           3 :     break;
    1385             : 
    1386           2 :   case 22: /* property_op: TOKEN_LE  */
    1387           2 :                    { (yyval.prop_op) = eLE; }
    1388           2 :     break;
    1389             : 
    1390           2 :   case 23: /* property_op: TOKEN_LT  */
    1391           2 :                    { (yyval.prop_op) = eLT; }
    1392           2 :     break;
    1393             : 
    1394           2 :   case 24: /* property_op: TOKEN_GT  */
    1395           2 :                    { (yyval.prop_op) = eGT; }
    1396           2 :     break;
    1397             : 
    1398           1 :   case 25: /* content_op: TOKEN_STARTS_WITH  */
    1399           1 :                           { (yyval.prop_op) = eSTARTSWITH; }
    1400           1 :     break;
    1401             : 
    1402           1 :   case 26: /* content_op: TOKEN_EQUALS  */
    1403           1 :                        { (yyval.prop_op) = eEQUALS; }
    1404           1 :     break;
    1405             : 
    1406          28 :   case 27: /* value: simple_value  */
    1407          28 :                         { (yyval.value) = (yyvsp[0].value);}
    1408          28 :     break;
    1409             : 
    1410           1 :   case 28: /* value: simple_value TOKEN_RANGE simple_value  */
    1411             :                                                       {
    1412           1 :                 (yyval.value) = create_value_range(talloc_tos(), (yyvsp[-2].value), (yyvsp[0].value));
    1413           1 :                 if (!(yyval.value)) {
    1414           0 :                          YYERROR;
    1415             :                 }
    1416             :         }
    1417             :     break;
    1418             : 
    1419           0 :   case 29: /* value: date_shortcut  */
    1420             :                            {
    1421           0 :                 (yyval.value) = create_date_range_shortcut(talloc_tos(), (yyvsp[0].daterange));
    1422           0 :                 if (!(yyval.value)) {
    1423           0 :                          YYERROR;
    1424             :                 }
    1425             :         }
    1426             :     break;
    1427             : 
    1428           1 :   case 30: /* value: size_shortcut  */
    1429             :                            {
    1430           1 :                 (yyval.value) = create_size_range_shortcut(talloc_tos(), (yyvsp[0].sizerange));
    1431           1 :                 if (!(yyval.value)) {
    1432           0 :                          YYERROR;
    1433             :                 }
    1434             :         }
    1435             :     break;
    1436             : 
    1437           0 :   case 31: /* date_shortcut: TOKEN_TODAY  */
    1438           0 :                     { (yyval.daterange) = eTODAY; }
    1439           0 :     break;
    1440             : 
    1441           0 :   case 32: /* date_shortcut: TOKEN_YESTERDAY  */
    1442           0 :                           { (yyval.daterange) = eYESTERDAY; }
    1443           0 :     break;
    1444             : 
    1445           0 :   case 33: /* date_shortcut: TOKEN_THISWEEK  */
    1446           0 :                          { (yyval.daterange) = eTHISWEEK; }
    1447           0 :     break;
    1448             : 
    1449           0 :   case 34: /* date_shortcut: TOKEN_LASTWEEK  */
    1450           0 :                          { (yyval.daterange) = eLASTWEEK; }
    1451           0 :     break;
    1452             : 
    1453           0 :   case 35: /* date_shortcut: TOKEN_THISMONTH  */
    1454           0 :                           { (yyval.daterange) = eTHISMONTH; }
    1455           0 :     break;
    1456             : 
    1457           0 :   case 36: /* date_shortcut: TOKEN_LASTMONTH  */
    1458           0 :                           { (yyval.daterange) = eTHISMONTH; }
    1459           0 :     break;
    1460             : 
    1461           0 :   case 37: /* date_shortcut: TOKEN_THISYEAR  */
    1462           0 :                          { (yyval.daterange) = eTHISYEAR; }
    1463           0 :     break;
    1464             : 
    1465           0 :   case 38: /* date_shortcut: TOKEN_LASTYEAR  */
    1466           0 :                          { (yyval.daterange) = eLASTYEAR; }
    1467           0 :     break;
    1468             : 
    1469           0 :   case 39: /* size_shortcut: TOKEN_EMPTY  */
    1470           0 :                     { (yyval.sizerange) = eEMPTY; }
    1471           0 :     break;
    1472             : 
    1473           0 :   case 40: /* size_shortcut: TOKEN_TINY  */
    1474           0 :                      { (yyval.sizerange) = eTINY; }
    1475           0 :     break;
    1476             : 
    1477           1 :   case 41: /* size_shortcut: TOKEN_SMALL  */
    1478           1 :                       { (yyval.sizerange) = eSMALL; }
    1479           1 :     break;
    1480             : 
    1481           0 :   case 42: /* size_shortcut: TOKEN_MEDIUM  */
    1482           0 :                        { (yyval.sizerange) = eMEDIUM; }
    1483           0 :     break;
    1484             : 
    1485           0 :   case 43: /* size_shortcut: TOKEN_LARGE  */
    1486           0 :                       { (yyval.sizerange) = eLARGE; }
    1487           0 :     break;
    1488             : 
    1489           0 :   case 44: /* size_shortcut: TOKEN_HUGE  */
    1490           0 :                      { (yyval.sizerange) = eHUGE; }
    1491           0 :     break;
    1492             : 
    1493           0 :   case 45: /* size_shortcut: TOKEN_GIGANTIC  */
    1494           0 :                          { (yyval.sizerange) = eGIGANTIC; }
    1495           0 :     break;
    1496             : 
    1497          15 :   case 46: /* simple_value: TOKEN_NUMBER  */
    1498             :                         {
    1499          15 :                 (yyval.value) = create_num_val(talloc_tos(), (yyvsp[0].num));
    1500          15 :                 if (!(yyval.value)) {
    1501           0 :                          YYERROR;
    1502             :                 }
    1503             :         }
    1504             :     break;
    1505             : 
    1506           0 :   case 47: /* simple_value: TOKEN_NUMBER TOKEN_K  */
    1507             :                                   {
    1508           0 :                 (yyval.value) = create_num_val(talloc_tos(), (yyvsp[-1].num) * 1024);
    1509           0 :                 if (!(yyval.value)) {
    1510           0 :                          YYERROR;
    1511             :                 }
    1512             :         }
    1513             :     break;
    1514             : 
    1515           0 :   case 48: /* simple_value: TOKEN_NUMBER TOKEN_M  */
    1516             :                                   {
    1517           0 :                 (yyval.value) = create_num_val( talloc_tos(), (yyvsp[-1].num) * 1024 * 1024);
    1518           0 :                 if (!(yyval.value)) {
    1519           0 :                          YYERROR;
    1520             :                 }
    1521             :         }
    1522             :     break;
    1523             : 
    1524           0 :   case 49: /* simple_value: TOKEN_NUMBER TOKEN_G  */
    1525             :                                   {
    1526           0 :                 (yyval.value) = create_num_val(talloc_tos(), (yyvsp[-1].num) * 1024 * 1024 * 1024);
    1527           0 :                 if (!(yyval.value)) {
    1528           0 :                          YYERROR;
    1529             :                 }
    1530             :         }
    1531             :     break;
    1532             : 
    1533           0 :   case 50: /* simple_value: TOKEN_NUMBER TOKEN_T  */
    1534             :                                   {
    1535           0 :                 (yyval.value) = create_num_val(talloc_tos(),
    1536           0 :                                     (yyvsp[-1].num) * 1024 * 1024 * 1024 * 1024);
    1537           0 :                 if (!(yyval.value)) {
    1538           0 :                          YYERROR;
    1539             :                 }
    1540             :         }
    1541             :     break;
    1542             : 
    1543           0 :   case 51: /* simple_value: TOKEN_NUMBER TOKEN_KB  */
    1544             :                                    {
    1545           0 :                 (yyval.value) = create_num_val(talloc_tos(), (yyvsp[-1].num) * 1000);
    1546           0 :                 if (!(yyval.value)) {
    1547           0 :                          YYERROR;
    1548             :                 }
    1549             :         }
    1550             :     break;
    1551             : 
    1552           0 :   case 52: /* simple_value: TOKEN_NUMBER TOKEN_MB  */
    1553             :                                    {
    1554           0 :                 (yyval.value) = create_num_val( talloc_tos(), (yyvsp[-1].num) * 1000 * 1000);
    1555           0 :                 if (!(yyval.value)) {
    1556           0 :                          YYERROR;
    1557             :                 }
    1558             :         }
    1559             :     break;
    1560             : 
    1561           0 :   case 53: /* simple_value: TOKEN_NUMBER TOKEN_GB  */
    1562             :                                    {
    1563           0 :                 (yyval.value) = create_num_val(talloc_tos(), (yyvsp[-1].num) * 1000 * 1000 * 1000);
    1564           0 :                 if (!(yyval.value)) {
    1565           0 :                          YYERROR;
    1566             :                 }
    1567             :         }
    1568             :     break;
    1569             : 
    1570           0 :   case 54: /* simple_value: TOKEN_NUMBER TOKEN_TB  */
    1571             :                                    {
    1572           0 :                 (yyval.value) = create_num_val(talloc_tos(),
    1573           0 :                                     (yyvsp[-1].num) * 1000 * 1000 * 1000 * 1000);
    1574           0 :                 if (!(yyval.value)) {
    1575           0 :                          YYERROR;
    1576             :                 }
    1577             :         }
    1578             :     break;
    1579             : 
    1580           0 :   case 55: /* simple_value: TOKEN_TRUE  */
    1581             :                      {
    1582           0 :                 (yyval.value) = create_bool_val(talloc_tos(), true);
    1583           0 :                 if (!(yyval.value)) {
    1584           0 :                          YYERROR;
    1585             :                 }
    1586             :         }
    1587             :     break;
    1588             : 
    1589           0 :   case 56: /* simple_value: TOKEN_FALSE  */
    1590             :                       {
    1591           0 :                 (yyval.value) = create_num_val(talloc_tos(), false);
    1592           0 :                 if (!(yyval.value)) {
    1593           0 :                          YYERROR;
    1594             :                 }
    1595             :         }
    1596             :     break;
    1597             : 
    1598           0 :   case 57: /* simple_value: TOKEN_STRING_LITERAL  */
    1599             :                                   {
    1600           0 :                 char *tmp_str = talloc_strdup(talloc_tos(), (yyvsp[0].strval)+1);
    1601           0 :                 tmp_str[strlen(tmp_str)-1] = '\0';
    1602           0 :                 (yyval.value) = create_string_val(talloc_tos(), tmp_str);
    1603           0 :                 if (!(yyval.value)) {
    1604           0 :                          YYERROR;
    1605             :                 }
    1606             :         }
    1607             :     break;
    1608             : 
    1609          15 :   case 58: /* simple_value: TOKEN_IDENTIFIER  */
    1610             :                               {
    1611          15 :                 (yyval.value) = create_string_val(talloc_tos(), (yyvsp[0].strval));
    1612          15 :                 if (!(yyval.value)) {
    1613           0 :                          YYERROR;
    1614             :                 }
    1615             :         }
    1616             :     break;
    1617             : 
    1618           9 :   case 59: /* restr: basic_restr  */
    1619             :                       {
    1620           9 :                 (yyval.restr) = create_restr(talloc_tos(), eVALUE, NULL, NULL, (yyvsp[0].bas_rest));
    1621           9 :                 if (!(yyval.restr)) {
    1622           0 :                          YYERROR;
    1623             :                 }
    1624             :         }
    1625             :     break;
    1626             : 
    1627           0 :   case 60: /* restr: restr TOKEN_AND restr  */
    1628             :                                       {
    1629           0 :                 (yyval.restr) = create_restr(talloc_tos(), eAND, (yyvsp[-2].restr), (yyvsp[0].restr), NULL);
    1630           0 :                 if (!(yyval.restr)) {
    1631           0 :                          YYERROR;
    1632             :                 }
    1633             :         }
    1634             :     break;
    1635             : 
    1636           0 :   case 61: /* restr: restr TOKEN_OR restr  */
    1637             :                                      {
    1638           0 :                 (yyval.restr) = create_restr(talloc_tos(), eOR, (yyvsp[-2].restr), (yyvsp[0].restr), NULL);
    1639           0 :                 if (!(yyval.restr)) {
    1640           0 :                          YYERROR;
    1641             :                 }
    1642             :         }
    1643             :     break;
    1644             : 
    1645             : 
    1646             : 
    1647             :       default: break;
    1648             :     }
    1649             :   /* User semantic actions sometimes alter yychar, and that requires
    1650             :      that yytoken be updated with the new translation.  We take the
    1651             :      approach of translating immediately before every use of yytoken.
    1652             :      One alternative is translating here after every semantic action,
    1653             :      but that translation would be missed if the semantic action invokes
    1654             :      YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
    1655             :      if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
    1656             :      incorrect destructor might then be invoked immediately.  In the
    1657             :      case of YYERROR or YYBACKUP, subsequent parser actions might lead
    1658             :      to an incorrect destructor call or verbose syntax error message
    1659             :      before the lookahead is translated.  */
    1660         276 :   YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
    1661             : 
    1662         276 :   YYPOPSTACK (yylen);
    1663         276 :   yylen = 0;
    1664             : 
    1665         276 :   *++yyvsp = yyval;
    1666             : 
    1667             :   /* Now 'shift' the result of the reduction.  Determine what state
    1668             :      that goes to, based on the state we popped back to and the rule
    1669             :      number reduced by.  */
    1670             :   {
    1671         276 :     const int yylhs = yyr1[yyn] - YYNTOKENS;
    1672         276 :     const int yyi = yypgoto[yylhs] + *yyssp;
    1673         126 :     yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
    1674          59 :                ? yytable[yyi]
    1675         402 :                : yydefgoto[yylhs]);
    1676             :   }
    1677             : 
    1678         276 :   goto yynewstate;
    1679             : 
    1680             : 
    1681             : /*--------------------------------------.
    1682             : | yyerrlab -- here on detecting error.  |
    1683             : `--------------------------------------*/
    1684           0 : yyerrlab:
    1685             :   /* Make sure we have latest lookahead translation.  See comments at
    1686             :      user semantic actions for why this is necessary.  */
    1687           0 :   yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
    1688             :   /* If not already recovering from an error, report this error.  */
    1689           0 :   if (!yyerrstatus)
    1690             :     {
    1691           0 :       ++yynerrs;
    1692           0 :       yyerror (select, scanner, YY_("syntax error"));
    1693             :     }
    1694             : 
    1695           0 :   if (yyerrstatus == 3)
    1696             :     {
    1697             :       /* If just tried and failed to reuse lookahead token after an
    1698             :          error, discard it.  */
    1699             : 
    1700           0 :       if (yychar <= YYEOF)
    1701             :         {
    1702             :           /* Return failure if at end of input.  */
    1703           0 :           if (yychar == YYEOF)
    1704           0 :             YYABORT;
    1705             :         }
    1706             :       else
    1707             :         {
    1708             :           yydestruct ("Error: discarding",
    1709             :                       yytoken, &yylval, select, scanner);
    1710             :           yychar = YYEMPTY;
    1711             :         }
    1712             :     }
    1713             : 
    1714             :   /* Else will try to reuse lookahead token after shifting the error
    1715             :      token.  */
    1716           0 :   goto yyerrlab1;
    1717             : 
    1718             : 
    1719             : /*---------------------------------------------------.
    1720             : | yyerrorlab -- error raised explicitly by YYERROR.  |
    1721             : `---------------------------------------------------*/
    1722           0 : yyerrorlab:
    1723             :   /* Pacify compilers when the user code never invokes YYERROR and the
    1724             :      label yyerrorlab therefore never appears in user code.  */
    1725           0 :   if (0)
    1726             :     YYERROR;
    1727           0 :   ++yynerrs;
    1728             : 
    1729             :   /* Do not reclaim the symbols of the rule whose action triggered
    1730             :      this YYERROR.  */
    1731           0 :   YYPOPSTACK (yylen);
    1732           0 :   yylen = 0;
    1733           0 :   YY_STACK_PRINT (yyss, yyssp);
    1734           0 :   yystate = *yyssp;
    1735           0 :   goto yyerrlab1;
    1736             : 
    1737             : 
    1738             : /*-------------------------------------------------------------.
    1739             : | yyerrlab1 -- common code for both syntax error and YYERROR.  |
    1740             : `-------------------------------------------------------------*/
    1741           0 : yyerrlab1:
    1742           0 :   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
    1743             : 
    1744             :   /* Pop stack until we find a state that shifts the error token.  */
    1745           0 :   for (;;)
    1746             :     {
    1747           0 :       yyn = yypact[yystate];
    1748           0 :       if (!yypact_value_is_default (yyn))
    1749             :         {
    1750           0 :           yyn += YYSYMBOL_YYerror;
    1751           0 :           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
    1752             :             {
    1753           0 :               yyn = yytable[yyn];
    1754           0 :               if (0 < yyn)
    1755             :                 break;
    1756             :             }
    1757             :         }
    1758             : 
    1759             :       /* Pop the current state because it cannot handle the error token.  */
    1760           0 :       if (yyssp == yyss)
    1761           0 :         YYABORT;
    1762             : 
    1763             : 
    1764           0 :       yydestruct ("Error: popping",
    1765             :                   YY_ACCESSING_SYMBOL (yystate), yyvsp, select, scanner);
    1766           0 :       YYPOPSTACK (1);
    1767           0 :       yystate = *yyssp;
    1768           0 :       YY_STACK_PRINT (yyss, yyssp);
    1769             :     }
    1770             : 
    1771             :   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
    1772           0 :   *++yyvsp = yylval;
    1773             :   YY_IGNORE_MAYBE_UNINITIALIZED_END
    1774             : 
    1775             : 
    1776             :   /* Shift the error token.  */
    1777           0 :   YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
    1778             : 
    1779           0 :   yystate = yyn;
    1780           0 :   goto yynewstate;
    1781             : 
    1782             : 
    1783             : /*-------------------------------------.
    1784             : | yyacceptlab -- YYACCEPT comes here.  |
    1785             : `-------------------------------------*/
    1786          24 : yyacceptlab:
    1787          24 :   yyresult = 0;
    1788          24 :   goto yyreturnlab;
    1789             : 
    1790             : 
    1791             : /*-----------------------------------.
    1792             : | yyabortlab -- YYABORT comes here.  |
    1793             : `-----------------------------------*/
    1794           0 : yyabortlab:
    1795           0 :   yyresult = 1;
    1796           0 :   goto yyreturnlab;
    1797             : 
    1798             : 
    1799             : /*-----------------------------------------------------------.
    1800             : | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here.  |
    1801             : `-----------------------------------------------------------*/
    1802           0 : yyexhaustedlab:
    1803           0 :   yyerror (select, scanner, YY_("memory exhausted"));
    1804           0 :   yyresult = 2;
    1805           0 :   goto yyreturnlab;
    1806             : 
    1807             : 
    1808             : /*----------------------------------------------------------.
    1809             : | yyreturnlab -- parsing is finished, clean up and return.  |
    1810             : `----------------------------------------------------------*/
    1811          24 : yyreturnlab:
    1812          24 :   if (yychar != YYEMPTY)
    1813             :     {
    1814             :       /* Make sure we have latest lookahead translation.  See comments at
    1815             :          user semantic actions for why this is necessary.  */
    1816          24 :       yytoken = YYTRANSLATE (yychar);
    1817             :       yydestruct ("Cleanup: discarding lookahead",
    1818             :                   yytoken, &yylval, select, scanner);
    1819             :     }
    1820             :   /* Do not reclaim the symbols of the rule whose action triggered
    1821             :      this YYABORT or YYACCEPT.  */
    1822             :   YYPOPSTACK (yylen);
    1823             :   YY_STACK_PRINT (yyss, yyssp);
    1824          24 :   while (yyssp != yyss)
    1825             :     {
    1826             :       yydestruct ("Cleanup: popping",
    1827             :                   YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, select, scanner);
    1828             :       YYPOPSTACK (1);
    1829             :     }
    1830             : #ifndef yyoverflow
    1831          24 :   if (yyss != yyssa)
    1832           0 :     YYSTACK_FREE (yyss);
    1833             : #endif
    1834             : 
    1835          24 :   return yyresult;
    1836             : }
    1837             : 
    1838             : 

Generated by: LCOV version 1.14