FreeCAD

Форк
0
/
QuantityParser.c 
1749 строк · 54.9 Кб
1
// clang-format off
2
/* A Bison parser, made by GNU Bison 3.0.4.  */
3

4
/* Bison implementation for Yacc-like parsers in C
5

6
   Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
7

8
   This program is free software: you can redistribute it and/or modify
9
   it under the terms of the GNU General Public License as published by
10
   the Free Software Foundation, either version 3 of the License, or
11
   (at your option) any later version.
12

13
   This program is distributed in the hope that it will be useful,
14
   but WITHOUT ANY WARRANTY; without even the implied warranty of
15
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
   GNU General Public License for more details.
17

18
   You should have received a copy of the GNU General Public License
19
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
20

21
/* As a special exception, you may create a larger work that contains
22
   part or all of the Bison parser skeleton and distribute that work
23
   under terms of your choice, so long as that work isn't itself a
24
   parser generator using the skeleton or a modified version thereof
25
   as a parser skeleton.  Alternatively, if you modify or redistribute
26
   the parser skeleton itself, you may (at your option) remove this
27
   special exception, which will cause the skeleton and the resulting
28
   Bison output files to be licensed under the GNU General Public
29
   License without this special exception.
30

31
   This special exception was added by the Free Software Foundation in
32
   version 2.2 of Bison.  */
33

34
/* C LALR(1) parser skeleton written by Richard Stallman, by
35
   simplifying the original so-called "semantic" parser.  */
36

37
/* All symbols defined below should begin with yy or YY, to avoid
38
   infringing on user name space.  This should be done even for local
39
   variables, as they might otherwise be expanded by user macros.
40
   There are some unavoidable exceptions within include files to
41
   define necessary library symbols; they are noted "INFRINGES ON
42
   USER NAME SPACE" below.  */
43

44
/* Identify Bison output.  */
45
#define YYBISON 1
46

47
/* Bison version.  */
48
#define YYBISON_VERSION "3.0.4"
49

50
/* Skeleton name.  */
51
#define YYSKELETON_NAME "yacc.c"
52

53
/* Pure parsers.  */
54
#define YYPURE 0
55

56
/* Push parsers.  */
57
#define YYPUSH 0
58

59
/* Pull parsers.  */
60
#define YYPULL 1
61

62

63

64

65
/* Copy the first part of user declarations.  */
66
#line 6 "QuantityParser.y" /* yacc.c:339  */
67

68
        #define YYSTYPE Quantity
69
        #define yyparse Quantity_yyparse
70
        #define yyerror Quantity_yyerror
71
        #ifndef  DOUBLE_MAX
72
        # define DOUBLE_MAX 1.7976931348623157E+308    /* max decimal value of a "double"*/
73
        #endif
74
        #ifndef  DOUBLE_MIN
75
        # define DOUBLE_MIN 2.2250738585072014E-308    /* min decimal value of a "double"*/
76
        #endif
77

78

79
#line 79 "QuantityParser.c" /* yacc.c:339  */
80

81
# ifndef YY_NULLPTR
82
#  if defined __cplusplus && 201103L <= __cplusplus
83
#   define YY_NULLPTR nullptr
84
#  else
85
#   define YY_NULLPTR 0
86
#  endif
87
# endif
88

89
/* Enabling verbose error messages.  */
90
#ifdef YYERROR_VERBOSE
91
# undef YYERROR_VERBOSE
92
# define YYERROR_VERBOSE 1
93
#else
94
# define YYERROR_VERBOSE 0
95
#endif
96

97

98
/* Debug traces.  */
99
#ifndef YYDEBUG
100
# define YYDEBUG 0
101
#endif
102
#if YYDEBUG
103
extern int yydebug;
104
#endif
105

106
/* Token type.  */
107
#ifndef YYTOKENTYPE
108
# define YYTOKENTYPE
109
  enum yytokentype
110
  {
111
    UNIT = 258,
112
    ONE = 259,
113
    NUM = 260,
114
    MINUSSIGN = 261,
115
    ACOS = 262,
116
    ASIN = 263,
117
    ATAN = 264,
118
    ATAN2 = 265,
119
    COS = 266,
120
    EXP = 267,
121
    ABS = 268,
122
    MOD = 269,
123
    LOG = 270,
124
    LOG10 = 271,
125
    POW = 272,
126
    SIN = 273,
127
    SINH = 274,
128
    TAN = 275,
129
    TANH = 276,
130
    SQRT = 277,
131
    NEG = 278
132
  };
133
#endif
134

135
/* Value type.  */
136
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
137
typedef int YYSTYPE;
138
# define YYSTYPE_IS_TRIVIAL 1
139
# define YYSTYPE_IS_DECLARED 1
140
#endif
141

142

143
extern YYSTYPE yylval;
144

145
int yyparse (void);
146

147

148

149
/* Copy the second part of user declarations.  */
150

151
#line 151 "QuantityParser.c" /* yacc.c:358  */
152

153
#ifdef short
154
# undef short
155
#endif
156

157
#ifdef YYTYPE_UINT8
158
typedef YYTYPE_UINT8 yytype_uint8;
159
#else
160
typedef unsigned char yytype_uint8;
161
#endif
162

163
#ifdef YYTYPE_INT8
164
typedef YYTYPE_INT8 yytype_int8;
165
#else
166
typedef signed char yytype_int8;
167
#endif
168

169
#ifdef YYTYPE_UINT16
170
typedef YYTYPE_UINT16 yytype_uint16;
171
#else
172
typedef unsigned short int yytype_uint16;
173
#endif
174

175
#ifdef YYTYPE_INT16
176
typedef YYTYPE_INT16 yytype_int16;
177
#else
178
typedef short int yytype_int16;
179
#endif
180

181
#ifndef YYSIZE_T
182
# ifdef __SIZE_TYPE__
183
#  define YYSIZE_T __SIZE_TYPE__
184
# elif defined size_t
185
#  define YYSIZE_T size_t
186
# elif ! defined YYSIZE_T
187
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
188
#  define YYSIZE_T size_t
189
# else
190
#  define YYSIZE_T unsigned int
191
# endif
192
#endif
193

194
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
195

196
#ifndef YY_
197
# if defined YYENABLE_NLS && YYENABLE_NLS
198
#  if ENABLE_NLS
199
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
200
#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
201
#  endif
202
# endif
203
# ifndef YY_
204
#  define YY_(Msgid) Msgid
205
# endif
206
#endif
207

208
#ifndef YY_ATTRIBUTE
209
# if (defined __GNUC__                                               \
210
      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
211
     || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
212
#  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
213
# else
214
#  define YY_ATTRIBUTE(Spec) /* empty */
215
# endif
216
#endif
217

218
#ifndef YY_ATTRIBUTE_PURE
219
# define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
220
#endif
221

222
#ifndef YY_ATTRIBUTE_UNUSED
223
# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
224
#endif
225

226
#if !defined _Noreturn \
227
     && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
228
# if defined _MSC_VER && 1200 <= _MSC_VER
229
#  define _Noreturn __declspec (noreturn)
230
# else
231
#  define _Noreturn YY_ATTRIBUTE ((__noreturn__))
232
# endif
233
#endif
234

235
/* Suppress unused-variable warnings by "using" E.  */
236
#if ! defined lint || defined __GNUC__
237
# define YYUSE(E) ((void) (E))
238
#else
239
# define YYUSE(E) /* empty */
240
#endif
241

242
#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
243
/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
244
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
245
    _Pragma ("GCC diagnostic push") \
246
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
247
    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
248
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
249
    _Pragma ("GCC diagnostic pop")
250
#else
251
# define YY_INITIAL_VALUE(Value) Value
252
#endif
253
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
254
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
255
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
256
#endif
257
#ifndef YY_INITIAL_VALUE
258
# define YY_INITIAL_VALUE(Value) /* Nothing. */
259
#endif
260

