LCOV - code coverage report
Current view: top level - contrib/seg - segparse.c (source / functions) Hit Total Coverage
Test: PostgreSQL 15devel Lines: 95 154 61.7 %
Date: 2021-12-05 02:08:31 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* A Bison parser, made by GNU Bison 3.7.5.  */
       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 <http://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 30705
      50             : 
      51             : /* Bison version string.  */
      52             : #define YYBISON_VERSION "3.7.5"
      53             : 
      54             : /* Skeleton name.  */
      55             : #define YYSKELETON_NAME "yacc.c"
      56             : 
      57             : /* Pure parsers.  */
      58             : #define YYPURE 0
      59             : 
      60             : /* Push parsers.  */
      61             : #define YYPUSH 0
      62             : 
      63             : /* Pull parsers.  */
      64             : #define YYPULL 1
      65             : 
      66             : 
      67             : /* Substitute the variable and function names.  */
      68             : #define yyparse         seg_yyparse
      69             : #define yylex           seg_yylex
      70             : #define yyerror         seg_yyerror
      71             : #define yydebug         seg_yydebug
      72             : #define yynerrs         seg_yynerrs
      73             : #define yylval          seg_yylval
      74             : #define yychar          seg_yychar
      75             : 
      76             : /* First part of user prologue.  */
      77             : #line 1 "segparse.y"
      78             : 
      79             : /* contrib/seg/segparse.y */
      80             : 
      81             : #include "postgres.h"
      82             : 
      83             : #include <math.h>
      84             : 
      85             : #include "fmgr.h"
      86             : #include "utils/builtins.h"
      87             : 
      88             : #include "segdata.h"
      89             : 
      90             : /*
      91             :  * Bison doesn't allocate anything that needs to live across parser calls,
      92             :  * so we can easily have it use palloc instead of malloc.  This prevents
      93             :  * memory leaks if we error out during parsing.  Note this only works with
      94             :  * bison >= 2.0.  However, in bison 1.875 the default is to use alloca()
      95             :  * if possible, so there's not really much problem anyhow, at least if
      96             :  * you're building with gcc.
      97             :  */
      98             : #define YYMALLOC palloc
      99             : #define YYFREE   pfree
     100             : 
     101             : static float seg_atof(const char *value);
     102             : 
     103             : static char strbuf[25] = {
     104             :     '0', '0', '0', '0', '0',
     105             :     '0', '0', '0', '0', '0',
     106             :     '0', '0', '0', '0', '0',
     107             :     '0', '0', '0', '0', '0',
     108             :     '0', '0', '0', '0', '\0'
     109             : };
     110             : 
     111             : 
     112             : #line 113 "segparse.c"
     113             : 
     114             : # ifndef YY_CAST
     115             : #  ifdef __cplusplus
     116             : #   define YY_CAST(Type, Val) static_cast<Type> (Val)
     117             : #   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
     118             : #  else
     119             : #   define YY_CAST(Type, Val) ((Type) (Val))
     120             : #   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
     121             : #  endif
     122             : # endif
     123             : # ifndef YY_NULLPTR
     124             : #  if defined __cplusplus
     125             : #   if 201103L <= __cplusplus
     126             : #    define YY_NULLPTR nullptr
     127             : #   else
     128             : #    define YY_NULLPTR 0
     129             : #   endif
     130             : #  else
     131             : #   define YY_NULLPTR ((void*)0)
     132             : #  endif
     133             : # endif
     134             : 
     135             : 
     136             : /* Debug traces.  */
     137             : #ifndef YYDEBUG
     138             : # define YYDEBUG 0
     139             : #endif
     140             : #if YYDEBUG
     141             : extern int seg_yydebug;
     142             : #endif
     143             : 
     144             : /* Token kinds.  */
     145             : #ifndef YYTOKENTYPE
     146             : # define YYTOKENTYPE
     147             :   enum yytokentype
     148             :   {
     149             :     YYEMPTY = -2,
     150             :     YYEOF = 0,                     /* "end of file"  */
     151             :     YYerror = 256,                 /* error  */
     152             :     YYUNDEF = 257,                 /* "invalid token"  */
     153             :     SEGFLOAT = 258,                /* SEGFLOAT  */
     154             :     RANGE = 259,                   /* RANGE  */
     155             :     PLUMIN = 260,                  /* PLUMIN  */
     156             :     EXTENSION = 261                /* EXTENSION  */
     157             :   };
     158             :   typedef enum yytokentype yytoken_kind_t;
     159             : #endif
     160             : 
     161             : /* Value type.  */
     162             : #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
     163             : union YYSTYPE
     164             : {
     165             : #line 41 "segparse.y"
     166             : 
     167             :     struct BND {
     168             :         float val;
     169             :         char  ext;
     170             :         char  sigd;
     171             :     } bnd;
     172             :     char * text;
     173             : 
     174             : #line 175 "segparse.c"
     175             : 
     176             : };
     177             : typedef union YYSTYPE YYSTYPE;
     178             : # define YYSTYPE_IS_TRIVIAL 1
     179             : # define YYSTYPE_IS_DECLARED 1
     180             : #endif
     181             : 
     182             : 
     183             : extern YYSTYPE seg_yylval;
     184             : 
     185             : int seg_yyparse (SEG *result);
     186             : 
     187             : 
     188             : /* Symbol kind.  */
     189             : enum yysymbol_kind_t
     190             : {
     191             :   YYSYMBOL_YYEMPTY = -2,
     192             :   YYSYMBOL_YYEOF = 0,                      /* "end of file"  */
     193             :   YYSYMBOL_YYerror = 1,                    /* error  */
     194             :   YYSYMBOL_YYUNDEF = 2,                    /* "invalid token"  */
     195             :   YYSYMBOL_SEGFLOAT = 3,                   /* SEGFLOAT  */
     196             :   YYSYMBOL_RANGE = 4,                      /* RANGE  */
     197             :   YYSYMBOL_PLUMIN = 5,                     /* PLUMIN  */
     198             :   YYSYMBOL_EXTENSION = 6,                  /* EXTENSION  */
     199             :   YYSYMBOL_YYACCEPT = 7,                   /* $accept  */
     200             :   YYSYMBOL_range = 8,                      /* range  */
     201             :   YYSYMBOL_boundary = 9,                   /* boundary  */
     202             :   YYSYMBOL_deviation = 10                  /* deviation  */
     203             : };
     204             : typedef enum yysymbol_kind_t yysymbol_kind_t;
     205             : 
     206             : 
     207             : 
     208             : 
     209             : #ifdef short
     210             : # undef short
     211             : #endif
     212             : 
     213             : /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
     214             :    <limits.h> and (if available) <stdint.h> are included
     215             :    so that the code can choose integer types of a good width.  */
     216             : 
     217             : #ifndef __PTRDIFF_MAX__
     218             : # include <limits.h> /* INFRINGES ON USER NAME SPACE */
     219             : # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
     220             : #  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
     221             : #  define YY_STDINT_H
     222             : # endif
     223             : #endif
     224             : 
     225             : /* Narrow types that promote to a signed type and that can represent a
     226             :    signed or unsigned integer of at least N bits.  In tables they can
     227             :    save space and decrease cache pressure.  Promoting to a signed type
     228             :    helps avoid bugs in integer arithmetic.  */
     229             : 
     230             : #ifdef __INT_LEAST8_MAX__
     231             : typedef __INT_LEAST8_TYPE__ yytype_int8;
     232             : #elif defined YY_STDINT_H
     233             : typedef int_least8_t yytype_int8;
     234             : #else
     235             : typedef signed char yytype_int8;
     236             : #endif
     237             : 
     238             : #ifdef __INT_LEAST16_MAX__
     239             : typedef __INT_LEAST16_TYPE__ yytype_int16;
     240             : #elif defined YY_STDINT_H
     241             : typedef int_least16_t yytype_int16;
     242             : #else
     243             : typedef short yytype_int16;
     244             : #endif
     245             : 
     246             : /* Work around bug in HP-UX 11.23, which defines these macros
     247             :    incorrectly for preprocessor constants.  This workaround can likely
     248             :    be removed in 2023, as HPE has promised support for HP-UX 11.23
     249             :    (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
     250             :    <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>.  */
     251             : #ifdef __hpux
     252             : # undef UINT_LEAST8_MAX
     253             : # undef UINT_LEAST16_MAX
     254             : # define UINT_LEAST8_MAX 255
     255             : # define UINT_LEAST16_MAX 65535
     256             : #endif
     257             : 
     258             : #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
     259             : typedef __UINT_LEAST8_TYPE__ yytype_uint8;
     260             : #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
     261             :        && UINT_LEAST8_MAX <= INT_MAX)
     262             : typedef uint_least8_t yytype_uint8;
     263             : #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
     264             : typedef unsigned char yytype_uint8;
     265             : #else
     266             : typedef short yytype_uint8;
     267             : #endif
     268             : 
     269             : #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
     270             : typedef __UINT_LEAST16_TYPE__ yytype_uint16;
     271             : #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
     272             :        && UINT_LEAST16_MAX <= INT_MAX)
     273             : typedef uint_least16_t yytype_uint16;
     274             : #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
     275             : typedef unsigned short yytype_uint16;
     276             : #else
     277             : typedef int yytype_uint16;
     278             : #endif
     279             : 
     280             : #ifndef YYPTRDIFF_T
     281             : # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
     282             : #  define YYPTRDIFF_T __PTRDIFF_TYPE__
     283             : #  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
     284             : # elif defined PTRDIFF_MAX
     285             : #  ifndef ptrdiff_t
     286             : #   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
     287             : #  endif
     288             : #  define YYPTRDIFF_T ptrdiff_t
     289             : #  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
     290             : # else
     291             : #  define YYPTRDIFF_T long
     292             : #  define YYPTRDIFF_MAXIMUM LONG_MAX
     293             : # endif
     294             : #endif
     295             : 
     296             : #ifndef YYSIZE_T
     297             : # ifdef __SIZE_TYPE__
     298             : #  define YYSIZE_T __SIZE_TYPE__
     299             : # elif defined size_t
     300             : #  define YYSIZE_T size_t
     301             : # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
     302             : #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
     303             : #  define YYSIZE_T size_t
     304             : # else
     305             : #  define YYSIZE_T unsigned
     306             : # endif
     307             : #endif
     308             : 
     309             : #define YYSIZE_MAXIMUM                                  \
     310             :   YY_CAST (YYPTRDIFF_T,                                 \
     311             :            (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
     312             :             ? YYPTRDIFF_MAXIMUM                         \
     313             :             : YY_CAST (YYSIZE_T, -1)))
     314             : 
     315             : #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
     316             : 
     317             : 
     318             : /* Stored state numbers (used for stacks). */
     319             : typedef yytype_int8 yy_state_t;
     320             : 
     321             : /* State numbers in computations.  */
     322             : typedef int yy_state_fast_t;
     323             : 
     324             : #ifndef YY_
     325             : # if defined YYENABLE_NLS && YYENABLE_NLS
     326             : #  if ENABLE_NLS
     327             : #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
     328             : #   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
     329             : #  endif
     330             : # endif
     331             : # ifndef YY_
     332             : #  define YY_(Msgid) Msgid
     333             : # endif
     334             : #endif
     335             : 
     336             : 
     337             : #ifndef YY_ATTRIBUTE_PURE
     338             : # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
     339             : #  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
     340             : # else
     341             : #  define YY_ATTRIBUTE_PURE
     342             : # endif
     343             : #endif
     344             : 
     345             : #ifndef YY_ATTRIBUTE_UNUSED
     346             : # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
     347             : #  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
     348             : # else
     349             : #  define YY_ATTRIBUTE_UNUSED
     350             : # endif
     351             : #endif
     352             : 
     353             : /* Suppress unused-variable warnings by "using" E.  */
     354             : #if ! defined lint || defined __GNUC__
     355             : # define YY_USE(E) ((void) (E))
     356             : #else
     357             : # define YY_USE(E) /* empty */
     358             : #endif
     359             : 
     360             : #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
     361             : /* Suppress an incorrect diagnostic about yylval being uninitialized.  */
     362             : # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                            \
     363             :     _Pragma ("GCC diagnostic push")                                     \
     364             :     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
     365             :     _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
     366             : # define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
     367             :     _Pragma ("GCC diagnostic pop")
     368             : #else
     369             : # define YY_INITIAL_VALUE(Value) Value
     370             : #endif
     371             : #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
     372             : # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
     373             : # define YY_IGNORE_MAYBE_UNINITIALIZED_END
     374             : #endif
     375             : #ifndef YY_INITIAL_VALUE
     376             : # define YY_INITIAL_VALUE(Value) /* Nothing. */
     377             : #endif
     378             : 
     379             : #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
     380             : # define YY_IGNORE_USELESS_CAST_BEGIN                          \
     381             :     _Pragma ("GCC diagnostic push")                            \
     382             :     _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
     383             : # define YY_IGNORE_USELESS_CAST_END            \
     384             :     _Pragma ("GCC diagnostic pop")
     385             : #endif
     386             : #ifndef YY_IGNORE_USELESS_CAST_BEGIN
     387             : # define YY_IGNORE_USELESS_CAST_BEGIN
     388             : # define YY_IGNORE_USELESS_CAST_END
     389             : #endif
     390             : 
     391             : 
     392             : #define YY_ASSERT(E) ((void) (0 && (E)))
     393             : 
     394             : #if !defined yyoverflow
     395             : 
     396             : /* The parser invokes alloca or malloc; define the necessary symbols.  */
     397             : 
     398             : # ifdef YYSTACK_USE_ALLOCA
     399             : #  if YYSTACK_USE_ALLOCA
     400             : #   ifdef __GNUC__
     401             : #    define YYSTACK_ALLOC __builtin_alloca
     402             : #   elif defined __BUILTIN_VA_ARG_INCR
     403             : #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
     404             : #   elif defined _AIX
     405             : #    define YYSTACK_ALLOC __alloca
     406             : #   elif defined _MSC_VER
     407             : #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
     408             : #    define alloca _alloca
     409             : #   else
     410             : #    define YYSTACK_ALLOC alloca
     411             : #    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
     412             : #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
     413             :       /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
     414             : #     ifndef EXIT_SUCCESS
     415             : #      define EXIT_SUCCESS 0
     416             : #     endif
     417             : #    endif
     418             : #   endif
     419             : #  endif
     420             : # endif
     421             : 
     422             : # ifdef YYSTACK_ALLOC
     423             :    /* Pacify GCC's 'empty if-body' warning.  */
     424             : #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
     425             : #  ifndef YYSTACK_ALLOC_MAXIMUM
     426             :     /* The OS might guarantee only one guard page at the bottom of the stack,
     427             :        and a page size can be as small as 4096 bytes.  So we cannot safely
     428             :        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
     429             :        to allow for a few compiler-allocated temporary stack slots.  */
     430             : #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
     431             : #  endif
     432             : # else
     433             : #  define YYSTACK_ALLOC YYMALLOC
     434             : #  define YYSTACK_FREE YYFREE
     435             : #  ifndef YYSTACK_ALLOC_MAXIMUM
     436             : #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
     437             : #  endif
     438             : #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
     439             :        && ! ((defined YYMALLOC || defined malloc) \
     440             :              && (defined YYFREE || defined free)))
     441             : #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
     442             : #   ifndef EXIT_SUCCESS
     443             : #    define EXIT_SUCCESS 0
     444             : #   endif
     445             : #  endif
     446             : #  ifndef YYMALLOC
     447             : #   define YYMALLOC malloc
     448             : #   if ! defined malloc && ! defined EXIT_SUCCESS
     449             : void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
     450             : #   endif
     451             : #  endif
     452             : #  ifndef YYFREE
     453             : #   define YYFREE free
     454             : #   if ! defined free && ! defined EXIT_SUCCESS
     455             : void free (void *); /* INFRINGES ON USER NAME SPACE */
     456             : #   endif
     457             : #  endif
     458             : # endif
     459             : #endif /* !defined yyoverflow */
     460             : 
     461             : #if (! defined yyoverflow \
     462             :      && (! defined __cplusplus \
     463             :          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
     464             : 
     465             : /* A type that is properly aligned for any stack member.  */
     466             : union yyalloc
     467             : {
     468             :   yy_state_t yyss_alloc;
     469             :   YYSTYPE yyvs_alloc;
     470             : };
     471             : 
     472             : /* The size of the maximum gap between one aligned stack and the next.  */
     473             : # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
     474             : 
     475             : /* The size of an array large to enough to hold all stacks, each with
     476             :    N elements.  */
     477             : # define YYSTACK_BYTES(N) \
     478             :      ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
     479             :       + YYSTACK_GAP_MAXIMUM)
     480             : 
     481             : # define YYCOPY_NEEDED 1
     482             : 
     483             : /* Relocate STACK from its old location to the new one.  The
     484             :    local variables YYSIZE and YYSTACKSIZE give the old and new number of
     485             :    elements in the stack, and YYPTR gives the new location of the
     486             :    stack.  Advance YYPTR to a properly aligned location for the next
     487             :    stack.  */
     488             : # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
     489             :     do                                                                  \
     490             :       {                                                                 \
     491             :         YYPTRDIFF_T yynewbytes;                                         \
     492             :         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
     493             :         Stack = &yyptr->Stack_alloc;                                    \
     494             :         yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
     495             :         yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
     496             :       }                                                                 \
     497             :     while (0)
     498             : 
     499             : #endif
     500             : 
     501             : #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
     502             : /* Copy COUNT objects from SRC to DST.  The source and destination do
     503             :    not overlap.  */
     504             : # ifndef YYCOPY
     505             : #  if defined __GNUC__ && 1 < __GNUC__
     506             : #   define YYCOPY(Dst, Src, Count) \
     507             :       __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
     508             : #  else
     509             : #   define YYCOPY(Dst, Src, Count)              \
     510             :       do                                        \
     511             :         {                                       \
     512             :           YYPTRDIFF_T yyi;                      \
     513             :           for (yyi = 0; yyi < (Count); yyi++)   \
     514             :             (Dst)[yyi] = (Src)[yyi];            \
     515             :         }                                       \
     516             :       while (0)
     517             : #  endif
     518             : # endif
     519             : #endif /* !YYCOPY_NEEDED */
     520             : 
     521             : /* YYFINAL -- State number of the termination state.  */
     522             : #define YYFINAL  8
     523             : /* YYLAST -- Last index in YYTABLE.  */
     524             : #define YYLAST   12
     525             : 
     526             : /* YYNTOKENS -- Number of terminals.  */
     527             : #define YYNTOKENS  7
     528             : /* YYNNTS -- Number of nonterminals.  */
     529             : #define YYNNTS  4
     530             : /* YYNRULES -- Number of rules.  */
     531             : #define YYNRULES  9
     532             : /* YYNSTATES -- Number of states.  */
     533             : #define YYNSTATES  14
     534             : 
     535             : /* YYMAXUTOK -- Last valid token kind.  */
     536             : #define YYMAXUTOK   261
     537             : 
     538             : 
     539             : /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
     540             :    as returned by yylex, with out-of-bounds checking.  */
     541             : #define YYTRANSLATE(YYX)                                \
     542             :   (0 <= (YYX) && (YYX) <= YYMAXUTOK                     \
     543             :    ? YY_CAST (yysymbol_kind_t, yytranslate[YYX])        \
     544             :    : YYSYMBOL_YYUNDEF)
     545             : 
     546             : /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
     547             :    as returned by yylex.  */
     548             : static const yytype_int8 yytranslate[] =
     549             : {
     550             :        0,     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,     2,     2,     2,     2,
     566             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     567             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     568             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     569             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     570             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     571             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     572             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     573             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     574             :        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     575             :        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
     576             :        5,     6
     577             : };
     578             : 
     579             : #if YYDEBUG
     580             :   /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
     581             : static const yytype_uint8 yyrline[] =
     582             : {
     583             :        0,    61,    61,    73,    91,   101,   111,   119,   128,   139
     584             : };
     585             : #endif
     586             : 
     587             : /** Accessing symbol of state STATE.  */
     588             : #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
     589             : 
     590             : #if YYDEBUG || 0
     591             : /* The user-facing name of the symbol whose (internal) number is
     592             :    YYSYMBOL.  No bounds checking.  */
     593             : static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
     594             : 
     595             : /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
     596             :    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
     597             : static const char *const yytname[] =
     598             : {
     599             :   "\"end of file\"", "error", "\"invalid token\"", "SEGFLOAT", "RANGE",
     600             :   "PLUMIN", "EXTENSION", "$accept", "range", "boundary", "deviation", YY_NULLPTR
     601             : };
     602             : 
     603             : static const char *
     604             : yysymbol_name (yysymbol_kind_t yysymbol)
     605             : {
     606             :   return yytname[yysymbol];
     607             : }
     608             : #endif
     609             : 
     610             : #ifdef YYPRINT
     611             : /* YYTOKNUM[NUM] -- (External) token number corresponding to the
     612             :    (internal) symbol number NUM (which must be that of a token).  */
     613             : static const yytype_int16 yytoknum[] =
     614             : {
     615             :        0,   256,   257,   258,   259,   260,   261
     616             : };
     617             : #endif
     618             : 
     619             : #define YYPACT_NINF (-3)
     620             : 
     621             : #define yypact_value_is_default(Yyn) \
     622             :   ((Yyn) == YYPACT_NINF)
     623             : 
     624             : #define YYTABLE_NINF (-1)
     625             : 
     626             : #define yytable_value_is_error(Yyn) \
     627             :   0
     628             : 
     629             :   /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
     630             :      STATE-NUM.  */
     631             : static const yytype_int8 yypact[] =
     632             : {
     633             :       -1,    -3,     3,     1,     8,     6,    -3,    -3,    -3,     3,
     634             :        9,    -3,    -3,    -3
     635             : };
     636             : 
     637             :   /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
     638             :      Performed when YYTABLE does not specify something else to do.  Zero
     639             :      means the default is an error.  */
     640             : static const yytype_int8 yydefact[] =
     641             : {
     642             :        0,     7,     0,     0,     0,     6,     5,     8,     1,     4,
     643             :        0,     3,     9,     2
     644             : };
     645             : 
     646             :   /* YYPGOTO[NTERM-NUM].  */
     647             : static const yytype_int8 yypgoto[] =
     648             : {
     649             :       -3,    -3,    -2,    -3
     650             : };
     651             : 
     652             :   /* YYDEFGOTO[NTERM-NUM].  */
     653             : static const yytype_int8 yydefgoto[] =
     654             : {
     655             :        0,     4,     5,    13
     656             : };
     657             : 
     658             :   /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
     659             :      positive, shift that token.  If negative, reduce the rule whose
     660             :      number is the opposite.  If YYTABLE_NINF, syntax error.  */
     661             : static const yytype_int8 yytable[] =
     662             : {
     663             :        6,     0,     1,     2,     7,     3,     1,    11,     8,     3,
     664             :        9,    10,    12
     665             : };
     666             : 
     667             : static const yytype_int8 yycheck[] =
     668             : {
     669             :        2,    -1,     3,     4,     3,     6,     3,     9,     0,     6,
     670             :        4,     5,     3
     671             : };
     672             : 
     673             :   /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
     674             :      symbol of state STATE-NUM.  */
     675             : static const yytype_int8 yystos[] =
     676             : {
     677             :        0,     3,     4,     6,     8,     9,     9,     3,     0,     4,
     678             :        5,     9,     3,    10
     679             : };
     680             : 
     681             :   /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
     682             : static const yytype_int8 yyr1[] =
     683             : {
     684             :        0,     7,     8,     8,     8,     8,     8,     9,     9,    10
     685             : };
     686             : 
     687             :   /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
     688             : static const yytype_int8 yyr2[] =
     689             : {
     690             :        0,     2,     3,     3,     2,     2,     1,     1,     2,     1
     691             : };
     692             : 
     693             : 
     694             : enum { YYENOMEM = -2 };
     695             : 
     696             : #define yyerrok         (yyerrstatus = 0)
     697             : #define yyclearin       (yychar = YYEMPTY)
     698             : 
     699             : #define YYACCEPT        goto yyacceptlab
     700             : #define YYABORT         goto yyabortlab
     701             : #define YYERROR         goto yyerrorlab
     702             : 
     703             : 
     704             : #define YYRECOVERING()  (!!yyerrstatus)
     705             : 
     706             : #define YYBACKUP(Token, Value)                                    \
     707             :   do                                                              \
     708             :     if (yychar == YYEMPTY)                                        \
     709             :       {                                                           \
     710             :         yychar = (Token);                                         \
     711             :         yylval = (Value);                                         \
     712             :         YYPOPSTACK (yylen);                                       \
     713             :         yystate = *yyssp;                                         \
     714             :         goto yybackup;                                            \
     715             :       }                                                           \
     716             :     else                                                          \
     717             :       {                                                           \
     718             :         yyerror (result, YY_("syntax error: cannot back up")); \
     719             :         YYERROR;                                                  \
     720             :       }                                                           \
     721             :   while (0)
     722             : 
     723             : /* Backward compatibility with an undocumented macro.
     724             :    Use YYerror or YYUNDEF. */
     725             : #define YYERRCODE YYUNDEF
     726             : 
     727             : 
     728             : /* Enable debugging if requested.  */
     729             : #if YYDEBUG
     730             : 
     731             : # ifndef YYFPRINTF
     732             : #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
     733             : #  define YYFPRINTF fprintf
     734             : # endif
     735             : 
     736             : # define YYDPRINTF(Args)                        \
     737             : do {                                            \
     738             :   if (yydebug)                                  \
     739             :     YYFPRINTF Args;                             \
     740             : } while (0)
     741             : 
     742             : /* This macro is provided for backward compatibility. */
     743             : # ifndef YY_LOCATION_PRINT
     744             : #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
     745             : # endif
     746             : 
     747             : 
     748             : # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
     749             : do {                                                                      \
     750             :   if (yydebug)                                                            \
     751             :     {                                                                     \
     752             :       YYFPRINTF (stderr, "%s ", Title);                                   \
     753             :       yy_symbol_print (stderr,                                            \
     754             :                   Kind, Value, result); \
     755             :       YYFPRINTF (stderr, "\n");                                           \
     756             :     }                                                                     \
     757             : } while (0)
     758             : 
     759             : 
     760             : /*-----------------------------------.
     761             : | Print this symbol's value on YYO.  |
     762             : `-----------------------------------*/
     763             : 
     764             : static void
     765             : yy_symbol_value_print (FILE *yyo,
     766             :                        yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, SEG *result)
     767             : {
     768             :   FILE *yyoutput = yyo;
     769             :   YY_USE (yyoutput);
     770             :   YY_USE (result);
     771             :   if (!yyvaluep)
     772             :     return;
     773             : # ifdef YYPRINT
     774             :   if (yykind < YYNTOKENS)
     775             :     YYPRINT (yyo, yytoknum[yykind], *yyvaluep);
     776             : # endif
     777             :   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
     778             :   YY_USE (yykind);
     779             :   YY_IGNORE_MAYBE_UNINITIALIZED_END
     780             : }
     781             : 
     782             : 
     783             : /*---------------------------.
     784             : | Print this symbol on YYO.  |
     785             : `---------------------------*/
     786             : 
     787             : static void
     788             : yy_symbol_print (FILE *yyo,
     789             :                  yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, SEG *result)
     790             : {
     791             :   YYFPRINTF (yyo, "%s %s (",
     792             :              yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
     793             : 
     794             :   yy_symbol_value_print (yyo, yykind, yyvaluep, result);
     795             :   YYFPRINTF (yyo, ")");
     796             : }
     797             : 
     798             : /*------------------------------------------------------------------.
     799             : | yy_stack_print -- Print the state stack from its BOTTOM up to its |
     800             : | TOP (included).                                                   |
     801             : `------------------------------------------------------------------*/
     802             : 
     803             : static void
     804             : yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
     805             : {
     806             :   YYFPRINTF (stderr, "Stack now");
     807             :   for (; yybottom <= yytop; yybottom++)
     808             :     {
     809             :       int yybot = *yybottom;
     810             :       YYFPRINTF (stderr, " %d", yybot);
     811             :     }
     812             :   YYFPRINTF (stderr, "\n");
     813             : }
     814             : 
     815             : # define YY_STACK_PRINT(Bottom, Top)                            \
     816             : do {                                                            \
     817             :   if (yydebug)                                                  \
     818             :     yy_stack_print ((Bottom), (Top));                           \
     819             : } while (0)
     820             : 
     821             : 
     822             : /*------------------------------------------------.
     823             : | Report that the YYRULE is going to be reduced.  |
     824             : `------------------------------------------------*/
     825             : 
     826             : static void
     827             : yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
     828             :                  int yyrule, SEG *result)
     829             : {
     830             :   int yylno = yyrline[yyrule];
     831             :   int yynrhs = yyr2[yyrule];
     832             :   int yyi;
     833             :   YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
     834             :              yyrule - 1, yylno);
     835             :   /* The symbols being reduced.  */
     836             :   for (yyi = 0; yyi < yynrhs; yyi++)
     837             :     {
     838             :       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
     839             :       yy_symbol_print (stderr,
     840             :                        YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
     841             :                        &yyvsp[(yyi + 1) - (yynrhs)], result);
     842             :       YYFPRINTF (stderr, "\n");
     843             :     }
     844             : }
     845             : 
     846             : # define YY_REDUCE_PRINT(Rule)          \
     847             : do {                                    \
     848             :   if (yydebug)                          \
     849             :     yy_reduce_print (yyssp, yyvsp, Rule, result); \
     850             : } while (0)
     851             : 
     852             : /* Nonzero means print parse trace.  It is left uninitialized so that
     853             :    multiple parsers can coexist.  */
     854             : int yydebug;
     855             : #else /* !YYDEBUG */
     856             : # define YYDPRINTF(Args) ((void) 0)
     857             : # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
     858             : # define YY_STACK_PRINT(Bottom, Top)
     859             : # define YY_REDUCE_PRINT(Rule)
     860             : #endif /* !YYDEBUG */
     861             : 
     862             : 
     863             : /* YYINITDEPTH -- initial size of the parser's stacks.  */
     864             : #ifndef YYINITDEPTH
     865             : # define YYINITDEPTH 200
     866             : #endif
     867             : 
     868             : /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
     869             :    if the built-in stack extension method is used).
     870             : 
     871             :    Do not make this value too large; the results are undefined if
     872             :    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
     873             :    evaluated with infinite-precision integer arithmetic.  */
     874             : 
     875             : #ifndef YYMAXDEPTH
     876             : # define YYMAXDEPTH 10000
     877             : #endif
     878             : 
     879             : 
     880             : 
     881             : 
     882             : 
     883             : 
     884             : /*-----------------------------------------------.
     885             : | Release the memory associated to this symbol.  |
     886             : `-----------------------------------------------*/
     887             : 
     888             : static void
     889       11204 : yydestruct (const char *yymsg,
     890             :             yysymbol_kind_t yykind, YYSTYPE *yyvaluep, SEG *result)
     891             : {
     892             :   YY_USE (yyvaluep);
     893             :   YY_USE (result);
     894       11204 :   if (!yymsg)
     895           0 :     yymsg = "Deleting";
     896             :   YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
     897             : 
     898             :   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
     899             :   YY_USE (yykind);
     900             :   YY_IGNORE_MAYBE_UNINITIALIZED_END
     901       11204 : }
     902             : 
     903             : 
     904             : /* Lookahead token kind.  */
     905             : int yychar;
     906             : 
     907             : /* The semantic value of the lookahead symbol.  */
     908             : YYSTYPE yylval;
     909             : /* Number of syntax errors so far.  */
     910             : int yynerrs;
     911             : 
     912             : 
     913             : 
     914             : 
     915             : /*----------.
     916             : | yyparse.  |
     917             : `----------*/
     918             : 
     919             : int
     920        5620 : yyparse (SEG *result)
     921             : {
     922        5620 :     yy_state_fast_t yystate = 0;
     923             :     /* Number of tokens to shift before error messages enabled.  */
     924        5620 :     int yyerrstatus = 0;
     925             : 
     926             :     /* Refer to the stacks through separate pointers, to allow yyoverflow
     927             :        to reallocate them elsewhere.  */
     928             : 
     929             :     /* Their size.  */
     930        5620 :     YYPTRDIFF_T yystacksize = YYINITDEPTH;
     931             : 
     932             :     /* The state stack: array, bottom, top.  */
     933             :     yy_state_t yyssa[YYINITDEPTH];
     934        5620 :     yy_state_t *yyss = yyssa;
     935        5620 :     yy_state_t *yyssp = yyss;
     936             : 
     937             :     /* The semantic value stack: array, bottom, top.  */
     938             :     YYSTYPE yyvsa[YYINITDEPTH];
     939        5620 :     YYSTYPE *yyvs = yyvsa;
     940        5620 :     YYSTYPE *yyvsp = yyvs;
     941             : 
     942             :   int yyn;
     943             :   /* The return value of yyparse.  */
     944             :   int yyresult;
     945             :   /* Lookahead symbol kind.  */
     946        5620 :   yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
     947             :   /* The variables used to return semantic value and location from the
     948             :      action routines.  */
     949             :   YYSTYPE yyval;
     950             : 
     951             : 
     952             : 
     953             : #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
     954             : 
     955             :   /* The number of symbols on the RHS of the reduced rule.
     956             :      Keep to zero when no symbol should be popped.  */
     957        5620 :   int yylen = 0;
     958             : 
     959             :   YYDPRINTF ((stderr, "Starting parse\n"));
     960             : 
     961        5620 :   yychar = YYEMPTY; /* Cause a token to be read.  */
     962        5620 :   goto yysetstate;
     963             : 
     964             : 
     965             : /*------------------------------------------------------------.
     966             : | yynewstate -- push a new state, which is found in yystate.  |
     967             : `------------------------------------------------------------*/
     968       39188 : yynewstate:
     969             :   /* In all cases, when you get here, the value and location stacks
     970             :      have just been pushed.  So pushing a state here evens the stacks.  */
     971       39188 :   yyssp++;
     972             : 
     973             : 
     974             : /*--------------------------------------------------------------------.
     975             : | yysetstate -- set current state (the top of the stack) to yystate.  |
     976             : `--------------------------------------------------------------------*/
     977       44808 : yysetstate:
     978             :   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
     979             :   YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
     980             :   YY_IGNORE_USELESS_CAST_BEGIN
     981       44808 :   *yyssp = YY_CAST (yy_state_t, yystate);
     982             :   YY_IGNORE_USELESS_CAST_END
     983             :   YY_STACK_PRINT (yyss, yyssp);
     984             : 
     985       44808 :   if (yyss + yystacksize - 1 <= yyssp)
     986             : #if !defined yyoverflow && !defined YYSTACK_RELOCATE
     987             :     goto yyexhaustedlab;
     988             : #else
     989             :     {
     990             :       /* Get the current used size of the three stacks, in elements.  */
     991           0 :       YYPTRDIFF_T yysize = yyssp - yyss + 1;
     992             : 
     993             : # if defined yyoverflow
     994             :       {
     995             :         /* Give user a chance to reallocate the stack.  Use copies of
     996             :            these so that the &'s don't force the real ones into
     997             :            memory.  */
     998             :         yy_state_t *yyss1 = yyss;
     999             :         YYSTYPE *yyvs1 = yyvs;
    1000             : 
    1001             :         /* Each stack pointer address is followed by the size of the
    1002             :            data in use in that stack, in bytes.  This used to be a
    1003             :            conditional around just the two extra args, but that might
    1004             :            be undefined if yyoverflow is a macro.  */
    1005             :         yyoverflow (YY_("memory exhausted"),
    1006             :                     &yyss1, yysize * YYSIZEOF (*yyssp),
    1007             :                     &yyvs1, yysize * YYSIZEOF (*yyvsp),
    1008             :                     &yystacksize);
    1009             :         yyss = yyss1;
    1010             :         yyvs = yyvs1;
    1011             :       }
    1012             : # else /* defined YYSTACK_RELOCATE */
    1013             :       /* Extend the stack our own way.  */
    1014           0 :       if (YYMAXDEPTH <= yystacksize)
    1015           0 :         goto yyexhaustedlab;
    1016           0 :       yystacksize *= 2;
    1017           0 :       if (YYMAXDEPTH < yystacksize)
    1018           0 :         yystacksize = YYMAXDEPTH;
    1019             : 
    1020             :       {
    1021           0 :         yy_state_t *yyss1 = yyss;
    1022             :         union yyalloc *yyptr =
    1023           0 :           YY_CAST (union yyalloc *,
    1024             :                    YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
    1025           0 :         if (! yyptr)
    1026           0 :           goto yyexhaustedlab;
    1027           0 :         YYSTACK_RELOCATE (yyss_alloc, yyss);
    1028           0 :         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
    1029             : #  undef YYSTACK_RELOCATE
    1030           0 :         if (yyss1 != yyssa)
    1031           0 :           YYSTACK_FREE (yyss1);
    1032             :       }
    1033             : # endif
    1034             : 
    1035           0 :       yyssp = yyss + yysize - 1;
    1036           0 :       yyvsp = yyvs + yysize - 1;
    1037             : 
    1038             :       YY_IGNORE_USELESS_CAST_BEGIN
    1039             :       YYDPRINTF ((stderr, "Stack size increased to %ld\n",
    1040             :                   YY_CAST (long, yystacksize)));
    1041             :       YY_IGNORE_USELESS_CAST_END
    1042             : 
    1043           0 :       if (yyss + yystacksize - 1 <= yyssp)
    1044           0 :         YYABORT;
    1045             :     }
    1046             : #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
    1047             : 
    1048       44808 :   if (yystate == YYFINAL)
    1049        5602 :     YYACCEPT;
    1050             : 
    1051       39206 :   goto yybackup;
    1052             : 
    1053             : 
    1054             : /*-----------.
    1055             : | yybackup.  |
    1056             : `-----------*/
    1057       39206 : yybackup:
    1058             :   /* Do appropriate processing given the current state.  Read a
    1059             :      lookahead token if we need one and don't already have one.  */
    1060             : 
    1061             :   /* First try to decide what to do without reference to lookahead token.  */
    1062       39206 :   yyn = yypact[yystate];
    1063       39206 :   if (yypact_value_is_default (yyn))
    1064       15128 :     goto yydefault;
    1065             : 
    1066             :   /* Not known => get a lookahead token if don't already have one.  */
    1067             : 
    1068             :   /* YYCHAR is either empty, or end-of-input, or a valid lookahead.  */
    1069       24078 :   if (yychar == YYEMPTY)
    1070             :     {
    1071             :       YYDPRINTF ((stderr, "Reading a token\n"));
    1072       23272 :       yychar = yylex ();
    1073             :     }
    1074             : 
    1075       24078 :   if (yychar <= YYEOF)
    1076             :     {
    1077        6402 :       yychar = YYEOF;
    1078        6402 :       yytoken = YYSYMBOL_YYEOF;
    1079             :       YYDPRINTF ((stderr, "Now at end of input.\n"));
    1080             :     }
    1081       17676 :   else if (yychar == YYerror)
    1082             :     {
    1083             :       /* The scanner already issued an error message, process directly
    1084             :          to error recovery.  But do not keep the error token as
    1085             :          lookahead, it is too special and may lead us to an endless
    1086             :          loop in error recovery. */
    1087           0 :       yychar = YYUNDEF;
    1088           0 :       yytoken = YYSYMBOL_YYerror;
    1089           0 :       goto yyerrlab1;
    1090             :     }
    1091             :   else
    1092             :     {
    1093       17676 :       yytoken = YYTRANSLATE (yychar);
    1094             :       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
    1095             :     }
    1096             : 
    1097             :   /* If the proper action on seeing token YYTOKEN is to reduce or to
    1098             :      detect an error, take that action.  */
    1099       24078 :   yyn += yytoken;
    1100       24078 :   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
    1101         822 :     goto yydefault;
    1102       23256 :   yyn = yytable[yyn];
    1103       23256 :   if (yyn <= 0)
    1104             :     {
    1105             :       if (yytable_value_is_error (yyn))
    1106             :         goto yyerrlab;
    1107           0 :       yyn = -yyn;
    1108           0 :       goto yyreduce;
    1109             :     }
    1110             : 
    1111             :   /* Count tokens shifted since error; after three, turn off error
    1112             :      status.  */
    1113       23256 :   if (yyerrstatus)
    1114           0 :     yyerrstatus--;
    1115             : 
    1116             :   /* Shift the lookahead token.  */
    1117             :   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
    1118       23256 :   yystate = yyn;
    1119             :   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
    1120       23256 :   *++yyvsp = yylval;
    1121             :   YY_IGNORE_MAYBE_UNINITIALIZED_END
    1122             : 
    1123             :   /* Discard the shifted token.  */
    1124       23256 :   yychar = YYEMPTY;
    1125       23256 :   goto yynewstate;
    1126             : 
    1127             : 
    1128             : /*-----------------------------------------------------------.
    1129             : | yydefault -- do the default action for the current state.  |
    1130             : `-----------------------------------------------------------*/
    1131       15950 : yydefault:
    1132       15950 :   yyn = yydefact[yystate];
    1133       15950 :   if (yyn == 0)
    1134          16 :     goto yyerrlab;
    1135       15934 :   goto yyreduce;
    1136             : 
    1137             : 
    1138             : /*-----------------------------.
    1139             : | yyreduce -- do a reduction.  |
    1140             : `-----------------------------*/
    1141       15934 : yyreduce:
    1142             :   /* yyn is the number of a rule to reduce with.  */
    1143       15934 :   yylen = yyr2[yyn];
    1144             : 
    1145             :   /* If YYLEN is nonzero, implement the default value of the action:
    1146             :      '$$ = $1'.
    1147             : 
    1148             :      Otherwise, the following line sets YYVAL to garbage.
    1149             :      This behavior is undocumented and Bison
    1150             :      users should not rely upon it.  Assigning to YYVAL
    1151             :      unconditionally makes the parser a bit smaller, and it avoids a
    1152             :      GCC warning that YYVAL may be used uninitialized.  */
    1153       15934 :   yyval = yyvsp[1-yylen];
    1154             : 
    1155             : 
    1156             :   YY_REDUCE_PRINT (yyn);
    1157       15934 :   switch (yyn)
    1158             :     {
    1159          10 :   case 2: /* range: boundary PLUMIN deviation  */
    1160             : #line 62 "segparse.y"
    1161             :         {
    1162             :         result->lower = (yyvsp[-2].bnd).val - (yyvsp[0].bnd).val;
    1163             :         result->upper = (yyvsp[-2].bnd).val + (yyvsp[0].bnd).val;
    1164             :         sprintf(strbuf, "%g", result->lower);
    1165             :         result->l_sigd = Max(Min(6, significant_digits(strbuf)), Max((yyvsp[-2].bnd).sigd, (yyvsp[0].bnd).sigd));
    1166             :         sprintf(strbuf, "%g", result->upper);
    1167             :         result->u_sigd = Max(Min(6, significant_digits(strbuf)), Max((yyvsp[-2].bnd).sigd, (yyvsp[0].bnd).sigd));
    1168             :         result->l_ext = '\0';
    1169             :         result->u_ext = '\0';
    1170             :     }
    1171             : #line 1172 "segparse.c"
    1172          10 :     break;
    1173             : 
    1174        4698 :   case 3: /* range: boundary RANGE boundary  */
    1175             : #line 74 "segparse.y"
    1176             :         {
    1177             :         result->lower = (yyvsp[-2].bnd).val;
    1178             :         result->upper = (yyvsp[0].bnd).val;
    1179             :         if ( result->lower > result->upper ) {
    1180             :             ereport(ERROR,
    1181             :                     (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
    1182             :                      errmsg("swapped boundaries: %g is greater than %g",
    1183             :                             result->lower, result->upper)));
    1184             : 
    1185             :             YYERROR;
    1186             :         }
    1187             :         result->l_sigd = (yyvsp[-2].bnd).sigd;
    1188             :         result->u_sigd = (yyvsp[0].bnd).sigd;
    1189             :         result->l_ext = ( (yyvsp[-2].bnd).ext ? (yyvsp[-2].bnd).ext : '\0' );
    1190             :         result->u_ext = ( (yyvsp[0].bnd).ext ? (yyvsp[0].bnd).ext : '\0' );
    1191             :     }
    1192             : #line 1193 "segparse.c"
    1193        4698 :     break;
    1194             : 
    1195          92 :   case 4: /* range: boundary RANGE  */
    1196             : #line 92 "segparse.y"
    1197             :         {
    1198             :         result->lower = (yyvsp[-1].bnd).val;
    1199             :         result->upper = HUGE_VAL;
    1200             :         result->l_sigd = (yyvsp[-1].bnd).sigd;
    1201             :         result->u_sigd = 0;
    1202             :         result->l_ext = ( (yyvsp[-1].bnd).ext ? (yyvsp[-1].bnd).ext : '\0' );
    1203             :         result->u_ext = '-';
    1204             :     }
    1205             : #line 1206 "segparse.c"
    1206          92 :     break;
    1207             : 
    1208          98 :   case 5: /* range: RANGE boundary  */
    1209             : #line 102 "segparse.y"
    1210             :         {
    1211             :         result->lower = -HUGE_VAL;
    1212             :         result->upper = (yyvsp[0].bnd).val;
    1213             :         result->l_sigd = 0;
    1214             :         result->u_sigd = (yyvsp[0].bnd).sigd;
    1215             :         result->l_ext = '-';
    1216             :         result->u_ext = ( (yyvsp[0].bnd).ext ? (yyvsp[0].bnd).ext : '\0' );
    1217             :     }
    1218             : #line 1219 "segparse.c"
    1219          98 :     break;
    1220             : 
    1221         714 :   case 6: /* range: boundary  */
    1222             : #line 112 "segparse.y"
    1223             :         {
    1224             :         result->lower = result->upper = (yyvsp[0].bnd).val;
    1225             :         result->l_sigd = result->u_sigd = (yyvsp[0].bnd).sigd;
    1226             :         result->l_ext = result->u_ext = ( (yyvsp[0].bnd).ext ? (yyvsp[0].bnd).ext : '\0' );
    1227             :     }
    1228             : #line 1229 "segparse.c"
    1229         714 :     break;
    1230             : 
    1231        7878 :   case 7: /* boundary: SEGFLOAT  */
    1232             : #line 120 "segparse.y"
    1233             :         {
    1234             :         /* temp variable avoids a gcc 3.3.x bug on Sparc64 */
    1235             :         float val = seg_atof((yyvsp[0].text));
    1236             : 
    1237             :         (yyval.bnd).ext = '\0';
    1238             :         (yyval.bnd).sigd = significant_digits((yyvsp[0].text));
    1239             :         (yyval.bnd).val = val;
    1240             :     }
    1241             : #line 1242 "segparse.c"
    1242        7876 :     break;
    1243             : 
    1244        2434 :   case 8: /* boundary: EXTENSION SEGFLOAT  */
    1245             : #line 129 "segparse.y"
    1246             :         {
    1247             :         /* temp variable avoids a gcc 3.3.x bug on Sparc64 */
    1248             :         float val = seg_atof((yyvsp[0].text));
    1249             : 
    1250             :         (yyval.bnd).ext = (yyvsp[-1].text)[0];
    1251             :         (yyval.bnd).sigd = significant_digits((yyvsp[0].text));
    1252             :         (yyval.bnd).val = val;
    1253             :     }
    1254             : #line 1255 "segparse.c"
    1255        2434 :     break;
    1256             : 
    1257          10 :   case 9: /* deviation: SEGFLOAT  */
    1258             : #line 140 "segparse.y"
    1259             :         {
    1260             :         /* temp variable avoids a gcc 3.3.x bug on Sparc64 */
    1261             :         float val = seg_atof((yyvsp[0].text));
    1262             : 
    1263             :         (yyval.bnd).ext = '\0';
    1264             :         (yyval.bnd).sigd = significant_digits((yyvsp[0].text));
    1265             :         (yyval.bnd).val = val;
    1266             :     }
    1267             : #line 1268 "segparse.c"
    1268          10 :     break;
    1269             : 
    1270             : 
    1271             : #line 1272 "segparse.c"
    1272             : 
    1273           0 :       default: break;
    1274             :     }
    1275             :   /* User semantic actions sometimes alter yychar, and that requires
    1276             :      that yytoken be updated with the new translation.  We take the
    1277             :      approach of translating immediately before every use of yytoken.
    1278             :      One alternative is translating here after every semantic action,
    1279             :      but that translation would be missed if the semantic action invokes
    1280             :      YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
    1281             :      if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
    1282             :      incorrect destructor might then be invoked immediately.  In the
    1283             :      case of YYERROR or YYBACKUP, subsequent parser actions might lead
    1284             :      to an incorrect destructor call or verbose syntax error message
    1285             :      before the lookahead is translated.  */
    1286             :   YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
    1287             : 
    1288       15932 :   YYPOPSTACK (yylen);
    1289       15932 :   yylen = 0;
    1290             : 
    1291       15932 :   *++yyvsp = yyval;
    1292             : 
    1293             :   /* Now 'shift' the result of the reduction.  Determine what state
    1294             :      that goes to, based on the state we popped back to and the rule
    1295             :      number reduced by.  */
    1296             :   {
    1297       15932 :     const int yylhs = yyr1[yyn] - YYNTOKENS;
    1298       15932 :     const int yyi = yypgoto[yylhs] + *yyssp;
    1299        4806 :     yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
    1300        4796 :                ? yytable[yyi]
    1301       20738 :                : yydefgoto[yylhs]);
    1302             :   }
    1303             : 
    1304       15932 :   goto yynewstate;
    1305             : 
    1306             : 
    1307             : /*--------------------------------------.
    1308             : | yyerrlab -- here on detecting error.  |
    1309             : `--------------------------------------*/
    1310          16 : yyerrlab:
    1311             :   /* Make sure we have latest lookahead translation.  See comments at
    1312             :      user semantic actions for why this is necessary.  */
    1313          16 :   yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
    1314             :   /* If not already recovering from an error, report this error.  */
    1315          16 :   if (!yyerrstatus)
    1316             :     {
    1317          16 :       ++yynerrs;
    1318          16 :       yyerror (result, YY_("syntax error"));
    1319             :     }
    1320             : 
    1321           0 :   if (yyerrstatus == 3)
    1322             :     {
    1323             :       /* If just tried and failed to reuse lookahead token after an
    1324             :          error, discard it.  */
    1325             : 
    1326           0 :       if (yychar <= YYEOF)
    1327             :         {
    1328             :           /* Return failure if at end of input.  */
    1329           0 :           if (yychar == YYEOF)
    1330           0 :             YYABORT;
    1331             :         }
    1332             :       else
    1333             :         {
    1334           0 :           yydestruct ("Error: discarding",
    1335             :                       yytoken, &yylval, result);
    1336           0 :           yychar = YYEMPTY;
    1337             :         }
    1338             :     }
    1339             : 
    1340             :   /* Else will try to reuse lookahead token after shifting the error
    1341             :      token.  */
    1342           0 :   goto yyerrlab1;
    1343             : 
    1344             : 
    1345             : /*---------------------------------------------------.
    1346             : | yyerrorlab -- error raised explicitly by YYERROR.  |
    1347             : `---------------------------------------------------*/
    1348             : yyerrorlab:
    1349             :   /* Pacify compilers when the user code never invokes YYERROR and the
    1350             :      label yyerrorlab therefore never appears in user code.  */
    1351             :   if (0)
    1352             :     YYERROR;
    1353             : 
    1354             :   /* Do not reclaim the symbols of the rule whose action triggered
    1355             :      this YYERROR.  */
    1356             :   YYPOPSTACK (yylen);
    1357             :   yylen = 0;
    1358             :   YY_STACK_PRINT (yyss, yyssp);
    1359             :   yystate = *yyssp;
    1360             :   goto yyerrlab1;
    1361             : 
    1362             : 
    1363             : /*-------------------------------------------------------------.
    1364             : | yyerrlab1 -- common code for both syntax error and YYERROR.  |
    1365             : `-------------------------------------------------------------*/
    1366           0 : yyerrlab1:
    1367           0 :   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
    1368             : 
    1369             :   /* Pop stack until we find a state that shifts the error token.  */
    1370             :   for (;;)
    1371             :     {
    1372           0 :       yyn = yypact[yystate];
    1373           0 :       if (!yypact_value_is_default (yyn))
    1374             :         {
    1375           0 :           yyn += YYSYMBOL_YYerror;
    1376           0 :           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
    1377             :             {
    1378           0 :               yyn = yytable[yyn];
    1379           0 :               if (0 < yyn)
    1380           0 :                 break;
    1381             :             }
    1382             :         }
    1383             : 
    1384             :       /* Pop the current state because it cannot handle the error token.  */
    1385           0 :       if (yyssp == yyss)
    1386           0 :         YYABORT;
    1387             : 
    1388             : 
    1389           0 :       yydestruct ("Error: popping",
    1390           0 :                   YY_ACCESSING_SYMBOL (yystate), yyvsp, result);
    1391           0 :       YYPOPSTACK (1);
    1392           0 :       yystate = *yyssp;
    1393             :       YY_STACK_PRINT (yyss, yyssp);
    1394             :     }
    1395             : 
    1396             :   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
    1397           0 :   *++yyvsp = yylval;
    1398             :   YY_IGNORE_MAYBE_UNINITIALIZED_END
    1399             : 
    1400             : 
    1401             :   /* Shift the error token.  */
    1402             :   YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
    1403             : 
    1404           0 :   yystate = yyn;
    1405           0 :   goto yynewstate;
    1406             : 
    1407             : 
    1408             : /*-------------------------------------.
    1409             : | yyacceptlab -- YYACCEPT comes here.  |
    1410             : `-------------------------------------*/
    1411        5602 : yyacceptlab:
    1412        5602 :   yyresult = 0;
    1413        5602 :   goto yyreturn;
    1414             : 
    1415             : 
    1416             : /*-----------------------------------.
    1417             : | yyabortlab -- YYABORT comes here.  |
    1418             : `-----------------------------------*/
    1419           0 : yyabortlab:
    1420           0 :   yyresult = 1;
    1421           0 :   goto yyreturn;
    1422             : 
    1423             : 
    1424             : #if !defined yyoverflow
    1425             : /*-------------------------------------------------.
    1426             : | yyexhaustedlab -- memory exhaustion comes here.  |
    1427             : `-------------------------------------------------*/
    1428           0 : yyexhaustedlab:
    1429           0 :   yyerror (result, YY_("memory exhausted"));
    1430             :   yyresult = 2;
    1431             :   goto yyreturn;
    1432             : #endif
    1433             : 
    1434             : 
    1435             : /*-------------------------------------------------------.
    1436             : | yyreturn -- parsing is finished, clean up and return.  |
    1437             : `-------------------------------------------------------*/
    1438        5602 : yyreturn:
    1439        5602 :   if (yychar != YYEMPTY)
    1440             :     {
    1441             :       /* Make sure we have latest lookahead translation.  See comments at
    1442             :          user semantic actions for why this is necessary.  */
    1443           0 :       yytoken = YYTRANSLATE (yychar);
    1444           0 :       yydestruct ("Cleanup: discarding lookahead",
    1445             :                   yytoken, &yylval, result);
    1446             :     }
    1447             :   /* Do not reclaim the symbols of the rule whose action triggered
    1448             :      this YYABORT or YYACCEPT.  */
    1449        5602 :   YYPOPSTACK (yylen);
    1450             :   YY_STACK_PRINT (yyss, yyssp);
    1451       16806 :   while (yyssp != yyss)
    1452             :     {
    1453       11204 :       yydestruct ("Cleanup: popping",
    1454       11204 :                   YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, result);
    1455       11204 :       YYPOPSTACK (1);
    1456             :     }
    1457             : #ifndef yyoverflow
    1458        5602 :   if (yyss != yyssa)
    1459           0 :     YYSTACK_FREE (yyss);
    1460             : #endif
    1461             : 
    1462        5602 :   return yyresult;
    1463             : }
    1464             : 
    1465             : #line 150 "segparse.y"
    1466             : 
    1467             : 
    1468             : 
    1469             : static float
    1470             : seg_atof(const char *value)
    1471             : {
    1472             :     Datum datum;
    1473             : 
    1474             :     datum = DirectFunctionCall1(float4in, CStringGetDatum(value));
    1475             :     return DatumGetFloat4(datum);
    1476             : }
    1477             : 
    1478             : 
    1479             : #include "segscan.c"

Generated by: LCOV version 1.14