47 #define YYBISON_VERSION "3.0.1"
50 #define YYSKELETON_NAME "yacc.c"
63 #define yyparse gse_parse
65 #define yyerror gse_error
66 #define yydebug gse_debug
67 #define yynerrs gse_nerrs
69 #define yylval gse_lval
70 #define yychar gse_char
77 # if defined __cplusplus && 201103L <= __cplusplus
78 # define YY_NULLPTR nullptr
85 #ifdef YYERROR_VERBOSE
86 # undef YYERROR_VERBOSE
87 # define YYERROR_VERBOSE 1
89 # define YYERROR_VERBOSE 0
94 #ifndef YY_GSE_GSE_TAB_HH_INCLUDED
95 # define YY_GSE_GSE_TAB_HH_INCLUDED
122 #define gse_arg(arg) ((gse_arg *)(arg))
128 #line 129 "gse.tab.cc"
149 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
161 #line 162 "gse.tab.cc"
163 # define YYSTYPE_IS_TRIVIAL 1
164 # define YYSTYPE_IS_DECLARED 1
176 #line 177 "gse.tab.cc"
188 int op2,
double val2);
191 #line 192 "gse.tab.cc"
222 # ifdef __SIZE_TYPE__
223 # define YYSIZE_T __SIZE_TYPE__
224 # elif defined size_t
225 # define YYSIZE_T size_t
226 # elif ! defined YYSIZE_T
228 # define YYSIZE_T size_t
230 # define YYSIZE_T unsigned int
234 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
237 # if defined YYENABLE_NLS && YYENABLE_NLS
239 # include <libintl.h>
240 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
244 # define YY_(Msgid) Msgid
249 # if (defined __GNUC__ \
250 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
251 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
252 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
254 # define YY_ATTRIBUTE(Spec)
258 #ifndef YY_ATTRIBUTE_PURE
259 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
262 #ifndef YY_ATTRIBUTE_UNUSED
263 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
266 #if !defined _Noreturn \
267 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
268 # if defined _MSC_VER && 1200 <= _MSC_VER
269 # define _Noreturn __declspec (noreturn)
271 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
276 #if ! defined lint || defined __GNUC__
277 # define YYUSE(E) ((void) (E))
282 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
284 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
285 _Pragma ("GCC diagnostic push") \
286 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
287 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
288 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
289 _Pragma ("GCC diagnostic pop")
291 # define YY_INITIAL_VALUE(Value) Value
293 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
294 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
295 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
297 #ifndef YY_INITIAL_VALUE
298 # define YY_INITIAL_VALUE(Value)
302 #if ! defined yyoverflow || YYERROR_VERBOSE
306 # ifdef YYSTACK_USE_ALLOCA
307 # if YYSTACK_USE_ALLOCA
309 # define YYSTACK_ALLOC __builtin_alloca
310 # elif defined __BUILTIN_VA_ARG_INCR
313 # define YYSTACK_ALLOC __alloca
314 # elif defined _MSC_VER
316 # define alloca _alloca
318 # define YYSTACK_ALLOC alloca
319 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
322 # ifndef EXIT_SUCCESS
323 # define EXIT_SUCCESS 0
330 # ifdef YYSTACK_ALLOC
332 # define YYSTACK_FREE(Ptr) do { ; } while (0)
333 # ifndef YYSTACK_ALLOC_MAXIMUM
338 # define YYSTACK_ALLOC_MAXIMUM 4032
341 # define YYSTACK_ALLOC YYMALLOC
342 # define YYSTACK_FREE YYFREE
343 # ifndef YYSTACK_ALLOC_MAXIMUM
344 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
346 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
347 && ! ((defined YYMALLOC || defined malloc) \
348 && (defined YYFREE || defined free)))
350 # ifndef EXIT_SUCCESS
351 # define EXIT_SUCCESS 0
355 # define YYMALLOC malloc
356 # if ! defined malloc && ! defined EXIT_SUCCESS
362 # if ! defined free && ! defined EXIT_SUCCESS
370 #if (! defined yyoverflow \
371 && (! defined __cplusplus \
372 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
382 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
386 # define YYSTACK_BYTES(N) \
387 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
388 + YYSTACK_GAP_MAXIMUM)
390 # define YYCOPY_NEEDED 1
397 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
400 YYSIZE_T yynewbytes; \
401 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
402 Stack = &yyptr->Stack_alloc; \
403 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
404 yyptr += yynewbytes / sizeof (*yyptr); \
410 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
414 # if defined __GNUC__ && 1 < __GNUC__
415 # define YYCOPY(Dst, Src, Count) \
416 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
418 # define YYCOPY(Dst, Src, Count) \
422 for (yyi = 0; yyi < (Count); yyi++) \
423 (Dst)[yyi] = (Src)[yyi]; \
447 #define YYMAXUTOK 267
449 #define YYTRANSLATE(YYX) \
450 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
456 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
460 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
461 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
464 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
465 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
466 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
467 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
468 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
469 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
470 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
471 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
472 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
473 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
474 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
475 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
476 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
477 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
478 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
479 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
480 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
481 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
482 5, 6, 7, 8, 9, 10, 11, 12
489 0, 108, 108, 114, 120, 129, 132, 133, 136, 137,
494 #if YYDEBUG || YYERROR_VERBOSE || 0
497 static const char *
const yytname[] =
499 "$end",
"error",
"$undefined",
"SCAN_INT",
"SCAN_FLOAT",
"SCAN_WORD",
500 "SCAN_FIELD",
"SCAN_EQUAL",
"SCAN_NOT_EQUAL",
"SCAN_GREATER",
501 "SCAN_GREATER_EQL",
"SCAN_LESS",
"SCAN_LESS_EQL",
"$accept",
"clause",
511 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
516 #define YYPACT_NINF -7
518 #define yypact_value_is_default(Yystate) \
519 (!!((Yystate) == (-7)))
521 #define YYTABLE_NINF -1
523 #define yytable_value_is_error(Yytable_value) \
530 12, -7, -7, -7, 1, -5, -5, -7, -7, -7,
531 -7, -7, -7, -7, 5, 7, -7, -5, 5, -7
539 0, 6, 7, 5, 0, 0, 0, 1, 8, 9,
540 10, 11, 12, 13, 0, 0, 2, 3, 0, 4
560 15, 7, 8, 9, 10, 11, 12, 13, 1, 2,
561 16, 18, 3, 17, 19, 1, 2, 3
566 6, 0, 7, 8, 9, 10, 11, 12, 3, 4,
567 14, 17, 5, 15, 18, 3, 4, 5
574 0, 3, 4, 5, 14, 15, 16, 0, 7, 8,
575 9, 10, 11, 12, 17, 17, 16, 15, 17, 16
581 0, 13, 14, 14, 14, 15, 16, 16, 17, 17,
588 0, 2, 3, 3, 5, 1, 1, 1, 1, 1,
593 #define yyerrok (yyerrstatus = 0)
594 #define yyclearin (yychar = YYEMPTY)
598 #define YYACCEPT goto yyacceptlab
599 #define YYABORT goto yyabortlab
600 #define YYERROR goto yyerrorlab
603 #define YYRECOVERING() (!!yyerrstatus)
605 #define YYBACKUP(Token, Value) \
607 if (yychar == YYEMPTY) \
611 YYPOPSTACK (yylen); \
617 yyerror (arg, YY_("syntax error: cannot back up")); \
624 #define YYERRCODE 256
633 # define YYFPRINTF fprintf
636 # define YYDPRINTF(Args) \
643 #ifndef YY_LOCATION_PRINT
644 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
648 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
652 YYFPRINTF (stderr, "%s ", Title); \
653 yy_symbol_print (stderr, \
655 YYFPRINTF (stderr, "\n"); \
665 yy_symbol_value_print (FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep,
gse_arg *arg)
667 FILE *yyo = yyoutput;
674 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
685 yy_symbol_print (FILE *yyoutput,
int yytype,
YYSTYPE const *
const yyvaluep,
gse_arg *arg)
688 yytype <
YYNTOKENS ?
"token" :
"nterm", yytname[yytype]);
690 yy_symbol_value_print (yyoutput, yytype, yyvaluep, arg);
703 for (; yybottom <= yytop; yybottom++)
705 int yybot = *yybottom;
711 # define YY_STACK_PRINT(Bottom, Top) \
714 yy_stack_print ((Bottom), (Top)); \
725 unsigned long int yylno = yyrline[yyrule];
726 int yynrhs = yyr2[yyrule];
728 YYFPRINTF (stderr,
"Reducing stack by rule %d (line %lu):\n",
731 for (yyi = 0; yyi < yynrhs; yyi++)
734 yy_symbol_print (stderr,
735 yystos[yyssp[yyi + 1 - yynrhs]],
736 &(yyvsp[(yyi + 1) - (yynrhs)])
742 # define YY_REDUCE_PRINT(Rule) \
745 yy_reduce_print (yyssp, yyvsp, Rule, arg); \
752 # define YYDPRINTF(Args)
753 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
754 # define YY_STACK_PRINT(Bottom, Top)
755 # define YY_REDUCE_PRINT(Rule)
761 # define YYINITDEPTH 200
772 # define YYMAXDEPTH 10000
779 # if defined __GLIBC__ && defined _STRING_H
780 # define yystrlen strlen
784 yystrlen (
const char *yystr)
787 for (yylen = 0; yystr[yylen]; yylen++)
795 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
796 # define yystpcpy stpcpy
801 yystpcpy (
char *yydest,
const char *yysrc)
804 const char *yys = yysrc;
806 while ((*yyd++ = *yys++) !=
'\0')
823 yytnamerr (
char *yyres,
const char *yystr)
828 char const *yyp = yystr;
835 goto do_not_strip_quotes;
839 goto do_not_strip_quotes;
852 do_not_strip_quotes: ;
856 return yystrlen (yystr);
858 return yystpcpy (yyres, yystr) - yyres;
871 yysyntax_error (
YYSIZE_T *yymsg_alloc,
char **yymsg,
876 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
880 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
910 int yyn = yypact[*yyssp];
911 yyarg[yycount++] = yytname[yytoken];
917 int yyxbegin = yyn < 0 ? -yyn : 0;
919 int yychecklim =
YYLAST - yyn + 1;
923 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
924 if (yycheck[yyx + yyn] == yyx && yyx !=
YYTERROR
927 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
933 yyarg[yycount++] = yytname[yyx];
936 if (! (yysize <= yysize1
947 # define YYCASE_(N, S) \
951 YYCASE_(0,
YY_(
"syntax error"));
952 YYCASE_(1,
YY_(
"syntax error, unexpected %s"));
953 YYCASE_(2,
YY_(
"syntax error, unexpected %s, expecting %s"));
954 YYCASE_(3,
YY_(
"syntax error, unexpected %s, expecting %s or %s"));
955 YYCASE_(4,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s"));
956 YYCASE_(5,
YY_(
"syntax error, unexpected %s, expecting %s or %s or %s or %s"));
961 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
967 if (*yymsg_alloc < yysize)
969 *yymsg_alloc = 2 * yysize;
970 if (! (yysize <= *yymsg_alloc
982 while ((*yyp = *yyformat) !=
'\0')
983 if (*yyp ==
'%' && yyformat[1] ==
's' && yyi < yycount)
985 yyp += yytnamerr (yyp, yyarg[yyi++]);
1003 yydestruct (
const char *yymsg,
int yytype,
YYSTYPE *yyvaluep,
gse_arg *arg)
1069 char *yymsg = yymsgbuf;
1070 YYSIZE_T yymsg_alloc =
sizeof yymsgbuf;
1073 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1079 yyssp = yyss = yyssa;
1080 yyvsp = yyvs = yyvsa;
1083 YYDPRINTF ((stderr,
"Starting parse\n"));
1102 if (yyss + yystacksize - 1 <= yyssp)
1105 YYSIZE_T yysize = yyssp - yyss + 1;
1119 yyoverflow (
YY_(
"memory exhausted"),
1120 &yyss1, yysize *
sizeof (*yyssp),
1121 &yyvs1, yysize *
sizeof (*yyvsp),
1128 # ifndef YYSTACK_RELOCATE
1129 goto yyexhaustedlab;
1133 goto yyexhaustedlab;
1143 goto yyexhaustedlab;
1146 # undef YYSTACK_RELOCATE
1153 yyssp = yyss + yysize - 1;
1154 yyvsp = yyvs + yysize - 1;
1156 YYDPRINTF ((stderr,
"Stack size increased to %lu\n",
1157 (
unsigned long int) yystacksize));
1159 if (yyss + yystacksize - 1 <= yyssp)
1163 YYDPRINTF ((stderr,
"Entering state %d\n", yystate));
1179 yyn = yypact[yystate];
1188 YYDPRINTF ((stderr,
"Reading a token: "));
1192 if (yychar <=
YYEOF)
1194 yychar = yytoken =
YYEOF;
1195 YYDPRINTF ((stderr,
"Now at end of input.\n"));
1206 if (yyn < 0 ||
YYLAST < yyn || yycheck[yyn] != yytoken)
1240 yyn = yydefact[yystate];
1261 yyval = yyvsp[1-yylen];
1272 (yyval.boolean) =
true;
1274 #line 1275 "gse.tab.cc"
1282 (yyval.boolean) =
true;
1284 #line 1285 "gse.tab.cc"
1293 (yyval.boolean) =
true;
1295 #line 1296 "gse.tab.cc"
1299 #line 1300 "gse.tab.cc"
1327 yystate = yypgoto[yyn -
YYNTOKENS] + *yyssp;
1328 if (0 <= yystate && yystate <=
YYLAST && yycheck[yystate] == *yyssp)
1329 yystate = yytable[yystate];
1348 #if ! YYERROR_VERBOSE
1351 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1354 char const *yymsgp =
YY_(
"syntax error");
1355 int yysyntax_error_status;
1356 yysyntax_error_status = YYSYNTAX_ERROR;
1357 if (yysyntax_error_status == 0)
1359 else if (yysyntax_error_status == 1)
1361 if (yymsg != yymsgbuf)
1367 yymsg_alloc =
sizeof yymsgbuf;
1368 yysyntax_error_status = 2;
1372 yysyntax_error_status = YYSYNTAX_ERROR;
1377 if (yysyntax_error_status == 2)
1378 goto yyexhaustedlab;
1380 # undef YYSYNTAX_ERROR
1386 if (yyerrstatus == 3)
1391 if (yychar <=
YYEOF)
1394 if (yychar ==
YYEOF)
1399 yydestruct (
"Error: discarding",
1400 yytoken, &yylval, arg);
1438 yyn = yypact[yystate];
1455 yydestruct (
"Error: popping",
1456 yystos[yystate], yyvsp, arg);
1488 #if !defined yyoverflow || YYERROR_VERBOSE
1504 yydestruct (
"Cleanup: discarding lookahead",
1505 yytoken, &yylval, arg);
1511 while (yyssp != yyss)
1513 yydestruct (
"Cleanup: popping",
1514 yystos[*yyssp], yyvsp, arg);
1522 if (yymsg != yymsgbuf)
1534 "An expression passed to the grid() function could not be parsed.\n\
1535 Examples of expressions that will work are: \"i>=10.0\" or \"23.6<i<56.0\"\n\
1536 where \"i\" is the name of one of the Grid's map vectors.");
1540 decode_relop(
int op)
1554 throw Error(malformed_expr,
"Unrecognized relational operator");
1559 decode_inverse_relop(
int op)
1573 throw Error(malformed_expr,
"Unrecognized relational operator");
1589 decode_inverse_relop(op));
1594 int op2,
double val2)
1598 relop rop1 = decode_inverse_relop(op1);
1599 relop rop2 = decode_relop(op2);
1605 throw Error(malformed_expr,
1606 "GSE Clause operands must define a monotonic interval.");
1611 throw Error(malformed_expr,
1612 "GSE Clause operands must define a monotonic interval.");
1617 throw Error(malformed_expr,
"Unrecognized relational operator.");
#define yytable_value_is_error(Yytable_value)
#define yypact_value_is_default(Yystate)
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
static class NCMLUtil overview
int gse_parse(gse_arg *arg)
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
Argument to the GSE parser.
#define YY_REDUCE_PRINT(Rule)
void gse_error(gse_arg *arg, const char *str)
Holds the results of parsing one of the Grid Selection Expression clauses.
unsigned short int yytype_uint16
#define YYSTACK_ALLOC_MAXIMUM
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
#define YY_STACK_PRINT(Bottom, Top)
GSEClause * build_dual_gse_clause(gse_arg *arg, char id[ID_MAX], int op1, double val1, int op2, double val2)
GSEClause * build_rev_gse_clause(gse_arg *arg, char id[ID_MAX], int op, double val)
GSEClause * build_gse_clause(gse_arg *arg, char id[ID_MAX], int op, double val)
unsigned char yytype_uint8