261

262
#if ! defined yyoverflow || YYERROR_VERBOSE
263

264
/* The parser invokes alloca or malloc; define the necessary symbols.  */
265

266
# ifdef YYSTACK_USE_ALLOCA
267
#  if YYSTACK_USE_ALLOCA
268
#   ifdef __GNUC__
269
#    define YYSTACK_ALLOC __builtin_alloca
270
#   elif defined __BUILTIN_VA_ARG_INCR
271
#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
272
#   elif defined _AIX
273
#    define YYSTACK_ALLOC __alloca
274
#   elif defined _MSC_VER
275
#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
276
#    define alloca _alloca
277
#   else
278
#    define YYSTACK_ALLOC alloca
279
#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
280
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
281
      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
282
#     ifndef EXIT_SUCCESS
283
#      define EXIT_SUCCESS 0
284
#     endif
285
#    endif
286
#   endif
287
#  endif
288
# endif
289

290
# ifdef YYSTACK_ALLOC
291
   /* Pacify GCC's 'empty if-body' warning.  */
292
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
293
#  ifndef YYSTACK_ALLOC_MAXIMUM
294
    /* The OS might guarantee only one guard page at the bottom of the stack,
295
       and a page size can be as small as 4096 bytes.  So we cannot safely
296
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
297
       to allow for a few compiler-allocated temporary stack slots.  */
298
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
299
#  endif
300
# else
301
#  define YYSTACK_ALLOC YYMALLOC
302
#  define YYSTACK_FREE YYFREE
303
#  ifndef YYSTACK_ALLOC_MAXIMUM
304
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
305
#  endif
306
#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
307
       && ! ((defined YYMALLOC || defined malloc) \
308
             && (defined YYFREE || defined free)))
309
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
310
#   ifndef EXIT_SUCCESS
311
#    define EXIT_SUCCESS 0
312
#   endif
313
#  endif
314
#  ifndef YYMALLOC
315
#   define YYMALLOC malloc
316
#   if ! defined malloc && ! defined EXIT_SUCCESS
317
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
318
#   endif
319
#  endif
320
#  ifndef YYFREE
321
#   define YYFREE free
322
#   if ! defined free && ! defined EXIT_SUCCESS
323
void free (void *); /* INFRINGES ON USER NAME SPACE */
324
#   endif
325
#  endif
326
# endif
327
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
328

329

330
#if (! defined yyoverflow \
331
     && (! defined __cplusplus \
332
         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
333

334
/* A type that is properly aligned for any stack member.  */
335
union yyalloc
336
{
337
  yytype_int16 yyss_alloc;
338
  YYSTYPE yyvs_alloc;
339
};
340

341
/* The size of the maximum gap between one aligned stack and the next.  */
342
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
343

344
/* The size of an array large to enough to hold all stacks, each with
345
   N elements.  */
346
# define YYSTACK_BYTES(N) \
347
     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
348
      + YYSTACK_GAP_MAXIMUM)
349

350
# define YYCOPY_NEEDED 1
351

352
/* Relocate STACK from its old location to the new one.  The
353
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
354
   elements in the stack, and YYPTR gives the new location of the
355
   stack.  Advance YYPTR to a properly aligned location for the next
356
   stack.  */
357
# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
358
    do                                                                  \
359
      {                                                                 \
360
        YYSIZE_T yynewbytes;                                            \
361
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
362
        Stack = &yyptr->Stack_alloc;                                    \
363
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
364
        yyptr += yynewbytes / sizeof (*yyptr);                          \
365
      }                                                                 \
366
    while (0)
367

368
#endif
369

370
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
371
/* Copy COUNT objects from SRC to DST.  The source and destination do
372
   not overlap.  */
373
# ifndef YYCOPY
374
#  if defined __GNUC__ && 1 < __GNUC__
375
#   define YYCOPY(Dst, Src, Count) \
376
      __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
377
#  else
378
#   define YYCOPY(Dst, Src, Count)              \
379
      do                                        \
380
        {                                       \
381
          YYSIZE_T yyi;                         \
382
          for (yyi = 0; yyi < (Count); yyi++)   \
383
            (Dst)[yyi] = (Src)[yyi];            \
384
        }                                       \
385
      while (0)
386
#  endif
387
# endif
388
#endif /* !YYCOPY_NEEDED */
389

390
/* YYFINAL -- State number of the termination state.  */
391
#define YYFINAL  42
392
/* YYLAST -- Last index in YYTABLE.  */
393
#define YYLAST   236
394

395
/* YYNTOKENS -- Number of terminals.  */
396
#define YYNTOKENS  30
397
/* YYNNTS -- Number of nonterminals.  */
398
#define YYNNTS  5
399
/* YYNRULES -- Number of rules.  */
400
#define YYNRULES  37
401
/* YYNSTATES -- Number of states.  */
402
#define YYNSTATES  96
403

404
/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
405
   by yylex, with out-of-bounds checking.  */
406
#define YYUNDEFTOK  2
407
#define YYMAXUTOK   278
408

409
#define YYTRANSLATE(YYX)                                                \
410
  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
411

412
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
413
   as returned by yylex, without out-of-bounds checking.  */
414
static const yytype_uint8 yytranslate[] =
415
{
416
       0,     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
      28,    29,    24,    23,     2,     2,     2,    25,     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,    27,     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,     2,     2,     2,     2,
439
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
440
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
441
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
442
       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
443
      15,    16,    17,    18,    19,    20,    21,    22,    26
444
};
445

446
#if YYDEBUG
447
  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
448
static const yytype_uint8 yyrline[] =
449
{
450
       0,    34,    34,    35,    36,    37,    38,    39,    41,    42,
451
      43,    44,    45,    46,    47,    48,    49,    50,    51,    52,
452
      53,    54,    55,    56,    57,    58,    59,    60,    61,    62,
453
      65,    66,    67,    68,    69,    70,    72,    73
454
};
455
#endif
456

457
#if YYDEBUG || YYERROR_VERBOSE || 0
458
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
459
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
460
static const char *const yytname[] =
461
{
462
  "$end", "error", "$undefined", "UNIT", "ONE", "NUM", "MINUSSIGN",
463
  "ACOS", "ASIN", "ATAN", "ATAN2", "COS", "EXP", "ABS", "MOD", "LOG",
464
  "LOG10", "POW", "SIN", "SINH", "TAN", "TANH", "SQRT", "'+'", "'*'",
465
  "'/'", "NEG", "'^'", "'('", "')'", "$accept", "input", "num", "unit",
466
  "quantity", YY_NULLPTR
467
};
468
#endif
469

470
# ifdef YYPRINT
471
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
472
   (internal) symbol number NUM (which must be that of a token).  */
473
static const yytype_uint16 yytoknum[] =
474
{
475
       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
476
     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
477
     275,   276,   277,    43,    42,    47,   278,    94,    40,    41
478
};
479
# endif
480

481
#define YYPACT_NINF -26
482

483
#define yypact_value_is_default(Yystate) \
484
  (!!((Yystate) == (-26)))
485

486
#define YYTABLE_NINF -1
487

488
#define yytable_value_is_error(Yytable_value) \
489
  0
490

491
  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
492
     STATE-NUM.  */
493
static const yytype_int16 yypact[] =
494
{
495
      72,   -26,   -26,   -26,   117,   -25,   -23,   -10,    -7,    -5,
496
      -4,    -3,    21,    22,    23,    24,    26,    28,    72,    58,
497
      92,   -12,   117,    -2,   -26,   117,    35,   117,   117,   117,
498
     117,   117,   117,   117,   117,   117,   117,   117,   117,   117,
499
      36,   -18,   -26,    39,   117,   117,   117,    72,   117,    -2,
500
     -12,    -2,    -2,   117,    92,   117,    41,   117,    80,   125,
501
     134,   141,   149,   156,   163,   171,   178,   185,   193,   200,
502
     207,   -26,   -26,    -8,    -8,    35,    35,   -12,    35,    41,
503
      41,   -13,   -26,   -26,   -26,   -26,   -26,   -26,   -26,   -26,
504
     -26,   -26,   -26,   -26,   -26,   -26
505
};
506

