OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
he5dds.tab.cc
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 3.0.1. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
6 
7  This program is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 
20 /* As a special exception, you may create a larger work that contains
21  part or all of the Bison parser skeleton and distribute that work
22  under terms of your choice, so long as that work isn't itself a
23  parser generator using the skeleton or a modified version thereof
24  as a parser skeleton. Alternatively, if you modify or redistribute
25  the parser skeleton itself, you may (at your option) remove this
26  special exception, which will cause the skeleton and the resulting
27  Bison output files to be licensed under the GNU General Public
28  License without this special exception.
29 
30  This special exception was added by the Free Software Foundation in
31  version 2.2 of Bison. */
32 
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34  simplifying the original so-called "semantic" parser. */
35 
36 /* All symbols defined below should begin with yy or YY, to avoid
37  infringing on user name space. This should be done even for local
38  variables, as they might otherwise be expanded by user macros.
39  There are some unavoidable exceptions within include files to
40  define necessary library symbols; they are noted "INFRINGES ON
41  USER NAME SPACE" below. */
42 
43 /* Identify Bison output. */
44 #define YYBISON 1
45 
46 /* Bison version. */
47 #define YYBISON_VERSION "3.0.1"
48 
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51 
52 /* Pure parsers. */
53 #define YYPURE 0
54 
55 /* Push parsers. */
56 #define YYPUSH 0
57 
58 /* Pull parsers. */
59 #define YYPULL 1
60 
61 
62 /* Substitute the variable and function names. */
63 #define yyparse he5ddsparse
64 #define yylex he5ddslex
65 #define yyerror he5ddserror
66 #define yydebug he5ddsdebug
67 #define yynerrs he5ddsnerrs
68 
69 #define yylval he5ddslval
70 #define yychar he5ddschar
71 
72 /* Copy the first part of user declarations. */
73 
74 #line 75 "he5dds.tab.cc" /* yacc.c:339 */
75 
76 # ifndef YY_NULLPTR
77 # if defined __cplusplus && 201103L <= __cplusplus
78 # define YY_NULLPTR nullptr
79 # else
80 # define YY_NULLPTR 0
81 # endif
82 # endif
83 
84 /* Enabling verbose error messages. */
85 #ifdef YYERROR_VERBOSE
86 # undef YYERROR_VERBOSE
87 # define YYERROR_VERBOSE 1
88 #else
89 # define YYERROR_VERBOSE 0
90 #endif
91 
92 /* In a future release of Bison, this section will be replaced
93  by #include "he5dds.tab.hh". */
94 #ifndef YY_HE5DDS_HE5DDS_TAB_HH_INCLUDED
95 # define YY_HE5DDS_HE5DDS_TAB_HH_INCLUDED
96 /* Debug traces. */
97 #ifndef YYDEBUG
98 # define YYDEBUG 1
99 #endif
100 #if YYDEBUG
101 extern int he5ddsdebug;
102 #endif
103 /* "%code requires" blocks. */
104 #line 28 "he5dds.yy" /* yacc.c:355 */
105 
106 
107 #define YYSTYPE char *
108 #define YYDEBUG 1
109 // Uncomment the following line for debugging.
110 //#define VERBOSE
111 // #define YYPARSE_PARAM he5parser
112 
113 #include <stdio.h>
114 #include <stdlib.h>
115 #include <string.h>
116 #include <string>
117 #include <iostream>
118 #include <assert.h>
119 #include <vector>
120 #include <map>
121 #include <sstream>
122 //#include "he5dds.tab.hh"
123 #include "HE5Parser.h"
124 
125 using namespace std;
126 
127 // It's defined in he5dds.lex.
128 //extern int yy_line_num;
129 
130 
131 #line 132 "he5dds.tab.cc" /* yacc.c:355 */
132 
133 /* Token type. */
134 #ifndef YYTOKENTYPE
135 # define YYTOKENTYPE
137  {
138  GROUP = 258,
139  END_GROUP = 259,
140  OBJECT = 260,
141  END_OBJECT = 261,
142  GRID_NAME = 262,
143  SWATH_NAME = 263,
144  ZA_NAME = 264,
145  DEFAULT = 265,
146  XDIM = 266,
147  YDIM = 267,
148  UPPERLEFTPT = 268,
151  PROJECTION = 271,
152  GRIDORIGIN = 272,
157  DATA_TYPE = 277,
160  INT = 280,
161  FLOAT = 281,
162  STR = 282
163  };
164 #endif
165 
166 /* Value type. */
167 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
168 typedef int YYSTYPE;
169 # define YYSTYPE_IS_TRIVIAL 1
170 # define YYSTYPE_IS_DECLARED 1
171 #endif
172 
173 
174 extern YYSTYPE he5ddslval;
175 
176 int he5ddsparse (HE5Parser *he5parser);
177 
178 #endif /* !YY_HE5DDS_HE5DDS_TAB_HH_INCLUDED */
179 
180 /* Copy the second part of user declarations. */
181 
182 #line 183 "he5dds.tab.cc" /* yacc.c:358 */
183 /* Unqualified %code blocks. */
184 #line 55 "he5dds.yy" /* yacc.c:359 */
185 
186 // This is a flag to indicate if parser is reading geolocatoin or data
187 // variable.
188 // This should be changed to a enum type parser state variable later.
189 bool swath_is_geo_field = false;
190 string dimension_name = "";
191 
192 void he5ddserror(HE5Parser *he5parser, char *s);
193 int he5ddslex(void);
194 
195 
196 #line 197 "he5dds.tab.cc" /* yacc.c:359 */
197 
198 #ifdef short
199 # undef short
200 #endif
201 
202 #ifdef YYTYPE_UINT8
203 typedef YYTYPE_UINT8 yytype_uint8;
204 #else
205 typedef unsigned char yytype_uint8;
206 #endif
207 
208 #ifdef YYTYPE_INT8
209 typedef YYTYPE_INT8 yytype_int8;
210 #else
211 typedef signed char yytype_int8;
212 #endif
213 
214 #ifdef YYTYPE_UINT16
215 typedef YYTYPE_UINT16 yytype_uint16;
216 #else
217 typedef unsigned short int yytype_uint16;
218 #endif
219 
220 #ifdef YYTYPE_INT16
221 typedef YYTYPE_INT16 yytype_int16;
222 #else
223 typedef short int yytype_int16;
224 #endif
225 
226 #ifndef YYSIZE_T
227 # ifdef __SIZE_TYPE__
228 # define YYSIZE_T __SIZE_TYPE__
229 # elif defined size_t
230 # define YYSIZE_T size_t
231 # elif ! defined YYSIZE_T
232 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
233 # define YYSIZE_T size_t
234 # else
235 # define YYSIZE_T unsigned int
236 # endif
237 #endif
238 
239 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
240 
241 #ifndef YY_
242 # if defined YYENABLE_NLS && YYENABLE_NLS
243 # if ENABLE_NLS
244 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
245 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
246 # endif
247 # endif
248 # ifndef YY_
249 # define YY_(Msgid) Msgid
250 # endif
251 #endif
252 
253 #ifndef YY_ATTRIBUTE
254 # if (defined __GNUC__ \
255  && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
256  || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
257 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
258 # else
259 # define YY_ATTRIBUTE(Spec) /* empty */
260 # endif
261 #endif
262 
263 #ifndef YY_ATTRIBUTE_PURE
264 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
265 #endif
266 
267 #ifndef YY_ATTRIBUTE_UNUSED
268 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
269 #endif
270 
271 #if !defined _Noreturn \
272  && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
273 # if defined _MSC_VER && 1200 <= _MSC_VER
274 # define _Noreturn __declspec (noreturn)
275 # else
276 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
277 # endif
278 #endif
279 
280 /* Suppress unused-variable warnings by "using" E. */
281 #if ! defined lint || defined __GNUC__
282 # define YYUSE(E) ((void) (E))
283 #else
284 # define YYUSE(E) /* empty */
285 #endif
286 
287 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
288 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
289 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
290  _Pragma ("GCC diagnostic push") \
291  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
292  _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
293 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
294  _Pragma ("GCC diagnostic pop")
295 #else
296 # define YY_INITIAL_VALUE(Value) Value
297 #endif
298 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
299 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
300 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
301 #endif
302 #ifndef YY_INITIAL_VALUE
303 # define YY_INITIAL_VALUE(Value) /* Nothing. */
304 #endif
305 
306 
307 #if ! defined yyoverflow || YYERROR_VERBOSE
308 
309 /* The parser invokes alloca or malloc; define the necessary symbols. */
310 
311 # ifdef YYSTACK_USE_ALLOCA
312 # if YYSTACK_USE_ALLOCA
313 # ifdef __GNUC__
314 # define YYSTACK_ALLOC __builtin_alloca
315 # elif defined __BUILTIN_VA_ARG_INCR
316 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
317 # elif defined _AIX
318 # define YYSTACK_ALLOC __alloca
319 # elif defined _MSC_VER
320 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
321 # define alloca _alloca
322 # else
323 # define YYSTACK_ALLOC alloca
324 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
325 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
326  /* Use EXIT_SUCCESS as a witness for stdlib.h. */
327 # ifndef EXIT_SUCCESS
328 # define EXIT_SUCCESS 0
329 # endif
330 # endif
331 # endif
332 # endif
333 # endif
334 
335 # ifdef YYSTACK_ALLOC
336  /* Pacify GCC's 'empty if-body' warning. */
337 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
338 # ifndef YYSTACK_ALLOC_MAXIMUM
339  /* The OS might guarantee only one guard page at the bottom of the stack,
340  and a page size can be as small as 4096 bytes. So we cannot safely
341  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
342  to allow for a few compiler-allocated temporary stack slots. */
343 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
344 # endif
345 # else
346 # define YYSTACK_ALLOC YYMALLOC
347 # define YYSTACK_FREE YYFREE
348 # ifndef YYSTACK_ALLOC_MAXIMUM
349 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
350 # endif
351 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
352  && ! ((defined YYMALLOC || defined malloc) \
353  && (defined YYFREE || defined free)))
354 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
355 # ifndef EXIT_SUCCESS
356 # define EXIT_SUCCESS 0
357 # endif
358 # endif
359 # ifndef YYMALLOC
360 # define YYMALLOC malloc
361 # if ! defined malloc && ! defined EXIT_SUCCESS
362 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
363 # endif
364 # endif
365 # ifndef YYFREE
366 # define YYFREE free
367 # if ! defined free && ! defined EXIT_SUCCESS
368 void free (void *); /* INFRINGES ON USER NAME SPACE */
369 # endif
370 # endif
371 # endif
372 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
373 
374 
375 #if (! defined yyoverflow \
376  && (! defined __cplusplus \
377  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
378 
379 /* A type that is properly aligned for any stack member. */
380 union yyalloc
381 {
382  yytype_int16 yyss_alloc;
383  YYSTYPE yyvs_alloc;
384 };
385 
386 /* The size of the maximum gap between one aligned stack and the next. */
387 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
388 
389 /* The size of an array large to enough to hold all stacks, each with
390  N elements. */
391 # define YYSTACK_BYTES(N) \
392  ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
393  + YYSTACK_GAP_MAXIMUM)
394 
395 # define YYCOPY_NEEDED 1
396 
397 /* Relocate STACK from its old location to the new one. The
398  local variables YYSIZE and YYSTACKSIZE give the old and new number of
399  elements in the stack, and YYPTR gives the new location of the
400  stack. Advance YYPTR to a properly aligned location for the next
401  stack. */
402 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
403  do \
404  { \
405  YYSIZE_T yynewbytes; \
406  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
407  Stack = &yyptr->Stack_alloc; \
408  yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
409  yyptr += yynewbytes / sizeof (*yyptr); \
410  } \
411  while (0)
412 
413 #endif
414 
415 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
416 /* Copy COUNT objects from SRC to DST. The source and destination do
417  not overlap. */
418 # ifndef YYCOPY
419 # if defined __GNUC__ && 1 < __GNUC__
420 # define YYCOPY(Dst, Src, Count) \
421  __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
422 # else
423 # define YYCOPY(Dst, Src, Count) \
424  do \
425  { \
426  YYSIZE_T yyi; \
427  for (yyi = 0; yyi < (Count); yyi++) \
428  (Dst)[yyi] = (Src)[yyi]; \
429  } \
430  while (0)
431 # endif
432 # endif
433 #endif /* !YYCOPY_NEEDED */
434 
435 /* YYFINAL -- State number of the termination state. */
436 #define YYFINAL 2
437 /* YYLAST -- Last index in YYTABLE. */
438 #define YYLAST 122
439 
440 /* YYNTOKENS -- Number of terminals. */
441 #define YYNTOKENS 33
442 /* YYNNTS -- Number of nonterminals. */
443 #define YYNNTS 26
444 /* YYNRULES -- Number of rules. */
445 #define YYNRULES 56
446 /* YYNSTATES -- Number of states. */
447 #define YYNSTATES 108
448 
449 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
450  by yylex, with out-of-bounds checking. */
451 #define YYUNDEFTOK 2
452 #define YYMAXUTOK 282
453 
454 #define YYTRANSLATE(YYX) \
455  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
456 
457 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
458  as returned by yylex, without out-of-bounds checking. */
459 static const yytype_uint8 yytranslate[] =
460 {
461  0, 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, 28, 2, 2, 2, 2, 2,
465  29, 30, 2, 2, 31, 2, 2, 2, 2, 2,
466  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
467  2, 32, 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, 2, 2, 2, 2,
482  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
483  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
484  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
485  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
486  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
487  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
488  15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
489  25, 26, 27
490 };
491 
492 #if YYDEBUG
493  /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
494 static const yytype_uint16 yyrline[] =
495 {
496  0, 110, 110, 111, 112, 113, 114, 115, 116, 117,
497  122, 123, 126, 127, 161, 191, 223, 224, 225, 226,
498  227, 228, 229, 230, 231, 232, 233, 234, 235, 236,
499  238, 245, 252, 253, 256, 280, 297, 314, 322, 332,
500  354, 353, 363, 400, 420, 451, 478, 477, 489, 488,
501  497, 582, 605, 632, 646, 654, 666
502 };
503 #endif
504 
505 #if YYDEBUG || YYERROR_VERBOSE || 0
506 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
507  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
508 static const char *const yytname[] =
509 {
510  "$end", "error", "$undefined", "GROUP", "END_GROUP", "OBJECT",
511  "END_OBJECT", "GRID_NAME", "SWATH_NAME", "ZA_NAME", "DEFAULT", "XDIM",
512  "YDIM", "UPPERLEFTPT", "LOWERRIGHTPT", "PIXELREGISTRATION", "PROJECTION",
513  "GRIDORIGIN", "DIMENSION_NAME", "DIMENSION_SIZE", "DATA_FIELD_NAME",
514  "GEO_FIELD_NAME", "DATA_TYPE", "DIMENSION_LIST", "COMPRESSION_TYPE",
515  "INT", "FLOAT", "STR", "'\"'", "'('", "')'", "','", "'='", "$accept",
516  "attribute_list", "dataseq", "dataseq1", "data", "attribute",
517  "attribute_grid_name", "attribute_swath_name", "attribute_za_name",
518  "attribute_dimension_name", "attribute_dimension_size",
519  "attribute_dimension_list", "$@1", "attribute_data_field_name",
520  "attribute_geo_field_name", "attribute_xdim", "attribute_ydim", "group",
521  "$@2", "object", "$@3", "projection", "attribute_pixelregistration",
522  "attribute_gridorigin", "attribute_upperleft", "attribute_lowerright", YY_NULLPTR
523 };
524 #endif
525 
526 # ifdef YYPRINT
527 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
528  (internal) symbol number NUM (which must be that of a token). */
529 static const yytype_uint16 yytoknum[] =
530 {
531  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
532  265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
533  275, 276, 277, 278, 279, 280, 281, 282, 34, 40,
534  41, 44, 61
535 };
536 # endif
537 
538 #define YYPACT_NINF -32
539 
540 #define yypact_value_is_default(Yystate) \
541  (!!((Yystate) == (-32)))
542 
543 #define YYTABLE_NINF -1
544 
545 #define yytable_value_is_error(Yytable_value) \
546  0
547 
548  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
549  STATE-NUM. */
550 static const yytype_int8 yypact[] =
551 {
552  -32, 0, -32, -31, -22, -6, 26, 41, 10, 51,
553  -4, 21, 59, 55, 61, 57, 58, 60, 62, -32,
554  -32, 63, 64, -32, -32, -32, -32, -32, -32, -32,
555  -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,
556  -32, 66, 70, 71, 72, 73, -32, -32, -32, 65,
557  -32, 75, -32, 76, -32, -23, 77, 78, 79, 80,
558  81, 49, -32, -32, -32, -32, -32, 82, 83, -32,
559  -32, -32, -32, -32, -32, 49, -32, -32, 84, 54,
560  -32, -32, -32, 89, 90, -32, 91, -32, -32, -32,
561  52, -32, 25, 48, 74, 87, -32, -32, 54, 86,
562  88, -32, -32, -32, 94, 95, -32, -32
563 };
564 
565  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
566  Performed when YYTABLE does not specify something else to do. Zero
567  means the default is an error. */
568 static const yytype_uint8 yydefact[] =
569 {
570  2, 0, 1, 0, 0, 0, 0, 0, 0, 0,
571  0, 0, 0, 0, 0, 0, 0, 0, 0, 29,
572  40, 0, 0, 4, 16, 32, 33, 19, 20, 21,
573  22, 23, 17, 18, 5, 3, 28, 26, 27, 24,
574  25, 0, 0, 0, 0, 0, 44, 45, 54, 0,
575  56, 0, 51, 0, 52, 0, 0, 0, 0, 0,
576  0, 6, 46, 48, 34, 35, 36, 0, 0, 50,
577  38, 37, 39, 42, 43, 6, 31, 7, 0, 12,
578  30, 2, 2, 0, 0, 41, 0, 13, 14, 15,
579  0, 10, 0, 0, 0, 0, 8, 9, 12, 0,
580  0, 53, 55, 11, 0, 0, 47, 49
581 };
582 
583  /* YYPGOTO[NTERM-NUM]. */
584 static const yytype_int8 yypgoto[] =
585 {
586  -32, 3, 32, -32, 11, -32, -32, -32, -32, -32,
587  -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,
588  -32, -32, -32, -32, -32, -32
589 };
590 
591  /* YYDEFGOTO[NTERM-NUM]. */
592 static const yytype_int8 yydefgoto[] =
593 {
594  -1, 1, 80, 90, 91, 23, 24, 25, 26, 27,
595  28, 29, 59, 30, 31, 32, 33, 34, 81, 35,
596  82, 36, 37, 38, 39, 40
597 };
598 
599  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
600  positive, shift that token. If negative, reduce the rule whose
601  number is the opposite. If YYTABLE_NINF, syntax error. */
602 static const yytype_uint8 yytable[] =
603 {
604  2, 41, 70, 3, 71, 4, 48, 5, 6, 7,
605  42, 8, 9, 10, 11, 12, 13, 14, 15, 16,
606  17, 18, 19, 20, 21, 49, 43, 22, 3, 99,
607  4, 50, 5, 6, 7, 46, 8, 9, 10, 11,
608  12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
609  51, 3, 22, 4, 100, 5, 6, 7, 44, 8,
610  9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
611  19, 20, 21, 45, 77, 22, 47, 78, 79, 87,
612  88, 89, 97, 98, 92, 93, 52, 53, 54, 55,
613  56, 67, 57, 62, 58, 60, 61, 63, 64, 65,
614  66, 68, 72, 69, 101, 73, 74, 85, 76, 103,
615  0, 86, 75, 83, 84, 94, 95, 102, 104, 96,
616  105, 106, 107
617 };
618 
619 static const yytype_int8 yycheck[] =
620 {
621  0, 32, 25, 3, 27, 5, 10, 7, 8, 9,
622  32, 11, 12, 13, 14, 15, 16, 17, 18, 19,
623  20, 21, 22, 23, 24, 29, 32, 27, 3, 4,
624  5, 10, 7, 8, 9, 25, 11, 12, 13, 14,
625  15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
626  29, 3, 27, 5, 6, 7, 8, 9, 32, 11,
627  12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
628  22, 23, 24, 32, 25, 27, 25, 28, 29, 25,
629  26, 27, 30, 31, 81, 82, 27, 32, 27, 32,
630  32, 26, 32, 27, 32, 32, 32, 27, 27, 27,
631  27, 26, 25, 27, 30, 27, 27, 75, 27, 98,
632  -1, 27, 32, 31, 31, 26, 26, 30, 32, 28,
633  32, 27, 27
634 };
635 
636  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
637  symbol of state STATE-NUM. */
638 static const yytype_uint8 yystos[] =
639 {
640  0, 34, 0, 3, 5, 7, 8, 9, 11, 12,
641  13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
642  23, 24, 27, 38, 39, 40, 41, 42, 43, 44,
643  46, 47, 48, 49, 50, 52, 54, 55, 56, 57,
644  58, 32, 32, 32, 32, 32, 25, 25, 10, 29,
645  10, 29, 27, 32, 27, 32, 32, 32, 32, 45,
646  32, 32, 27, 27, 27, 27, 27, 26, 26, 27,
647  25, 27, 25, 27, 27, 32, 27, 25, 28, 29,
648  35, 51, 53, 31, 31, 35, 27, 25, 26, 27,
649  36, 37, 34, 34, 26, 26, 28, 30, 31, 4,
650  6, 30, 30, 37, 32, 32, 27, 27
651 };
652 
653  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
654 static const yytype_uint8 yyr1[] =
655 {
656  0, 33, 34, 34, 34, 34, 35, 35, 35, 35,
657  36, 36, 37, 37, 37, 37, 38, 38, 38, 38,
658  38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
659  38, 38, 38, 38, 39, 40, 41, 42, 42, 43,
660  45, 44, 46, 47, 48, 49, 51, 50, 53, 52,
661  54, 55, 56, 57, 57, 58, 58
662 };
663 
664  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
665 static const yytype_uint8 yyr2[] =
666 {
667  0, 2, 0, 2, 2, 2, 0, 1, 3, 3,
668  1, 3, 0, 1, 1, 1, 1, 1, 1, 1,
669  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
670  3, 3, 1, 1, 3, 3, 3, 3, 3, 3,
671  0, 4, 3, 3, 2, 2, 0, 8, 0, 8,
672  3, 2, 2, 6, 2, 6, 2
673 };
674 
675 
676 #define yyerrok (yyerrstatus = 0)
677 #define yyclearin (yychar = YYEMPTY)
678 #define YYEMPTY (-2)
679 #define YYEOF 0
680 
681 #define YYACCEPT goto yyacceptlab
682 #define YYABORT goto yyabortlab
683 #define YYERROR goto yyerrorlab
684 
685 
686 #define YYRECOVERING() (!!yyerrstatus)
687 
688 #define YYBACKUP(Token, Value) \
689 do \
690  if (yychar == YYEMPTY) \
691  { \
692  yychar = (Token); \
693  yylval = (Value); \
694  YYPOPSTACK (yylen); \
695  yystate = *yyssp; \
696  goto yybackup; \
697  } \
698  else \
699  { \
700  yyerror (he5parser, YY_("syntax error: cannot back up")); \
701  YYERROR; \
702  } \
703 while (0)
704 
705 /* Error token number */
706 #define YYTERROR 1
707 #define YYERRCODE 256
708 
709 
710 
711 /* Enable debugging if requested. */
712 #if YYDEBUG
713 
714 # ifndef YYFPRINTF
715 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
716 # define YYFPRINTF fprintf
717 # endif
718 
719 # define YYDPRINTF(Args) \
720 do { \
721  if (yydebug) \
722  YYFPRINTF Args; \
723 } while (0)
724 
725 /* This macro is provided for backward compatibility. */
726 #ifndef YY_LOCATION_PRINT
727 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
728 #endif
729 
730 
731 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
732 do { \
733  if (yydebug) \
734  { \
735  YYFPRINTF (stderr, "%s ", Title); \
736  yy_symbol_print (stderr, \
737  Type, Value, he5parser); \
738  YYFPRINTF (stderr, "\n"); \
739  } \
740 } while (0)
741 
742 
743 /*----------------------------------------.
744 | Print this symbol's value on YYOUTPUT. |
745 `----------------------------------------*/
746 
747 static void
748 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, HE5Parser *he5parser)
749 {
750  FILE *yyo = yyoutput;
751  YYUSE (yyo);
752  YYUSE (he5parser);
753  if (!yyvaluep)
754  return;
755 # ifdef YYPRINT
756  if (yytype < YYNTOKENS)
757  YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
758 # endif
759  YYUSE (yytype);
760 }
761 
762 
763 /*--------------------------------.
764 | Print this symbol on YYOUTPUT. |
765 `--------------------------------*/
766 
767 static void
768 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, HE5Parser *he5parser)
769 {
770  YYFPRINTF (yyoutput, "%s %s (",
771  yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
772 
773  yy_symbol_value_print (yyoutput, yytype, yyvaluep, he5parser);
774  YYFPRINTF (yyoutput, ")");
775 }
776 
777 /*------------------------------------------------------------------.
778 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
779 | TOP (included). |
780 `------------------------------------------------------------------*/
781 
782 static void
783 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
784 {
785  YYFPRINTF (stderr, "Stack now");
786  for (; yybottom <= yytop; yybottom++)
787  {
788  int yybot = *yybottom;
789  YYFPRINTF (stderr, " %d", yybot);
790  }
791  YYFPRINTF (stderr, "\n");
792 }
793 
794 # define YY_STACK_PRINT(Bottom, Top) \
795 do { \
796  if (yydebug) \
797  yy_stack_print ((Bottom), (Top)); \
798 } while (0)
799 
800 
801 /*------------------------------------------------.
802 | Report that the YYRULE is going to be reduced. |
803 `------------------------------------------------*/
804 
805 static void
806 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, HE5Parser *he5parser)
807 {
808  unsigned long int yylno = yyrline[yyrule];
809  int yynrhs = yyr2[yyrule];
810  int yyi;
811  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
812  yyrule - 1, yylno);
813  /* The symbols being reduced. */
814  for (yyi = 0; yyi < yynrhs; yyi++)
815  {
816  YYFPRINTF (stderr, " $%d = ", yyi + 1);
817  yy_symbol_print (stderr,
818  yystos[yyssp[yyi + 1 - yynrhs]],
819  &(yyvsp[(yyi + 1) - (yynrhs)])
820  , he5parser);
821  YYFPRINTF (stderr, "\n");
822  }
823 }
824 
825 # define YY_REDUCE_PRINT(Rule) \
826 do { \
827  if (yydebug) \
828  yy_reduce_print (yyssp, yyvsp, Rule, he5parser); \
829 } while (0)
830 
831 /* Nonzero means print parse trace. It is left uninitialized so that
832  multiple parsers can coexist. */
834 #else /* !YYDEBUG */
835 # define YYDPRINTF(Args)
836 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
837 # define YY_STACK_PRINT(Bottom, Top)
838 # define YY_REDUCE_PRINT(Rule)
839 #endif /* !YYDEBUG */
840 
841 
842 /* YYINITDEPTH -- initial size of the parser's stacks. */
843 #ifndef YYINITDEPTH
844 # define YYINITDEPTH 200
845 #endif
846 
847 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
848  if the built-in stack extension method is used).
849 
850  Do not make this value too large; the results are undefined if
851  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
852  evaluated with infinite-precision integer arithmetic. */
853 
854 #ifndef YYMAXDEPTH
855 # define YYMAXDEPTH 10000
856 #endif
857 
858 
859 #if YYERROR_VERBOSE
860 
861 # ifndef yystrlen
862 # if defined __GLIBC__ && defined _STRING_H
863 # define yystrlen strlen
864 # else
865 /* Return the length of YYSTR. */
866 static YYSIZE_T
867 yystrlen (const char *yystr)
868 {
869  YYSIZE_T yylen;
870  for (yylen = 0; yystr[yylen]; yylen++)
871  continue;
872  return yylen;
873 }
874 # endif
875 # endif
876 
877 # ifndef yystpcpy
878 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
879 # define yystpcpy stpcpy
880 # else
881 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
882  YYDEST. */
883 static char *
884 yystpcpy (char *yydest, const char *yysrc)
885 {
886  char *yyd = yydest;
887  const char *yys = yysrc;
888 
889  while ((*yyd++ = *yys++) != '\0')
890  continue;
891 
892  return yyd - 1;
893 }
894 # endif
895 # endif
896 
897 # ifndef yytnamerr
898 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
899  quotes and backslashes, so that it's suitable for yyerror. The
900  heuristic is that double-quoting is unnecessary unless the string
901  contains an apostrophe, a comma, or backslash (other than
902  backslash-backslash). YYSTR is taken from yytname. If YYRES is
903  null, do not copy; instead, return the length of what the result
904  would have been. */
905 static YYSIZE_T
906 yytnamerr (char *yyres, const char *yystr)
907 {
908  if (*yystr == '"')
909  {
910  YYSIZE_T yyn = 0;
911  char const *yyp = yystr;
912 
913  for (;;)
914  switch (*++yyp)
915  {
916  case '\'':
917  case ',':
918  goto do_not_strip_quotes;
919 
920  case '\\':
921  if (*++yyp != '\\')
922  goto do_not_strip_quotes;
923  /* Fall through. */
924  default:
925  if (yyres)
926  yyres[yyn] = *yyp;
927  yyn++;
928  break;
929 
930  case '"':
931  if (yyres)
932  yyres[yyn] = '\0';
933  return yyn;
934  }
935  do_not_strip_quotes: ;
936  }
937 
938  if (! yyres)
939  return yystrlen (yystr);
940 
941  return yystpcpy (yyres, yystr) - yyres;
942 }
943 # endif
944 
945 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
946  about the unexpected token YYTOKEN for the state stack whose top is
947  YYSSP.
948 
949  Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
950  not large enough to hold the message. In that case, also set
951  *YYMSG_ALLOC to the required number of bytes. Return 2 if the
952  required number of bytes is too large to store. */
953 static int
954 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
955  yytype_int16 *yyssp, int yytoken)
956 {
957  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
958  YYSIZE_T yysize = yysize0;
959  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
960  /* Internationalized format string. */
961  const char *yyformat = YY_NULLPTR;
962  /* Arguments of yyformat. */
963  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
964  /* Number of reported tokens (one for the "unexpected", one per
965  "expected"). */
966  int yycount = 0;
967 
968  /* There are many possibilities here to consider:
969  - If this state is a consistent state with a default action, then
970  the only way this function was invoked is if the default action
971  is an error action. In that case, don't check for expected
972  tokens because there are none.
973  - The only way there can be no lookahead present (in yychar) is if
974  this state is a consistent state with a default action. Thus,
975  detecting the absence of a lookahead is sufficient to determine
976  that there is no unexpected or expected token to report. In that
977  case, just report a simple "syntax error".
978  - Don't assume there isn't a lookahead just because this state is a
979  consistent state with a default action. There might have been a
980  previous inconsistent state, consistent state with a non-default
981  action, or user semantic action that manipulated yychar.
982  - Of course, the expected token list depends on states to have
983  correct lookahead information, and it depends on the parser not
984  to perform extra reductions after fetching a lookahead from the
985  scanner and before detecting a syntax error. Thus, state merging
986  (from LALR or IELR) and default reductions corrupt the expected
987  token list. However, the list is correct for canonical LR with
988  one exception: it will still contain any token that will not be
989  accepted due to an error action in a later state.
990  */
991  if (yytoken != YYEMPTY)
992  {
993  int yyn = yypact[*yyssp];
994  yyarg[yycount++] = yytname[yytoken];
995  if (!yypact_value_is_default (yyn))
996  {
997  /* Start YYX at -YYN if negative to avoid negative indexes in
998  YYCHECK. In other words, skip the first -YYN actions for
999  this state because they are default actions. */
1000  int yyxbegin = yyn < 0 ? -yyn : 0;
1001  /* Stay within bounds of both yycheck and yytname. */
1002  int yychecklim = YYLAST - yyn + 1;
1003  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1004  int yyx;
1005 
1006  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1007  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1008  && !yytable_value_is_error (yytable[yyx + yyn]))
1009  {
1010  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1011  {
1012  yycount = 1;
1013  yysize = yysize0;
1014  break;
1015  }
1016  yyarg[yycount++] = yytname[yyx];
1017  {
1018  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1019  if (! (yysize <= yysize1
1020  && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1021  return 2;
1022  yysize = yysize1;
1023  }
1024  }
1025  }
1026  }
1027 
1028  switch (yycount)
1029  {
1030 # define YYCASE_(N, S) \
1031  case N: \
1032  yyformat = S; \
1033  break
1034  YYCASE_(0, YY_("syntax error"));
1035  YYCASE_(1, YY_("syntax error, unexpected %s"));
1036  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1037  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1038  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1039  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1040 # undef YYCASE_
1041  }
1042 
1043  {
1044  YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1045  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1046  return 2;
1047  yysize = yysize1;
1048  }
1049 
1050  if (*yymsg_alloc < yysize)
1051  {
1052  *yymsg_alloc = 2 * yysize;
1053  if (! (yysize <= *yymsg_alloc
1054  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1055  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1056  return 1;
1057  }
1058 
1059  /* Avoid sprintf, as that infringes on the user's name space.
1060  Don't have undefined behavior even if the translation
1061  produced a string with the wrong number of "%s"s. */
1062  {
1063  char *yyp = *yymsg;
1064  int yyi = 0;
1065  while ((*yyp = *yyformat) != '\0')
1066  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1067  {
1068  yyp += yytnamerr (yyp, yyarg[yyi++]);
1069  yyformat += 2;
1070  }
1071  else
1072  {
1073  yyp++;
1074  yyformat++;
1075  }
1076  }
1077  return 0;
1078 }
1079 #endif /* YYERROR_VERBOSE */
1080 
1081 /*-----------------------------------------------.
1082 | Release the memory associated to this symbol. |
1083 `-----------------------------------------------*/
1084 
1085 static void
1086 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, HE5Parser *he5parser)
1087 {
1088  YYUSE (yyvaluep);
1089  YYUSE (he5parser);
1090  if (!yymsg)
1091  yymsg = "Deleting";
1092  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1093 
1095  YYUSE (yytype);
1097 }
1098 
1099 
1100 
1101 
1102 /* The lookahead symbol. */
1104 
1105 /* The semantic value of the lookahead symbol. */
1107 /* Number of syntax errors so far. */
1109 
1110 
1111 /*----------.
1112 | yyparse. |
1113 `----------*/
1114 
1115 int
1116 yyparse (HE5Parser *he5parser)
1117 {
1118  int yystate;
1119  /* Number of tokens to shift before error messages enabled. */
1120  int yyerrstatus;
1121 
1122  /* The stacks and their tools:
1123  'yyss': related to states.
1124  'yyvs': related to semantic values.
1125 
1126  Refer to the stacks through separate pointers, to allow yyoverflow
1127  to reallocate them elsewhere. */
1128 
1129  /* The state stack. */
1130  yytype_int16 yyssa[YYINITDEPTH];
1131  yytype_int16 *yyss;
1132  yytype_int16 *yyssp;
1133 
1134  /* The semantic value stack. */
1135  YYSTYPE yyvsa[YYINITDEPTH];
1136  YYSTYPE *yyvs;
1137  YYSTYPE *yyvsp;
1138 
1139  YYSIZE_T yystacksize;
1140 
1141  int yyn;
1142  int yyresult;
1143  /* Lookahead token as an internal (translated) token number. */
1144  int yytoken = 0;
1145  /* The variables used to return semantic value and location from the
1146  action routines. */
1147  YYSTYPE yyval;
1148 
1149 #if YYERROR_VERBOSE
1150  /* Buffer for error messages, and its allocated size. */
1151  char yymsgbuf[128];
1152  char *yymsg = yymsgbuf;
1153  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1154 #endif
1155 
1156 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1157 
1158  /* The number of symbols on the RHS of the reduced rule.
1159  Keep to zero when no symbol should be popped. */
1160  int yylen = 0;
1161 
1162  yyssp = yyss = yyssa;
1163  yyvsp = yyvs = yyvsa;
1164  yystacksize = YYINITDEPTH;
1165 
1166  YYDPRINTF ((stderr, "Starting parse\n"));
1167 
1168  yystate = 0;
1169  yyerrstatus = 0;
1170  yynerrs = 0;
1171  yychar = YYEMPTY; /* Cause a token to be read. */
1172  goto yysetstate;
1173 
1174 /*------------------------------------------------------------.
1175 | yynewstate -- Push a new state, which is found in yystate. |
1176 `------------------------------------------------------------*/
1177  yynewstate:
1178  /* In all cases, when you get here, the value and location stacks
1179  have just been pushed. So pushing a state here evens the stacks. */
1180  yyssp++;
1181 
1182  yysetstate:
1183  *yyssp = yystate;
1184 
1185  if (yyss + yystacksize - 1 <= yyssp)
1186  {
1187  /* Get the current used size of the three stacks, in elements. */
1188  YYSIZE_T yysize = yyssp - yyss + 1;
1189 
1190 #ifdef yyoverflow
1191  {
1192  /* Give user a chance to reallocate the stack. Use copies of
1193  these so that the &'s don't force the real ones into
1194  memory. */
1195  YYSTYPE *yyvs1 = yyvs;
1196  yytype_int16 *yyss1 = yyss;
1197 
1198  /* Each stack pointer address is followed by the size of the
1199  data in use in that stack, in bytes. This used to be a
1200  conditional around just the two extra args, but that might
1201  be undefined if yyoverflow is a macro. */
1202  yyoverflow (YY_("memory exhausted"),
1203  &yyss1, yysize * sizeof (*yyssp),
1204  &yyvs1, yysize * sizeof (*yyvsp),
1205  &yystacksize);
1206 
1207  yyss = yyss1;
1208  yyvs = yyvs1;
1209  }
1210 #else /* no yyoverflow */
1211 # ifndef YYSTACK_RELOCATE
1212  goto yyexhaustedlab;
1213 # else
1214  /* Extend the stack our own way. */
1215  if (YYMAXDEPTH <= yystacksize)
1216  goto yyexhaustedlab;
1217  yystacksize *= 2;
1218  if (YYMAXDEPTH < yystacksize)
1219  yystacksize = YYMAXDEPTH;
1220 
1221  {
1222  yytype_int16 *yyss1 = yyss;
1223  union yyalloc *yyptr =
1224  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1225  if (! yyptr)
1226  goto yyexhaustedlab;
1227  YYSTACK_RELOCATE (yyss_alloc, yyss);
1228  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1229 # undef YYSTACK_RELOCATE
1230  if (yyss1 != yyssa)
1231  YYSTACK_FREE (yyss1);
1232  }
1233 # endif
1234 #endif /* no yyoverflow */
1235 
1236  yyssp = yyss + yysize - 1;
1237  yyvsp = yyvs + yysize - 1;
1238 
1239  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1240  (unsigned long int) yystacksize));
1241 
1242  if (yyss + yystacksize - 1 <= yyssp)
1243  YYABORT;
1244  }
1245 
1246  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1247 
1248  if (yystate == YYFINAL)
1249  YYACCEPT;
1250 
1251  goto yybackup;
1252 
1253 /*-----------.
1254 | yybackup. |
1255 `-----------*/
1256 yybackup:
1257 
1258  /* Do appropriate processing given the current state. Read a
1259  lookahead token if we need one and don't already have one. */
1260 
1261  /* First try to decide what to do without reference to lookahead token. */
1262  yyn = yypact[yystate];
1263  if (yypact_value_is_default (yyn))
1264  goto yydefault;
1265 
1266  /* Not known => get a lookahead token if don't already have one. */
1267 
1268  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1269  if (yychar == YYEMPTY)
1270  {
1271  YYDPRINTF ((stderr, "Reading a token: "));
1272  yychar = yylex ();
1273  }
1274 
1275  if (yychar <= YYEOF)
1276  {
1277  yychar = yytoken = YYEOF;
1278  YYDPRINTF ((stderr, "Now at end of input.\n"));
1279  }
1280  else
1281  {
1282  yytoken = YYTRANSLATE (yychar);
1283  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1284  }
1285 
1286  /* If the proper action on seeing token YYTOKEN is to reduce or to
1287  detect an error, take that action. */
1288  yyn += yytoken;
1289  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1290  goto yydefault;
1291  yyn = yytable[yyn];
1292  if (yyn <= 0)
1293  {
1294  if (yytable_value_is_error (yyn))
1295  goto yyerrlab;
1296  yyn = -yyn;
1297  goto yyreduce;
1298  }
1299 
1300  /* Count tokens shifted since error; after three, turn off error
1301  status. */
1302  if (yyerrstatus)
1303  yyerrstatus--;
1304 
1305  /* Shift the lookahead token. */
1306  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1307 
1308  /* Discard the shifted token. */
1309  yychar = YYEMPTY;
1310 
1311  yystate = yyn;
1313  *++yyvsp = yylval;
1315 
1316  goto yynewstate;
1317 
1318 
1319 /*-----------------------------------------------------------.
1320 | yydefault -- do the default action for the current state. |
1321 `-----------------------------------------------------------*/
1322 yydefault:
1323  yyn = yydefact[yystate];
1324  if (yyn == 0)
1325  goto yyerrlab;
1326  goto yyreduce;
1327 
1328 
1329 /*-----------------------------.
1330 | yyreduce -- Do a reduction. |
1331 `-----------------------------*/
1332 yyreduce:
1333  /* yyn is the number of a rule to reduce with. */
1334  yylen = yyr2[yyn];
1335 
1336  /* If YYLEN is nonzero, implement the default value of the action:
1337  '$$ = $1'.
1338 
1339  Otherwise, the following line sets YYVAL to garbage.
1340  This behavior is undocumented and Bison
1341  users should not rely upon it. Assigning to YYVAL
1342  unconditionally makes the parser a bit smaller, and it avoids a
1343  GCC warning that YYVAL may be used uninitialized. */
1344  yyval = yyvsp[1-yylen];
1345 
1346 
1347  YY_REDUCE_PRINT (yyn);
1348  switch (yyn)
1349  {
1350  case 13:
1351 #line 128 "he5dds.yy" /* yacc.c:1646 */
1352  {
1353 #ifdef VERBOSE
1354  cout << "data: " << (yyvsp[0])
1355  << "parser_state: "
1356  << ((HE5Parser*)(he5parser))->parser_state
1357  << endl;
1358 #endif
1359  // We find that some products have dimension names "1", "2", etc., so add this parsing. KY 2012-12-4
1360  HE5Parser* p = (HE5Parser*)he5parser;
1361  if(p->parser_state == 10){ // THis is parsing DimList.
1362  string a;
1363  a = a.append((yyval));
1364  HE5Dim d;
1365  d.name = a;
1366  d.size = 0; /* <hyokyung 2011.12. 8. 13:50:34> */
1367 
1368  if(p->structure_state == HE5Parser::GRID) {
1369  p->grid_list.back().data_var_list.back().dim_list.push_back(d);
1370  }
1371 
1372 
1373  if(p->structure_state == HE5Parser::SWATH) {
1374  if(swath_is_geo_field == true)
1375  p->swath_list.back().geo_var_list.back().dim_list.push_back(d);
1376  else
1377  p->swath_list.back().data_var_list.back().dim_list.push_back(d);
1378  }
1379 
1380  if(p->structure_state == HE5Parser::ZA) {
1381  p->za_list.back().data_var_list.back().dim_list.push_back(d);
1382  }
1383  }
1384 }
1385 #line 1386 "he5dds.tab.cc" /* yacc.c:1646 */
1386  break;
1387 
1388  case 14:
1389 #line 162 "he5dds.yy" /* yacc.c:1646 */
1390  {
1391 #ifdef VERBOSE
1392  cout << "data: " << (yyvsp[0])
1393  << "parser_state: "
1394  << ((HE5Parser*)(he5parser))->parser_state
1395  << endl;
1396 #endif
1397  switch(((HE5Parser*)(he5parser))->parser_state){
1398  case 0:
1399  ((HE5Parser*)(he5parser))->parser_state = 1;
1400  ((HE5Parser*)(he5parser))->point_left = atof((yyvsp[0]));
1401  break;
1402  case 1:
1403  ((HE5Parser*)(he5parser))->parser_state = 2;
1404  ((HE5Parser*)(he5parser))->point_upper = atof((yyvsp[0]));
1405  break;
1406  case 2:
1407  ((HE5Parser*)(he5parser))->parser_state = 3;
1408  ((HE5Parser*)(he5parser))->point_right = atof((yyvsp[0]));
1409  break;
1410  case 3:
1411  ((HE5Parser*)(he5parser))->parser_state = 4;
1412  ((HE5Parser*)(he5parser))->point_lower = atof((yyvsp[0]));
1413  break;
1414  default:
1415  break;
1416  };
1417 }
1418 #line 1419 "he5dds.tab.cc" /* yacc.c:1646 */
1419  break;
1420 
1421  case 15:
1422 #line 192 "he5dds.yy" /* yacc.c:1646 */
1423  {
1424  HE5Parser* p = (HE5Parser*)he5parser;
1425  if(p->parser_state == 10){
1426  string a;
1427  a = a.append((yyval));
1428  HE5Dim d;
1429  d.name = a;
1430  d.size = 0; /* <hyokyung 2011.12. 8. 13:50:34> */
1431 
1432  if(p->structure_state == HE5Parser::GRID) {
1433  p->grid_list.back().data_var_list.back().dim_list.push_back(d);
1434  }
1435 
1436 
1437  if(p->structure_state == HE5Parser::SWATH) {
1438  if(swath_is_geo_field == true)
1439  p->swath_list.back().geo_var_list.back().dim_list.push_back(d);
1440  else
1441  p->swath_list.back().data_var_list.back().dim_list.push_back(d);
1442  }
1443 
1444  if(p->structure_state == HE5Parser::ZA) {
1445  p->za_list.back().data_var_list.back().dim_list.push_back(d);
1446  }
1447  }
1448 
1449 
1450 }
1451 #line 1452 "he5dds.tab.cc" /* yacc.c:1646 */
1452  break;
1453 
1454  case 30:
1455 #line 239 "he5dds.yy" /* yacc.c:1646 */
1456  {
1457 #ifdef VEROBSE
1458  cout << "Rule STR '=' dataseq:" << (yyvsp[-1]) << endl;
1459 #endif
1460 }
1461 #line 1462 "he5dds.tab.cc" /* yacc.c:1646 */
1462  break;
1463 
1464  case 31:
1465 #line 246 "he5dds.yy" /* yacc.c:1646 */
1466  {
1467 #ifdef VERBOSE
1468  cout << "Rule COMPRESSION_TYPE '=' STR:" << (yyvsp[-1]) << endl;
1469 #endif
1470 
1471 }
1472 #line 1473 "he5dds.tab.cc" /* yacc.c:1646 */
1473  break;
1474 
1475  case 34:
1476 #line 257 "he5dds.yy" /* yacc.c:1646 */
1477  {
1478  HE5Parser* p = (HE5Parser*)he5parser;
1479  HE5Grid g;
1480  // Initialize the Grid structure.
1481  g.point_lower = -999.0;
1482  g.point_upper = -999.0;
1483  g.point_left = -999.0;
1484  g.point_right = -999.0;
1488 
1489 #ifdef VERBOSE
1490  cout << "Grid Name is:" << (yyvsp[0]) << endl;
1491 #endif
1492 
1493  // Save the Grid name.
1494  g.name = (yyvsp[0]);
1495  p->grid_list.push_back(g);
1497 }
1498 #line 1499 "he5dds.tab.cc" /* yacc.c:1646 */
1499  break;
1500 
1501  case 35:
1502 #line 281 "he5dds.yy" /* yacc.c:1646 */
1503  {
1504  HE5Parser* p = (HE5Parser*)he5parser;
1505  HE5Swath s;
1506 
1507 #ifdef VERBOSE
1508  cout << "Swath Name is:" << (yyvsp[0]) << endl;
1509 #endif
1510 
1511  // Save the Swath name.
1512  s.name = (yyvsp[0]);
1513  p->swath_list.push_back(s);
1515 
1516 }
1517 #line 1518 "he5dds.tab.cc" /* yacc.c:1646 */
1518  break;
1519 
1520  case 36:
1521 #line 298 "he5dds.yy" /* yacc.c:1646 */
1522  {
1523  HE5Parser* p = (HE5Parser*)he5parser;
1524  HE5Za z;
1525 
1526 #ifdef VERBOSE
1527  cout << "Zonal Average Name is:" << (yyvsp[0]) << endl;
1528 #endif
1529 
1530  // Save the ZA name.
1531  z.name = (yyvsp[0]);
1532  p->za_list.push_back(z);
1534 }
1535 #line 1536 "he5dds.tab.cc" /* yacc.c:1646 */
1536  break;
1537 
1538  case 37:
1539 #line 315 "he5dds.yy" /* yacc.c:1646 */
1540  {
1541  // Save the dimension name.
1542  dimension_name = (yyvsp[0]);
1543 #ifdef VERBOSE
1544  cout << " Dimension name: " << dimension_name << endl;
1545 #endif
1546 }
1547 #line 1548 "he5dds.tab.cc" /* yacc.c:1646 */
1548  break;
1549 
1550  case 38:
1551 #line 323 "he5dds.yy" /* yacc.c:1646 */
1552  {
1553  // Save the dimension name.
1554  dimension_name = (yyvsp[0]);
1555 #ifdef VERBOSE
1556  cout << " Dimension name: " << dimension_name << endl;
1557 #endif
1558 }
1559 #line 1560 "he5dds.tab.cc" /* yacc.c:1646 */
1560  break;
1561 
1562  case 39:
1563 #line 333 "he5dds.yy" /* yacc.c:1646 */
1564  {
1565  HE5Parser* p = (HE5Parser*)he5parser;
1566  HE5Dim d;
1567  d.name = dimension_name;
1568  d.size = atoi((yyvsp[0]));
1569 
1570  // Save the dimension name and its size.
1571  if(p->structure_state == HE5Parser::GRID){
1572  p->grid_list.back().dim_list.push_back(d);
1573  }
1574  if(p->structure_state == HE5Parser::SWATH){
1575  p->swath_list.back().dim_list.push_back(d);
1576  }
1577  if(p->structure_state == HE5Parser::ZA){
1578  p->za_list.back().dim_list.push_back(d);
1579  }
1580 
1581 }
1582 #line 1583 "he5dds.tab.cc" /* yacc.c:1646 */
1583  break;
1584 
1585  case 40:
1586 #line 354 "he5dds.yy" /* yacc.c:1646 */
1587  {
1588  ((HE5Parser*)(he5parser))->parser_state = 10;
1589 }
1590 #line 1591 "he5dds.tab.cc" /* yacc.c:1646 */
1591  break;
1592 
1593  case 41:
1594 #line 358 "he5dds.yy" /* yacc.c:1646 */
1595  {
1596  ((HE5Parser*)(he5parser))->parser_state = 11;
1597 }
1598 #line 1599 "he5dds.tab.cc" /* yacc.c:1646 */
1599  break;
1600 
1601  case 42:
1602 #line 364 "he5dds.yy" /* yacc.c:1646 */
1603  {
1604 #ifdef VERBOSE
1605  cout << (yyvsp[0]) << endl;
1606 #endif
1607  HE5Parser* p = (HE5Parser*)he5parser;
1608  HE5Var v;
1609  // Save the data field name.
1610  v.name = (yyvsp[0]);
1611 
1612  // Push the variable into list.
1613  switch(p->structure_state){
1614 
1615  case HE5Parser::GRID:
1616  p->grid_list.back().data_var_list.push_back(v);
1617  break;
1618 
1619  case HE5Parser::SWATH:
1620  p->swath_list.back().data_var_list.push_back(v);
1621  swath_is_geo_field = false;
1622  break;
1623 
1624  case HE5Parser::ZA:
1625  p->za_list.back().data_var_list.push_back(v);
1626  break;
1627 
1628  default:
1629  p->err_msg = "Unexpected parser structure state.";
1630  YYERROR;
1631  break;
1632  }
1633 
1634 
1635 }
1636 #line 1637 "he5dds.tab.cc" /* yacc.c:1646 */
1637  break;
1638 
1639  case 43:
1640 #line 401 "he5dds.yy" /* yacc.c:1646 */
1641  {
1642 
1643  HE5Parser* p = (HE5Parser*)he5parser;
1645  HE5Var v;
1646  v.name = (yyvsp[0]);
1647  p->swath_list.back().geo_var_list.push_back(v);
1648  swath_is_geo_field = true;
1649  }
1650  else{
1651  p->err_msg = "Geo field variable is defined on non-Swath structure:" + string((yyvsp[0]));
1652  YYERROR;
1653 
1654 
1655  }
1656 }
1657 #line 1658 "he5dds.tab.cc" /* yacc.c:1646 */
1658  break;
1659 
1660  case 44:
1661 #line 421 "he5dds.yy" /* yacc.c:1646 */
1662  {
1663  // Remember the X Dimension
1664 #ifdef VERBOSE
1665  cout << "XDim is:" << atoi((yyvsp[0])) << endl;
1666 #endif
1667  HE5Dim d;
1668  HE5Parser* p = (HE5Parser*)he5parser;
1669 
1670  d.name = "XDim";
1671  d.size = atoi((yyvsp[0]));
1672  // Save the dimension name and its size.
1673  if(p->structure_state == HE5Parser::GRID){
1674  p->grid_list.back().dim_list.push_back(d);
1675  }
1676 
1677  // Throw an error instead.
1678  // Although we haven't seen XDim and YDim defined outside the
1679  // "GROUP=Dimension" block in Swath and ZA cases, we handle the following
1680  // cases for robustness.
1681  if(p->structure_state == HE5Parser::SWATH){
1682  p->swath_list.back().dim_list.push_back(d);
1683  }
1684 
1685  if(p->structure_state == HE5Parser::ZA){
1686  p->za_list.back().dim_list.push_back(d);
1687  }
1688 
1689 }
1690 #line 1691 "he5dds.tab.cc" /* yacc.c:1646 */
1691  break;
1692 
1693  case 45:
1694 #line 452 "he5dds.yy" /* yacc.c:1646 */
1695  {
1696  // Remember the Y Dimension
1697 #ifdef VERBOSE
1698  cout << "YDim is:" << atoi((yyvsp[0])) << endl;
1699 #endif
1700  HE5Dim d;
1701  HE5Parser* p = (HE5Parser*)he5parser;
1702 
1703  d.name = "YDim";
1704  d.size = atoi((yyvsp[0]));
1705  // Save the dimension name and its size.
1706  if(p->structure_state == HE5Parser::GRID){
1707  p->grid_list.back().dim_list.push_back(d);
1708  }
1709  if(p->structure_state == HE5Parser::SWATH){
1710  p->swath_list.back().dim_list.push_back(d);
1711  }
1712  if(p->structure_state == HE5Parser::ZA){
1713  p->za_list.back().dim_list.push_back(d);
1714  }
1715 }
1716 #line 1717 "he5dds.tab.cc" /* yacc.c:1646 */
1717  break;
1718 
1719  case 46:
1720 #line 478 "he5dds.yy" /* yacc.c:1646 */
1721  {
1722 #ifdef VERBOSE
1723  cout << "GROUP=" << (yyvsp[0]) << endl;
1724 #endif
1725 }
1726 #line 1727 "he5dds.tab.cc" /* yacc.c:1646 */
1727  break;
1728 
1729  case 48:
1730 #line 489 "he5dds.yy" /* yacc.c:1646 */
1731  {
1732 #ifdef VERBOSE
1733  cout << (yyvsp[0]) << endl;
1734 #endif
1735 }
1736 #line 1737 "he5dds.tab.cc" /* yacc.c:1646 */
1737  break;
1738 
1739  case 50:
1740 #line 498 "he5dds.yy" /* yacc.c:1646 */
1741  {
1742  HE5Parser* p = (HE5Parser*)he5parser;
1743 #ifdef VERBOSE
1744  cerr << "Got projection " << (yyvsp[0]) << endl;
1745 #endif
1746  HE5Grid *g = &p->grid_list.back();
1747  if(strncmp("HE5_GCTP_GEO", (yyvsp[0]), 12)==0)
1748  g->projection = HE5_GCTP_GEO;
1749  else if(strncmp("HE5_GCTP_UTM", (yyvsp[0]), 12)==0)
1750  g->projection = HE5_GCTP_UTM;
1751  else if(strncmp("HE5_GCTP_SPCS", (yyvsp[0]), 13)==0)
1752  g->projection = HE5_GCTP_SPCS;
1753  else if(strncmp("HE5_GCTP_ALBERS", (yyvsp[0]), 15)==0)
1754  g->projection = HE5_GCTP_ALBERS;
1755  else if(strncmp("HE5_GCTP_LAMCC", (yyvsp[0]), 14)==0)
1756  g->projection = HE5_GCTP_LAMCC;
1757  else if(strncmp("HE5_GCTP_MERCAT", (yyvsp[0]), 15)==0)
1758  g->projection = HE5_GCTP_MERCAT;
1759  else if(strncmp("HE5_GCTP_PS", (yyvsp[0]), 11)==0)
1760  g->projection = HE5_GCTP_PS;
1761  else if(strncmp("HE5_GCTP_POLYC", (yyvsp[0]), 14)==0)
1762  g->projection = HE5_GCTP_POLYC;
1763  else if(strncmp("HE5_GCTP_EQUIDC", (yyvsp[0]), 15)==0)
1764  g->projection = HE5_GCTP_EQUIDC;
1765  else if(strncmp("HE5_GCTP_TM", (yyvsp[0]), 11)==0)
1766  g->projection = HE5_GCTP_TM;
1767  else if(strncmp("HE5_GCTP_STEREO", (yyvsp[0]), 15)==0)
1768  g->projection = HE5_GCTP_STEREO;
1769  else if(strncmp("HE5_GCTP_LAMAZ", (yyvsp[0]), 14)==0)
1770  g->projection = HE5_GCTP_LAMAZ;
1771  else if(strncmp("HE5_GCTP_AZMEQD", (yyvsp[0]), 15)==0)
1772  g->projection = HE5_GCTP_AZMEQD;
1773  else if(strncmp("HE5_GCTP_GNOMON", (yyvsp[0]), 15)==0)
1774  g->projection = HE5_GCTP_GNOMON;
1775  else if(strncmp("HE5_GCTP_ORTHO", (yyvsp[0]), 14)==0)
1776  g->projection = HE5_GCTP_ORTHO;
1777  else if(strncmp("HE5_GCTP_GVNSP", (yyvsp[0]), 14)==0)
1778  g->projection = HE5_GCTP_GVNSP;
1779  else if(strncmp("HE5_GCTP_SNSOID", (yyvsp[0]), 15)==0)
1780  g->projection = HE5_GCTP_SNSOID;
1781  else if(strncmp("HE5_GCTP_EQRECT", (yyvsp[0]), 15)==0)
1782  g->projection = HE5_GCTP_EQRECT;
1783  else if(strncmp("HE5_GCTP_MILLER", (yyvsp[0]), 15)==0)
1784  g->projection = HE5_GCTP_MILLER;
1785  else if(strncmp("HE5_GCTP_VGRINT", (yyvsp[0]), 15)==0)
1786  g->projection = HE5_GCTP_VGRINT;
1787  else if(strncmp("HE5_GCTP_HOM", (yyvsp[0]), 12)==0)
1788  g->projection = HE5_GCTP_HOM;
1789  else if(strncmp("HE5_GCTP_ROBIN", (yyvsp[0]), 14)==0)
1790  g->projection = HE5_GCTP_ROBIN;
1791  else if(strncmp("HE5_GCTP_SOM", (yyvsp[0]), 12)==0)
1792  g->projection = HE5_GCTP_SOM;
1793  else if(strncmp("HE5_GCTP_ALASKA", (yyvsp[0]), 15)==0)
1794  g->projection = HE5_GCTP_ALASKA;
1795  else if(strncmp("HE5_GCTP_GOOD", (yyvsp[0]), 13)==0)
1796  g->projection = HE5_GCTP_GOOD;
1797  else if(strncmp("HE5_GCTP_MOLL", (yyvsp[0]), 13)==0)
1798  g->projection = HE5_GCTP_MOLL;
1799  else if(strncmp("HE5_GCTP_IMOLL", (yyvsp[0]), 14)==0)
1800  g->projection = HE5_GCTP_IMOLL;
1801  else if(strncmp("HE5_GCTP_HAMMER", (yyvsp[0]), 15)==0)
1802  g->projection = HE5_GCTP_HAMMER;
1803  else if(strncmp("HE5_GCTP_WAGIV", (yyvsp[0]), 14)==0)
1804  g->projection = HE5_GCTP_WAGIV;
1805  else if(strncmp("HE5_GCTP_WAGVII", (yyvsp[0]), 15)==0)
1806  g->projection = HE5_GCTP_WAGVII;
1807  else if(strncmp("HE5_GCTP_OBLEQA", (yyvsp[0]), 15)==0)
1808  g->projection = HE5_GCTP_OBLEQA;
1809  else if(strncmp("HE5_GCTP_CEA", (yyvsp[0]), 12)==0)
1810  g->projection = HE5_GCTP_CEA;
1811  else if(strncmp("HE5_GCTP_BCEA", (yyvsp[0]), 13)==0)
1812  g->projection = HE5_GCTP_BCEA;
1813  else if(strncmp("HE5_GCTP_ISINUS", (yyvsp[0]), 15)==0)
1814  g->projection = HE5_GCTP_ISINUS;
1815  else{
1816  p->err_msg = std::string("") +
1817  "An unknown projection is detected in StructMetadata." +
1818  "The projection code is " + (yyvsp[0]) + ".";
1819  g->projection = HE5_GCTP_UNKNOWN;
1820  //YYERROR;
1821  }
1822 }
1823 #line 1824 "he5dds.tab.cc" /* yacc.c:1646 */
1824  break;
1825 
1826  case 51:
1827 #line 583 "he5dds.yy" /* yacc.c:1646 */
1828  {
1829 
1830  // We use enum for pixel registration in HE5Grid.h, which starts from 0.
1831  // Thus, the default value should be negative.
1833  HE5Parser* p = (HE5Parser*)he5parser;
1834  HE5Grid *g = &p->grid_list.back();
1835 
1836  if(strncmp("HE5_HDFE_CENTER", (yyvsp[0]), 15)==0)
1837  value = HE5_HDFE_CENTER;
1838  else if(strncmp("HE5_HDFE_CORNER", (yyvsp[0]), 15)==0)
1839  value = HE5_HDFE_CORNER;
1840  else
1841  {
1842  ((HE5Parser*)(he5parser))->err_msg =
1843  "Wrong PixelRegistration Value";
1844  //YYERROR;
1845  }
1846  g->pixelregistration = value;
1847 }
1848 #line 1849 "he5dds.tab.cc" /* yacc.c:1646 */
1849  break;
1850 
1851  case 52:
1852 #line 606 "he5dds.yy" /* yacc.c:1646 */
1853  {
1854  // We use enum for origin in HE5Grid.h, which starts from 0.
1855  // Thus, the default value should be negative.
1857  HE5Parser* p = (HE5Parser*)he5parser;
1858  HE5Grid *g = &p->grid_list.back();
1859  if(strncmp("HE5_HDFE_GD_UL", (yyvsp[0]), 14)==0)
1860  value = HE5_HDFE_GD_UL;
1861  else if(strncmp("HE5_HDFE_GD_UR", (yyvsp[0]), 14)==0)
1862  value = HE5_HDFE_GD_UR;
1863  else if(strncmp("HE5_HDFE_GD_LL", (yyvsp[0]), 14)==0)
1864  value = HE5_HDFE_GD_LL;
1865  else if(strncmp("HE5_HDFE_GD_LR", (yyvsp[0]), 14)==0)
1866  value = HE5_HDFE_GD_LR;
1867  else
1868  {
1869  // Throw an error for unknown origin value.
1870  p->err_msg =
1871  "Wrong Grid Origin Value:" + string((yyvsp[0]));
1872  //YYERROR;
1873  }
1874  g->gridorigin = value;
1875 
1876 }
1877 #line 1878 "he5dds.tab.cc" /* yacc.c:1646 */
1878  break;
1879 
1880  case 53:
1881 #line 633 "he5dds.yy" /* yacc.c:1646 */
1882  {
1883 #ifdef VEROBSE
1884  fprintf(stdout, "## %s %f %f\n", (yyvsp[-5]), atof((yyvsp[-3])), atof((yyvsp[-1])));
1885 #endif
1886 
1887  HE5Parser* p = (HE5Parser*)he5parser;
1888  HE5Grid *g = &p->grid_list.back();
1889 
1890  g->point_left = atof((yyvsp[-3]));
1891  g->point_upper = atof((yyvsp[-1]));
1892 
1893 
1894 }
1895 #line 1896 "he5dds.tab.cc" /* yacc.c:1646 */
1896  break;
1897 
1898  case 54:
1899 #line 647 "he5dds.yy" /* yacc.c:1646 */
1900  {
1901 #ifdef VERBOSE
1902  fprintf(stderr, "## %s %s\n", (yyvsp[-1]), (yyvsp[0]));
1903 #endif
1904 }
1905 #line 1906 "he5dds.tab.cc" /* yacc.c:1646 */
1906  break;
1907 
1908  case 55:
1909 #line 655 "he5dds.yy" /* yacc.c:1646 */
1910  {
1911 #ifdef VERBOSE
1912  fprintf(stdout, "## %s %f %f\n", (yyvsp[-5]), atof((yyvsp[-3])), atof((yyvsp[-1])));
1913 #endif
1914 
1915  HE5Parser* p = (HE5Parser*)he5parser;
1916  HE5Grid *g = &p->grid_list.back();
1917 
1918  g->point_right = atof((yyvsp[-3]));
1919  g->point_lower = atof((yyvsp[-1]));
1920 }
1921 #line 1922 "he5dds.tab.cc" /* yacc.c:1646 */
1922  break;
1923 
1924  case 56:
1925 #line 667 "he5dds.yy" /* yacc.c:1646 */
1926  {
1927 }
1928 #line 1929 "he5dds.tab.cc" /* yacc.c:1646 */
1929  break;
1930 
1931 
1932 #line 1933 "he5dds.tab.cc" /* yacc.c:1646 */
1933  default: break;
1934  }
1935  /* User semantic actions sometimes alter yychar, and that requires
1936  that yytoken be updated with the new translation. We take the
1937  approach of translating immediately before every use of yytoken.
1938  One alternative is translating here after every semantic action,
1939  but that translation would be missed if the semantic action invokes
1940  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1941  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1942  incorrect destructor might then be invoked immediately. In the
1943  case of YYERROR or YYBACKUP, subsequent parser actions might lead
1944  to an incorrect destructor call or verbose syntax error message
1945  before the lookahead is translated. */
1946  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1947 
1948  YYPOPSTACK (yylen);
1949  yylen = 0;
1950  YY_STACK_PRINT (yyss, yyssp);
1951 
1952  *++yyvsp = yyval;
1953 
1954  /* Now 'shift' the result of the reduction. Determine what state
1955  that goes to, based on the state we popped back to and the rule
1956  number reduced by. */
1957 
1958  yyn = yyr1[yyn];
1959 
1960  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1961  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1962  yystate = yytable[yystate];
1963  else
1964  yystate = yydefgoto[yyn - YYNTOKENS];
1965 
1966  goto yynewstate;
1967 
1968 
1969 /*--------------------------------------.
1970 | yyerrlab -- here on detecting error. |
1971 `--------------------------------------*/
1972 yyerrlab:
1973  /* Make sure we have latest lookahead translation. See comments at
1974  user semantic actions for why this is necessary. */
1975  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1976 
1977  /* If not already recovering from an error, report this error. */
1978  if (!yyerrstatus)
1979  {
1980  ++yynerrs;
1981 #if ! YYERROR_VERBOSE
1982  yyerror (he5parser, YY_("syntax error"));
1983 #else
1984 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1985  yyssp, yytoken)
1986  {
1987  char const *yymsgp = YY_("syntax error");
1988  int yysyntax_error_status;
1989  yysyntax_error_status = YYSYNTAX_ERROR;
1990  if (yysyntax_error_status == 0)
1991  yymsgp = yymsg;
1992  else if (yysyntax_error_status == 1)
1993  {
1994  if (yymsg != yymsgbuf)
1995  YYSTACK_FREE (yymsg);
1996  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1997  if (!yymsg)
1998  {
1999  yymsg = yymsgbuf;
2000  yymsg_alloc = sizeof yymsgbuf;
2001  yysyntax_error_status = 2;
2002  }
2003  else
2004  {
2005  yysyntax_error_status = YYSYNTAX_ERROR;
2006  yymsgp = yymsg;
2007  }
2008  }
2009  yyerror (he5parser, yymsgp);
2010  if (yysyntax_error_status == 2)
2011  goto yyexhaustedlab;
2012  }
2013 # undef YYSYNTAX_ERROR
2014 #endif
2015  }
2016 
2017 
2018 
2019  if (yyerrstatus == 3)
2020  {
2021  /* If just tried and failed to reuse lookahead token after an
2022  error, discard it. */
2023 
2024  if (yychar <= YYEOF)
2025  {
2026  /* Return failure if at end of input. */
2027  if (yychar == YYEOF)
2028  YYABORT;
2029  }
2030  else
2031  {
2032  yydestruct ("Error: discarding",
2033  yytoken, &yylval, he5parser);
2034  yychar = YYEMPTY;
2035  }
2036  }
2037 
2038  /* Else will try to reuse lookahead token after shifting the error
2039  token. */
2040  goto yyerrlab1;
2041 
2042 
2043 /*---------------------------------------------------.
2044 | yyerrorlab -- error raised explicitly by YYERROR. |
2045 `---------------------------------------------------*/
2046 yyerrorlab:
2047 
2048  /* Pacify compilers like GCC when the user code never invokes
2049  YYERROR and the label yyerrorlab therefore never appears in user
2050  code. */
2051  if (/*CONSTCOND*/ 0)
2052  goto yyerrorlab;
2053 
2054  /* Do not reclaim the symbols of the rule whose action triggered
2055  this YYERROR. */
2056  YYPOPSTACK (yylen);
2057  yylen = 0;
2058  YY_STACK_PRINT (yyss, yyssp);
2059  yystate = *yyssp;
2060  goto yyerrlab1;
2061 
2062 
2063 /*-------------------------------------------------------------.
2064 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2065 `-------------------------------------------------------------*/
2066 yyerrlab1:
2067  yyerrstatus = 3; /* Each real token shifted decrements this. */
2068 
2069  for (;;)
2070  {
2071  yyn = yypact[yystate];
2072  if (!yypact_value_is_default (yyn))
2073  {
2074  yyn += YYTERROR;
2075  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2076  {
2077  yyn = yytable[yyn];
2078  if (0 < yyn)
2079  break;
2080  }
2081  }
2082 
2083  /* Pop the current state because it cannot handle the error token. */
2084  if (yyssp == yyss)
2085  YYABORT;
2086 
2087 
2088  yydestruct ("Error: popping",
2089  yystos[yystate], yyvsp, he5parser);
2090  YYPOPSTACK (1);
2091  yystate = *yyssp;
2092  YY_STACK_PRINT (yyss, yyssp);
2093  }
2094 
2096  *++yyvsp = yylval;
2098 
2099 
2100  /* Shift the error token. */
2101  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2102 
2103  yystate = yyn;
2104  goto yynewstate;
2105 
2106 
2107 /*-------------------------------------.
2108 | yyacceptlab -- YYACCEPT comes here. |
2109 `-------------------------------------*/
2110 yyacceptlab:
2111  yyresult = 0;
2112  goto yyreturn;
2113 
2114 /*-----------------------------------.
2115 | yyabortlab -- YYABORT comes here. |
2116 `-----------------------------------*/
2117 yyabortlab:
2118  yyresult = 1;
2119  goto yyreturn;
2120 
2121 #if !defined yyoverflow || YYERROR_VERBOSE
2122 /*-------------------------------------------------.
2123 | yyexhaustedlab -- memory exhaustion comes here. |
2124 `-------------------------------------------------*/
2125 yyexhaustedlab:
2126  yyerror (he5parser, YY_("memory exhausted"));
2127  yyresult = 2;
2128  /* Fall through. */
2129 #endif
2130 
2131 yyreturn:
2132  if (yychar != YYEMPTY)
2133  {
2134  /* Make sure we have latest lookahead translation. See comments at
2135  user semantic actions for why this is necessary. */
2136  yytoken = YYTRANSLATE (yychar);
2137  yydestruct ("Cleanup: discarding lookahead",
2138  yytoken, &yylval, he5parser);
2139  }
2140  /* Do not reclaim the symbols of the rule whose action triggered
2141  this YYABORT or YYACCEPT. */
2142  YYPOPSTACK (yylen);
2143  YY_STACK_PRINT (yyss, yyssp);
2144  while (yyssp != yyss)
2145  {
2146  yydestruct ("Cleanup: popping",
2147  yystos[*yyssp], yyvsp, he5parser);
2148  YYPOPSTACK (1);
2149  }
2150 #ifndef yyoverflow
2151  if (yyss != yyssa)
2152  YYSTACK_FREE (yyss);
2153 #endif
2154 #if YYERROR_VERBOSE
2155  if (yymsg != yymsgbuf)
2156  YYSTACK_FREE (yymsg);
2157 #endif
2158  return yyresult;
2159 }
2160 #line 671 "he5dds.yy" /* yacc.c:1906 */
2161 
2162 
2163 
2164 // This function is required for linking, but DODS uses its own error
2165 // reporting mechanism.
2166 void
2168 {
2169  cerr << "he5dds.y ERROR: " << s << endl;
2170 }
2171 
#define YYMAXDEPTH
Definition: he5dds.tab.cc:855
signed char yytype_int8
Definition: he5dds.tab.cc:211
#define YYSTACK_FREE
Definition: he5dds.tab.cc:347
#define YY_(Msgid)
Definition: he5dds.tab.cc:249
#define yydebug
Definition: he5dds.tab.cc:66
unsigned char yytype_uint8
Definition: he5dds.tab.cc:205
Definition: HE5Dim.h:8
int he5ddslex(void)
string name
Definition: HE5Za.h:9
signed char yytype_int8
Definition: gse.tab.cc:206
float point_right
The rightmost coordinate value of a Grid.
Definition: HE5Grid.h:26
#define YYPOPSTACK(N)
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
Definition: he5dds.tab.cc:731
int he5ddsdebug
#define yyparse
Definition: he5dds.tab.cc:63
string name
Definition: HE5Grid.h:15
yytokentype
Definition: gse.tab.cc:133
STL namespace.
#define YYABORT
Definition: he5dds.tab.cc:682
#define YYSTACK_ALLOC_MAXIMUM
Definition: he5dds.tab.cc:349
#define YYDPRINTF(Args)
Definition: he5dds.tab.cc:719
string name
Definition: HE5Dim.h:9
string dimension_name
Definition: he5dds.tab.cc:190
void * malloc(YYSIZE_T)
#define YYLAST
Definition: he5dds.tab.cc:438
#define yynerrs
Definition: he5dds.tab.cc:67
#define YYINITDEPTH
Definition: he5dds.tab.cc:844
EOS5GridPRType pixelregistration
Definition: HE5Grid.h:35
#define yytable_value_is_error(Yytable_value)
Definition: he5dds.tab.cc:545
unsigned short int yytype_uint16
Definition: he5dds.tab.cc:217
#define YYACCEPT
Definition: he5dds.tab.cc:681
#define YYERROR
Definition: he5dds.tab.cc:683
#define YYEOF
Definition: he5dds.tab.cc:679
#define yylex
Definition: he5dds.tab.cc:64
#define YYFINAL
Definition: he5dds.tab.cc:436
vector< HE5Swath > swath_list
Definition: HE5Parser.h:54
float point_left
The leftmost coordinate value of a Grid.
Definition: HE5Grid.h:24
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition: he5dds.tab.cc:300
#define YYNTOKENS
Definition: he5dds.tab.cc:441
#define YY_NULLPTR
Definition: he5dds.tab.cc:80
EOS5GridPCType projection
Definition: HE5Grid.h:42
#define YYSTACK_ALLOC
Definition: he5dds.tab.cc:346
#define yyalloc
Definition: lex.gse.cc:24
EOS5GridPRType
This file defines a few enum types used by HDF-EOS5 products.
Definition: HE5GridPara.h:3
string name
Definition: HE5Swath.h:10
unsigned short int yytype_uint16
Definition: gse.tab.cc:212
float point_lower
The bottom coordinate value of a Grid.
Definition: HE5Grid.h:20
#define YY_STACK_PRINT(Bottom, Top)
Definition: he5dds.tab.cc:794
string err_msg
Have any parse error message.
Definition: HE5Parser.h:72
float point_upper
The top coordinate value of a Grid.
Definition: HE5Grid.h:22
int size
Definition: HE5Dim.h:10
string name
Definition: HE5Var.h:10
Definition: HE5Za.h:7
EOS5GridOriginType gridorigin
Definition: HE5Grid.h:39
#define YYTERROR
Definition: he5dds.tab.cc:706
int parser_state
Have the StructMetadata parser's state.
Definition: HE5Parser.h:69
int structure_state
Have the parser's state in terms of structure.
Definition: HE5Parser.h:62
#define YYTRANSLATE(YYX)
Definition: he5dds.tab.cc:454
int he5ddsparse(HE5Parser *he5parser)
short int yytype_int16
Definition: he5dds.tab.cc:223
A class for parsing NASA HDF-EOS5 StructMetadata.
#define yypact_value_is_default(Yystate)
Definition: he5dds.tab.cc:540
EOS5GridOriginType
Definition: HE5GridPara.h:8
#define YY_REDUCE_PRINT(Rule)
Definition: he5dds.tab.cc:825
short int yytype_int16
Definition: gse.tab.cc:218
YYSTYPE he5ddslval
bool swath_is_geo_field
Definition: he5dds.tab.cc:189
vector< HE5Grid > grid_list
Definition: HE5Parser.h:55
#define YYSTACK_BYTES(N)
Definition: he5dds.tab.cc:391
void free(void *)
#define yyerror
Definition: he5dds.tab.cc:65
#define YYFPRINTF
Definition: he5dds.tab.cc:716
vector< HE5Za > za_list
Definition: HE5Parser.h:56
#define YYSTYPE
Definition: he5dds.tab.cc:107
#define yylval
Definition: he5dds.tab.cc:69
#define yychar
Definition: he5dds.tab.cc:70
void he5ddserror(HE5Parser *he5parser, char *s)
Definition: he5dds.tab.cc:2167
#define YYSIZE_T
Definition: he5dds.tab.cc:233
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition: he5dds.tab.cc:299
#define YYEMPTY
Definition: he5dds.tab.cc:678
#define YYUSE(E)
Definition: he5dds.tab.cc:282
Definition: HE5Var.h:9
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition: he5dds.tab.cc:402
unsigned char yytype_uint8
Definition: gse.tab.cc:200