1
/* A Bison parser, made by GNU Bison 1.875. */
3
/* Skeleton parser for Yacc-like parsing with Bison,
4
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
6
This program is free software; you can redistribute it and/or modify
2
/* A Bison parser, made by GNU Bison 2.4.1. */
4
/* Skeleton implementation for Bison's Yacc-like parsers in C
6
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7
Free Software Foundation, Inc.
9
This program is free software: you can redistribute it and/or modify
7
10
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2, or (at your option)
11
the Free Software Foundation, either version 3 of the License, or
12
(at your option) any later version.
11
14
This program is distributed in the hope that it will be useful,
12
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
17
GNU General Public License for more details.
16
19
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 59 Temple Place - Suite 330,
19
Boston, MA 02111-1307, USA. */
21
/* As a special exception, when this file is copied by Bison into a
22
Bison output file, you may use that output file without restriction.
23
This special exception was added by the Free Software Foundation
24
in version 1.24 of Bison. */
26
/* Written by Richard Stallman by simplifying the original so called
27
``semantic'' parser. */
20
along with this program. If not, see <http://www.gnu.org/licenses/>. */
22
/* As a special exception, you may create a larger work that contains
23
part or all of the Bison parser skeleton and distribute that work
24
under terms of your choice, so long as that work isn't itself a
25
parser generator using the skeleton or a modified version thereof
26
as a parser skeleton. Alternatively, if you modify or redistribute
27
the parser skeleton itself, you may (at your option) remove this
28
special exception, which will cause the skeleton and the resulting
29
Bison output files to be licensed under the GNU General Public
30
License without this special exception.
32
This special exception was added by the Free Software Foundation in
33
version 2.2 of Bison. */
35
/* C LALR(1) parser skeleton written by Richard Stallman, by
36
simplifying the original so-called "semantic" parser. */
29
38
/* All symbols defined below should begin with yy or YY, to avoid
30
39
infringing on user name space. This should be done even for local
36
45
/* Identify Bison output. */
49
#define YYBISON_VERSION "2.4.1"
39
51
/* Skeleton name. */
40
52
#define YYSKELETON_NAME "yacc.c"
42
54
/* Pure parsers. */
45
63
/* Using locations. */
46
64
#define YYLSP_NEEDED 0
48
/* If NAME_PREFIX is specified substitute the variables and functions
50
#define yyparse seg_yyparse
51
#define yylex seg_yylex
52
#define yyerror seg_yyerror
53
#define yylval seg_yylval
54
#define yychar seg_yychar
55
#define yydebug seg_yydebug
56
#define yynerrs seg_yynerrs
62
/* Put the tokens into the symbol table, so that GDB and other debuggers
66
/* Substitute the variable and function names. */
67
#define yyparse seg_yyparse
68
#define yylex seg_yylex
69
#define yyerror seg_yyerror
70
#define yylval seg_yylval
71
#define yychar seg_yychar
72
#define yydebug seg_yydebug
73
#define yynerrs seg_yynerrs
79
76
/* Copy the first part of user declarations. */
78
/* Line 189 of yacc.c */
80
79
#line 1 "segparse.y"
82
81
#define YYPARSE_PARAM result /* need this to pass a pointer (void *) to yyparse */
132
134
# define YYERROR_VERBOSE 0
135
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
137
/* Enabling the token table. */
138
#ifndef YYTOKEN_TABLE
139
# define YYTOKEN_TABLE 0
146
/* Put the tokens into the symbol table, so that GDB and other debuggers
158
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
159
typedef union YYSTYPE
162
/* Line 214 of yacc.c */
136
163
#line 46 "segparse.y"
137
typedef union YYSTYPE {
174
/* Line 214 of yacc.c */
175
#line 176 "segparse.c"
145
/* Line 186 of yacc.c. */
146
#line 146 "segparse.c"
177
# define YYSTYPE_IS_TRIVIAL 1
147
178
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
148
179
# define YYSTYPE_IS_DECLARED 1
149
# define YYSTYPE_IS_TRIVIAL 1
154
183
/* Copy the second part of user declarations. */
157
/* Line 214 of yacc.c. */
158
#line 158 "segparse.c"
160
#if ! defined (yyoverflow) || YYERROR_VERBOSE
186
/* Line 264 of yacc.c */
187
#line 188 "segparse.c"
194
typedef YYTYPE_UINT8 yytype_uint8;
196
typedef unsigned char yytype_uint8;
200
typedef YYTYPE_INT8 yytype_int8;
201
#elif (defined __STDC__ || defined __C99__FUNC__ \
202
|| defined __cplusplus || defined _MSC_VER)
203
typedef signed char yytype_int8;
205
typedef short int yytype_int8;
209
typedef YYTYPE_UINT16 yytype_uint16;
211
typedef unsigned short int yytype_uint16;
215
typedef YYTYPE_INT16 yytype_int16;
217
typedef short int yytype_int16;
221
# ifdef __SIZE_TYPE__
222
# define YYSIZE_T __SIZE_TYPE__
223
# elif defined size_t
224
# define YYSIZE_T size_t
225
# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
226
|| defined __cplusplus || defined _MSC_VER)
227
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
228
# define YYSIZE_T size_t
230
# define YYSIZE_T unsigned int
234
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
239
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
240
# define YY_(msgid) dgettext ("bison-runtime", msgid)
244
# define YY_(msgid) msgid
248
/* Suppress unused-variable warnings by "using" E. */
249
#if ! defined lint || defined __GNUC__
250
# define YYUSE(e) ((void) (e))
252
# define YYUSE(e) /* empty */
255
/* Identity function, used to suppress warnings about constant conditions. */
259
#if (defined __STDC__ || defined __C99__FUNC__ \
260
|| defined __cplusplus || defined _MSC_VER)
273
#if ! defined yyoverflow || YYERROR_VERBOSE
162
275
/* The parser invokes alloca or malloc; define the necessary symbols. */
164
# if YYSTACK_USE_ALLOCA
165
# define YYSTACK_ALLOC alloca
167
# ifndef YYSTACK_USE_ALLOCA
168
# if defined (alloca) || defined (_ALLOCA_H)
277
# ifdef YYSTACK_USE_ALLOCA
278
# if YYSTACK_USE_ALLOCA
280
# define YYSTACK_ALLOC __builtin_alloca
281
# elif defined __BUILTIN_VA_ARG_INCR
282
# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
284
# define YYSTACK_ALLOC __alloca
285
# elif defined _MSC_VER
286
# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
287
# define alloca _alloca
169
289
# define YYSTACK_ALLOC alloca
172
# define YYSTACK_ALLOC __builtin_alloca
290
# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
291
|| defined __cplusplus || defined _MSC_VER)
292
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
178
301
# ifdef YYSTACK_ALLOC
179
/* Pacify GCC's `empty if-body' warning. */
180
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
302
/* Pacify GCC's `empty if-body' warning. */
303
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
304
# ifndef YYSTACK_ALLOC_MAXIMUM
305
/* The OS might guarantee only one guard page at the bottom of the stack,
306
and a page size can be as small as 4096 bytes. So we cannot safely
307
invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
308
to allow for a few compiler-allocated temporary stack slots. */
309
# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
182
# if defined (__STDC__) || defined (__cplusplus)
312
# define YYSTACK_ALLOC YYMALLOC
313
# define YYSTACK_FREE YYFREE
314
# ifndef YYSTACK_ALLOC_MAXIMUM
315
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
317
# if (defined __cplusplus && ! defined _STDLIB_H \
318
&& ! ((defined YYMALLOC || defined malloc) \
319
&& (defined YYFREE || defined free)))
183
320
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
184
# define YYSIZE_T size_t
186
# define YYSTACK_ALLOC malloc
187
# define YYSTACK_FREE free
326
# define YYMALLOC malloc
327
# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
328
|| defined __cplusplus || defined _MSC_VER)
329
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
334
# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
335
|| defined __cplusplus || defined _MSC_VER)
336
void free (void *); /* INFRINGES ON USER NAME SPACE */
189
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
192
#if (! defined (yyoverflow) \
193
&& (! defined (__cplusplus) \
194
|| (YYSTYPE_IS_TRIVIAL)))
340
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
343
#if (! defined yyoverflow \
344
&& (! defined __cplusplus \
345
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
196
347
/* A type that is properly aligned for any stack member. */
350
yytype_int16 yyss_alloc;
203
354
/* The size of the maximum gap between one aligned stack and the next. */
204
355
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
232
383
elements in the stack, and YYPTR gives the new location of the
233
384
stack. Advance YYPTR to a properly aligned location for the next
235
# define YYSTACK_RELOCATE(Stack) \
386
# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
238
389
YYSIZE_T yynewbytes; \
239
YYCOPY (&yyptr->Stack, Stack, yysize); \
240
Stack = &yyptr->Stack; \
390
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
391
Stack = &yyptr->Stack_alloc; \
241
392
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
242
393
yyptr += yynewbytes / sizeof (*yyptr); \
248
#if defined (__STDC__) || defined (__cplusplus)
249
typedef signed char yysigned_char;
251
typedef short yysigned_char;
254
/* YYFINAL -- State number of the termination state. */
399
/* YYFINAL -- State number of the termination state. */
255
400
#define YYFINAL 8
256
401
/* YYLAST -- Last index in YYTABLE. */
257
402
#define YYLAST 12
259
/* YYNTOKENS -- Number of terminals. */
404
/* YYNTOKENS -- Number of terminals. */
260
405
#define YYNTOKENS 7
261
/* YYNNTS -- Number of nonterminals. */
406
/* YYNNTS -- Number of nonterminals. */
263
/* YYNRULES -- Number of rules. */
408
/* YYNRULES -- Number of rules. */
264
409
#define YYNRULES 9
265
/* YYNRULES -- Number of states. */
410
/* YYNRULES -- Number of states. */
266
411
#define YYNSTATES 14
268
413
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
269
414
#define YYUNDEFTOK 2
270
415
#define YYMAXUTOK 261
272
#define YYTRANSLATE(YYX) \
417
#define YYTRANSLATE(YYX) \
273
418
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
275
420
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
276
static const unsigned char yytranslate[] =
421
static const yytype_uint8 yytranslate[] =
278
423
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
279
424
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
308
453
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
310
static const unsigned char yyprhs[] =
455
static const yytype_uint8 yyprhs[] =
312
457
0, 0, 3, 7, 11, 14, 17, 19, 21, 24
315
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
316
static const yysigned_char yyrhs[] =
460
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
461
static const yytype_int8 yyrhs[] =
318
463
8, 0, -1, 9, 5, 10, -1, 9, 4, 9,
319
464
-1, 9, 4, -1, 4, 9, -1, 9, -1, 3,
323
468
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
324
static const unsigned char yyrline[] =
469
static const yytype_uint8 yyrline[] =
326
471
0, 67, 67, 78, 95, 104, 113, 121, 130, 141
330
#if YYDEBUG || YYERROR_VERBOSE
331
/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
332
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
475
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
476
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
477
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
333
478
static const char *const yytname[] =
335
"$end", "error", "$undefined", "SEGFLOAT", "RANGE", "PLUMIN", "EXTENSION",
336
"$accept", "range", "boundary", "deviation", 0
480
"$end", "error", "$undefined", "SEGFLOAT", "RANGE", "PLUMIN",
481
"EXTENSION", "$accept", "range", "boundary", "deviation", 0
341
486
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
342
487
token YYLEX-NUM. */
343
static const unsigned short yytoknum[] =
488
static const yytype_uint16 yytoknum[] =
345
490
0, 256, 257, 258, 259, 260, 261
349
494
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
350
static const unsigned char yyr1[] =
495
static const yytype_uint8 yyr1[] =
352
497
0, 7, 8, 8, 8, 8, 8, 9, 9, 10
355
500
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
356
static const unsigned char yyr2[] =
501
static const yytype_uint8 yyr2[] =
358
503
0, 2, 3, 3, 2, 2, 1, 1, 2, 1
453
583
yychar = (Token); \
454
584
yylval = (Value); \
455
585
yytoken = YYTRANSLATE (yychar); \
461
yyerror ("syntax error: cannot back up");\
591
yyerror (YY_("syntax error: cannot back up")); \
466
597
#define YYTERROR 1
467
598
#define YYERRCODE 256
469
/* YYLLOC_DEFAULT -- Compute the default location (before the actions
601
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
602
If N is 0, then set CURRENT to the empty location which ends
603
the previous symbol: RHS[0] (always defined). */
605
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
472
606
#ifndef YYLLOC_DEFAULT
473
# define YYLLOC_DEFAULT(Current, Rhs, N) \
474
Current.first_line = Rhs[1].first_line; \
475
Current.first_column = Rhs[1].first_column; \
476
Current.last_line = Rhs[N].last_line; \
477
Current.last_column = Rhs[N].last_column;
607
# define YYLLOC_DEFAULT(Current, Rhs, N) \
611
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
612
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
613
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
614
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
618
(Current).first_line = (Current).last_line = \
619
YYRHSLOC (Rhs, 0).last_line; \
620
(Current).first_column = (Current).last_column = \
621
YYRHSLOC (Rhs, 0).last_column; \
627
/* YY_LOCATION_PRINT -- Print the location on the stream.
628
This macro was not mandated originally: define only if we know
629
we won't break user code: when these are the locations we know. */
631
#ifndef YY_LOCATION_PRINT
632
# if YYLTYPE_IS_TRIVIAL
633
# define YY_LOCATION_PRINT(File, Loc) \
634
fprintf (File, "%d.%d-%d.%d", \
635
(Loc).first_line, (Loc).first_column, \
636
(Loc).last_line, (Loc).last_column)
638
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
480
643
/* YYLEX -- calling `yylex' with the right arguments. */
499
662
YYFPRINTF Args; \
502
# define YYDSYMPRINT(Args) \
508
# define YYDSYMPRINTF(Title, Token, Value, Location) \
512
YYFPRINTF (stderr, "%s ", Title); \
513
yysymprint (stderr, \
515
YYFPRINTF (stderr, "\n"); \
665
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
669
YYFPRINTF (stderr, "%s ", Title); \
670
yy_symbol_print (stderr, \
672
YYFPRINTF (stderr, "\n"); \
677
/*--------------------------------.
678
| Print this symbol on YYOUTPUT. |
679
`--------------------------------*/
682
#if (defined __STDC__ || defined __C99__FUNC__ \
683
|| defined __cplusplus || defined _MSC_VER)
685
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
688
yy_symbol_value_print (yyoutput, yytype, yyvaluep)
691
YYSTYPE const * const yyvaluep;
697
if (yytype < YYNTOKENS)
698
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
710
/*--------------------------------.
711
| Print this symbol on YYOUTPUT. |
712
`--------------------------------*/
714
#if (defined __STDC__ || defined __C99__FUNC__ \
715
|| defined __cplusplus || defined _MSC_VER)
717
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
720
yy_symbol_print (yyoutput, yytype, yyvaluep)
723
YYSTYPE const * const yyvaluep;
726
if (yytype < YYNTOKENS)
727
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
729
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
731
yy_symbol_value_print (yyoutput, yytype, yyvaluep);
732
YYFPRINTF (yyoutput, ")");
519
735
/*------------------------------------------------------------------.
520
736
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
522
738
`------------------------------------------------------------------*/
524
#if defined (__STDC__) || defined (__cplusplus)
740
#if (defined __STDC__ || defined __C99__FUNC__ \
741
|| defined __cplusplus || defined _MSC_VER)
526
yy_stack_print (short *bottom, short *top)
743
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
529
yy_stack_print (bottom, top)
746
yy_stack_print (yybottom, yytop)
747
yytype_int16 *yybottom;
534
751
YYFPRINTF (stderr, "Stack now");
535
for (/* Nothing. */; bottom <= top; ++bottom)
536
YYFPRINTF (stderr, " %d", *bottom);
752
for (; yybottom <= yytop; yybottom++)
754
int yybot = *yybottom;
755
YYFPRINTF (stderr, " %d", yybot);
537
757
YYFPRINTF (stderr, "\n");
543
763
yy_stack_print ((Bottom), (Top)); \
547
767
/*------------------------------------------------.
548
768
| Report that the YYRULE is going to be reduced. |
549
769
`------------------------------------------------*/
551
#if defined (__STDC__) || defined (__cplusplus)
771
#if (defined __STDC__ || defined __C99__FUNC__ \
772
|| defined __cplusplus || defined _MSC_VER)
553
yy_reduce_print (int yyrule)
774
yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
556
yy_reduce_print (yyrule)
777
yy_reduce_print (yyvsp, yyrule)
782
int yynrhs = yyr2[yyrule];
561
unsigned int yylineno = yyrline[yyrule];
562
YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
563
yyrule - 1, yylineno);
564
/* Print the symbols being reduced, and their result. */
565
for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
566
YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
567
YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
784
unsigned long int yylno = yyrline[yyrule];
785
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
787
/* The symbols being reduced. */
788
for (yyi = 0; yyi < yynrhs; yyi++)
790
YYFPRINTF (stderr, " $%d = ", yyi + 1);
791
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
792
&(yyvsp[(yyi + 1) - (yynrhs)])
794
YYFPRINTF (stderr, "\n");
570
798
# define YY_REDUCE_PRINT(Rule) \
573
yy_reduce_print (Rule); \
801
yy_reduce_print (yyvsp, Rule); \
576
804
/* Nonzero means print parse trace. It is left uninitialized so that
577
805
multiple parsers can coexist. */
579
807
#else /* !YYDEBUG */
580
808
# define YYDPRINTF(Args)
581
# define YYDSYMPRINT(Args)
582
# define YYDSYMPRINTF(Title, Token, Value, Location)
809
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
583
810
# define YY_STACK_PRINT(Bottom, Top)
584
811
# define YY_REDUCE_PRINT(Rule)
585
812
#endif /* !YYDEBUG */
610
833
#if YYERROR_VERBOSE
612
835
# ifndef yystrlen
613
# if defined (__GLIBC__) && defined (_STRING_H)
836
# if defined __GLIBC__ && defined _STRING_H
614
837
# define yystrlen strlen
616
839
/* Return the length of YYSTR. */
840
#if (defined __STDC__ || defined __C99__FUNC__ \
841
|| defined __cplusplus || defined _MSC_VER)
618
# if defined (__STDC__) || defined (__cplusplus)
619
843
yystrlen (const char *yystr)
625
register const char *yys = yystr;
627
while (*yys++ != '\0')
851
for (yylen = 0; yystr[yylen]; yylen++)
630
return yys - yystr - 1;
635
858
# ifndef yystpcpy
636
# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
859
# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
637
860
# define yystpcpy stpcpy
639
862
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
864
#if (defined __STDC__ || defined __C99__FUNC__ \
865
|| defined __cplusplus || defined _MSC_VER)
642
# if defined (__STDC__) || defined (__cplusplus)
643
867
yystpcpy (char *yydest, const char *yysrc)
645
870
yystpcpy (yydest, yysrc)
650
register char *yyd = yydest;
651
register const char *yys = yysrc;
876
const char *yys = yysrc;
653
878
while ((*yyd++ = *yys++) != '\0')
661
#endif /* !YYERROR_VERBOSE */
887
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
888
quotes and backslashes, so that it's suitable for yyerror. The
889
heuristic is that double-quoting is unnecessary unless the string
890
contains an apostrophe, a comma, or backslash (other than
891
backslash-backslash). YYSTR is taken from yytname. If YYRES is
892
null, do not copy; instead, return the length of what the result
895
yytnamerr (char *yyres, const char *yystr)
900
char const *yyp = yystr;
907
goto do_not_strip_quotes;
911
goto do_not_strip_quotes;
924
do_not_strip_quotes: ;
928
return yystrlen (yystr);
930
return yystpcpy (yyres, yystr) - yyres;
934
/* Copy into YYRESULT an error message about the unexpected token
935
YYCHAR while in state YYSTATE. Return the number of bytes copied,
936
including the terminating null byte. If YYRESULT is null, do not
937
copy anything; just return the number of bytes that would be
938
copied. As a special case, return 0 if an ordinary "syntax error"
939
message will do. Return YYSIZE_MAXIMUM if overflow occurs during
942
yysyntax_error (char *yyresult, int yystate, int yychar)
944
int yyn = yypact[yystate];
946
if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
950
int yytype = YYTRANSLATE (yychar);
951
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
952
YYSIZE_T yysize = yysize0;
954
int yysize_overflow = 0;
955
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
956
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
960
/* This is so xgettext sees the translatable formats that are
961
constructed on the fly. */
962
YY_("syntax error, unexpected %s");
963
YY_("syntax error, unexpected %s, expecting %s");
964
YY_("syntax error, unexpected %s, expecting %s or %s");
965
YY_("syntax error, unexpected %s, expecting %s or %s or %s");
966
YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
970
static char const yyunexpected[] = "syntax error, unexpected %s";
971
static char const yyexpecting[] = ", expecting %s";
972
static char const yyor[] = " or %s";
973
char yyformat[sizeof yyunexpected
974
+ sizeof yyexpecting - 1
975
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
976
* (sizeof yyor - 1))];
977
char const *yyprefix = yyexpecting;
979
/* Start YYX at -YYN if negative to avoid negative indexes in
981
int yyxbegin = yyn < 0 ? -yyn : 0;
983
/* Stay within bounds of both yycheck and yytname. */
984
int yychecklim = YYLAST - yyn + 1;
985
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
988
yyarg[0] = yytname[yytype];
989
yyfmt = yystpcpy (yyformat, yyunexpected);
991
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
992
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
994
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
998
yyformat[sizeof yyunexpected - 1] = '\0';
1001
yyarg[yycount++] = yytname[yyx];
1002
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1003
yysize_overflow |= (yysize1 < yysize);
1005
yyfmt = yystpcpy (yyfmt, yyprefix);
1009
yyf = YY_(yyformat);
1010
yysize1 = yysize + yystrlen (yyf);
1011
yysize_overflow |= (yysize1 < yysize);
1014
if (yysize_overflow)
1015
return YYSIZE_MAXIMUM;
1019
/* Avoid sprintf, as that infringes on the user's name space.
1020
Don't have undefined behavior even if the translation
1021
produced a string with the wrong number of "%s"s. */
1022
char *yyp = yyresult;
1024
while ((*yyp = *yyf) != '\0')
1026
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1028
yyp += yytnamerr (yyp, yyarg[yyi++]);
1041
#endif /* YYERROR_VERBOSE */
666
/*--------------------------------.
667
| Print this symbol on YYOUTPUT. |
668
`--------------------------------*/
670
#if defined (__STDC__) || defined (__cplusplus)
672
yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
675
yysymprint (yyoutput, yytype, yyvaluep)
681
/* Pacify ``unused variable'' warnings. */
684
if (yytype < YYNTOKENS)
686
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
688
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
692
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
699
YYFPRINTF (yyoutput, ")");
702
#endif /* ! YYDEBUG */
703
1044
/*-----------------------------------------------.
704
1045
| Release the memory associated to this symbol. |
705
1046
`-----------------------------------------------*/
707
#if defined (__STDC__) || defined (__cplusplus)
1049
#if (defined __STDC__ || defined __C99__FUNC__ \
1050
|| defined __cplusplus || defined _MSC_VER)
709
yydestruct (int yytype, YYSTYPE *yyvaluep)
1052
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
712
yydestruct (yytype, yyvaluep)
1055
yydestruct (yymsg, yytype, yyvaluep)
714
1058
YYSTYPE *yyvaluep;
717
/* Pacify ``unused variable'' warnings. */
1065
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
729
1075
/* Prevent warnings from -Wmissing-prototypes. */
731
1076
#ifdef YYPARSE_PARAM
732
# if defined (__STDC__) || defined (__cplusplus)
1077
#if defined __STDC__ || defined __cplusplus
733
1078
int yyparse (void *YYPARSE_PARAM);
737
1082
#else /* ! YYPARSE_PARAM */
738
#if defined (__STDC__) || defined (__cplusplus)
1083
#if defined __STDC__ || defined __cplusplus
739
1084
int yyparse (void);
781
register int yystate;
1131
/* Number of tokens to shift before error messages enabled. */
1134
/* The stacks and their tools:
1135
`yyss': related to states.
1136
`yyvs': related to semantic values.
1138
Refer to the stacks thru separate pointers, to allow yyoverflow
1139
to reallocate them elsewhere. */
1141
/* The state stack. */
1142
yytype_int16 yyssa[YYINITDEPTH];
1144
yytype_int16 *yyssp;
1146
/* The semantic value stack. */
1147
YYSTYPE yyvsa[YYINITDEPTH];
1151
YYSIZE_T yystacksize;
784
/* Number of tokens to shift before error messages enabled. */
786
1155
/* Lookahead token as an internal (translated) token number. */
789
/* Three stacks and their tools:
790
`yyss': related to states,
791
`yyvs': related to semantic values,
792
`yyls': related to locations.
794
Refer to the stacks thru separate pointers, to allow yyoverflow
795
to reallocate them elsewhere. */
797
/* The state stack. */
798
short yyssa[YYINITDEPTH];
800
register short *yyssp;
802
/* The semantic value stack. */
803
YYSTYPE yyvsa[YYINITDEPTH];
804
YYSTYPE *yyvs = yyvsa;
805
register YYSTYPE *yyvsp;
809
#define YYPOPSTACK (yyvsp--, yyssp--)
811
YYSIZE_T yystacksize = YYINITDEPTH;
813
1157
/* The variables used to return semantic value and location from the
814
1158
action routines. */
818
/* When reducing, the number of symbols on the RHS of the reduced
1162
/* Buffer for error messages, and its allocated size. */
1164
char *yymsg = yymsgbuf;
1165
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1168
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1170
/* The number of symbols on the RHS of the reduced rule.
1171
Keep to zero when no symbol should be popped. */
1177
yystacksize = YYINITDEPTH;
822
1179
YYDPRINTF ((stderr, "Starting parse\n"));
825
1182
yyerrstatus = 0;
827
yychar = YYEMPTY; /* Cause a token to be read. */
1184
yychar = YYEMPTY; /* Cause a token to be read. */
829
1186
/* Initialize stack pointers.
830
1187
Waste one element of value and location stack
831
1188
so that they stay on the same level as the state stack.
832
1189
The wasted elements are never initialized. */
1371
/* Line 1455 of yacc.c */
1023
1372
#line 67 "segparse.y"
1025
((SEG *)result)->lower = yyvsp[-2].bnd.val - yyvsp[0].bnd.val;
1026
((SEG *)result)->upper = yyvsp[-2].bnd.val + yyvsp[0].bnd.val;
1374
((SEG *)result)->lower = (yyvsp[(1) - (3)].bnd).val - (yyvsp[(3) - (3)].bnd).val;
1375
((SEG *)result)->upper = (yyvsp[(1) - (3)].bnd).val + (yyvsp[(3) - (3)].bnd).val;
1027
1376
sprintf(strbuf, "%g", ((SEG *)result)->lower);
1028
((SEG *)result)->l_sigd = Max(Min(6, significant_digits(strbuf)), Max(yyvsp[-2].bnd.sigd, yyvsp[0].bnd.sigd));
1377
((SEG *)result)->l_sigd = Max(Min(6, significant_digits(strbuf)), Max((yyvsp[(1) - (3)].bnd).sigd, (yyvsp[(3) - (3)].bnd).sigd));
1029
1378
sprintf(strbuf, "%g", ((SEG *)result)->upper);
1030
((SEG *)result)->u_sigd = Max(Min(6, significant_digits(strbuf)), Max(yyvsp[-2].bnd.sigd, yyvsp[0].bnd.sigd));
1379
((SEG *)result)->u_sigd = Max(Min(6, significant_digits(strbuf)), Max((yyvsp[(1) - (3)].bnd).sigd, (yyvsp[(3) - (3)].bnd).sigd));
1031
1380
((SEG *)result)->l_ext = '\0';
1032
1381
((SEG *)result)->u_ext = '\0';
1387
/* Line 1455 of yacc.c */
1037
1388
#line 78 "segparse.y"
1039
((SEG *)result)->lower = yyvsp[-2].bnd.val;
1040
((SEG *)result)->upper = yyvsp[0].bnd.val;
1390
((SEG *)result)->lower = (yyvsp[(1) - (3)].bnd).val;
1391
((SEG *)result)->upper = (yyvsp[(3) - (3)].bnd).val;
1041
1392
if ( ((SEG *)result)->lower > ((SEG *)result)->upper ) {
1043
1394
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1049
((SEG *)result)->l_sigd = yyvsp[-2].bnd.sigd;
1050
((SEG *)result)->u_sigd = yyvsp[0].bnd.sigd;
1051
((SEG *)result)->l_ext = ( yyvsp[-2].bnd.ext ? yyvsp[-2].bnd.ext : '\0' );
1052
((SEG *)result)->u_ext = ( yyvsp[0].bnd.ext ? yyvsp[0].bnd.ext : '\0' );
1400
((SEG *)result)->l_sigd = (yyvsp[(1) - (3)].bnd).sigd;
1401
((SEG *)result)->u_sigd = (yyvsp[(3) - (3)].bnd).sigd;
1402
((SEG *)result)->l_ext = ( (yyvsp[(1) - (3)].bnd).ext ? (yyvsp[(1) - (3)].bnd).ext : '\0' );
1403
((SEG *)result)->u_ext = ( (yyvsp[(3) - (3)].bnd).ext ? (yyvsp[(3) - (3)].bnd).ext : '\0' );
1409
/* Line 1455 of yacc.c */
1057
1410
#line 95 "segparse.y"
1059
((SEG *)result)->lower = yyvsp[-1].bnd.val;
1412
((SEG *)result)->lower = (yyvsp[(1) - (2)].bnd).val;
1060
1413
((SEG *)result)->upper = HUGE_VAL;
1061
((SEG *)result)->l_sigd = yyvsp[-1].bnd.sigd;
1414
((SEG *)result)->l_sigd = (yyvsp[(1) - (2)].bnd).sigd;
1062
1415
((SEG *)result)->u_sigd = 0;
1063
((SEG *)result)->l_ext = ( yyvsp[-1].bnd.ext ? yyvsp[-1].bnd.ext : '\0' );
1416
((SEG *)result)->l_ext = ( (yyvsp[(1) - (2)].bnd).ext ? (yyvsp[(1) - (2)].bnd).ext : '\0' );
1064
1417
((SEG *)result)->u_ext = '-';
1423
/* Line 1455 of yacc.c */
1069
1424
#line 104 "segparse.y"
1071
1426
((SEG *)result)->lower = -HUGE_VAL;
1072
((SEG *)result)->upper = yyvsp[0].bnd.val;
1427
((SEG *)result)->upper = (yyvsp[(2) - (2)].bnd).val;
1073
1428
((SEG *)result)->l_sigd = 0;
1074
((SEG *)result)->u_sigd = yyvsp[0].bnd.sigd;
1429
((SEG *)result)->u_sigd = (yyvsp[(2) - (2)].bnd).sigd;
1075
1430
((SEG *)result)->l_ext = '-';
1076
((SEG *)result)->u_ext = ( yyvsp[0].bnd.ext ? yyvsp[0].bnd.ext : '\0' );
1431
((SEG *)result)->u_ext = ( (yyvsp[(2) - (2)].bnd).ext ? (yyvsp[(2) - (2)].bnd).ext : '\0' );
1437
/* Line 1455 of yacc.c */
1081
1438
#line 113 "segparse.y"
1083
((SEG *)result)->lower = ((SEG *)result)->upper = yyvsp[0].bnd.val;
1084
((SEG *)result)->l_sigd = ((SEG *)result)->u_sigd = yyvsp[0].bnd.sigd;
1085
((SEG *)result)->l_ext = ((SEG *)result)->u_ext = ( yyvsp[0].bnd.ext ? yyvsp[0].bnd.ext : '\0' );
1440
((SEG *)result)->lower = ((SEG *)result)->upper = (yyvsp[(1) - (1)].bnd).val;
1441
((SEG *)result)->l_sigd = ((SEG *)result)->u_sigd = (yyvsp[(1) - (1)].bnd).sigd;
1442
((SEG *)result)->l_ext = ((SEG *)result)->u_ext = ( (yyvsp[(1) - (1)].bnd).ext ? (yyvsp[(1) - (1)].bnd).ext : '\0' );
1448
/* Line 1455 of yacc.c */
1090
1449
#line 121 "segparse.y"
1092
1451
/* temp variable avoids a gcc 3.3.x bug on Sparc64 */
1093
float val = seg_atof(yyvsp[0].text);
1452
float val = seg_atof((yyvsp[(1) - (1)].text));
1095
yyval.bnd.ext = '\0';
1096
yyval.bnd.sigd = significant_digits(yyvsp[0].text);
1097
yyval.bnd.val = val;
1454
(yyval.bnd).ext = '\0';
1455
(yyval.bnd).sigd = significant_digits((yyvsp[(1) - (1)].text));
1456
(yyval.bnd).val = val;
1462
/* Line 1455 of yacc.c */
1102
1463
#line 130 "segparse.y"
1104
1465
/* temp variable avoids a gcc 3.3.x bug on Sparc64 */
1105
float val = seg_atof(yyvsp[0].text);
1466
float val = seg_atof((yyvsp[(2) - (2)].text));
1107
yyval.bnd.ext = yyvsp[-1].text[0];
1108
yyval.bnd.sigd = significant_digits(yyvsp[0].text);
1109
yyval.bnd.val = val;
1468
(yyval.bnd).ext = (yyvsp[(1) - (2)].text)[0];
1469
(yyval.bnd).sigd = significant_digits((yyvsp[(2) - (2)].text));
1470
(yyval.bnd).val = val;
1476
/* Line 1455 of yacc.c */
1114
1477
#line 141 "segparse.y"
1116
1479
/* temp variable avoids a gcc 3.3.x bug on Sparc64 */
1117
float val = seg_atof(yyvsp[0].text);
1480
float val = seg_atof((yyvsp[(1) - (1)].text));
1119
yyval.bnd.ext = '\0';
1120
yyval.bnd.sigd = significant_digits(yyvsp[0].text);
1121
yyval.bnd.val = val;
1482
(yyval.bnd).ext = '\0';
1483
(yyval.bnd).sigd = significant_digits((yyvsp[(1) - (1)].text));
1484
(yyval.bnd).val = val;
1490
/* Line 1455 of yacc.c */
1491
#line 1492 "segparse.c"
1128
/* Line 991 of yacc.c. */
1129
#line 1129 "segparse.c"
1494
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1135
1498
YY_STACK_PRINT (yyss, yyssp);
1137
1500
*++yyvsp = yyval;
1140
1502
/* Now `shift' the result of the reduction. Determine what state
1141
1503
that goes to, based on the state we popped back to and the rule
1142
1504
number reduced by. */
1160
1522
if (!yyerrstatus)
1164
yyn = yypact[yystate];
1166
if (YYPACT_NINF < yyn && yyn < YYLAST)
1168
YYSIZE_T yysize = 0;
1169
int yytype = YYTRANSLATE (yychar);
1174
/* Start YYX at -YYN if negative to avoid negative indexes in
1176
for (yyx = yyn < 0 ? -yyn : 0;
1177
yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1178
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1179
yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1180
yysize += yystrlen ("syntax error, unexpected ") + 1;
1181
yysize += yystrlen (yytname[yytype]);
1182
yymsg = (char *) YYSTACK_ALLOC (yysize);
1185
char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
1186
yyp = yystpcpy (yyp, yytname[yytype]);
1191
for (yyx = yyn < 0 ? -yyn : 0;
1192
yyx < (int) (sizeof (yytname) / sizeof (char *));
1194
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1196
const char *yyq = ! yycount ? ", expecting " : " or ";
1197
yyp = yystpcpy (yyp, yyq);
1198
yyp = yystpcpy (yyp, yytname[yyx]);
1525
#if ! YYERROR_VERBOSE
1526
yyerror (YY_("syntax error"));
1529
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1530
if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1532
YYSIZE_T yyalloc = 2 * yysize;
1533
if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1534
yyalloc = YYSTACK_ALLOC_MAXIMUM;
1535
if (yymsg != yymsgbuf)
1203
1536
YYSTACK_FREE (yymsg);
1206
yyerror ("syntax error; also virtual memory exhausted");
1209
#endif /* YYERROR_VERBOSE */
1210
yyerror ("syntax error");
1537
yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1539
yymsg_alloc = yyalloc;
1543
yymsg_alloc = sizeof yymsgbuf;
1547
if (0 < yysize && yysize <= yymsg_alloc)
1549
(void) yysyntax_error (yymsg, yystate, yychar);
1554
yyerror (YY_("syntax error"));
1556
goto yyexhaustedlab;
1217
1566
/* If just tried and failed to reuse lookahead token after an
1218
1567
error, discard it. */
1220
/* Return failure if at end of input. */
1221
if (yychar == YYEOF)
1223
/* Pop the error token. */
1225
/* Pop the rest of the stack. */
1226
while (yyss < yyssp)
1228
YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
1229
yydestruct (yystos[*yyssp], yyvsp);
1235
YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
1236
yydestruct (yytoken, &yylval);
1569
if (yychar <= YYEOF)
1571
/* Return failure if at end of input. */
1572
if (yychar == YYEOF)
1577
yydestruct ("Error: discarding",
1241
1583
/* Else will try to reuse lookahead token after shifting the error
1246
/*----------------------------------------------------.
1247
| yyerrlab1 -- error raised explicitly by an action. |
1248
`----------------------------------------------------*/
1588
/*---------------------------------------------------.
1589
| yyerrorlab -- error raised explicitly by YYERROR. |
1590
`---------------------------------------------------*/
1593
/* Pacify compilers like GCC when the user code never invokes
1594
YYERROR and the label yyerrorlab therefore never appears in user
1596
if (/*CONSTCOND*/ 0)
1599
/* Do not reclaim the symbols of the rule which action triggered
1603
YY_STACK_PRINT (yyss, yyssp);
1608
/*-------------------------------------------------------------.
1609
| yyerrlab1 -- common code for both syntax error and YYERROR. |
1610
`-------------------------------------------------------------*/
1251
/* Suppress GCC warning that yyerrlab1 is unused when no action
1253
#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
1254
__attribute__ ((__unused__))
1261
/*---------------------------------------------------------------.
1262
| yyerrlab2 -- pop states until the error token can be shifted. |
1263
`---------------------------------------------------------------*/
1265
1612
yyerrstatus = 3; /* Each real token shifted decrements this. */