507
  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
508
     Performed when YYTABLE does not specify something else to do.  Zero
509
     means the default is an error.  */
510
static const yytype_uint8 yydefact[] =
511
{
512
       2,    30,     9,     8,     0,     0,     0,     0,     0,     0,
513
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
514
       3,     4,     5,     0,     9,     0,    14,     0,     0,     0,
515
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
516
       0,     0,     1,     0,     0,     0,     0,     0,     0,     0,
517
      36,     0,     0,     0,     0,     6,    31,     0,     0,     0,
518
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
519
       0,    16,    35,    11,    10,    12,    13,    37,    15,    32,
520
      33,    34,     7,    17,    18,    19,    29,    21,    20,    22,
521
      23,    24,    25,    26,    27,    28
522
};
523

524
  /* YYPGOTO[NTERM-NUM].  */
525
static const yytype_int8 yypgoto[] =
526
{
527
     -26,   -26,     0,    20,   -14
528
};
529

530
  /* YYDEFGOTO[NTERM-NUM].  */
531
static const yytype_int8 yydefgoto[] =
532
{
533
      -1,    19,    40,    41,    22
534
};
535

536
  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
537
     positive, shift that token.  If negative, reduce the rule whose
538
     number is the opposite.  If YYTABLE_NINF, syntax error.  */
539
static const yytype_uint8 yytable[] =
540
{
541
      20,     1,    43,    27,    26,    28,    51,    52,    55,    53,
542
      45,    72,    51,    52,    48,    53,    46,    57,    29,    48,
543
      21,    30,    54,    31,    32,    33,    49,    58,    59,    60,
544
      61,    62,    63,    64,    65,    66,    67,    68,    69,    70,
545
      50,    82,    44,    56,    73,    74,    75,    76,    78,    34,
546
      35,    36,    37,    81,    38,    54,    39,    76,    42,    45,
547
      46,    57,    48,    48,    23,    71,     0,    77,    53,     0,
548
       0,    79,    80,     0,    50,     1,     2,     3,     4,     5,
549
       6,     7,     0,     8,     9,    10,    44,    11,    12,     0,
550
      13,    14,    15,    16,    17,     1,    43,     0,    44,     0,
551
      18,     0,     0,    45,    46,    57,     0,    48,     0,    83,
552
       0,     0,     0,     0,     0,    45,    46,    47,     0,    48,
553
      49,    24,     3,     4,     5,     6,     7,     0,     8,     9,
554
      10,    44,    11,    12,     0,    13,    14,    15,    16,    17,
555
      44,     0,     0,     0,     0,    25,     0,    44,    45,    46,
556
      57,     0,    48,     0,    84,    44,     0,    45,    46,    57,
557
       0,    48,    44,    85,    45,    46,    57,     0,    48,    44,
558
      86,     0,    45,    46,    57,     0,    48,    44,    87,    45,
559
      46,    57,     0,    48,    44,    88,    45,    46,    57,     0,
560
      48,    44,    89,     0,    45,    46,    57,     0,    48,    44,
561
      90,    45,    46,    57,     0,    48,    44,    91,    45,    46,
562
      57,     0,    48,    44,    92,     0,    45,    46,    57,     0,
563
      48,     0,    93,    45,    46,    57,     0,    48,     0,    94,
564
      45,    46,    57,     0,    48,     0,    95
565
};
566

567
static const yytype_int8 yycheck[] =
568
{
569
       0,     3,     4,    28,     4,    28,    24,    25,    22,    27,
570
      23,    29,    24,    25,    27,    27,    24,    25,    28,    27,
571
       0,    28,    22,    28,    28,    28,    28,    27,    28,    29,
572
      30,    31,    32,    33,    34,    35,    36,    37,    38,    39,
573
      20,    55,     6,    23,    44,    45,    46,    47,    48,    28,
574
      28,    28,    28,    53,    28,    55,    28,    57,     0,    23,
575
      24,    25,    27,    27,    25,    29,    -1,    47,    27,    -1,
576
      -1,    51,    52,    -1,    54,     3,     4,     5,     6,     7,
577
       8,     9,    -1,    11,    12,    13,     6,    15,    16,    -1,
578
      18,    19,    20,    21,    22,     3,     4,    -1,     6,    -1,
579
      28,    -1,    -1,    23,    24,    25,    -1,    27,    -1,    29,
580
      -1,    -1,    -1,    -1,    -1,    23,    24,    25,    -1,    27,
581
      28,     4,     5,     6,     7,     8,     9,    -1,    11,    12,
582
      13,     6,    15,    16,    -1,    18,    19,    20,    21,    22,
583
       6,    -1,    -1,    -1,    -1,    28,    -1,     6,    23,    24,
584
      25,    -1,    27,    -1,    29,     6,    -1,    23,    24,    25,
585
      -1,    27,     6,    29,    23,    24,    25,    -1,    27,     6,
586
      29,    -1,    23,    24,    25,    -1,    27,     6,    29,    23,
587
      24,    25,    -1,    27,     6,    29,    23,    24,    25,    -1,
588
      27,     6,    29,    -1,    23,    24,    25,    -1,    27,     6,
589
      29,    23,    24,    25,    -1,    27,     6,    29,    23,    24,
590
      25,    -1,    27,     6,    29,    -1,    23,    24,    25,    -1,
591
      27,    -1,    29,    23,    24,    25,    -1,    27,    -1,    29,
592
      23,    24,    25,    -1,    27,    -1,    29
593
};
594

595
  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
596
     symbol of state STATE-NUM.  */
597
static const yytype_uint8 yystos[] =
598
{
599
       0,     3,     4,     5,     6,     7,     8,     9,    11,    12,
600
      13,    15,    16,    18,    19,    20,    21,    22,    28,    31,
601
      32,    33,    34,    25,     4,    28,    32,    28,    28,    28,
602
      28,    28,    28,    28,    28,    28,    28,    28,    28,    28,
603
      32,    33,     0,     4,     6,    23,    24,    25,    27,    28,
604
      33,    24,    25,    27,    32,    34,    33,    25,    32,    32,
605
      32,    32,    32,    32,    32,    32,    32,    32,    32,    32,
606
      32,    29,    29,    32,    32,    32,    32,    33,    32,    33,
607
      33,    32,    34,    29,    29,    29,    29,    29,    29,    29,
608
      29,    29,    29,    29,    29,    29
609
};
610

611
  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
612
static const yytype_uint8 yyr1[] =
613
{
614
       0,    30,    31,    31,    31,    31,    31,    31,    32,    32,
615
      32,    32,    32,    32,    32,    32,    32,    32,    32,    32,
616
      32,    32,    32,    32,    32,    32,    32,    32,    32,    32,
617
      33,    33,    33,    33,    33,    33,    34,    34
618
};
619

620
  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
621
static const yytype_uint8 yyr2[] =
622
{
623
       0,     2,     0,     1,     1,     1,     2,     3,     1,     1,
624
       3,     3,     3,     3,     2,     3,     3,     4,     4,     4,
625
       4,     4,     4,     4,     4,     4,     4,     4,     4,     4,
626
       1,     3,     3,     3,     3,     3,     2,     3
627
};
628

629

630
#define yyerrok         (yyerrstatus = 0)
631
#define yyclearin       (yychar = YYEMPTY)
632
#define YYEMPTY         (-2)
633
#define YYEOF           0
634

635
#define YYACCEPT        goto yyacceptlab
636
#define YYABORT         goto yyabortlab
637
#define YYERROR         goto yyerrorlab
638

