source: XIOS/trunk/src/parse_expr/yacc_parser.cpp @ 1704

Last change on this file since 1704 was 1704, checked in by yushan, 5 years ago

Introducing the new graph functionality. Attribute build_workflow_graph=.TRUE. is used in the field definition section in the xml file to enable the workflow graph of the field and other fields referecing to it. A more detailed document will be available soon on the graph fuctionality.

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