LCOV - code coverage report
Current view: top level - contrib/seg - segparse.c (source / functions) Hit Total Coverage
Test: PostgreSQL 13devel Lines: 75 129 58.1 %
Date: 2019-11-21 14:06:36 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.13