639

640
#define YYRECOVERING()  (!!yyerrstatus)
641

642
#define YYBACKUP(Token, Value)                                  \
643
do                                                              \
644
  if (yychar == YYEMPTY)                                        \
645
    {                                                           \
646
      yychar = (Token);                                         \
647
      yylval = (Value);                                         \
648
      YYPOPSTACK (yylen);                                       \
649
      yystate = *yyssp;                                         \
650
      goto yybackup;                                            \
651
    }                                                           \
652
  else                                                          \
653
    {                                                           \
654
      yyerror (YY_("syntax error: cannot back up")); \
655
      YYERROR;                                                  \
656
    }                                                           \
657
while (0)
658

659
/* Error token number */
660
#define YYTERROR        1
661
#define YYERRCODE       256
662

663

664

665
/* Enable debugging if requested.  */
666
#if YYDEBUG
667

668
# ifndef YYFPRINTF
669
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
670
#  define YYFPRINTF fprintf
671
# endif
672

673
# define YYDPRINTF(Args)                        \
674
do {                                            \
675
  if (yydebug)                                  \
676
    YYFPRINTF Args;                             \
677
} while (0)
678

679
/* This macro is provided for backward compatibility. */
680
#ifndef YY_LOCATION_PRINT
681
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
682
#endif
683

684

685
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
686
do {                                                                      \
687
  if (yydebug)                                                            \
688
    {                                                                     \
689
      YYFPRINTF (stderr, "%s ", Title);                                   \
690
      yy_symbol_print (stderr,                                            \
691
                  Type, Value); \
692
      YYFPRINTF (stderr, "\n");                                           \
693
    }                                                                     \
694
} while (0)
695

696

697
/*----------------------------------------.
698
| Print this symbol's value on YYOUTPUT.  |
699
`----------------------------------------*/
700

701
static void
702
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
703
{
704
  FILE *yyo = yyoutput;
705
  YYUSE (yyo);
706
  if (!yyvaluep)
707
    return;
708
# ifdef YYPRINT
709
  if (yytype < YYNTOKENS)
710
    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
711
# endif
712
  YYUSE (yytype);
713
}
714

715

716
/*--------------------------------.
717
| Print this symbol on YYOUTPUT.  |
718
`--------------------------------*/
719

720
static void
721
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
722
{
723
  YYFPRINTF (yyoutput, "%s %s (",
724
             yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
725

726
  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
727
  YYFPRINTF (yyoutput, ")");
728
}
729

730
/*------------------------------------------------------------------.
731
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
732
| TOP (included).                                                   |
733
`------------------------------------------------------------------*/
734

735
static void
736
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
737
{
738
  YYFPRINTF (stderr, "Stack now");
739
  for (; yybottom <= yytop; yybottom++)
740
    {
741
      int yybot = *yybottom;
742
      YYFPRINTF (stderr, " %d", yybot);
743
    }
744
  YYFPRINTF (stderr, "\n");
745
}
746

747
# define YY_STACK_PRINT(Bottom, Top)                            \
748
do {                                                            \
749
  if (yydebug)                                                  \
750
    yy_stack_print ((Bottom), (Top));                           \
751
} while (0)
752

753

754
/*------------------------------------------------.
755
| Report that the YYRULE is going to be reduced.  |
756
`------------------------------------------------*/
757

758
static void
759
yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
760
{
761
  unsigned long int yylno = yyrline[yyrule];
762
  int yynrhs = yyr2[yyrule];
763
  int yyi;
764
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
765
             yyrule - 1, yylno);
766
  /* The symbols being reduced.  */
767
  for (yyi = 0; yyi < yynrhs; yyi++)
768
    {
769
      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
770
      yy_symbol_print (stderr,
771
                       yystos[yyssp[yyi + 1 - yynrhs]],
772
                       &(yyvsp[(yyi + 1) - (yynrhs)])
773
                                              );
774
      YYFPRINTF (stderr, "\n");
775
    }
776
}
777

778
# define YY_REDUCE_PRINT(Rule)          \
779
do {                                    \
780
  if (yydebug)                          \
781
    yy_reduce_print (yyssp, yyvsp, Rule); \
782
} while (0)
783

784
/* Nonzero means print parse trace.  It is left uninitialized so that
785
   multiple parsers can coexist.  */
786
int yydebug;
787
#else /* !YYDEBUG */
788
# define YYDPRINTF(Args)
789
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
790
# define YY_STACK_PRINT(Bottom, Top)
791
# define YY_REDUCE_PRINT(Rule)
792
#endif /* !YYDEBUG */
793

794

795
/* YYINITDEPTH -- initial size of the parser's stacks.  */
796
#ifndef YYINITDEPTH
797
# define YYINITDEPTH 200
798
#endif
799

800
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
801
   if the built-in stack extension method is used).
802

803
   Do not make this value too large; the results are undefined if
804
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
805
   evaluated with infinite-precision integer arithmetic.  */
806

807
#ifndef YYMAXDEPTH
808
# define YYMAXDEPTH 10000
809
#endif
810

811

812
#if YYERROR_VERBOSE
813

814
# ifndef yystrlen
815
#  if defined __GLIBC__ && defined _STRING_H
816
#   define yystrlen strlen
817
#  else
818
/* Return the length of YYSTR.  */
819
static YYSIZE_T
820
yystrlen (const char *yystr)
821
{
822
  YYSIZE_T yylen;
823
  for (yylen = 0; yystr[yylen]; yylen++)
824
    continue;
825
  return yylen;
826
}
827
#  endif
828
# endif
829

830
# ifndef yystpcpy
831
#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
832
#   define yystpcpy stpcpy
833
#  else
834
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
835
   YYDEST.  */
836
static char *
837
yystpcpy (char *yydest, const char *yysrc)
838
{
839
  char *yyd = yydest;
840
  const char *yys = yysrc;
841

842
  while ((*yyd++ = *yys++) != '\0')
843
    continue;
844

845
  return yyd - 1;
846
}
847
#  endif
848
# endif
849

850
# ifndef yytnamerr
851
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
852
   quotes and backslashes, so that it's suitable for yyerror.  The
853
   heuristic is that double-quoting is unnecessary unless the string
854
   contains an apostrophe, a comma, or backslash (other than
855
   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
856
   null, do not copy; instead, return the length of what the result
857
   would have been.  */
858
static YYSIZE_T
859
yytnamerr (char *yyres, const char *yystr)
860
{
861
  if (*yystr == '"')
862
    {
863
      YYSIZE_T yyn = 0;
864
      char const *yyp = yystr;
865

866
      for (;;)
867
        switch (*++yyp)
868
          {
869
          case '\'':
870
          case ',':
871
            goto do_not_strip_quotes;
872

873
          case '\\':
874
            if (*++yyp != '\\')
875
              goto do_not_strip_quotes;
876
            /* Fall through.  */
877
          default:
878
            if (yyres)
879
              yyres[yyn] = *yyp;
880
            yyn++;
881
            break;
882

883
          case '"':
884
            if (yyres)
885
              yyres[yyn] = '\0';
886
            return yyn;
887
          }
888
    do_not_strip_quotes: ;
889
    }
890

891
  if (! yyres)
892
    return yystrlen (yystr);
893

894
  return yystpcpy (yyres, yystr) - yyres;
895
}
896
# endif
897

898
/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
899
   about the unexpected token YYTOKEN for the state stack whose top is
900
   YYSSP.
901

902
   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
903
   not large enough to hold the message.  In that case, also set
904
   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
905
   required number of bytes is too large to store.  */
906
static int
907
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
908
                yytype_int16 *yyssp, int yytoken)
