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

Last change on this file since 523 was 501, checked in by ymipsl, 10 years ago

Add licence copyright to all file ond directory src using the command :
svn propset -R copyright -F header_licence src

XIOS is now officialy under CeCILL licence

YM

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