909
{
910
  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
911
  YYSIZE_T yysize = yysize0;
912
  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
913
  /* Internationalized format string. */
914
  const char *yyformat = YY_NULLPTR;
915
  /* Arguments of yyformat. */
916
  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
917
  /* Number of reported tokens (one for the "unexpected", one per
918
     "expected"). */
919
  int yycount = 0;
920

921
  /* There are many possibilities here to consider:
922
     - If this state is a consistent state with a default action, then
923
       the only way this function was invoked is if the default action
924
       is an error action.  In that case, don't check for expected
925
       tokens because there are none.
926
     - The only way there can be no lookahead present (in yychar) is if
927
       this state is a consistent state with a default action.  Thus,
928
       detecting the absence of a lookahead is sufficient to determine
929
       that there is no unexpected or expected token to report.  In that
930
       case, just report a simple "syntax error".
931
     - Don't assume there isn't a lookahead just because this state is a
932
       consistent state with a default action.  There might have been a
933
       previous inconsistent state, consistent state with a non-default
934
       action, or user semantic action that manipulated yychar.
935
     - Of course, the expected token list depends on states to have
936
       correct lookahead information, and it depends on the parser not
937
       to perform extra reductions after fetching a lookahead from the
938
       scanner and before detecting a syntax error.  Thus, state merging
939
       (from LALR or IELR) and default reductions corrupt the expected
940
       token list.  However, the list is correct for canonical LR with
941
       one exception: it will still contain any token that will not be
942
       accepted due to an error action in a later state.
943
  */
944
  if (yytoken != YYEMPTY)
945
    {
946
      int yyn = yypact[*yyssp];
947
      yyarg[yycount++] = yytname[yytoken];
948
      if (!yypact_value_is_default (yyn))
949
        {
950
          /* Start YYX at -YYN if negative to avoid negative indexes in
951
             YYCHECK.  In other words, skip the first -YYN actions for
952
             this state because they are default actions.  */
953
          int yyxbegin = yyn < 0 ? -yyn : 0;
954
          /* Stay within bounds of both yycheck and yytname.  */
955
          int yychecklim = YYLAST - yyn + 1;
956
          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
957
          int yyx;
958

959
          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
960
            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
961
                && !yytable_value_is_error (yytable[yyx + yyn]))
962
              {
963
                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
964
                  {
965
                    yycount = 1;
966
                    yysize = yysize0;
967
                    break;
968
                  }
969
                yyarg[yycount++] = yytname[yyx];
970
                {
971
                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
972
                  if (! (yysize <= yysize1
973
                         && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
974
                    return 2;
975
                  yysize = yysize1;
976
                }
977
              }
978
        }
979
    }
980

981
  switch (yycount)
982
    {
983
# define YYCASE_(N, S)                      \
984
      case N:                               \
985
        yyformat = S;                       \
986
      break
987
      YYCASE_(0, YY_("syntax error"));
988
      YYCASE_(1, YY_("syntax error, unexpected %s"));
989
      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
990
      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
991
      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
992
      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
993
# undef YYCASE_
994
    }
995

996
  {
997
    YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
998
    if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
999
      return 2;
1000
    yysize = yysize1;
1001
  }
1002

1003
  if (*yymsg_alloc < yysize)
1004
    {
1005
      *yymsg_alloc = 2 * yysize;
1006
      if (! (yysize <= *yymsg_alloc
1007
             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1008
        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1009
      return 1;
1010
    }
1011

1012
  /* Avoid sprintf, as that infringes on the user's name space.
1013
     Don't have undefined behavior even if the translation
1014
     produced a string with the wrong number of "%s"s.  */
1015
  {
1016
    char *yyp = *yymsg;
1017
    int yyi = 0;
1018
    while ((*yyp = *yyformat) != '\0')
1019
      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1020
        {
1021
          yyp += yytnamerr (yyp, yyarg[yyi++]);
1022
          yyformat += 2;
1023
        }
1024
      else
1025
        {
1026
          yyp++;
1027
          yyformat++;
1028
        }
1029
  }
1030
  return 0;
1031
}
1032
#endif /* YYERROR_VERBOSE */
1033

1034
/*-----------------------------------------------.
1035
| Release the memory associated to this symbol.  |
1036
`-----------------------------------------------*/
1037

1038
static void
1039
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1040
{
1041
  YYUSE (yyvaluep);
1042
  if (!yymsg)
1043
    yymsg = "Deleting";
1044
  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1045

1046
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1047
  YYUSE (yytype);
1048
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1049
}
1050

1051

1052

1053

1054
/* The lookahead symbol.  */
1055
int yychar;
1056

1057
/* The semantic value of the lookahead symbol.  */
1058
YYSTYPE yylval;
1059
/* Number of syntax errors so far.  */
1060
int yynerrs;
1061

1062

1063
/*----------.
1064
| yyparse.  |
1065
`----------*/
1066

1067
int
1068
yyparse (void)
1069
{
1070
    int yystate;
1071
    /* Number of tokens to shift before error messages enabled.  */
1072
    int yyerrstatus;
1073

1074
    /* The stacks and their tools:
1075
       'yyss': related to states.
1076
       'yyvs': related to semantic values.
1077

1078
       Refer to the stacks through separate pointers, to allow yyoverflow
1079
       to reallocate them elsewhere.  */
1080

1081
    /* The state stack.  */
1082
    yytype_int16 yyssa[YYINITDEPTH];
1083
    yytype_int16 *yyss;
1084
    yytype_int16 *yyssp;
1085

1086
    /* The semantic value stack.  */
1087
    YYSTYPE yyvsa[YYINITDEPTH];
1088
    YYSTYPE *yyvs;
1089
    YYSTYPE *yyvsp;
1090

1091
    YYSIZE_T yystacksize;
1092

1093
  int yyn;
1094
  int yyresult;
1095
  /* Lookahead token as an internal (translated) token number.  */
1096
  int yytoken = 0;
1097
  /* The variables used to return semantic value and location from the
1098
     action routines.  */
1099
  YYSTYPE yyval;
1100

1101
#if YYERROR_VERBOSE
1102
  /* Buffer for error messages, and its allocated size.  */
1103
  char yymsgbuf[128];
1104
  char *yymsg = yymsgbuf;
1105
  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1106
#endif
1107

1108
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1109

1110
  /* The number of symbols on the RHS of the reduced rule.
1111
     Keep to zero when no symbol should be popped.  */
1112
  int yylen = 0;
1113

1114
  yyssp = yyss = yyssa;
1115
  yyvsp = yyvs = yyvsa;
1116
  yystacksize = YYINITDEPTH;
1117

1118
  YYDPRINTF ((stderr, "Starting parse\n"));
1119

1120
  yystate = 0;
1121
  yyerrstatus = 0;
1122
  yynerrs = 0;
1123
  yychar = YYEMPTY; /* Cause a token to be read.  */
1124
  goto yysetstate;
1125

1126
/*------------------------------------------------------------.
1127
| yynewstate -- Push a new state, which is found in yystate.  |
1128
`------------------------------------------------------------*/
1129
 yynewstate:
1130
  /* In all cases, when you get here, the value and location stacks
1131
     have just been pushed.  So pushing a state here evens the stacks.  */
1132
  yyssp++;
1133

1134
 yysetstate:
1135
  *yyssp = yystate;
1136

1137
  if (yyss + yystacksize - 1 <= yyssp)
1138
    {
1139
      /* Get the current used size of the three stacks, in elements.  */
1140
      YYSIZE_T yysize = yyssp - yyss + 1;
1141

1142
#ifdef yyoverflow
1143
      {
1144
        /* Give user a chance to reallocate the stack.  Use copies of
1145
           these so that the &'s don't force the real ones into
1146
           memory.  */
1147
        YYSTYPE *yyvs1 = yyvs;
1148
        yytype_int16 *yyss1 = yyss;
1149

1150
        /* Each stack pointer address is followed by the size of the
1151
           data in use in that stack, in bytes.  This used to be a
1152
           conditional around just the two extra args, but that might
1153
           be undefined if yyoverflow is a macro.  */
1154
        yyoverflow (YY_("memory exhausted"),
1155
                    &yyss1, yysize * sizeof (*yyssp),
1156
                    &yyvs1, yysize * sizeof (*yyvsp),
1157
                    &yystacksize);
1158

1159
        yyss = yyss1;
1160
        yyvs = yyvs1;
1161
      }
1162
#else /* no yyoverflow */
1163
# ifndef YYSTACK_RELOCATE
1164
      goto yyexhaustedlab;
1165
# else
1166
      /* Extend the stack our own way.  */
1167
      if (YYMAXDEPTH <= yystacksize)
1168
        goto yyexhaustedlab;
1169
      yystacksize *= 2;
1170
      if (YYMAXDEPTH < yystacksize)
1171
        yystacksize = YYMAXDEPTH;
1172

1173
      {
1174
        yytype_int16 *yyss1 = yyss;
1175
        union yyalloc *yyptr =
1176
          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1177
        if (! yyptr)
1178
          goto yyexhaustedlab;
1179
        YYSTACK_RELOCATE (yyss_alloc, yyss);
1180
        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1181
#  undef YYSTACK_RELOCATE
1182
        if (yyss1 != yyssa)
1183
          YYSTACK_FREE (yyss1);
1184
      }
1185
# endif
1186
#endif /* no yyoverflow */
1187

1188
      yyssp = yyss + yysize - 1;
1189
      yyvsp = yyvs + yysize - 1;
1190

1191
      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1192
                  (unsigned long int) yystacksize));
1193

1194
      if (yyss + yystacksize - 1 <= yyssp)
1195
        YYABORT;
1196
    }
1197

1198
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1199

1200
  if (yystate == YYFINAL)
1201
    YYACCEPT;
1202

1203
  goto yybackup;
1204

1205
/*-----------.
1206
| yybackup.  |
1207
`-----------*/
1208
yybackup:
1209

1210
  /* Do appropriate processing given the current state.  Read a
1211
     lookahead token if we need one and don't already have one.  */
1212

1213
  /* First try to decide what to do without reference to lookahead token.  */
1214
  yyn = yypact[yystate];
1215
  if (yypact_value_is_default (yyn))
1216
    goto yydefault;
1217

1218
  /* Not known => get a lookahead token if don't already have one.  */
1219

1220
  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1221
  if (yychar == YYEMPTY)
1222
    {
1223
      YYDPRINTF ((stderr, "Reading a token: "));
1224
      yychar = yylex ();
1225
    }
1226

1227
  if (yychar <= YYEOF)
1228
    {
1229
      yychar = yytoken = YYEOF;
1230
      YYDPRINTF ((stderr, "Now at end of input.\n"));
1231
    }
1232
  else
1233
    {
1234
      yytoken = YYTRANSLATE (yychar);
1235
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1236
    }
1237

1238
  /* If the proper action on seeing token YYTOKEN is to reduce or to
1239
     detect an error, take that action.  */
1240
  yyn += yytoken;
1241
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1242
    goto yydefault;
1243
  yyn = yytable[yyn];
1244
  if (yyn <= 0)
1245
    {
1246
      if (yytable_value_is_error (yyn))
1247
        goto yyerrlab;
1248
      yyn = -yyn;
1249
      goto yyreduce;
1250
    }
1251

1252
  /* Count tokens shifted since error; after three, turn off error
1253
     status.  */
1254
  if (yyerrstatus)
1255
    yyerrstatus--;
1256

1257
  /* Shift the lookahead token.  */
1258
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1259

1260
  /* Discard the shifted token.  */
1261
  yychar = YYEMPTY;
1262

1263
  yystate = yyn;
1264
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1265
  *++yyvsp = yylval;
1266
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1267

1268
  goto yynewstate;
1269

1270

1271
/*-----------------------------------------------------------.
1272
| yydefault -- do the default action for the current state.  |
1273
`-----------------------------------------------------------*/
1274
yydefault:
1275
  yyn = yydefact[yystate];
1276
  if (yyn == 0)
1277
    goto yyerrlab;
1278
  goto yyreduce;
1279

1280

1281
/*-----------------------------.
1282
| yyreduce -- Do a reduction.  |
1283
`-----------------------------*/
1284
yyreduce:
1285
  /* yyn is the number of a rule to reduce with.  */
1286
  yylen = yyr2[yyn];
1287

1288
  /* If YYLEN is nonzero, implement the default value of the action:
1289
     '$$ = $1'.
1290

1291
     Otherwise, the following line sets YYVAL to garbage.
1292
     This behavior is undocumented and Bison
1293
     users should not rely upon it.  Assigning to YYVAL
1294
     unconditionally makes the parser a bit smaller, and it avoids a
1295
     GCC warning that YYVAL may be used uninitialized.  */
1296
  yyval = yyvsp[1-yylen];
1297

1298

1299
  YY_REDUCE_PRINT (yyn);
1300
  switch (yyn)
1301
    {
1302
        case 2:
1303
#line 34 "QuantityParser.y" /* yacc.c:1646  */
1304
    { QuantResult = Quantity(DOUBLE_MIN); /* empty input */ }
1305
#line 1305 "QuantityParser.c" /* yacc.c:1646  */
1306
    break;
1307

1308
  case 3:
1309
#line 35 "QuantityParser.y" /* yacc.c:1646  */
1310
    { QuantResult = (yyvsp[0])     ;            }
1311
#line 1311 "QuantityParser.c" /* yacc.c:1646  */
1312
    break;
1313

1314
  case 4:
1315
#line 36 "QuantityParser.y" /* yacc.c:1646  */
1316
    { QuantResult = (yyvsp[0])     ;            }
1317
#line 1317 "QuantityParser.c" /* yacc.c:1646  */
1318
    break;
1319

1320
  case 5:
1321
#line 37 "QuantityParser.y" /* yacc.c:1646  */
1322
    { QuantResult = (yyvsp[0])     ;            }
1323
#line 1323 "QuantityParser.c" /* yacc.c:1646  */
1324
    break;
1325

1326
  case 6:
1327
#line 38 "QuantityParser.y" /* yacc.c:1646  */
1328
    { QuantResult = (yyvsp[-1]) + (yyvsp[0]);            }
1329
#line 1329 "QuantityParser.c" /* yacc.c:1646  */
1330
    break;
1331

1332
  case 7:
1333
#line 39 "QuantityParser.y" /* yacc.c:1646  */
1334
    { QuantResult = (yyvsp[-2]) + (yyvsp[-1]) + (yyvsp[0]);       }
1335
#line 1335 "QuantityParser.c" /* yacc.c:1646  */
1336
    break;
1337

1338
  case 8:
1339
#line 41 "QuantityParser.y" /* yacc.c:1646  */
1340
    { (yyval) = (yyvsp[0]);         	}
1341
#line 1341 "QuantityParser.c" /* yacc.c:1646  */
1342
    break;
1343

1344
  case 9:
1345
#line 42 "QuantityParser.y" /* yacc.c:1646  */
1346
    { (yyval) = (yyvsp[0]);         	}
1347
#line 1347 "QuantityParser.c" /* yacc.c:1646  */
1348
    break;
1349

1350
  case 10:
1351
#line 43 "QuantityParser.y" /* yacc.c:1646  */
1352
    { (yyval) = Quantity((yyvsp[-2]).getValue() + (yyvsp[0]).getValue());    	}
1353
#line 1353 "QuantityParser.c" /* yacc.c:1646  */
1354
    break;
1355

1356
  case 11:
1357
#line 44 "QuantityParser.y" /* yacc.c:1646  */
1358
    { (yyval) = Quantity((yyvsp[-2]).getValue() - (yyvsp[0]).getValue());    	}
1359
#line 1359 "QuantityParser.c" /* yacc.c:1646  */
1360
    break;
1361

1362
  case 12:
1363
#line 45 "QuantityParser.y" /* yacc.c:1646  */
1364
    { (yyval) = Quantity((yyvsp[-2]).getValue() * (yyvsp[0]).getValue());    	}
1365
#line 1365 "QuantityParser.c" /* yacc.c:1646  */
1366
    break;
1367

1368
  case 13:
1369
#line 46 "QuantityParser.y" /* yacc.c:1646  */
1370
    { (yyval) = Quantity((yyvsp[-2]).getValue() / (yyvsp[0]).getValue());    	}
1371
#line 1371 "QuantityParser.c" /* yacc.c:1646  */
1372
    break;
1373

1374
  case 14:
1375
#line 47 "QuantityParser.y" /* yacc.c:1646  */
1376
    { (yyval) = Quantity(-(yyvsp[0]).getValue());                    }
1377
#line 1377 "QuantityParser.c" /* yacc.c:1646  */
1378
    break;
1379

1380
  case 15:
1381
#line 48 "QuantityParser.y" /* yacc.c:1646  */
1382
    { (yyval) = Quantity(pow ((yyvsp[-2]).getValue(), (yyvsp[0]).getValue()));}
1383
#line 1383 "QuantityParser.c" /* yacc.c:1646  */
1384
    break;
1385

1386
  case 16:
1387
#line 49 "QuantityParser.y" /* yacc.c:1646  */
1388
    { (yyval) = (yyvsp[-1]);         	}
1389
#line 1389 "QuantityParser.c" /* yacc.c:1646  */
1390
    break;
1391

1392
  case 17:
1393
#line 50 "QuantityParser.y" /* yacc.c:1646  */
1394
    { (yyval) = Quantity(acos((yyvsp[-1]).getValue()));   }
1395
#line 1395 "QuantityParser.c" /* yacc.c:1646  */
1396
    break;
1397

1398
  case 18:
1399
#line 51 "QuantityParser.y" /* yacc.c:1646  */
1400
    { (yyval) = Quantity(asin((yyvsp[-1]).getValue()));   }
1401
#line 1401 "QuantityParser.c" /* yacc.c:1646  */
1402
    break;
1403

1404
  case 19:
1405
#line 52 "QuantityParser.y" /* yacc.c:1646  */
1406
    { (yyval) = Quantity(atan((yyvsp[-1]).getValue()));   }
1407
#line 1407 "QuantityParser.c" /* yacc.c:1646  */
1408
    break;
1409

1410
  case 20:
1411
#line 53 "QuantityParser.y" /* yacc.c:1646  */
1412
    { (yyval) = Quantity(fabs((yyvsp[-1]).getValue()));   }
1413
#line 1413 "QuantityParser.c" /* yacc.c:1646  */
1414
    break;
1415

1416
  case 21:
1417
#line 54 "QuantityParser.y" /* yacc.c:1646  */
1418
    { (yyval) = Quantity(exp((yyvsp[-1]).getValue()));    }
1419
#line 1419 "QuantityParser.c" /* yacc.c:1646  */
1420
    break;
1421

1422
  case 22:
1423
#line 55 "QuantityParser.y" /* yacc.c:1646  */
1424
    { (yyval) = Quantity(log((yyvsp[-1]).getValue()));    }
1425
#line 1425 "QuantityParser.c" /* yacc.c:1646  */
1426
    break;
1427

1428
  case 23:
1429
#line 56 "QuantityParser.y" /* yacc.c:1646  */
1430
    { (yyval) = Quantity(log10((yyvsp[-1]).getValue()));  }
1431
#line 1431 "QuantityParser.c" /* yacc.c:1646  */
1432
    break;
1433

1434
  case 24:
1435
#line 57 "QuantityParser.y" /* yacc.c:1646  */
1436
    { (yyval) = Quantity(sin((yyvsp[-1]).getValue()));    }
1437
#line 1437 "QuantityParser.c" /* yacc.c:1646  */
1438
    break;
1439

1440
  case 25:
1441
#line 58 "QuantityParser.y" /* yacc.c:1646  */
1442
    { (yyval) = Quantity(sinh((yyvsp[-1]).getValue()));   }
1443
#line 1443 "QuantityParser.c" /* yacc.c:1646  */
1444
    break;
1445

1446
  case 26:
1447
#line 59 "QuantityParser.y" /* yacc.c:1646  */
1448
    { (yyval) = Quantity(tan((yyvsp[-1]).getValue()));    }
1449
#line 1449 "QuantityParser.c" /* yacc.c:1646  */
1450
    break;
1451

1452
  case 27:
1453
#line 60 "QuantityParser.y" /* yacc.c:1646  */
1454
    { (yyval) = Quantity(tanh((yyvsp[-1]).getValue()));   }
1455
#line 1455 "QuantityParser.c" /* yacc.c:1646  */
1456
    break;
1457

1458
  case 28:
1459
#line 61 "QuantityParser.y" /* yacc.c:1646  */
1460
    { (yyval) = Quantity(sqrt((yyvsp[-1]).getValue()));   }
1461
#line 1461 "QuantityParser.c" /* yacc.c:1646  */
1462
    break;
1463

1464
  case 29:
1465
#line 62 "QuantityParser.y" /* yacc.c:1646  */
1466
    { (yyval) = Quantity(cos((yyvsp[-1]).getValue()));    }
1467
#line 1467 "QuantityParser.c" /* yacc.c:1646  */
1468
    break;
1469

1470
  case 30:
1471
#line 65 "QuantityParser.y" /* yacc.c:1646  */
1472
    { (yyval) = (yyvsp[0]);         	                }
1473
#line 1473 "QuantityParser.c" /* yacc.c:1646  */
1474
    break;
1475

1476
  case 31:
1477
#line 66 "QuantityParser.y" /* yacc.c:1646  */
1478
    { (yyval) = Quantity(1.0)/(yyvsp[0]);  	        }
1479
#line 1479 "QuantityParser.c" /* yacc.c:1646  */
1480
    break;
1481

1482
  case 32:
1483
#line 67 "QuantityParser.y" /* yacc.c:1646  */
1484
    { (yyval) = (yyvsp[-2]) * (yyvsp[0]);    	                }
1485
#line 1485 "QuantityParser.c" /* yacc.c:1646  */
1486
    break;
1487

1488
  case 33:
1489
#line 68 "QuantityParser.y" /* yacc.c:1646  */
1490
    { (yyval) = (yyvsp[-2]) / (yyvsp[0]);    	                }
1491
#line 1491 "QuantityParser.c" /* yacc.c:1646  */
1492
    break;
1493

1494
  case 34:
1495
#line 69 "QuantityParser.y" /* yacc.c:1646  */
1496
    { (yyval) = (yyvsp[-2]).pow ((yyvsp[0]));                 }
1497
#line 1497 "QuantityParser.c" /* yacc.c:1646  */
1498
    break;
1499

1500
  case 35:
1501
#line 70 "QuantityParser.y" /* yacc.c:1646  */
1502
    { (yyval) = (yyvsp[-1]);                          }
1503
#line 1503 "QuantityParser.c" /* yacc.c:1646  */
1504
    break;
1505

1506
  case 36:
1507
#line 72 "QuantityParser.y" /* yacc.c:1646  */
1508
    { (yyval) = (yyvsp[-1])*(yyvsp[0]);    	                }
1509
#line 1509 "QuantityParser.c" /* yacc.c:1646  */
1510
    break;
1511

1512
  case 37:
1513
#line 73 "QuantityParser.y" /* yacc.c:1646  */
1514
    { (yyval) = Quantity((yyvsp[-2]))/(yyvsp[0]);  	        }
1515
#line 1515 "QuantityParser.c" /* yacc.c:1646  */
1516
    break;
1517

1518

1519
#line 1519 "QuantityParser.c" /* yacc.c:1646  */
1520
      default: break;
1521
    }
1522
  /* User semantic actions sometimes alter yychar, and that requires
1523
     that yytoken be updated with the new translation.  We take the
1524
     approach of translating immediately before every use of yytoken.
1525
     One alternative is translating here after every semantic action,
1526
     but that translation would be missed if the semantic action invokes
1527
     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1528
     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
1529
     incorrect destructor might then be invoked immediately.  In the
1530
     case of YYERROR or YYBACKUP, subsequent parser actions might lead
1531
     to an incorrect destructor call or verbose syntax error message
1532
     before the lookahead is translated.  */
1533
  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1534

1535
  YYPOPSTACK (yylen);
1536
  yylen = 0;
1537
  YY_STACK_PRINT (yyss, yyssp);
1538

1539
  *++yyvsp = yyval;
1540

1541
  /* Now 'shift' the result of the reduction.  Determine what state
1542
     that goes to, based on the state we popped back to and the rule
1543
     number reduced by.  */
1544

1545
  yyn = yyr1[yyn];
1546

1547
  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1548
  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1549
    yystate = yytable[yystate];
1550
  else
1551
    yystate = yydefgoto[yyn - YYNTOKENS];
1552

1553
  goto yynewstate;
1554

1555

1556
/*--------------------------------------.
1557
| yyerrlab -- here on detecting error.  |
1558
`--------------------------------------*/
1559
yyerrlab:
1560
  /* Make sure we have latest lookahead translation.  See comments at
1561
     user semantic actions for why this is necessary.  */
1562
  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1563

1564
  /* If not already recovering from an error, report this error.  */
1565
  if (!yyerrstatus)
1566
    {
1567
      ++yynerrs;
1568
#if ! YYERROR_VERBOSE
1569
      yyerror (YY_("syntax error"));
1570
#else
1571
# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1572
                                        yyssp, yytoken)
1573
      {
1574
        char const *yymsgp = YY_("syntax error");
1575
        int yysyntax_error_status;
1576
        yysyntax_error_status = YYSYNTAX_ERROR;
1577
        if (yysyntax_error_status == 0)
1578
          yymsgp = yymsg;
1579
        else if (yysyntax_error_status == 1)
1580
          {
1581
            if (yymsg != yymsgbuf)
1582
              YYSTACK_FREE (yymsg);
1583
            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1584
            if (!yymsg)
1585
              {
1586
                yymsg = yymsgbuf;
1587
                yymsg_alloc = sizeof yymsgbuf;
1588
                yysyntax_error_status = 2;
1589
              }
1590
            else
1591
              {
1592
                yysyntax_error_status = YYSYNTAX_ERROR;
1593
                yymsgp = yymsg;
1594
              }
1595
          }
1596
        yyerror (yymsgp);
1597
        if (yysyntax_error_status == 2)
1598
          goto yyexhaustedlab;
1599
      }
1600
# undef YYSYNTAX_ERROR
1601
#endif
1602
    }
1603

1604

1605

1606
  if (yyerrstatus == 3)
1607
    {
1608
      /* If just tried and failed to reuse lookahead token after an
1609
         error, discard it.  */
1610

1611
      if (yychar <= YYEOF)
1612
        {
1613
          /* Return failure if at end of input.  */
1614
          if (yychar == YYEOF)
1615
            YYABORT;
1616
        }
1617
      else
1618
        {
1619
          yydestruct ("Error: discarding",
1620
                      yytoken, &yylval);
1621
          yychar = YYEMPTY;
1622
        }
1623
    }
1624

1625
  /* Else will try to reuse lookahead token after shifting the error
1626
     token.  */
1627
  goto yyerrlab1;
1628

1629

1630
/*---------------------------------------------------.
1631
| yyerrorlab -- error raised explicitly by YYERROR.  |
1632
`---------------------------------------------------*/
1633
yyerrorlab:
1634

1635
  /* Pacify compilers like GCC when the user code never invokes
1636
     YYERROR and the label yyerrorlab therefore never appears in user
1637
     code.  */
1638
  if (/*CONSTCOND*/ 0)
1639
     goto yyerrorlab;
1640

1641
  /* Do not reclaim the symbols of the rule whose action triggered
1642
     this YYERROR.  */
1643
  YYPOPSTACK (yylen);
1644
  yylen = 0;
1645
  YY_STACK_PRINT (yyss, yyssp);
1646
  yystate = *yyssp;
1647
  goto yyerrlab1;
1648

1649

1650
/*-------------------------------------------------------------.
1651
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
1652
`-------------------------------------------------------------*/
1653
yyerrlab1:
1654
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
1655

1656
  for (;;)
1657
    {
1658
      yyn = yypact[yystate];
1659
      if (!yypact_value_is_default (yyn))
1660
        {
1661
          yyn += YYTERROR;
1662
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1663
            {
1664
              yyn = yytable[yyn];
1665
              if (0 < yyn)
1666
                break;
1667
            }
1668
        }
1669

1670
      /* Pop the current state because it cannot handle the error token.  */
1671
      if (yyssp == yyss)
1672
        YYABORT;
1673

1674

1675
      yydestruct ("Error: popping",
1676
                  yystos[yystate], yyvsp);
1677
      YYPOPSTACK (1);
1678
      yystate = *yyssp;
1679
      YY_STACK_PRINT (yyss, yyssp);
1680
    }
1681

1682
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1683
  *++yyvsp = yylval;
1684
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1685

1686

1687
  /* Shift the error token.  */
1688
  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1689

1690
  yystate = yyn;
1691
  goto yynewstate;
1692

1693

1694
/*-------------------------------------.
1695
| yyacceptlab -- YYACCEPT comes here.  |
1696
`-------------------------------------*/
1697
yyacceptlab:
1698
  yyresult = 0;
1699
  goto yyreturn;
1700

1701
/*-----------------------------------.
1702
| yyabortlab -- YYABORT comes here.  |
1703
`-----------------------------------*/
1704
yyabortlab:
1705
  yyresult = 1;
1706
  goto yyreturn;
1707

1708
#if !defined yyoverflow || YYERROR_VERBOSE
1709
/*-------------------------------------------------.
1710
| yyexhaustedlab -- memory exhaustion comes here.  |
1711
`-------------------------------------------------*/
1712
yyexhaustedlab:
1713
  yyerror (YY_("memory exhausted"));
1714
  yyresult = 2;
1715
  /* Fall through.  */
1716
#endif
1717

1718
yyreturn:
1719
  if (yychar != YYEMPTY)
1720
    {
1721
      /* Make sure we have latest lookahead translation.  See comments at
1722
         user semantic actions for why this is necessary.  */
1723
      yytoken = YYTRANSLATE (yychar);
1724
      yydestruct ("Cleanup: discarding lookahead",
1725
                  yytoken, &yylval);
1726
    }
1727
  /* Do not reclaim the symbols of the rule whose action triggered
1728
     this YYABORT or YYACCEPT.  */
1729
  YYPOPSTACK (yylen);
1730
  YY_STACK_PRINT (yyss, yyssp);
1731
  while (yyssp != yyss)
1732
    {
1733
      yydestruct ("Cleanup: popping",
1734
                  yystos[*yyssp], yyvsp);
1735
      YYPOPSTACK (1);
1736
    }
1737
#ifndef yyoverflow
1738
  if (yyss != yyssa)
1739
    YYSTACK_FREE (yyss);
1740
#endif
1741
#if YYERROR_VERBOSE
1742
  if (yymsg != yymsgbuf)
1743
    YYSTACK_FREE (yymsg);
1744
#endif
1745
  return yyresult;
1746
}
1747
#line 77 "QuantityParser.y" /* yacc.c:1906  */
1748

1749
// clang-format on
1750

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.