1 /* A Bison parser, made by GNU Bison 3.0.2.  */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5    Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
6 
7    This program is free software: you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation, either version 3 of the License, or
10    (at your option) any later version.
11 
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16 
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
19 
20 /* As a special exception, you may create a larger work that contains
21    part or all of the Bison parser skeleton and distribute that work
22    under terms of your choice, so long as that work isn't itself a
23    parser generator using the skeleton or a modified version thereof
24    as a parser skeleton.  Alternatively, if you modify or redistribute
25    the parser skeleton itself, you may (at your option) remove this
26    special exception, which will cause the skeleton and the resulting
27    Bison output files to be licensed under the GNU General Public
28    License without this special exception.
29 
30    This special exception was added by the Free Software Foundation in
31    version 2.2 of Bison.  */
32 
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34    simplifying the original so-called "semantic" parser.  */
35 
36 /* All symbols defined below should begin with yy or YY, to avoid
37    infringing on user name space.  This should be done even for local
38    variables, as they might otherwise be expanded by user macros.
39    There are some unavoidable exceptions within include files to
40    define necessary library symbols; they are noted "INFRINGES ON
41    USER NAME SPACE" below.  */
42 
43 /* Identify Bison output.  */
44 #define YYBISON 1
45 
46 /* Bison version.  */
47 #define YYBISON_VERSION "3.0.2"
48 
49 /* Skeleton name.  */
50 #define YYSKELETON_NAME "yacc.c"
51 
52 /* Pure parsers.  */
53 #define YYPURE 0
54 
55 /* Push parsers.  */
56 #define YYPUSH 0
57 
58 /* Pull parsers.  */
59 #define YYPULL 1
60 
61 
62 
63 
64 /* Copy the first part of user declarations.  */
65 #line 4 "../../../svn/src/common/parser.y" /* yacc.c:339  */
66 
67 /*#define REENTRANT_PARSER */
68 #ifdef HAVE_CONFIG_H
69 #include "config.h"
70 #endif
71 #if ! defined(HAVE_CONFIG_H) || HAVE_STRING_H
72 # include <string.h>
73 #else
74 # if !HAVE_STRCHR
75 #  define strchr index
76 #  define strrchr rindex
77 # endif
78 char *strchr (), *strrchr ();
79 #endif
80 
81 #include <stdio.h>
82 #include <stdlib.h>
83 
84 #include "number.h"
85 
86 #include <stdarg.h>
87 #include <math.h>
88 #include <float.h>
89 #include <unistd.h> /* for isatty() */
90 #include "calculator.h"
91 #include "variables.h"
92 #include "files.h"
93 #include "conversion.h"
94 #include "number_formatting.h"
95 #include "output.h"
96 
97 /* Based on the headstart code by Shawn Ostermann
98 * modified by Kyle Wheeler
99 */
100 
101 /* include debugging code, in case we want it */
102 #define YYDEBUG 1
103 
104 /* to make it stop complaining about undeclared functions */
105 int yylex(void);
106 int yyerror(char *error_string, ...);
107 
108 int lines = 1;
109 int synerrors = 0;
110 short scanerror = 0;
111 char * errstring = NULL;
112 int errloc = -1;
113 int show_line_numbers = 0;
114 
115 
116 #line 117 "../../../svn/src/common/parser.c" /* yacc.c:339  */
117 
118 # ifndef YY_NULLPTR
119 #  if defined __cplusplus && 201103L <= __cplusplus
120 #   define YY_NULLPTR nullptr
121 #  else
122 #   define YY_NULLPTR 0
123 #  endif
124 # endif
125 
126 /* Enabling verbose error messages.  */
127 #ifdef YYERROR_VERBOSE
128 # undef YYERROR_VERBOSE
129 # define YYERROR_VERBOSE 1
130 #else
131 # define YYERROR_VERBOSE 0
132 #endif
133 
134 /* In a future release of Bison, this section will be replaced
135    by #include "y.tab.h".  */
136 #ifndef YY_YY__SVN_SRC_COMMON_PARSER_H_INCLUDED
137 # define YY_YY__SVN_SRC_COMMON_PARSER_H_INCLUDED
138 /* Debug traces.  */
139 #ifndef YYDEBUG
140 # define YYDEBUG 0
141 #endif
142 #if YYDEBUG
143 extern int yydebug;
144 #endif
145 
146 /* Token type.  */
147 #ifndef YYTOKENTYPE
148 # define YYTOKENTYPE
149   enum yytokentype
150   {
151     DEC_CMD = 258,
152     OCT_CMD = 259,
153     HEX_CMD = 260,
154     BIN_CMD = 261,
155     DISPLAY_PREFS_CMD = 262,
156     RADIAN_CMD = 263,
157     REMEMBER_CMD = 264,
158     LISTVAR_CMD = 265,
159     STORE_CMD = 266,
160     CMOD_CMD = 267,
161     PRINT_HELP_CMD = 268,
162     PREFIX_CMD = 269,
163     INT_CMD = 270,
164     VERBOSE_CMD = 271,
165     DELIM_CMD = 272,
166     ASSERT_CMD = 273,
167     ENG_CMD = 274,
168     HLIMIT_CMD = 275,
169     ROUNDING_INDICATION_CMD = 276,
170     PRECISION_CMD = 277,
171     BITS_CMD = 278,
172     BASE_CMD = 279,
173     GUARD_CMD = 280,
174     CONVERT_CMD = 281,
175     EOLN = 282,
176     OPEN_PARENTHESES = 283,
177     CLOSE_PARENTHESES = 284,
178     OPEN_BRACE = 285,
179     CLOSE_BRACE = 286,
180     OPEN_BRACKET = 287,
181     CLOSE_BRACKET = 288,
182     WPLUS = 289,
183     WMINUS = 290,
184     WMULT = 291,
185     WDIV = 292,
186     WMOD = 293,
187     EQUALS_SIGN = 294,
188     WPOW = 295,
189     WEXP = 296,
190     WSQR = 297,
191     WOR = 298,
192     WAND = 299,
193     WEQUAL = 300,
194     WNEQUAL = 301,
195     WGT = 302,
196     WLT = 303,
197     WGEQ = 304,
198     WLEQ = 305,
199     WLSHFT = 306,
200     WRSHFT = 307,
201     WBOR = 308,
202     WBAND = 309,
203     WBXOR = 310,
204     WBNOT = 311,
205     WNOT = 312,
206     WLOG = 313,
207     WLN = 314,
208     WROUND = 315,
209     WABS = 316,
210     WSQRT = 317,
211     WCEIL = 318,
212     WFLOOR = 319,
213     WCBRT = 320,
214     WLOGTWO = 321,
215     WBANG = 322,
216     WSIN = 323,
217     WCOS = 324,
218     WTAN = 325,
219     WASIN = 326,
220     WACOS = 327,
221     WATAN = 328,
222     WSINH = 329,
223     WCOSH = 330,
224     WTANH = 331,
225     WASINH = 332,
226     WACOSH = 333,
227     WATANH = 334,
228     WCOT = 335,
229     WACOT = 336,
230     WCOTH = 337,
231     WACOTH = 338,
232     WRAND = 339,
233     WIRAND = 340,
234     WFACT = 341,
235     WCOMP = 342,
236     WSEC = 343,
237     WCSC = 344,
238     WASEC = 345,
239     WACSC = 346,
240     WSECH = 347,
241     WCSCH = 348,
242     WASECH = 349,
243     WACSCH = 350,
244     WEINT = 351,
245     WGAMMA = 352,
246     WLNGAMMA = 353,
247     WZETA = 354,
248     WSINC = 355,
249     NUMBER = 356,
250     VARIABLE = 357,
251     STRING = 358,
252     OPEN_CMD = 359,
253     SAVE_CMD = 360,
254     ASSIGNMENT = 361,
255     IDSEP_CMD = 362,
256     DSEP_CMD = 363,
257     ITSEP_CMD = 364,
258     TSEP_CMD = 365,
259     WNEG = 366
260   };
261 #endif
262 /* Tokens.  */
263 #define DEC_CMD 258
264 #define OCT_CMD 259
265 #define HEX_CMD 260
266 #define BIN_CMD 261
267 #define DISPLAY_PREFS_CMD 262
268 #define RADIAN_CMD 263
269 #define REMEMBER_CMD 264
270 #define LISTVAR_CMD 265
271 #define STORE_CMD 266
272 #define CMOD_CMD 267
273 #define PRINT_HELP_CMD 268
274 #define PREFIX_CMD 269
275 #define INT_CMD 270
276 #define VERBOSE_CMD 271
277 #define DELIM_CMD 272
278 #define ASSERT_CMD 273
279 #define ENG_CMD 274
280 #define HLIMIT_CMD 275
281 #define ROUNDING_INDICATION_CMD 276
282 #define PRECISION_CMD 277
283 #define BITS_CMD 278
284 #define BASE_CMD 279
285 #define GUARD_CMD 280
286 #define CONVERT_CMD 281
287 #define EOLN 282
288 #define OPEN_PARENTHESES 283
289 #define CLOSE_PARENTHESES 284
290 #define OPEN_BRACE 285
291 #define CLOSE_BRACE 286
292 #define OPEN_BRACKET 287
293 #define CLOSE_BRACKET 288
294 #define WPLUS 289
295 #define WMINUS 290
296 #define WMULT 291
297 #define WDIV 292
298 #define WMOD 293
299 #define EQUALS_SIGN 294
300 #define WPOW 295
301 #define WEXP 296
302 #define WSQR 297
303 #define WOR 298
304 #define WAND 299
305 #define WEQUAL 300
306 #define WNEQUAL 301
307 #define WGT 302
308 #define WLT 303
309 #define WGEQ 304
310 #define WLEQ 305
311 #define WLSHFT 306
312 #define WRSHFT 307
313 #define WBOR 308
314 #define WBAND 309
315 #define WBXOR 310
316 #define WBNOT 311
317 #define WNOT 312
318 #define WLOG 313
319 #define WLN 314
320 #define WROUND 315
321 #define WABS 316
322 #define WSQRT 317
323 #define WCEIL 318
324 #define WFLOOR 319
325 #define WCBRT 320
326 #define WLOGTWO 321
327 #define WBANG 322
328 #define WSIN 323
329 #define WCOS 324
330 #define WTAN 325
331 #define WASIN 326
332 #define WACOS 327
333 #define WATAN 328
334 #define WSINH 329
335 #define WCOSH 330
336 #define WTANH 331
337 #define WASINH 332
338 #define WACOSH 333
339 #define WATANH 334
340 #define WCOT 335
341 #define WACOT 336
342 #define WCOTH 337
343 #define WACOTH 338
344 #define WRAND 339
345 #define WIRAND 340
346 #define WFACT 341
347 #define WCOMP 342
348 #define WSEC 343
349 #define WCSC 344
350 #define WASEC 345
351 #define WACSC 346
352 #define WSECH 347
353 #define WCSCH 348
354 #define WASECH 349
355 #define WACSCH 350
356 #define WEINT 351
357 #define WGAMMA 352
358 #define WLNGAMMA 353
359 #define WZETA 354
360 #define WSINC 355
361 #define NUMBER 356
362 #define VARIABLE 357
363 #define STRING 358
364 #define OPEN_CMD 359
365 #define SAVE_CMD 360
366 #define ASSIGNMENT 361
367 #define IDSEP_CMD 362
368 #define DSEP_CMD 363
369 #define ITSEP_CMD 364
370 #define TSEP_CMD 365
371 #define WNEG 366
372 
373 /* Value type.  */
374 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
375 typedef union YYSTYPE YYSTYPE;
376 union YYSTYPE
377 {
378 #line 56 "../../../svn/src/common/parser.y" /* yacc.c:355  */
379  /* the types that we use in the tokens */
380 enum functions function;
381 enum operations operation;
382 Number number;
383 long integer;
384 enum commands cmd;
385 char * variable;
386 char character;
387 struct conv_req conver;
388 
389 #line 390 "../../../svn/src/common/parser.c" /* yacc.c:355  */
390 };
391 # define YYSTYPE_IS_TRIVIAL 1
392 # define YYSTYPE_IS_DECLARED 1
393 #endif
394 
395 
396 extern YYSTYPE yylval;
397 
398 int yyparse (void);
399 
400 #endif /* !YY_YY__SVN_SRC_COMMON_PARSER_H_INCLUDED  */
401 
402 /* Copy the second part of user declarations.  */
403 
404 #line 405 "../../../svn/src/common/parser.c" /* yacc.c:358  */
405 
406 #ifdef short
407 # undef short
408 #endif
409 
410 #ifdef YYTYPE_UINT8
411 typedef YYTYPE_UINT8 yytype_uint8;
412 #else
413 typedef unsigned char yytype_uint8;
414 #endif
415 
416 #ifdef YYTYPE_INT8
417 typedef YYTYPE_INT8 yytype_int8;
418 #else
419 typedef signed char yytype_int8;
420 #endif
421 
422 #ifdef YYTYPE_UINT16
423 typedef YYTYPE_UINT16 yytype_uint16;
424 #else
425 typedef unsigned short int yytype_uint16;
426 #endif
427 
428 #ifdef YYTYPE_INT16
429 typedef YYTYPE_INT16 yytype_int16;
430 #else
431 typedef short int yytype_int16;
432 #endif
433 
434 #ifndef YYSIZE_T
435 # ifdef __SIZE_TYPE__
436 #  define YYSIZE_T __SIZE_TYPE__
437 # elif defined size_t
438 #  define YYSIZE_T size_t
439 # elif ! defined YYSIZE_T
440 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
441 #  define YYSIZE_T size_t
442 # else
443 #  define YYSIZE_T unsigned int
444 # endif
445 #endif
446 
447 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
448 
449 #ifndef YY_
450 # if defined YYENABLE_NLS && YYENABLE_NLS
451 #  if ENABLE_NLS
452 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
453 #   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
454 #  endif
455 # endif
456 # ifndef YY_
457 #  define YY_(Msgid) Msgid
458 # endif
459 #endif
460 
461 #ifndef YY_ATTRIBUTE
462 # if (defined __GNUC__                                               \
463       && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
464      || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
465 #  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
466 # else
467 #  define YY_ATTRIBUTE(Spec) /* empty */
468 # endif
469 #endif
470 
471 #ifndef YY_ATTRIBUTE_PURE
472 # define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
473 #endif
474 
475 #ifndef YY_ATTRIBUTE_UNUSED
476 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
477 #endif
478 
479 #if !defined _Noreturn \
480      && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
481 # if defined _MSC_VER && 1200 <= _MSC_VER
482 #  define _Noreturn __declspec (noreturn)
483 # else
484 #  define _Noreturn YY_ATTRIBUTE ((__noreturn__))
485 # endif
486 #endif
487 
488 /* Suppress unused-variable warnings by "using" E.  */
489 #if ! defined lint || defined __GNUC__
490 # define YYUSE(E) ((void) (E))
491 #else
492 # define YYUSE(E) /* empty */
493 #endif
494 
495 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
496 /* Suppress an incorrect diagnostic about yylval being uninitialized.  */
497 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
498     _Pragma ("GCC diagnostic push") \
499     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
500     _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
501 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
502     _Pragma ("GCC diagnostic pop")
503 #else
504 # define YY_INITIAL_VALUE(Value) Value
505 #endif
506 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
507 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
508 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
509 #endif
510 #ifndef YY_INITIAL_VALUE
511 # define YY_INITIAL_VALUE(Value) /* Nothing. */
512 #endif
513 
514 
515 #if ! defined yyoverflow || YYERROR_VERBOSE
516 
517 /* The parser invokes alloca or malloc; define the necessary symbols.  */
518 
519 # ifdef YYSTACK_USE_ALLOCA
520 #  if YYSTACK_USE_ALLOCA
521 #   ifdef __GNUC__
522 #    define YYSTACK_ALLOC __builtin_alloca
523 #   elif defined __BUILTIN_VA_ARG_INCR
524 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
525 #   elif defined _AIX
526 #    define YYSTACK_ALLOC __alloca
527 #   elif defined _MSC_VER
528 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
529 #    define alloca _alloca
530 #   else
531 #    define YYSTACK_ALLOC alloca
532 #    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
533 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
534       /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
535 #     ifndef EXIT_SUCCESS
536 #      define EXIT_SUCCESS 0
537 #     endif
538 #    endif
539 #   endif
540 #  endif
541 # endif
542 
543 # ifdef YYSTACK_ALLOC
544    /* Pacify GCC's 'empty if-body' warning.  */
545 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
546 #  ifndef YYSTACK_ALLOC_MAXIMUM
547     /* The OS might guarantee only one guard page at the bottom of the stack,
548        and a page size can be as small as 4096 bytes.  So we cannot safely
549        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
550        to allow for a few compiler-allocated temporary stack slots.  */
551 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
552 #  endif
553 # else
554 #  define YYSTACK_ALLOC YYMALLOC
555 #  define YYSTACK_FREE YYFREE
556 #  ifndef YYSTACK_ALLOC_MAXIMUM
557 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
558 #  endif
559 #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
560        && ! ((defined YYMALLOC || defined malloc) \
561              && (defined YYFREE || defined free)))
562 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
563 #   ifndef EXIT_SUCCESS
564 #    define EXIT_SUCCESS 0
565 #   endif
566 #  endif
567 #  ifndef YYMALLOC
568 #   define YYMALLOC malloc
569 #   if ! defined malloc && ! defined EXIT_SUCCESS
570 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
571 #   endif
572 #  endif
573 #  ifndef YYFREE
574 #   define YYFREE free
575 #   if ! defined free && ! defined EXIT_SUCCESS
576 void free (void *); /* INFRINGES ON USER NAME SPACE */
577 #   endif
578 #  endif
579 # endif
580 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
581 
582 
583 #if (! defined yyoverflow \
584      && (! defined __cplusplus \
585          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
586 
587 /* A type that is properly aligned for any stack member.  */
588 union yyalloc
589 {
590   yytype_int16 yyss_alloc;
591   YYSTYPE yyvs_alloc;
592 };
593 
594 /* The size of the maximum gap between one aligned stack and the next.  */
595 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
596 
597 /* The size of an array large to enough to hold all stacks, each with
598    N elements.  */
599 # define YYSTACK_BYTES(N) \
600      ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
601       + YYSTACK_GAP_MAXIMUM)
602 
603 # define YYCOPY_NEEDED 1
604 
605 /* Relocate STACK from its old location to the new one.  The
606    local variables YYSIZE and YYSTACKSIZE give the old and new number of
607    elements in the stack, and YYPTR gives the new location of the
608    stack.  Advance YYPTR to a properly aligned location for the next
609    stack.  */
610 # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
611     do                                                                  \
612       {                                                                 \
613         YYSIZE_T yynewbytes;                                            \
614         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
615         Stack = &yyptr->Stack_alloc;                                    \
616         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
617         yyptr += yynewbytes / sizeof (*yyptr);                          \
618       }                                                                 \
619     while (0)
620 
621 #endif
622 
623 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
624 /* Copy COUNT objects from SRC to DST.  The source and destination do
625    not overlap.  */
626 # ifndef YYCOPY
627 #  if defined __GNUC__ && 1 < __GNUC__
628 #   define YYCOPY(Dst, Src, Count) \
629       __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
630 #  else
631 #   define YYCOPY(Dst, Src, Count)              \
632       do                                        \
633         {                                       \
634           YYSIZE_T yyi;                         \
635           for (yyi = 0; yyi < (Count); yyi++)   \
636             (Dst)[yyi] = (Src)[yyi];            \
637         }                                       \
638       while (0)
639 #  endif
640 # endif
641 #endif /* !YYCOPY_NEEDED */
642 
643 /* YYFINAL -- State number of the termination state.  */
644 #define YYFINAL  111
645 /* YYLAST -- Last index in YYTABLE.  */
646 #define YYLAST   997
647 
648 /* YYNTOKENS -- Number of terminals.  */
649 #define YYNTOKENS  112
650 /* YYNNTS -- Number of nonterminals.  */
651 #define YYNNTS  17
652 /* YYNRULES -- Number of rules.  */
653 #define YYNRULES  133
654 /* YYNSTATES -- Number of states.  */
655 #define YYNSTATES  176
656 
657 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
658    by yylex, with out-of-bounds checking.  */
659 #define YYUNDEFTOK  2
660 #define YYMAXUTOK   366
661 
662 #define YYTRANSLATE(YYX)                                                \
663   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
664 
665 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
666    as returned by yylex, without out-of-bounds checking.  */
667 static const yytype_uint8 yytranslate[] =
668 {
669        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
670        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
671        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
672        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
673        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
674        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
675        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
676        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
677        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
678        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
679        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
680        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
681        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
682        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
683        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
684        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
685        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
686        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
687        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
688        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
689        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
690        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
691        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
692        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
693        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
694        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
695        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
696       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
697       25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
698       35,    36,    37,    38,    39,    40,    41,    42,    43,    44,
699       45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
700       55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
701       65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
702       75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
703       85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
704       95,    96,    97,    98,    99,   100,   101,   102,   103,   104,
705      105,   106,   107,   108,   109,   110,   111
706 };
707 
708 #if YYDEBUG
709   /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
710 static const yytype_uint16 yyrline[] =
711 {
712        0,   109,   109,   110,   113,   114,   117,   136,   142,   159,
713      169,   183,   186,   190,   194,   198,   202,   211,   221,   231,
714      241,   252,   257,   262,   268,   272,   276,   284,   292,   302,
715      306,   323,   335,   340,   345,   349,   367,   375,   385,   408,
716      419,   429,   437,   440,   445,   468,   490,   498,   508,   509,
717      510,   511,   512,   513,   514,   515,   516,   517,   518,   519,
718      520,   521,   522,   523,   524,   525,   526,   529,   530,   531,
719      532,   533,   534,   535,   536,   537,   538,   539,   540,   541,
720      542,   543,   544,   545,   546,   547,   548,   549,   550,   551,
721      552,   553,   554,   555,   556,   557,   558,   559,   560,   561,
722      562,   563,   564,   565,   566,   567,   568,   569,   570,   571,
723      572,   573,   576,   577,   578,   581,   582,   583,   586,   587,
724      594,   599,   602,   606,   615,   617,   619,   621,   624,   626,
725      627,   633,   634,   640
726 };
727 #endif
728 
729 #if YYDEBUG || YYERROR_VERBOSE || 0
730 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
731    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
732 static const char *const yytname[] =
733 {
734   "$end", "error", "$undefined", "DEC_CMD", "OCT_CMD", "HEX_CMD",
735   "BIN_CMD", "DISPLAY_PREFS_CMD", "RADIAN_CMD", "REMEMBER_CMD",
736   "LISTVAR_CMD", "STORE_CMD", "CMOD_CMD", "PRINT_HELP_CMD", "PREFIX_CMD",
737   "INT_CMD", "VERBOSE_CMD", "DELIM_CMD", "ASSERT_CMD", "ENG_CMD",
738   "HLIMIT_CMD", "ROUNDING_INDICATION_CMD", "PRECISION_CMD", "BITS_CMD",
739   "BASE_CMD", "GUARD_CMD", "CONVERT_CMD", "EOLN", "OPEN_PARENTHESES",
740   "CLOSE_PARENTHESES", "OPEN_BRACE", "CLOSE_BRACE", "OPEN_BRACKET",
741   "CLOSE_BRACKET", "WPLUS", "WMINUS", "WMULT", "WDIV", "WMOD",
742   "EQUALS_SIGN", "WPOW", "WEXP", "WSQR", "WOR", "WAND", "WEQUAL",
743   "WNEQUAL", "WGT", "WLT", "WGEQ", "WLEQ", "WLSHFT", "WRSHFT", "WBOR",
744   "WBAND", "WBXOR", "WBNOT", "WNOT", "WLOG", "WLN", "WROUND", "WABS",
745   "WSQRT", "WCEIL", "WFLOOR", "WCBRT", "WLOGTWO", "WBANG", "WSIN", "WCOS",
746   "WTAN", "WASIN", "WACOS", "WATAN", "WSINH", "WCOSH", "WTANH", "WASINH",
747   "WACOSH", "WATANH", "WCOT", "WACOT", "WCOTH", "WACOTH", "WRAND",
748   "WIRAND", "WFACT", "WCOMP", "WSEC", "WCSC", "WASEC", "WACSC", "WSECH",
749   "WCSCH", "WASECH", "WACSCH", "WEINT", "WGAMMA", "WLNGAMMA", "WZETA",
750   "WSINC", "NUMBER", "VARIABLE", "STRING", "OPEN_CMD", "SAVE_CMD",
751   "ASSIGNMENT", "IDSEP_CMD", "DSEP_CMD", "ITSEP_CMD", "TSEP_CMD", "WNEG",
752   "$accept", "input", "lines", "oneline", "eoln", "command",
753   "optionalstring", "assignment", "exp", "func", "nullexp", "sign",
754   "exp_l2", "oval", "exp_l3", "parenthated", "capsule", YY_NULLPTR
755 };
756 #endif
757 
758 # ifdef YYPRINT
759 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
760    (internal) symbol number NUM (which must be that of a token).  */
761 static const yytype_uint16 yytoknum[] =
762 {
763        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
764      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
765      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
766      285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
767      295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
768      305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
769      315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
770      325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
771      335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
772      345,   346,   347,   348,   349,   350,   351,   352,   353,   354,
773      355,   356,   357,   358,   359,   360,   361,   362,   363,   364,
774      365,   366
775 };
776 # endif
777 
778 #define YYPACT_NINF -91
779 
780 #define yypact_value_is_default(Yystate) \
781   (!!((Yystate) == (-91)))
782 
783 #define YYTABLE_NINF -5
784 
785 #define yytable_value_is_error(Yytable_value) \
786   0
787 
788   /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
789      STATE-NUM.  */
790 static const yytype_int16 yypact[] =
791 {
792        0,     4,   -91,   -91,   -91,   -91,   -91,   -91,   -91,   -91,
793      -69,   -91,   -91,   -91,   -91,   -91,   -91,   -91,   -91,   -91,
794      -91,   -91,   -91,   -91,   -91,   -91,   -91,   399,   473,   547,
795      -91,   -91,   -91,   -91,   -91,   -91,   -91,   -91,   -91,   -91,
796      -91,   -91,   -91,   -91,   -91,   -91,   -91,   -91,   -91,   -91,
797      -91,   -91,   -91,   -91,   -91,   -91,   -91,   -91,   -91,   -91,
798      -91,   -91,   -91,   -91,   -91,   -91,   -91,   -91,   -91,   -91,
799      -91,   -91,   -91,   -91,   -91,   -91,   -91,    -2,   -91,   -91,
800      249,   -91,   -91,   -91,   -91,    39,   -91,   111,   -91,     4,
801        4,   845,     8,   -91,   695,   -91,   -91,   -91,   621,   -91,
802      -91,   -91,   -91,   872,   -91,   897,   -91,   920,   323,   -57,
803      768,   -91,   -91,   -91,   -91,   695,   695,   695,   695,   695,
804      695,   695,   695,   695,   695,   695,   695,   695,   695,   695,
805      695,   695,   695,   -91,   769,   -91,   769,    10,   -91,   -91,
806      -91,   769,   -91,   -91,   -91,   -57,   768,   -91,   -91,   -91,
807      236,   236,    -7,    -7,    -7,   620,   620,   188,   188,   188,
808      188,   188,   188,    -7,    -7,   620,   620,   942,   -13,   -91,
809      769,   -91,   -91,   -91,   769,   -91
810 };
811 
812   /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
813      Performed when YYTABLE does not specify something else to do.  Zero
814      means the default is an error.  */
815 static const yytype_uint8 yydefact[] =
816 {
817        0,     0,    15,    13,    12,    14,    24,    25,    33,    29,
818        0,    41,    34,    32,    22,    23,    21,    16,    30,    28,
819       31,    27,    37,    39,    26,    38,    11,     0,     0,     0,
820      116,   115,    97,   103,   104,    91,    93,    94,    95,    96,
821       99,    98,   100,    92,    67,    68,    69,    73,    74,    75,
822       79,    80,    81,    85,    86,    87,    70,    76,    82,    88,
823      101,   102,   105,   106,    71,    72,    77,    78,    83,    84,
824       89,    90,   107,   108,   109,   110,   111,   129,    35,    36,
825        0,    18,    17,    20,    19,     0,     2,     0,     9,     0,
826        0,     0,   117,   127,     0,    66,   118,   128,   121,    10,
827       40,   112,   129,     0,   113,     0,   114,     0,     0,    43,
828       43,     1,     5,     8,     7,     0,     0,     0,     0,     0,
829        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
830        0,     0,     0,     6,     0,   132,   121,   117,   131,   130,
831      122,   121,   124,   125,   126,    43,    43,    42,    45,    44,
832       49,    48,    63,    64,    65,    51,    50,    55,    56,    57,
833       58,    59,    60,    61,    62,    52,    54,    53,   133,   119,
834        0,   120,    47,    46,   121,   123
835 };
836 
837   /* YYPGOTO[NTERM-NUM].  */
838 static const yytype_int16 yypgoto[] =
839 {
840      -91,   -91,   -38,   -91,    66,   -91,     3,   -91,   133,   -91,
841      -91,   -90,   -44,    93,   130,   -41,   -82
842 };
843 
844   /* YYDEFGOTO[NTERM-NUM].  */
845 static const yytype_int16 yydefgoto[] =
846 {
847       -1,    85,    86,    87,    88,    89,   148,    90,    91,    92,
848       93,    94,    95,   140,    96,    97,    98
849 };
850 
851   /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
852      positive, shift that token.  If negative, reduce the rule whose
853      number is the opposite.  If YYTABLE_NINF, syntax error.  */
854 static const yytype_int16 yytable[] =
855 {
856       -3,     1,   134,     2,     3,     4,     5,     6,     7,     8,
857        9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
858       19,    20,    21,    22,    23,    24,    25,    26,    27,   138,
859       28,    26,    29,   100,    30,    31,    27,   108,    28,   111,
860       29,    32,    30,    31,    30,    31,   147,   170,   132,   112,
861      136,   135,   168,     0,   139,     0,    33,    34,    35,    36,
862       37,    38,    39,    40,    41,    42,    43,    99,    44,    45,
863       46,    47,    48,    49,    50,    51,    52,    53,    54,    55,
864       56,    57,    58,    59,    60,    61,    62,    63,    64,    65,
865       66,    67,    68,    69,    70,    71,    72,    73,    74,    75,
866       76,    77,     0,     0,    78,    79,    80,    81,    82,    83,
867       84,    -4,     1,   149,     2,     3,     4,     5,     6,     7,
868        8,     9,    10,    11,    12,    13,    14,    15,    16,    17,
869       18,    19,    20,    21,    22,    23,    24,    25,    26,    27,
870        0,    28,     0,    29,     0,    30,    31,     0,   172,   173,
871        0,     0,    32,     0,     0,   113,   114,   133,     0,     0,
872      103,   105,   107,     0,     0,     0,     0,    33,    34,    35,
873       36,    37,    38,    39,    40,    41,    42,    43,     0,    44,
874       45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
875       55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
876       65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
877       75,    76,    77,   110,     0,    78,    79,    80,    81,    82,
878       83,    84,   115,   116,   117,   118,   119,     0,   141,   169,
879        0,     0,     0,     0,   171,     0,     0,     0,     0,   128,
880      129,   146,     0,   132,     0,     0,     0,     0,   150,   151,
881      152,   153,   154,   155,   156,   157,   158,   159,   160,   161,
882      162,   163,   164,   165,   166,   167,   141,   175,     0,     0,
883        0,   141,   117,   118,   119,     0,     0,    27,     0,    28,
884        0,    29,     0,    30,    31,     0,     0,   128,   129,     0,
885       32,   132,     0,     0,     0,     0,     0,     0,     0,     0,
886      174,     0,     0,     0,   141,    33,    34,    35,    36,    37,
887       38,    39,    40,    41,    42,    43,     0,    44,    45,    46,
888       47,    48,    49,    50,    51,    52,    53,    54,    55,    56,
889       57,    58,    59,    60,    61,    62,    63,    64,    65,    66,
890       67,    68,    69,    70,    71,    72,    73,    74,    75,    76,
891      102,    27,   109,    28,     0,    29,     0,    30,    31,     0,
892        0,     0,     0,     0,    32,     0,     0,     0,     0,     0,
893        0,     0,     0,     0,     0,     0,     0,     0,     0,    33,
894       34,    35,    36,    37,    38,    39,    40,    41,    42,    43,
895        0,    44,    45,    46,    47,    48,    49,    50,    51,    52,
896       53,    54,    55,    56,    57,    58,    59,    60,    61,    62,
897       63,    64,    65,    66,    67,    68,    69,    70,    71,    72,
898       73,    74,    75,    76,   102,     0,   145,    27,   101,    28,
899        0,    29,     0,    30,    31,     0,     0,     0,     0,     0,
900       32,     0,     0,     0,     0,     0,     0,     0,     0,     0,
901        0,     0,     0,     0,     0,    33,    34,    35,    36,    37,
902       38,    39,    40,    41,    42,    43,     0,    44,    45,    46,
903       47,    48,    49,    50,    51,    52,    53,    54,    55,    56,
904       57,    58,    59,    60,    61,    62,    63,    64,    65,    66,
905       67,    68,    69,    70,    71,    72,    73,    74,    75,    76,
906      102,    27,     0,    28,   104,    29,     0,    30,    31,     0,
907        0,     0,     0,     0,    32,     0,     0,     0,     0,     0,
908        0,     0,     0,     0,     0,     0,     0,     0,     0,    33,
909       34,    35,    36,    37,    38,    39,    40,    41,    42,    43,
910        0,    44,    45,    46,    47,    48,    49,    50,    51,    52,
911       53,    54,    55,    56,    57,    58,    59,    60,    61,    62,
912       63,    64,    65,    66,    67,    68,    69,    70,    71,    72,
913       73,    74,    75,    76,   102,    27,     0,    28,     0,    29,
914      106,    30,    31,     0,     0,     0,     0,     0,    32,     0,
915        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
916        0,     0,     0,    33,    34,    35,    36,    37,    38,    39,
917       40,    41,    42,    43,     0,    44,    45,    46,    47,    48,
918       49,    50,    51,    52,    53,    54,    55,    56,    57,    58,
919       59,    60,    61,    62,    63,    64,    65,    66,    67,    68,
920       69,    70,    71,    72,    73,    74,    75,    76,   102,    27,
921        0,    28,     0,    29,   115,   116,   117,   118,   119,     0,
922        0,   137,    32,   138,     0,   122,   123,   124,   125,   126,
923      127,   128,   129,     0,     0,   132,     0,    33,    34,    35,
924       36,    37,    38,    39,    40,    41,    42,    43,   139,    44,
925       45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
926       55,    56,    57,    58,    59,    60,    61,    62,    63,    64,
927       65,    66,    67,    68,    69,    70,    71,    72,    73,    74,
928       75,    76,   102,    27,     0,    28,     0,    29,     0,    30,
929       31,     0,     0,     0,     0,     0,    32,     0,     0,     0,
930        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
931        0,    33,    34,    35,    36,    37,    38,    39,    40,    41,
932       42,    43,     0,    44,    45,    46,    47,    48,    49,    50,
933       51,    52,    53,    54,    55,    56,    57,    58,    59,    60,
934       61,    62,    63,    64,    65,    66,    67,    68,    69,    70,
935       71,    72,    73,    74,    75,    76,   102,    27,     0,    28,
936        0,    29,   115,   116,   117,   118,   119,     0,     0,     0,
937       32,   120,   121,   122,   123,   124,   125,   126,   127,   128,
938      129,   130,   131,   132,     0,    33,    34,    35,    36,    37,
939       38,    39,    40,    41,    42,    43,     0,    44,    45,    46,
940       47,    48,    49,    50,    51,    52,    53,    54,    55,    56,
941       57,    58,    59,    60,    61,    62,    63,    64,    65,    66,
942       67,    68,    69,    70,    71,    72,    73,    74,    75,    76,
943      102,   147,    26,     0,     0,     0,     0,     0,     0,   115,
944      116,   117,   118,   119,     0,     0,     0,     0,   120,   121,
945      122,   123,   124,   125,   126,   127,   128,   129,   130,   131,
946      132,   142,     0,     0,     0,     0,   115,   116,   117,   118,
947      119,     0,     0,     0,     0,   120,   121,   122,   123,   124,
948      125,   126,   127,   128,   129,   130,   131,   132,   143,     0,
949        0,   115,   116,   117,   118,   119,     0,     0,     0,     0,
950      120,   121,   122,   123,   124,   125,   126,   127,   128,   129,
951      130,   131,   132,   144,   115,   116,   117,   118,   119,     0,
952        0,     0,     0,   120,   121,   122,   123,   124,   125,   126,
953      127,   128,   129,   130,   131,   132,   115,   116,   117,   118,
954      119,     0,     0,     0,     0,   120,   121,   122,   123,   124,
955      125,   126,   127,   128,   129,   130,   131,   132
956 };
957 
958 static const yytype_int16 yycheck[] =
959 {
960        0,     1,    92,     3,     4,     5,     6,     7,     8,     9,
961       10,    11,    12,    13,    14,    15,    16,    17,    18,    19,
962       20,    21,    22,    23,    24,    25,    26,    27,    28,    42,
963       30,    27,    32,   102,    34,    35,    28,    39,    30,     0,
964       32,    41,    34,    35,    34,    35,   103,   137,    55,    87,
965       94,    92,   134,    -1,    67,    -1,    56,    57,    58,    59,
966       60,    61,    62,    63,    64,    65,    66,     1,    68,    69,
967       70,    71,    72,    73,    74,    75,    76,    77,    78,    79,
968       80,    81,    82,    83,    84,    85,    86,    87,    88,    89,
969       90,    91,    92,    93,    94,    95,    96,    97,    98,    99,
970      100,   101,    -1,    -1,   104,   105,   106,   107,   108,   109,
971      110,     0,     1,   110,     3,     4,     5,     6,     7,     8,
972        9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
973       19,    20,    21,    22,    23,    24,    25,    26,    27,    28,
974       -1,    30,    -1,    32,    -1,    34,    35,    -1,   145,   146,
975       -1,    -1,    41,    -1,    -1,    89,    90,    91,    -1,    -1,
976       27,    28,    29,    -1,    -1,    -1,    -1,    56,    57,    58,
977       59,    60,    61,    62,    63,    64,    65,    66,    -1,    68,
978       69,    70,    71,    72,    73,    74,    75,    76,    77,    78,
979       79,    80,    81,    82,    83,    84,    85,    86,    87,    88,
980       89,    90,    91,    92,    93,    94,    95,    96,    97,    98,
981       99,   100,   101,    80,    -1,   104,   105,   106,   107,   108,
982      109,   110,    34,    35,    36,    37,    38,    -1,    98,   136,
983       -1,    -1,    -1,    -1,   141,    -1,    -1,    -1,    -1,    51,
984       52,   108,    -1,    55,    -1,    -1,    -1,    -1,   115,   116,
985      117,   118,   119,   120,   121,   122,   123,   124,   125,   126,
986      127,   128,   129,   130,   131,   132,   136,   174,    -1,    -1,
987       -1,   141,    36,    37,    38,    -1,    -1,    28,    -1,    30,
988       -1,    32,    -1,    34,    35,    -1,    -1,    51,    52,    -1,
989       41,    55,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
990      170,    -1,    -1,    -1,   174,    56,    57,    58,    59,    60,
991       61,    62,    63,    64,    65,    66,    -1,    68,    69,    70,
992       71,    72,    73,    74,    75,    76,    77,    78,    79,    80,
993       81,    82,    83,    84,    85,    86,    87,    88,    89,    90,
994       91,    92,    93,    94,    95,    96,    97,    98,    99,   100,
995      101,    28,   103,    30,    -1,    32,    -1,    34,    35,    -1,
996       -1,    -1,    -1,    -1,    41,    -1,    -1,    -1,    -1,    -1,
997       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    56,
998       57,    58,    59,    60,    61,    62,    63,    64,    65,    66,
999       -1,    68,    69,    70,    71,    72,    73,    74,    75,    76,
1000       77,    78,    79,    80,    81,    82,    83,    84,    85,    86,
1001       87,    88,    89,    90,    91,    92,    93,    94,    95,    96,
1002       97,    98,    99,   100,   101,    -1,   103,    28,    29,    30,
1003       -1,    32,    -1,    34,    35,    -1,    -1,    -1,    -1,    -1,
1004       41,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1005       -1,    -1,    -1,    -1,    -1,    56,    57,    58,    59,    60,
1006       61,    62,    63,    64,    65,    66,    -1,    68,    69,    70,
1007       71,    72,    73,    74,    75,    76,    77,    78,    79,    80,
1008       81,    82,    83,    84,    85,    86,    87,    88,    89,    90,
1009       91,    92,    93,    94,    95,    96,    97,    98,    99,   100,
1010      101,    28,    -1,    30,    31,    32,    -1,    34,    35,    -1,
1011       -1,    -1,    -1,    -1,    41,    -1,    -1,    -1,    -1,    -1,
1012       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    56,
1013       57,    58,    59,    60,    61,    62,    63,    64,    65,    66,
1014       -1,    68,    69,    70,    71,    72,    73,    74,    75,    76,
1015       77,    78,    79,    80,    81,    82,    83,    84,    85,    86,
1016       87,    88,    89,    90,    91,    92,    93,    94,    95,    96,
1017       97,    98,    99,   100,   101,    28,    -1,    30,    -1,    32,
1018       33,    34,    35,    -1,    -1,    -1,    -1,    -1,    41,    -1,
1019       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1020       -1,    -1,    -1,    56,    57,    58,    59,    60,    61,    62,
1021       63,    64,    65,    66,    -1,    68,    69,    70,    71,    72,
1022       73,    74,    75,    76,    77,    78,    79,    80,    81,    82,
1023       83,    84,    85,    86,    87,    88,    89,    90,    91,    92,
1024       93,    94,    95,    96,    97,    98,    99,   100,   101,    28,
1025       -1,    30,    -1,    32,    34,    35,    36,    37,    38,    -1,
1026       -1,    40,    41,    42,    -1,    45,    46,    47,    48,    49,
1027       50,    51,    52,    -1,    -1,    55,    -1,    56,    57,    58,
1028       59,    60,    61,    62,    63,    64,    65,    66,    67,    68,
1029       69,    70,    71,    72,    73,    74,    75,    76,    77,    78,
1030       79,    80,    81,    82,    83,    84,    85,    86,    87,    88,
1031       89,    90,    91,    92,    93,    94,    95,    96,    97,    98,
1032       99,   100,   101,    28,    -1,    30,    -1,    32,    -1,    34,
1033       35,    -1,    -1,    -1,    -1,    -1,    41,    -1,    -1,    -1,
1034       -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
1035       -1,    56,    57,    58,    59,    60,    61,    62,    63,    64,
1036       65,    66,    -1,    68,    69,    70,    71,    72,    73,    74,
1037       75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
1038       85,    86,    87,    88,    89,    90,    91,    92,    93,    94,
1039       95,    96,    97,    98,    99,   100,   101,    28,    -1,    30,
1040       -1,    32,    34,    35,    36,    37,    38,    -1,    -1,    -1,
1041       41,    43,    44,    45,    46,    47,    48,    49,    50,    51,
1042       52,    53,    54,    55,    -1,    56,    57,    58,    59,    60,
1043       61,    62,    63,    64,    65,    66,    -1,    68,    69,    70,
1044       71,    72,    73,    74,    75,    76,    77,    78,    79,    80,
1045       81,    82,    83,    84,    85,    86,    87,    88,    89,    90,
1046       91,    92,    93,    94,    95,    96,    97,    98,    99,   100,
1047      101,   103,    27,    -1,    -1,    -1,    -1,    -1,    -1,    34,
1048       35,    36,    37,    38,    -1,    -1,    -1,    -1,    43,    44,
1049       45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
1050       55,    29,    -1,    -1,    -1,    -1,    34,    35,    36,    37,
1051       38,    -1,    -1,    -1,    -1,    43,    44,    45,    46,    47,
1052       48,    49,    50,    51,    52,    53,    54,    55,    31,    -1,
1053       -1,    34,    35,    36,    37,    38,    -1,    -1,    -1,    -1,
1054       43,    44,    45,    46,    47,    48,    49,    50,    51,    52,
1055       53,    54,    55,    33,    34,    35,    36,    37,    38,    -1,
1056       -1,    -1,    -1,    43,    44,    45,    46,    47,    48,    49,
1057       50,    51,    52,    53,    54,    55,    34,    35,    36,    37,
1058       38,    -1,    -1,    -1,    -1,    43,    44,    45,    46,    47,
1059       48,    49,    50,    51,    52,    53,    54,    55
1060 };
1061 
1062   /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1063      symbol of state STATE-NUM.  */
1064 static const yytype_uint8 yystos[] =
1065 {
1066        0,     1,     3,     4,     5,     6,     7,     8,     9,    10,
1067       11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
1068       21,    22,    23,    24,    25,    26,    27,    28,    30,    32,
1069       34,    35,    41,    56,    57,    58,    59,    60,    61,    62,
1070       63,    64,    65,    66,    68,    69,    70,    71,    72,    73,
1071       74,    75,    76,    77,    78,    79,    80,    81,    82,    83,
1072       84,    85,    86,    87,    88,    89,    90,    91,    92,    93,
1073       94,    95,    96,    97,    98,    99,   100,   101,   104,   105,
1074      106,   107,   108,   109,   110,   113,   114,   115,   116,   117,
1075      119,   120,   121,   122,   123,   124,   126,   127,   128,   116,
1076      102,    29,   101,   120,    31,   120,    33,   120,    39,   103,
1077      120,     0,   114,   116,   116,    34,    35,    36,    37,    38,
1078       43,    44,    45,    46,    47,    48,    49,    50,    51,    52,
1079       53,    54,    55,   116,   123,   127,   124,    40,    42,    67,
1080      125,   126,    29,    31,    33,   103,   120,   103,   118,   118,
1081      120,   120,   120,   120,   120,   120,   120,   120,   120,   120,
1082      120,   120,   120,   120,   120,   120,   120,   120,   128,   125,
1083      123,   125,   118,   118,   126,   125
1084 };
1085 
1086   /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
1087 static const yytype_uint8 yyr1[] =
1088 {
1089        0,   112,   113,   113,   114,   114,   115,   115,   115,   115,
1090      115,   116,   117,   117,   117,   117,   117,   117,   117,   117,
1091      117,   117,   117,   117,   117,   117,   117,   117,   117,   117,
1092      117,   117,   117,   117,   117,   117,   117,   117,   117,   117,
1093      117,   117,   118,   118,   119,   119,   119,   119,   120,   120,
1094      120,   120,   120,   120,   120,   120,   120,   120,   120,   120,
1095      120,   120,   120,   120,   120,   120,   120,   121,   121,   121,
1096      121,   121,   121,   121,   121,   121,   121,   121,   121,   121,
1097      121,   121,   121,   121,   121,   121,   121,   121,   121,   121,
1098      121,   121,   121,   121,   121,   121,   121,   121,   121,   121,
1099      121,   121,   121,   121,   121,   121,   121,   121,   121,   121,
1100      121,   121,   122,   122,   122,   123,   123,   123,   124,   124,
1101      125,   125,   126,   126,   127,   127,   127,   127,   128,   128,
1102      128,   128,   128,   128
1103 };
1104 
1105   /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
1106 static const yytype_uint8 yyr2[] =
1107 {
1108        0,     2,     1,     0,     1,     2,     2,     2,     2,     1,
1109        2,     1,     1,     1,     1,     1,     1,     1,     1,     1,
1110        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
1111        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
1112        2,     1,     1,     0,     3,     3,     4,     4,     3,     3,
1113        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
1114        3,     3,     3,     3,     3,     3,     1,     1,     1,     1,
1115        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
1116        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
1117        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
1118        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
1119        1,     1,     2,     2,     2,     1,     1,     0,     1,     3,
1120        2,     0,     2,     5,     3,     3,     3,     1,     1,     1,
1121        2,     2,     2,     3
1122 };
1123 
1124 
1125 #define yyerrok         (yyerrstatus = 0)
1126 #define yyclearin       (yychar = YYEMPTY)
1127 #define YYEMPTY         (-2)
1128 #define YYEOF           0
1129 
1130 #define YYACCEPT        goto yyacceptlab
1131 #define YYABORT         goto yyabortlab
1132 #define YYERROR         goto yyerrorlab
1133 
1134 
1135 #define YYRECOVERING()  (!!yyerrstatus)
1136 
1137 #define YYBACKUP(Token, Value)                                  \
1138 do                                                              \
1139   if (yychar == YYEMPTY)                                        \
1140     {                                                           \
1141       yychar = (Token);                                         \
1142       yylval = (Value);                                         \
1143       YYPOPSTACK (yylen);                                       \
1144       yystate = *yyssp;                                         \
1145       goto yybackup;                                            \
1146     }                                                           \
1147   else                                                          \
1148     {                                                           \
1149       yyerror (YY_("syntax error: cannot back up")); \
1150       YYERROR;                                                  \
1151     }                                                           \
1152 while (0)
1153 
1154 /* Error token number */
1155 #define YYTERROR        1
1156 #define YYERRCODE       256
1157 
1158 
1159 
1160 /* Enable debugging if requested.  */
1161 #if YYDEBUG
1162 
1163 # ifndef YYFPRINTF
1164 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1165 #  define YYFPRINTF fprintf
1166 # endif
1167 
1168 # define YYDPRINTF(Args)                        \
1169 do {                                            \
1170   if (yydebug)                                  \
1171     YYFPRINTF Args;                             \
1172 } while (0)
1173 
1174 /* This macro is provided for backward compatibility. */
1175 #ifndef YY_LOCATION_PRINT
1176 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1177 #endif
1178 
1179 
1180 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
1181 do {                                                                      \
1182   if (yydebug)                                                            \
1183     {                                                                     \
1184       YYFPRINTF (stderr, "%s ", Title);                                   \
1185       yy_symbol_print (stderr,                                            \
1186                   Type, Value); \
1187       YYFPRINTF (stderr, "\n");                                           \
1188     }                                                                     \
1189 } while (0)
1190 
1191 
1192 /*----------------------------------------.
1193 | Print this symbol's value on YYOUTPUT.  |
1194 `----------------------------------------*/
1195 
1196 static void
yy_symbol_value_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep)1197 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1198 {
1199   FILE *yyo = yyoutput;
1200   YYUSE (yyo);
1201   if (!yyvaluep)
1202     return;
1203 # ifdef YYPRINT
1204   if (yytype < YYNTOKENS)
1205     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1206 # endif
1207   YYUSE (yytype);
1208 }
1209 
1210 
1211 /*--------------------------------.
1212 | Print this symbol on YYOUTPUT.  |
1213 `--------------------------------*/
1214 
1215 static void
yy_symbol_print(FILE * yyoutput,int yytype,YYSTYPE const * const yyvaluep)1216 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1217 {
1218   YYFPRINTF (yyoutput, "%s %s (",
1219              yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1220 
1221   yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1222   YYFPRINTF (yyoutput, ")");
1223 }
1224 
1225 /*------------------------------------------------------------------.
1226 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1227 | TOP (included).                                                   |
1228 `------------------------------------------------------------------*/
1229 
1230 static void
yy_stack_print(yytype_int16 * yybottom,yytype_int16 * yytop)1231 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1232 {
1233   YYFPRINTF (stderr, "Stack now");
1234   for (; yybottom <= yytop; yybottom++)
1235     {
1236       int yybot = *yybottom;
1237       YYFPRINTF (stderr, " %d", yybot);
1238     }
1239   YYFPRINTF (stderr, "\n");
1240 }
1241 
1242 # define YY_STACK_PRINT(Bottom, Top)                            \
1243 do {                                                            \
1244   if (yydebug)                                                  \
1245     yy_stack_print ((Bottom), (Top));                           \
1246 } while (0)
1247 
1248 
1249 /*------------------------------------------------.
1250 | Report that the YYRULE is going to be reduced.  |
1251 `------------------------------------------------*/
1252 
1253 static void
yy_reduce_print(yytype_int16 * yyssp,YYSTYPE * yyvsp,int yyrule)1254 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
1255 {
1256   unsigned long int yylno = yyrline[yyrule];
1257   int yynrhs = yyr2[yyrule];
1258   int yyi;
1259   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1260              yyrule - 1, yylno);
1261   /* The symbols being reduced.  */
1262   for (yyi = 0; yyi < yynrhs; yyi++)
1263     {
1264       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
1265       yy_symbol_print (stderr,
1266                        yystos[yyssp[yyi + 1 - yynrhs]],
1267                        &(yyvsp[(yyi + 1) - (yynrhs)])
1268                                               );
1269       YYFPRINTF (stderr, "\n");
1270     }
1271 }
1272 
1273 # define YY_REDUCE_PRINT(Rule)          \
1274 do {                                    \
1275   if (yydebug)                          \
1276     yy_reduce_print (yyssp, yyvsp, Rule); \
1277 } while (0)
1278 
1279 /* Nonzero means print parse trace.  It is left uninitialized so that
1280    multiple parsers can coexist.  */
1281 int yydebug;
1282 #else /* !YYDEBUG */
1283 # define YYDPRINTF(Args)
1284 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1285 # define YY_STACK_PRINT(Bottom, Top)
1286 # define YY_REDUCE_PRINT(Rule)
1287 #endif /* !YYDEBUG */
1288 
1289 
1290 /* YYINITDEPTH -- initial size of the parser's stacks.  */
1291 #ifndef YYINITDEPTH
1292 # define YYINITDEPTH 200
1293 #endif
1294 
1295 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1296    if the built-in stack extension method is used).
1297 
1298    Do not make this value too large; the results are undefined if
1299    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1300    evaluated with infinite-precision integer arithmetic.  */
1301 
1302 #ifndef YYMAXDEPTH
1303 # define YYMAXDEPTH 10000
1304 #endif
1305 
1306 
1307 #if YYERROR_VERBOSE
1308 
1309 # ifndef yystrlen
1310 #  if defined __GLIBC__ && defined _STRING_H
1311 #   define yystrlen strlen
1312 #  else
1313 /* Return the length of YYSTR.  */
1314 static YYSIZE_T
yystrlen(const char * yystr)1315 yystrlen (const char *yystr)
1316 {
1317   YYSIZE_T yylen;
1318   for (yylen = 0; yystr[yylen]; yylen++)
1319     continue;
1320   return yylen;
1321 }
1322 #  endif
1323 # endif
1324 
1325 # ifndef yystpcpy
1326 #  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1327 #   define yystpcpy stpcpy
1328 #  else
1329 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1330    YYDEST.  */
1331 static char *
yystpcpy(char * yydest,const char * yysrc)1332 yystpcpy (char *yydest, const char *yysrc)
1333 {
1334   char *yyd = yydest;
1335   const char *yys = yysrc;
1336 
1337   while ((*yyd++ = *yys++) != '\0')
1338     continue;
1339 
1340   return yyd - 1;
1341 }
1342 #  endif
1343 # endif
1344 
1345 # ifndef yytnamerr
1346 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1347    quotes and backslashes, so that it's suitable for yyerror.  The
1348    heuristic is that double-quoting is unnecessary unless the string
1349    contains an apostrophe, a comma, or backslash (other than
1350    backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
1351    null, do not copy; instead, return the length of what the result
1352    would have been.  */
1353 static YYSIZE_T
yytnamerr(char * yyres,const char * yystr)1354 yytnamerr (char *yyres, const char *yystr)
1355 {
1356   if (*yystr == '"')
1357     {
1358       YYSIZE_T yyn = 0;
1359       char const *yyp = yystr;
1360 
1361       for (;;)
1362         switch (*++yyp)
1363           {
1364           case '\'':
1365           case ',':
1366             goto do_not_strip_quotes;
1367 
1368           case '\\':
1369             if (*++yyp != '\\')
1370               goto do_not_strip_quotes;
1371             /* Fall through.  */
1372           default:
1373             if (yyres)
1374               yyres[yyn] = *yyp;
1375             yyn++;
1376             break;
1377 
1378           case '"':
1379             if (yyres)
1380               yyres[yyn] = '\0';
1381             return yyn;
1382           }
1383     do_not_strip_quotes: ;
1384     }
1385 
1386   if (! yyres)
1387     return yystrlen (yystr);
1388 
1389   return yystpcpy (yyres, yystr) - yyres;
1390 }
1391 # endif
1392 
1393 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1394    about the unexpected token YYTOKEN for the state stack whose top is
1395    YYSSP.
1396 
1397    Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
1398    not large enough to hold the message.  In that case, also set
1399    *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
1400    required number of bytes is too large to store.  */
1401 static int
yysyntax_error(YYSIZE_T * yymsg_alloc,char ** yymsg,yytype_int16 * yyssp,int yytoken)1402 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1403                 yytype_int16 *yyssp, int yytoken)
1404 {
1405   YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1406   YYSIZE_T yysize = yysize0;
1407   enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1408   /* Internationalized format string. */
1409   const char *yyformat = YY_NULLPTR;
1410   /* Arguments of yyformat. */
1411   char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1412   /* Number of reported tokens (one for the "unexpected", one per
1413      "expected"). */
1414   int yycount = 0;
1415 
1416   /* There are many possibilities here to consider:
1417      - If this state is a consistent state with a default action, then
1418        the only way this function was invoked is if the default action
1419        is an error action.  In that case, don't check for expected
1420        tokens because there are none.
1421      - The only way there can be no lookahead present (in yychar) is if
1422        this state is a consistent state with a default action.  Thus,
1423        detecting the absence of a lookahead is sufficient to determine
1424        that there is no unexpected or expected token to report.  In that
1425        case, just report a simple "syntax error".
1426      - Don't assume there isn't a lookahead just because this state is a
1427        consistent state with a default action.  There might have been a
1428        previous inconsistent state, consistent state with a non-default
1429        action, or user semantic action that manipulated yychar.
1430      - Of course, the expected token list depends on states to have
1431        correct lookahead information, and it depends on the parser not
1432        to perform extra reductions after fetching a lookahead from the
1433        scanner and before detecting a syntax error.  Thus, state merging
1434        (from LALR or IELR) and default reductions corrupt the expected
1435        token list.  However, the list is correct for canonical LR with
1436        one exception: it will still contain any token that will not be
1437        accepted due to an error action in a later state.
1438   */
1439   if (yytoken != YYEMPTY)
1440     {
1441       int yyn = yypact[*yyssp];
1442       yyarg[yycount++] = yytname[yytoken];
1443       if (!yypact_value_is_default (yyn))
1444         {
1445           /* Start YYX at -YYN if negative to avoid negative indexes in
1446              YYCHECK.  In other words, skip the first -YYN actions for
1447              this state because they are default actions.  */
1448           int yyxbegin = yyn < 0 ? -yyn : 0;
1449           /* Stay within bounds of both yycheck and yytname.  */
1450           int yychecklim = YYLAST - yyn + 1;
1451           int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1452           int yyx;
1453 
1454           for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1455             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1456                 && !yytable_value_is_error (yytable[yyx + yyn]))
1457               {
1458                 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1459                   {
1460                     yycount = 1;
1461                     yysize = yysize0;
1462                     break;
1463                   }
1464                 yyarg[yycount++] = yytname[yyx];
1465                 {
1466                   YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1467                   if (! (yysize <= yysize1
1468                          && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1469                     return 2;
1470                   yysize = yysize1;
1471                 }
1472               }
1473         }
1474     }
1475 
1476   switch (yycount)
1477     {
1478 # define YYCASE_(N, S)                      \
1479       case N:                               \
1480         yyformat = S;                       \
1481       break
1482       YYCASE_(0, YY_("syntax error"));
1483       YYCASE_(1, YY_("syntax error, unexpected %s"));
1484       YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1485       YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1486       YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1487       YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1488 # undef YYCASE_
1489     }
1490 
1491   {
1492     YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1493     if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1494       return 2;
1495     yysize = yysize1;
1496   }
1497 
1498   if (*yymsg_alloc < yysize)
1499     {
1500       *yymsg_alloc = 2 * yysize;
1501       if (! (yysize <= *yymsg_alloc
1502              && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1503         *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1504       return 1;
1505     }
1506 
1507   /* Avoid sprintf, as that infringes on the user's name space.
1508      Don't have undefined behavior even if the translation
1509      produced a string with the wrong number of "%s"s.  */
1510   {
1511     char *yyp = *yymsg;
1512     int yyi = 0;
1513     while ((*yyp = *yyformat) != '\0')
1514       if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1515         {
1516           yyp += yytnamerr (yyp, yyarg[yyi++]);
1517           yyformat += 2;
1518         }
1519       else
1520         {
1521           yyp++;
1522           yyformat++;
1523         }
1524   }
1525   return 0;
1526 }
1527 #endif /* YYERROR_VERBOSE */
1528 
1529 /*-----------------------------------------------.
1530 | Release the memory associated to this symbol.  |
1531 `-----------------------------------------------*/
1532 
1533 static void
yydestruct(const char * yymsg,int yytype,YYSTYPE * yyvaluep)1534 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1535 {
1536   YYUSE (yyvaluep);
1537   if (!yymsg)
1538     yymsg = "Deleting";
1539   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1540 
1541   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1542   YYUSE (yytype);
1543   YY_IGNORE_MAYBE_UNINITIALIZED_END
1544 }
1545 
1546 
1547 
1548 
1549 /* The lookahead symbol.  */
1550 int yychar;
1551 
1552 /* The semantic value of the lookahead symbol.  */
1553 YYSTYPE yylval;
1554 /* Number of syntax errors so far.  */
1555 int yynerrs;
1556 
1557 
1558 /*----------.
1559 | yyparse.  |
1560 `----------*/
1561 
1562 int
yyparse(void)1563 yyparse (void)
1564 {
1565     int yystate;
1566     /* Number of tokens to shift before error messages enabled.  */
1567     int yyerrstatus;
1568 
1569     /* The stacks and their tools:
1570        'yyss': related to states.
1571        'yyvs': related to semantic values.
1572 
1573        Refer to the stacks through separate pointers, to allow yyoverflow
1574        to reallocate them elsewhere.  */
1575 
1576     /* The state stack.  */
1577     yytype_int16 yyssa[YYINITDEPTH];
1578     yytype_int16 *yyss;
1579     yytype_int16 *yyssp;
1580 
1581     /* The semantic value stack.  */
1582     YYSTYPE yyvsa[YYINITDEPTH];
1583     YYSTYPE *yyvs;
1584     YYSTYPE *yyvsp;
1585 
1586     YYSIZE_T yystacksize;
1587 
1588   int yyn;
1589   int yyresult;
1590   /* Lookahead token as an internal (translated) token number.  */
1591   int yytoken = 0;
1592   /* The variables used to return semantic value and location from the
1593      action routines.  */
1594   YYSTYPE yyval;
1595 
1596 #if YYERROR_VERBOSE
1597   /* Buffer for error messages, and its allocated size.  */
1598   char yymsgbuf[128];
1599   char *yymsg = yymsgbuf;
1600   YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1601 #endif
1602 
1603 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1604 
1605   /* The number of symbols on the RHS of the reduced rule.
1606      Keep to zero when no symbol should be popped.  */
1607   int yylen = 0;
1608 
1609   yyssp = yyss = yyssa;
1610   yyvsp = yyvs = yyvsa;
1611   yystacksize = YYINITDEPTH;
1612 
1613   YYDPRINTF ((stderr, "Starting parse\n"));
1614 
1615   yystate = 0;
1616   yyerrstatus = 0;
1617   yynerrs = 0;
1618   yychar = YYEMPTY; /* Cause a token to be read.  */
1619   goto yysetstate;
1620 
1621 /*------------------------------------------------------------.
1622 | yynewstate -- Push a new state, which is found in yystate.  |
1623 `------------------------------------------------------------*/
1624  yynewstate:
1625   /* In all cases, when you get here, the value and location stacks
1626      have just been pushed.  So pushing a state here evens the stacks.  */
1627   yyssp++;
1628 
1629  yysetstate:
1630   *yyssp = yystate;
1631 
1632   if (yyss + yystacksize - 1 <= yyssp)
1633     {
1634       /* Get the current used size of the three stacks, in elements.  */
1635       YYSIZE_T yysize = yyssp - yyss + 1;
1636 
1637 #ifdef yyoverflow
1638       {
1639         /* Give user a chance to reallocate the stack.  Use copies of
1640            these so that the &'s don't force the real ones into
1641            memory.  */
1642         YYSTYPE *yyvs1 = yyvs;
1643         yytype_int16 *yyss1 = yyss;
1644 
1645         /* Each stack pointer address is followed by the size of the
1646            data in use in that stack, in bytes.  This used to be a
1647            conditional around just the two extra args, but that might
1648            be undefined if yyoverflow is a macro.  */
1649         yyoverflow (YY_("memory exhausted"),
1650                     &yyss1, yysize * sizeof (*yyssp),
1651                     &yyvs1, yysize * sizeof (*yyvsp),
1652                     &yystacksize);
1653 
1654         yyss = yyss1;
1655         yyvs = yyvs1;
1656       }
1657 #else /* no yyoverflow */
1658 # ifndef YYSTACK_RELOCATE
1659       goto yyexhaustedlab;
1660 # else
1661       /* Extend the stack our own way.  */
1662       if (YYMAXDEPTH <= yystacksize)
1663         goto yyexhaustedlab;
1664       yystacksize *= 2;
1665       if (YYMAXDEPTH < yystacksize)
1666         yystacksize = YYMAXDEPTH;
1667 
1668       {
1669         yytype_int16 *yyss1 = yyss;
1670         union yyalloc *yyptr =
1671           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1672         if (! yyptr)
1673           goto yyexhaustedlab;
1674         YYSTACK_RELOCATE (yyss_alloc, yyss);
1675         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1676 #  undef YYSTACK_RELOCATE
1677         if (yyss1 != yyssa)
1678           YYSTACK_FREE (yyss1);
1679       }
1680 # endif
1681 #endif /* no yyoverflow */
1682 
1683       yyssp = yyss + yysize - 1;
1684       yyvsp = yyvs + yysize - 1;
1685 
1686       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1687                   (unsigned long int) yystacksize));
1688 
1689       if (yyss + yystacksize - 1 <= yyssp)
1690         YYABORT;
1691     }
1692 
1693   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1694 
1695   if (yystate == YYFINAL)
1696     YYACCEPT;
1697 
1698   goto yybackup;
1699 
1700 /*-----------.
1701 | yybackup.  |
1702 `-----------*/
1703 yybackup:
1704 
1705   /* Do appropriate processing given the current state.  Read a
1706      lookahead token if we need one and don't already have one.  */
1707 
1708   /* First try to decide what to do without reference to lookahead token.  */
1709   yyn = yypact[yystate];
1710   if (yypact_value_is_default (yyn))
1711     goto yydefault;
1712 
1713   /* Not known => get a lookahead token if don't already have one.  */
1714 
1715   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1716   if (yychar == YYEMPTY)
1717     {
1718       YYDPRINTF ((stderr, "Reading a token: "));
1719       yychar = yylex ();
1720     }
1721 
1722   if (yychar <= YYEOF)
1723     {
1724       yychar = yytoken = YYEOF;
1725       YYDPRINTF ((stderr, "Now at end of input.\n"));
1726     }
1727   else
1728     {
1729       yytoken = YYTRANSLATE (yychar);
1730       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1731     }
1732 
1733   /* If the proper action on seeing token YYTOKEN is to reduce or to
1734      detect an error, take that action.  */
1735   yyn += yytoken;
1736   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1737     goto yydefault;
1738   yyn = yytable[yyn];
1739   if (yyn <= 0)
1740     {
1741       if (yytable_value_is_error (yyn))
1742         goto yyerrlab;
1743       yyn = -yyn;
1744       goto yyreduce;
1745     }
1746 
1747   /* Count tokens shifted since error; after three, turn off error
1748      status.  */
1749   if (yyerrstatus)
1750     yyerrstatus--;
1751 
1752   /* Shift the lookahead token.  */
1753   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1754 
1755   /* Discard the shifted token.  */
1756   yychar = YYEMPTY;
1757 
1758   yystate = yyn;
1759   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1760   *++yyvsp = yylval;
1761   YY_IGNORE_MAYBE_UNINITIALIZED_END
1762 
1763   goto yynewstate;
1764 
1765 
1766 /*-----------------------------------------------------------.
1767 | yydefault -- do the default action for the current state.  |
1768 `-----------------------------------------------------------*/
1769 yydefault:
1770   yyn = yydefact[yystate];
1771   if (yyn == 0)
1772     goto yyerrlab;
1773   goto yyreduce;
1774 
1775 
1776 /*-----------------------------.
1777 | yyreduce -- Do a reduction.  |
1778 `-----------------------------*/
1779 yyreduce:
1780   /* yyn is the number of a rule to reduce with.  */
1781   yylen = yyr2[yyn];
1782 
1783   /* If YYLEN is nonzero, implement the default value of the action:
1784      '$$ = $1'.
1785 
1786      Otherwise, the following line sets YYVAL to garbage.
1787      This behavior is undocumented and Bison
1788      users should not rely upon it.  Assigning to YYVAL
1789      unconditionally makes the parser a bit smaller, and it avoids a
1790      GCC warning that YYVAL may be used uninitialized.  */
1791   yyval = yyvsp[1-yylen];
1792 
1793 
1794   YY_REDUCE_PRINT (yyn);
1795   switch (yyn)
1796     {
1797         case 6:
1798 #line 118 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
1799     {
1800 	extern int line_is_a_command;
1801 
1802 	if (scanerror) {
1803 		scanerror = synerrors = 0;
1804 	} else {
1805 		if (! synerrors && ! yynerrs) {
1806 			set_prettyanswer((yyvsp[-1].number));
1807 			num_set(last_answer,(yyvsp[-1].number));
1808 		} else {
1809 			synerrors = 0;
1810 			report_error("Too many errors.");
1811 		}
1812 	}
1813 	num_free((yyvsp[-1].number));
1814 	compute = 1;
1815 	line_is_a_command = 0;
1816 }
1817 #line 1818 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
1818     break;
1819 
1820   case 7:
1821 #line 136 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
1822     {
1823 	extern int line_is_a_command;
1824 
1825 	compute = 1;
1826 	line_is_a_command = 0;
1827 }
1828 #line 1829 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
1829     break;
1830 
1831   case 8:
1832 #line 142 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
1833     {
1834 	extern int line_is_a_command;
1835 
1836 	switch ((yyvsp[-1].cmd)) {
1837 		case redisplay:
1838 			if (! synerrors) {
1839 				set_prettyanswer(last_answer);
1840 			} else {
1841 				synerrors = 0;
1842 				report_error("Too many errors.");
1843 			}
1844 				break;
1845 		case nothing: break;
1846 	}
1847 	compute = 1;
1848 	line_is_a_command = 0;
1849 }
1850 #line 1851 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
1851     break;
1852 
1853   case 9:
1854 #line 160 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
1855     {
1856 	extern int line_is_a_command;
1857 
1858 	if (scanerror) {
1859 		scanerror = synerrors = 0;
1860 	}
1861 	compute = 1;
1862 	line_is_a_command = 0;
1863 }
1864 #line 1865 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
1865     break;
1866 
1867   case 10:
1868 #line 169 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
1869     {
1870 	extern int line_is_a_command;
1871 
1872     /* there is the possibility of lost memory here,
1873      * because "error" has no data type
1874      * (and because I'm passing around *actual* Number's
1875 	 * rather than pointers to them) */
1876     /* report_error("3 Error in scanner halts parser."); */
1877     compute = 1;
1878 	line_is_a_command = 0;
1879 }
1880 #line 1881 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
1881     break;
1882 
1883   case 11:
1884 #line 183 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
1885     { ++lines; }
1886 #line 1887 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
1887     break;
1888 
1889   case 12:
1890 #line 186 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
1891     {
1892 	(yyval.cmd) = isatty(0)?redisplay:nothing;
1893 	conf.output_format = HEXADECIMAL_FORMAT;
1894         display_output_format(HEXADECIMAL_FORMAT); }
1895 #line 1896 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
1896     break;
1897 
1898   case 13:
1899 #line 190 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
1900     {
1901 	(yyval.cmd) = isatty(0)?redisplay:nothing;
1902 	conf.output_format = OCTAL_FORMAT;
1903         display_output_format(OCTAL_FORMAT); }
1904 #line 1905 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
1905     break;
1906 
1907   case 14:
1908 #line 194 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
1909     {
1910 	(yyval.cmd) = isatty(0)?redisplay:nothing;
1911 	conf.output_format = BINARY_FORMAT;
1912         display_output_format(BINARY_FORMAT); }
1913 #line 1914 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
1914     break;
1915 
1916   case 15:
1917 #line 198 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
1918     {
1919 	(yyval.cmd) = isatty(0)?redisplay:nothing;
1920 	conf.output_format = DECIMAL_FORMAT;
1921         display_output_format(DECIMAL_FORMAT); }
1922 #line 1923 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
1923     break;
1924 
1925   case 16:
1926 #line 202 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
1927     {
1928 	if (strcmp((yyvsp[0].variable), pretty_answer)) {
1929                 fprintf(stderr, "Assertion on line %u:\n", lines);
1930 		fprintf(stderr, "   Pretty Answer is: '%s'\n", pretty_answer);
1931 		fprintf(stderr, "...should have been: '%s'\n", (yyvsp[0].variable));
1932 		exit(EXIT_FAILURE);
1933 	}
1934 	free((yyvsp[0].variable));
1935 }
1936 #line 1937 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
1937     break;
1938 
1939   case 17:
1940 #line 211 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
1941     {
1942 	(yyval.cmd) = nothing;
1943 	if (conf.thou_delimiter != (yyvsp[0].character)) {
1944             conf.dec_delimiter = (yyvsp[0].character);
1945 	    display_status("%c is now the decimal separator.", (yyvsp[0].character));
1946 	} else {
1947             extern int column;
1948             column --;
1949 	    report_error("%c cannot be the decimal separator. It is the thousands separator.", (yyvsp[0].character));
1950 	}}
1951 #line 1952 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
1952     break;
1953 
1954   case 18:
1955 #line 221 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
1956     {
1957 	(yyval.cmd) = nothing;
1958 	if (conf.in_thou_delimiter != (yyvsp[0].character) && (conf.in_thou_delimiter != 0 || conf.thou_delimiter != (yyvsp[0].character))) {
1959 	    conf.in_dec_delimiter = (yyvsp[0].character);
1960 	    display_status("%c is now the decimal separator for input.\n", (yyvsp[0].character));
1961 	} else {
1962             extern int column;
1963             column --;
1964 	    report_error("%c cannot be the decimal separator. It is the thousands separator.\n", (yyvsp[0].character));
1965 	}}
1966 #line 1967 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
1967     break;
1968 
1969   case 19:
1970 #line 231 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
1971     {
1972 	(yyval.cmd) = nothing;
1973 	if (conf.dec_delimiter != (yyvsp[0].character)) {
1974 	    conf.thou_delimiter = (yyvsp[0].character);
1975 	    display_status("%c is now the thousands separator.\n", (yyvsp[0].character));
1976 	} else if (standard_output) {
1977             extern int column;
1978             column --;
1979 	    report_error("%c cannot be the thousands separator. It is the decimal separator.\n", (yyvsp[0].character));
1980 	}}
1981 #line 1982 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
1982     break;
1983 
1984   case 20:
1985 #line 241 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
1986     {
1987 	(yyval.cmd) = nothing;
1988 	if (conf.in_dec_delimiter != (yyvsp[0].character) && (conf.in_dec_delimiter != 0 || conf.dec_delimiter != (yyvsp[0].character))) {
1989 	    conf.in_thou_delimiter = (yyvsp[0].character);
1990 	    display_status("%c is now the thousands separator for input.\n", (yyvsp[0].character));
1991 	} else  {
1992             extern int column;
1993             column --;
1994 	    report_error("%c cannot be the thousands separator. It is the decimal separator.\n", (yyvsp[0].character));
1995 	}
1996 }
1997 #line 1998 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
1998     break;
1999 
2000   case 21:
2001 #line 252 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2002     {
2003 	(yyval.cmd) = nothing;
2004 	conf.print_commas = ! conf.print_commas;
2005 	display_status("Will %sshow separators when printing large numbers.\n",conf.print_commas?"":"not ");
2006 }
2007 #line 2008 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2008     break;
2009 
2010   case 22:
2011 #line 257 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2012     {
2013 	(yyval.cmd) = nothing;
2014 	conf.print_ints = ! conf.print_ints;
2015 	display_status("Will %suse abbreviations for large integers.\n",conf.print_ints?"not ":"");
2016 }
2017 #line 2018 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2018     break;
2019 
2020   case 23:
2021 #line 263 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2022     {
2023 	(yyval.cmd) = nothing;
2024 	conf.verbose = ! conf.verbose;
2025 	display_status("Will %secho the lines to be evaluated.\n",conf.verbose?"":"not ");
2026 }
2027 #line 2028 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2028     break;
2029 
2030   case 24:
2031 #line 268 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2032     {
2033         display_prefs();
2034 	(yyval.cmd) = nothing;
2035 }
2036 #line 2037 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2037     break;
2038 
2039   case 25:
2040 #line 272 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2041     {
2042 	(yyval.cmd) = nothing;
2043 	conf.use_radians = ! conf.use_radians;
2044 	display_status("Now Using %s\n", conf.use_radians?"Radians":"Degrees");}
2045 #line 2046 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2046     break;
2047 
2048   case 26:
2049 #line 276 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2050     {
2051 	(yyval.cmd) = nothing;
2052         switch ((yyvsp[0].integer)) {
2053             case 0: conf.precision_guard = 0; break;
2054             case 1: conf.precision_guard = 1; break;
2055             case -1: conf.precision_guard = ! conf.precision_guard; break;
2056         }
2057 	display_status("Now %sUsing Conservative Precision\n", conf.precision_guard?"":"Not ");}
2058 #line 2059 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2059     break;
2060 
2061   case 27:
2062 #line 284 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2063     {
2064 	(yyval.cmd) = isatty(0)?redisplay:nothing;
2065 	conf.precision = (yyvsp[0].integer);
2066         if (conf.precision == -1) {
2067             display_status("Precision = auto");
2068         } else {
2069             display_status("Precision = %i", conf.precision);
2070         } }
2071 #line 2072 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2072     break;
2073 
2074   case 28:
2075 #line 292 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2076     {
2077     (yyval.cmd) = nothing;
2078 	if ((yyvsp[0].integer)) {
2079 		conf.history_limit = 1;
2080 		conf.history_limit_len = (yyvsp[0].integer);
2081 	} else {
2082 		conf.history_limit = 0;
2083 		conf.history_limit_len = 0;
2084 	}
2085 }
2086 #line 2087 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2087     break;
2088 
2089   case 29:
2090 #line 302 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2091     {
2092 	printvariables();
2093 	(yyval.cmd) = nothing;
2094 }
2095 #line 2096 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2096     break;
2097 
2098   case 30:
2099 #line 306 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2100     {
2101 	if ((yyvsp[0].integer) < 0) {
2102 		switch (conf.engineering) {
2103 			case always: conf.engineering = never; break;
2104 			case never: conf.engineering = automatic; break;
2105 			case automatic: conf.engineering = always; break;
2106 		}
2107 	} else {
2108 		switch((yyvsp[0].integer)) {
2109 			case 1: conf.engineering = automatic; break;
2110 			case 2: conf.engineering = always; break;
2111 			case 3: conf.engineering = never; break;
2112 		}
2113 	}
2114 	display_status("Engineering notation is %s\n",(conf.engineering==always)?"always used":(conf.engineering==never)?"never used":"used if convenient");
2115 	(yyval.cmd) = isatty(0)?redisplay:nothing;
2116 }
2117 #line 2118 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2118     break;
2119 
2120   case 31:
2121 #line 323 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2122     {
2123 	(yyval.cmd) = nothing;
2124 	if ((yyvsp[0].integer) != -1)
2125 		conf.rounding_indication = (yyvsp[0].integer);
2126 	else {
2127 		conf.rounding_indication += 1;
2128 		conf.rounding_indication %= 3;
2129 	}
2130 	display_status("Will display %s rounding indication",
2131 		(conf.rounding_indication==NO_ROUNDING_INDICATION)?"no":
2132                 ((conf.rounding_indication==SIMPLE_ROUNDING_INDICATION)?"simple":"significant figure"));
2133 }
2134 #line 2135 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2135     break;
2136 
2137   case 32:
2138 #line 335 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2139     {
2140 	(yyval.cmd) = nothing;
2141 	conf.print_prefixes = ! conf.print_prefixes;
2142 	display_status("Will %sprint number prefixes\n",conf.print_prefixes?"":"not ");
2143 }
2144 #line 2145 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2145     break;
2146 
2147   case 33:
2148 #line 340 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2149     {
2150 	(yyval.cmd) = nothing;
2151 	conf.remember_errors = ! conf.remember_errors;
2152 	display_status("Statements that produce errors are %s.\n",conf.remember_errors?"recorded":"forgotten");
2153 }
2154 #line 2155 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2155     break;
2156 
2157   case 34:
2158 #line 345 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2159     {
2160 	(yyval.cmd) = nothing;
2161 	display_interactive_help();
2162 }
2163 #line 2164 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2164     break;
2165 
2166   case 35:
2167 #line 349 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2168     {
2169 	extern char* open_file;
2170 	int i;
2171 	unsigned int len = strlen((yyvsp[0].variable))+1;
2172 	open_file = malloc(len);
2173         strncpy(open_file, (yyvsp[0].variable), len);
2174 	/* strip trailing spaces */
2175 	for (i=strlen(open_file)-1;i>=0;i--) {
2176 		if (open_file[i] != ' ') break;
2177 		open_file[i] = 0;
2178 	}
2179 	if (strlen(open_file) == 0) {
2180 		free(open_file);
2181 		open_file = NULL;
2182 		report_error("Please specify a file name to open.");
2183 	}
2184 	(yyval.cmd) = nothing;
2185 }
2186 #line 2187 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2187     break;
2188 
2189   case 36:
2190 #line 367 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2191     {
2192 	int retval;
2193 	retval = saveState((yyvsp[0].variable));
2194 	if (retval) {
2195 		report_error("Could not save file. (%s)", (char*)strerror(retval));
2196 	}
2197 	(yyval.cmd) = nothing;
2198 }
2199 #line 2200 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2200     break;
2201 
2202   case 37:
2203 #line 375 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2204     {
2205 	if ((yyvsp[0].integer) < NUM_PREC_MIN) {
2206 		report_error("Minimum precision is %lu (you asked for %lu).\n", (unsigned long)NUM_PREC_MIN, (yyvsp[0].integer));
2207 	} else if ((yyvsp[0].integer) > NUM_PREC_MAX) {
2208 		report_error("Maximum precision is %lu (you asked for %lu).\n", (unsigned long)NUM_PREC_MAX, (yyvsp[0].integer));
2209 	} else {
2210 		num_set_default_prec((yyvsp[0].integer));
2211 	}
2212 	(yyval.cmd) = nothing;
2213 }
2214 #line 2215 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2215     break;
2216 
2217   case 38:
2218 #line 386 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2219     {
2220 	int category = identify_units((yyvsp[0].conver).u1,(yyvsp[0].conver).u2);
2221 	switch (category) {
2222 		case -1:
2223 			report_error("Units must be in the same category.");
2224 			break;
2225 		case -2:
2226 			report_error("Units provided are not recognized.");
2227 			break;
2228 		case -3:
2229 			report_error("First unit provided was not recognized (%s).", (yyvsp[0].conver).u1);
2230 			break;
2231 		case -4:
2232 			report_error("Second unit provided was not recognized (%s).", (yyvsp[0].conver).u2);
2233 			break;
2234 		default:
2235 			uber_conversion(last_answer,category,unit_id(category,(yyvsp[0].conver).u1),unit_id(category,(yyvsp[0].conver).u2),last_answer);
2236 	}
2237 	free((yyvsp[0].conver).u1);
2238 	free((yyvsp[0].conver).u2);
2239 	(yyval.cmd) = redisplay;
2240 }
2241 #line 2242 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2242     break;
2243 
2244   case 39:
2245 #line 409 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2246     {
2247 	if ((yyvsp[0].integer) >= 2 && (yyvsp[0].integer) <= 36) {
2248 		char * str, junk;
2249 		str = num_to_str_complex(last_answer, (yyvsp[0].integer), conf.engineering, -1, conf.print_prefixes, &junk);
2250 		display_status("base %i: %s\n",(yyvsp[0].integer),str);
2251 	} else {
2252 		report_error("Base must be greater than one and less than 37.");
2253 	}
2254 	(yyval.cmd) = nothing;
2255 }
2256 #line 2257 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2257     break;
2258 
2259   case 40:
2260 #line 420 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2261     {
2262 	int retval = storeVar((yyvsp[0].variable));
2263 	if (retval == 0) {
2264 		display_status("successfully stored %s\n",(yyvsp[0].variable));
2265 	} else {
2266 		report_error("Failure to store variable!");
2267 	}
2268 	free((yyvsp[0].variable));
2269 }
2270 #line 2271 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2271     break;
2272 
2273   case 41:
2274 #line 430 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2275     {
2276 	(yyval.cmd) = nothing;
2277 	conf.c_style_mod = ! conf.c_style_mod;
2278 	display_status("The mod (%%) operation will %sbehave like it does in the C programming language.\n",conf.c_style_mod?"":"not ");
2279 }
2280 #line 2281 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2281     break;
2282 
2283   case 42:
2284 #line 437 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2285     {
2286 			   (yyval.variable) = (yyvsp[0].variable);
2287 			   }
2288 #line 2289 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2289     break;
2290 
2291   case 43:
2292 #line 440 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2293     {
2294 			   (yyval.variable) = NULL;
2295 			   }
2296 #line 2297 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2297     break;
2298 
2299   case 44:
2300 #line 446 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2301     {
2302 	if (compute && ! scanerror) {
2303 		/* if standard_error, q is reserved */
2304 		if (standard_output && !strcmp((yyvsp[-2].variable),"q")) {
2305 			report_error("q cannot be assigned a value. q is used to exit.");
2306 		} else {
2307 			if (putval((yyvsp[-2].variable),(yyvsp[-1].number),(yyvsp[0].variable)) == 0) {
2308                                 display_val((yyvsp[-2].variable));
2309 			} else {
2310 				report_error("There was a problem assigning the value.");
2311 			}
2312 		}
2313 		num_free((yyvsp[-1].number));
2314 	} else {
2315 		scanerror = 0;
2316 		report_error("Scanner error halts parser.");
2317 	}
2318 	free((yyvsp[-2].variable));
2319 	if ((yyvsp[0].variable) != NULL) {
2320 		free((yyvsp[0].variable));
2321 	}
2322 }
2323 #line 2324 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2324     break;
2325 
2326   case 45:
2327 #line 469 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2328     {
2329 	if (compute && ! scanerror) {
2330 		if (standard_output && !strcmp((yyvsp[-2].variable),"q")) {
2331 			report_error("q cannot be assigned an expression. q is used to exit.");
2332 		} else {
2333 			if (putexp((yyvsp[-2].variable),(yyvsp[-1].variable),(yyvsp[0].variable)) == 0) {
2334                                 display_val((yyvsp[-2].variable));
2335 			} else {
2336 				report_error("There was a problem assigning the expression.");
2337 			}
2338 		}
2339 	} else {
2340 		scanerror = 0;
2341 		report_error("Scanner error halts parser.");
2342 	}
2343 	free((yyvsp[-2].variable));
2344 	free((yyvsp[-1].variable));
2345 	if ((yyvsp[0].variable) != NULL) {
2346 		free((yyvsp[0].variable));
2347 	}
2348 }
2349 #line 2350 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2350     break;
2351 
2352   case 46:
2353 #line 491 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2354     {
2355 	report_error("Constants cannot be assigned to other values.");
2356 	num_free((yyvsp[-1].number));
2357 	if ((yyvsp[0].variable) != NULL) {
2358 		free((yyvsp[0].variable));
2359 	}
2360 }
2361 #line 2362 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2362     break;
2363 
2364   case 47:
2365 #line 499 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2366     {
2367 	report_error("Constants cannot be assigned to other values.");
2368 	free((yyvsp[-1].variable));
2369 	if ((yyvsp[0].variable) != NULL) {
2370 		free((yyvsp[0].variable));
2371 	}
2372 }
2373 #line 2374 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2374     break;
2375 
2376   case 48:
2377 #line 508 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2378     { num_init((yyval.number)); simple_exp((yyval.number), (yyvsp[-2].number), wminus, (yyvsp[0].number)); num_free((yyvsp[-2].number)); num_free((yyvsp[0].number)); }
2379 #line 2380 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2380     break;
2381 
2382   case 49:
2383 #line 509 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2384     { num_init((yyval.number)); simple_exp((yyval.number), (yyvsp[-2].number), wplus, (yyvsp[0].number)); num_free((yyvsp[-2].number)); num_free((yyvsp[0].number)); }
2385 #line 2386 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2386     break;
2387 
2388   case 50:
2389 #line 510 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2390     { num_init((yyval.number)); simple_exp((yyval.number), (yyvsp[-2].number), wand, (yyvsp[0].number)); num_free((yyvsp[-2].number)); num_free((yyvsp[0].number)); }
2391 #line 2392 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2392     break;
2393 
2394   case 51:
2395 #line 511 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2396     { num_init((yyval.number)); simple_exp((yyval.number), (yyvsp[-2].number), wor, (yyvsp[0].number)); num_free((yyvsp[-2].number)); num_free((yyvsp[0].number)); }
2397 #line 2398 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2398     break;
2399 
2400   case 52:
2401 #line 512 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2402     { num_init((yyval.number)); simple_exp((yyval.number), (yyvsp[-2].number), wbor, (yyvsp[0].number)); num_free((yyvsp[-2].number)); num_free((yyvsp[0].number)); }
2403 #line 2404 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2404     break;
2405 
2406   case 53:
2407 #line 513 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2408     { num_init((yyval.number)); simple_exp((yyval.number), (yyvsp[-2].number), wbxor, (yyvsp[0].number)); num_free((yyvsp[-2].number)); num_free((yyvsp[0].number)); }
2409 #line 2410 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2410     break;
2411 
2412   case 54:
2413 #line 514 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2414     { num_init((yyval.number)); simple_exp((yyval.number), (yyvsp[-2].number), wband, (yyvsp[0].number)); num_free((yyvsp[-2].number)); num_free((yyvsp[0].number)); }
2415 #line 2416 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2416     break;
2417 
2418   case 55:
2419 #line 515 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2420     { num_init((yyval.number)); simple_exp((yyval.number), (yyvsp[-2].number), wequal, (yyvsp[0].number)); num_free((yyvsp[-2].number)); num_free((yyvsp[0].number)); }
2421 #line 2422 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2422     break;
2423 
2424   case 56:
2425 #line 516 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2426     { num_init((yyval.number)); simple_exp((yyval.number), (yyvsp[-2].number), wnequal, (yyvsp[0].number)); num_free((yyvsp[-2].number)); num_free((yyvsp[0].number)); }
2427 #line 2428 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2428     break;
2429 
2430   case 57:
2431 #line 517 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2432     { num_init((yyval.number)); simple_exp((yyval.number), (yyvsp[-2].number), wgt, (yyvsp[0].number)); num_free((yyvsp[-2].number)); num_free((yyvsp[0].number)); }
2433 #line 2434 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2434     break;
2435 
2436   case 58:
2437 #line 518 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2438     { num_init((yyval.number)); simple_exp((yyval.number), (yyvsp[-2].number), wlt, (yyvsp[0].number)); num_free((yyvsp[-2].number)); num_free((yyvsp[0].number)); }
2439 #line 2440 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2440     break;
2441 
2442   case 59:
2443 #line 519 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2444     { num_init((yyval.number)); simple_exp((yyval.number), (yyvsp[-2].number), wgeq, (yyvsp[0].number)); num_free((yyvsp[-2].number)); num_free((yyvsp[0].number)); }
2445 #line 2446 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2446     break;
2447 
2448   case 60:
2449 #line 520 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2450     { num_init((yyval.number)); simple_exp((yyval.number), (yyvsp[-2].number), wleq, (yyvsp[0].number)); num_free((yyvsp[-2].number)); num_free((yyvsp[0].number)); }
2451 #line 2452 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2452     break;
2453 
2454   case 61:
2455 #line 521 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2456     { num_init((yyval.number)); simple_exp((yyval.number), (yyvsp[-2].number), wlshft, (yyvsp[0].number)); num_free((yyvsp[-2].number)); num_free((yyvsp[0].number)); }
2457 #line 2458 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2458     break;
2459 
2460   case 62:
2461 #line 522 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2462     { num_init((yyval.number)); simple_exp((yyval.number), (yyvsp[-2].number), wrshft, (yyvsp[0].number)); num_free((yyvsp[-2].number)); num_free((yyvsp[0].number)); }
2463 #line 2464 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2464     break;
2465 
2466   case 63:
2467 #line 523 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2468     { num_init((yyval.number)); simple_exp((yyval.number), (yyvsp[-2].number), wmult, (yyvsp[0].number)); num_free((yyvsp[-2].number)); num_free((yyvsp[0].number)); }
2469 #line 2470 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2470     break;
2471 
2472   case 64:
2473 #line 524 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2474     { num_init((yyval.number)); simple_exp((yyval.number), (yyvsp[-2].number), wdiv, (yyvsp[0].number)); num_free((yyvsp[-2].number)); num_free((yyvsp[0].number)); }
2475 #line 2476 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2476     break;
2477 
2478   case 65:
2479 #line 525 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2480     { num_init((yyval.number)); simple_exp((yyval.number), (yyvsp[-2].number), wmod, (yyvsp[0].number)); num_free((yyvsp[-2].number)); num_free((yyvsp[0].number)); }
2481 #line 2482 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2482     break;
2483 
2484   case 67:
2485 #line 529 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2486     { (yyval.function) = wsin; }
2487 #line 2488 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2488     break;
2489 
2490   case 68:
2491 #line 530 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2492     { (yyval.function) = wcos; }
2493 #line 2494 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2494     break;
2495 
2496   case 69:
2497 #line 531 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2498     { (yyval.function) = wtan; }
2499 #line 2500 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2500     break;
2501 
2502   case 70:
2503 #line 532 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2504     { (yyval.function) = wcot; }
2505 #line 2506 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2506     break;
2507 
2508   case 71:
2509 #line 533 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2510     { (yyval.function) = wsec; }
2511 #line 2512 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2512     break;
2513 
2514   case 72:
2515 #line 534 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2516     { (yyval.function) = wcsc; }
2517 #line 2518 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2518     break;
2519 
2520   case 73:
2521 #line 535 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2522     { (yyval.function) = wasin; }
2523 #line 2524 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2524     break;
2525 
2526   case 74:
2527 #line 536 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2528     { (yyval.function) = wacos; }
2529 #line 2530 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2530     break;
2531 
2532   case 75:
2533 #line 537 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2534     { (yyval.function) = watan; }
2535 #line 2536 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2536     break;
2537 
2538   case 76:
2539 #line 538 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2540     { (yyval.function) = wacot; }
2541 #line 2542 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2542     break;
2543 
2544   case 77:
2545 #line 539 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2546     { (yyval.function) = wasec; }
2547 #line 2548 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2548     break;
2549 
2550   case 78:
2551 #line 540 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2552     { (yyval.function) = wacsc; }
2553 #line 2554 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2554     break;
2555 
2556   case 79:
2557 #line 541 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2558     { (yyval.function) = wsinh; }
2559 #line 2560 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2560     break;
2561 
2562   case 80:
2563 #line 542 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2564     { (yyval.function) = wcosh; }
2565 #line 2566 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2566     break;
2567 
2568   case 81:
2569 #line 543 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2570     { (yyval.function) = wtanh; }
2571 #line 2572 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2572     break;
2573 
2574   case 82:
2575 #line 544 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2576     { (yyval.function) = wcoth; }
2577 #line 2578 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2578     break;
2579 
2580   case 83:
2581 #line 545 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2582     { (yyval.function) = wsech; }
2583 #line 2584 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2584     break;
2585 
2586   case 84:
2587 #line 546 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2588     { (yyval.function) = wcsch; }
2589 #line 2590 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2590     break;
2591 
2592   case 85:
2593 #line 547 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2594     { (yyval.function) = wasinh; }
2595 #line 2596 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2596     break;
2597 
2598   case 86:
2599 #line 548 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2600     { (yyval.function) = wacosh; }
2601 #line 2602 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2602     break;
2603 
2604   case 87:
2605 #line 549 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2606     { (yyval.function) = watanh; }
2607 #line 2608 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2608     break;
2609 
2610   case 88:
2611 #line 550 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2612     { (yyval.function) = wacoth; }
2613 #line 2614 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2614     break;
2615 
2616   case 89:
2617 #line 551 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2618     { (yyval.function) = wasech; }
2619 #line 2620 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2620     break;
2621 
2622   case 90:
2623 #line 552 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2624     { (yyval.function) = wacsch; }
2625 #line 2626 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2626     break;
2627 
2628   case 91:
2629 #line 553 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2630     { (yyval.function) = wlog; }
2631 #line 2632 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2632     break;
2633 
2634   case 92:
2635 #line 554 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2636     { (yyval.function) = wlogtwo; }
2637 #line 2638 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2638     break;
2639 
2640   case 93:
2641 #line 555 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2642     { (yyval.function) = wln; }
2643 #line 2644 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2644     break;
2645 
2646   case 94:
2647 #line 556 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2648     { (yyval.function) = wround; }
2649 #line 2650 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2650     break;
2651 
2652   case 95:
2653 #line 557 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2654     { (yyval.function) = wabs; }
2655 #line 2656 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2656     break;
2657 
2658   case 96:
2659 #line 558 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2660     { (yyval.function) = wsqrt; }
2661 #line 2662 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2662     break;
2663 
2664   case 97:
2665 #line 559 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2666     { (yyval.function) = wexp; }
2667 #line 2668 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2668     break;
2669 
2670   case 98:
2671 #line 560 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2672     { (yyval.function) = wfloor; }
2673 #line 2674 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2674     break;
2675 
2676   case 99:
2677 #line 561 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2678     { (yyval.function) = wceil; }
2679 #line 2680 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2680     break;
2681 
2682   case 100:
2683 #line 562 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2684     { (yyval.function) = wcbrt; }
2685 #line 2686 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2686     break;
2687 
2688   case 101:
2689 #line 563 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2690     { (yyval.function) = wrand; }
2691 #line 2692 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2692     break;
2693 
2694   case 102:
2695 #line 564 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2696     { (yyval.function) = wirand; }
2697 #line 2698 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2698     break;
2699 
2700   case 103:
2701 #line 565 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2702     { (yyval.function) = wbnot; }
2703 #line 2704 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2704     break;
2705 
2706   case 104:
2707 #line 566 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2708     { (yyval.function) = wnot; }
2709 #line 2710 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2710     break;
2711 
2712   case 105:
2713 #line 567 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2714     { (yyval.function) = wfact; }
2715 #line 2716 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2716     break;
2717 
2718   case 106:
2719 #line 568 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2720     { (yyval.function) = wcomp; }
2721 #line 2722 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2722     break;
2723 
2724   case 107:
2725 #line 569 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2726     { (yyval.function) = weint; }
2727 #line 2728 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2728     break;
2729 
2730   case 108:
2731 #line 570 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2732     { (yyval.function) = wgamma; }
2733 #line 2734 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2734     break;
2735 
2736   case 109:
2737 #line 571 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2738     { (yyval.function) = wlngamma; }
2739 #line 2740 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2740     break;
2741 
2742   case 110:
2743 #line 572 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2744     { (yyval.function) = wzeta; }
2745 #line 2746 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2746     break;
2747 
2748   case 111:
2749 #line 573 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2750     { (yyval.function) = wsinc; }
2751 #line 2752 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2752     break;
2753 
2754   case 115:
2755 #line 581 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2756     { (yyval.integer) = -1; }
2757 #line 2758 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2758     break;
2759 
2760   case 116:
2761 #line 582 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2762     { (yyval.integer) = 1; }
2763 #line 2764 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2764     break;
2765 
2766   case 117:
2767 #line 583 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2768     { (yyval.integer) = 1; }
2769 #line 2770 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2770     break;
2771 
2772   case 119:
2773 #line 587 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2774     { num_init((yyval.number));
2775 		     num_mul((yyvsp[-1].number),(yyvsp[-1].number),(yyvsp[0].number));
2776 		     num_mul_si((yyval.number),(yyvsp[-1].number),(yyvsp[-2].integer));
2777 		     num_free((yyvsp[-1].number));
2778 		     num_free((yyvsp[0].number)); }
2779 #line 2780 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2780     break;
2781 
2782   case 120:
2783 #line 594 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2784     {
2785      num_init_set((yyval.number),(yyvsp[-1].number));
2786      num_free((yyvsp[-1].number));
2787      num_free((yyvsp[0].number));
2788 }
2789 #line 2790 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2790     break;
2791 
2792   case 121:
2793 #line 599 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2794     { num_init_set_ui((yyval.number),1); }
2795 #line 2796 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2796     break;
2797 
2798   case 122:
2799 #line 602 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2800     { num_init((yyval.number));
2801                         simple_exp((yyval.number),(yyvsp[-1].number),wmult,(yyvsp[0].number));
2802 			num_free((yyvsp[-1].number));
2803 			num_free((yyvsp[0].number));}
2804 #line 2805 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2805     break;
2806 
2807   case 123:
2808 #line 606 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2809     { num_init((yyval.number));
2810 				  num_mul_si((yyvsp[-1].number),(yyvsp[-1].number),(yyvsp[-2].integer));
2811 				  num_pow((yyvsp[-4].number),(yyvsp[-4].number),(yyvsp[-1].number));
2812 				  num_mul((yyval.number),(yyvsp[-4].number),(yyvsp[0].number));
2813 				  num_free((yyvsp[-4].number));
2814 				  num_free((yyvsp[-1].number));
2815 				  num_free((yyvsp[0].number));}
2816 #line 2817 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2817     break;
2818 
2819   case 124:
2820 #line 616 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2821     { num_init((yyval.number)); num_set((yyval.number),(yyvsp[-1].number)); num_free((yyvsp[-1].number)); }
2822 #line 2823 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2823     break;
2824 
2825   case 125:
2826 #line 618 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2827     { num_init((yyval.number)); num_set((yyval.number),(yyvsp[-1].number)); num_free((yyvsp[-1].number)); }
2828 #line 2829 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2829     break;
2830 
2831   case 126:
2832 #line 620 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2833     { num_init((yyval.number)); num_set((yyval.number),(yyvsp[-1].number)); num_free((yyvsp[-1].number)); }
2834 #line 2835 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2835     break;
2836 
2837   case 127:
2838 #line 621 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2839     { num_init_set_ui((yyval.number),0); }
2840 #line 2841 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2841     break;
2842 
2843   case 128:
2844 #line 625 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2845     { num_init((yyval.number)); num_set((yyval.number),(yyvsp[0].number)); num_free((yyvsp[0].number)); }
2846 #line 2847 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2847     break;
2848 
2849   case 130:
2850 #line 628 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2851     {
2852 	   num_init((yyval.number));
2853 	   num_factorial((yyval.number),num_get_ui((yyvsp[-1].number)));
2854 	   num_free((yyvsp[-1].number));
2855 	   }
2856 #line 2857 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2857     break;
2858 
2859   case 131:
2860 #line 633 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2861     { num_init((yyval.number)); num_sqr((yyval.number),(yyvsp[-1].number)); num_free((yyvsp[-1].number)); }
2862 #line 2863 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2863     break;
2864 
2865   case 132:
2866 #line 635 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2867     {
2868 	   num_init((yyval.number));
2869 	   uber_function((yyval.number),(yyvsp[-1].function),(yyvsp[0].number));
2870 	   num_free((yyvsp[0].number));
2871 	   }
2872 #line 2873 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2873     break;
2874 
2875   case 133:
2876 #line 641 "../../../svn/src/common/parser.y" /* yacc.c:1646  */
2877     {
2878 	   num_init((yyval.number));
2879 	   num_mul_si((yyvsp[0].number),(yyvsp[0].number),(yyvsp[-1].integer));
2880 	   uber_function((yyval.number),(yyvsp[-2].function),(yyvsp[0].number));
2881 	   num_free((yyvsp[0].number));
2882 	   }
2883 #line 2884 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2884     break;
2885 
2886 
2887 #line 2888 "../../../svn/src/common/parser.c" /* yacc.c:1646  */
2888       default: break;
2889     }
2890   /* User semantic actions sometimes alter yychar, and that requires
2891      that yytoken be updated with the new translation.  We take the
2892      approach of translating immediately before every use of yytoken.
2893      One alternative is translating here after every semantic action,
2894      but that translation would be missed if the semantic action invokes
2895      YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2896      if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
2897      incorrect destructor might then be invoked immediately.  In the
2898      case of YYERROR or YYBACKUP, subsequent parser actions might lead
2899      to an incorrect destructor call or verbose syntax error message
2900      before the lookahead is translated.  */
2901   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2902 
2903   YYPOPSTACK (yylen);
2904   yylen = 0;
2905   YY_STACK_PRINT (yyss, yyssp);
2906 
2907   *++yyvsp = yyval;
2908 
2909   /* Now 'shift' the result of the reduction.  Determine what state
2910      that goes to, based on the state we popped back to and the rule
2911      number reduced by.  */
2912 
2913   yyn = yyr1[yyn];
2914 
2915   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2916   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2917     yystate = yytable[yystate];
2918   else
2919     yystate = yydefgoto[yyn - YYNTOKENS];
2920 
2921   goto yynewstate;
2922 
2923 
2924 /*--------------------------------------.
2925 | yyerrlab -- here on detecting error.  |
2926 `--------------------------------------*/
2927 yyerrlab:
2928   /* Make sure we have latest lookahead translation.  See comments at
2929      user semantic actions for why this is necessary.  */
2930   yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2931 
2932   /* If not already recovering from an error, report this error.  */
2933   if (!yyerrstatus)
2934     {
2935       ++yynerrs;
2936 #if ! YYERROR_VERBOSE
2937       yyerror (YY_("syntax error"));
2938 #else
2939 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2940                                         yyssp, yytoken)
2941       {
2942         char const *yymsgp = YY_("syntax error");
2943         int yysyntax_error_status;
2944         yysyntax_error_status = YYSYNTAX_ERROR;
2945         if (yysyntax_error_status == 0)
2946           yymsgp = yymsg;
2947         else if (yysyntax_error_status == 1)
2948           {
2949             if (yymsg != yymsgbuf)
2950               YYSTACK_FREE (yymsg);
2951             yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2952             if (!yymsg)
2953               {
2954                 yymsg = yymsgbuf;
2955                 yymsg_alloc = sizeof yymsgbuf;
2956                 yysyntax_error_status = 2;
2957               }
2958             else
2959               {
2960                 yysyntax_error_status = YYSYNTAX_ERROR;
2961                 yymsgp = yymsg;
2962               }
2963           }
2964         yyerror (yymsgp);
2965         if (yysyntax_error_status == 2)
2966           goto yyexhaustedlab;
2967       }
2968 # undef YYSYNTAX_ERROR
2969 #endif
2970     }
2971 
2972 
2973 
2974   if (yyerrstatus == 3)
2975     {
2976       /* If just tried and failed to reuse lookahead token after an
2977          error, discard it.  */
2978 
2979       if (yychar <= YYEOF)
2980         {
2981           /* Return failure if at end of input.  */
2982           if (yychar == YYEOF)
2983             YYABORT;
2984         }
2985       else
2986         {
2987           yydestruct ("Error: discarding",
2988                       yytoken, &yylval);
2989           yychar = YYEMPTY;
2990         }
2991     }
2992 
2993   /* Else will try to reuse lookahead token after shifting the error
2994      token.  */
2995   goto yyerrlab1;
2996 
2997 
2998 /*---------------------------------------------------.
2999 | yyerrorlab -- error raised explicitly by YYERROR.  |
3000 `---------------------------------------------------*/
3001 yyerrorlab:
3002 
3003   /* Pacify compilers like GCC when the user code never invokes
3004      YYERROR and the label yyerrorlab therefore never appears in user
3005      code.  */
3006   if (/*CONSTCOND*/ 0)
3007      goto yyerrorlab;
3008 
3009   /* Do not reclaim the symbols of the rule whose action triggered
3010      this YYERROR.  */
3011   YYPOPSTACK (yylen);
3012   yylen = 0;
3013   YY_STACK_PRINT (yyss, yyssp);
3014   yystate = *yyssp;
3015   goto yyerrlab1;
3016 
3017 
3018 /*-------------------------------------------------------------.
3019 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
3020 `-------------------------------------------------------------*/
3021 yyerrlab1:
3022   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
3023 
3024   for (;;)
3025     {
3026       yyn = yypact[yystate];
3027       if (!yypact_value_is_default (yyn))
3028         {
3029           yyn += YYTERROR;
3030           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
3031             {
3032               yyn = yytable[yyn];
3033               if (0 < yyn)
3034                 break;
3035             }
3036         }
3037 
3038       /* Pop the current state because it cannot handle the error token.  */
3039       if (yyssp == yyss)
3040         YYABORT;
3041 
3042 
3043       yydestruct ("Error: popping",
3044                   yystos[yystate], yyvsp);
3045       YYPOPSTACK (1);
3046       yystate = *yyssp;
3047       YY_STACK_PRINT (yyss, yyssp);
3048     }
3049 
3050   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
3051   *++yyvsp = yylval;
3052   YY_IGNORE_MAYBE_UNINITIALIZED_END
3053 
3054 
3055   /* Shift the error token.  */
3056   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
3057 
3058   yystate = yyn;
3059   goto yynewstate;
3060 
3061 
3062 /*-------------------------------------.
3063 | yyacceptlab -- YYACCEPT comes here.  |
3064 `-------------------------------------*/
3065 yyacceptlab:
3066   yyresult = 0;
3067   goto yyreturn;
3068 
3069 /*-----------------------------------.
3070 | yyabortlab -- YYABORT comes here.  |
3071 `-----------------------------------*/
3072 yyabortlab:
3073   yyresult = 1;
3074   goto yyreturn;
3075 
3076 #if !defined yyoverflow || YYERROR_VERBOSE
3077 /*-------------------------------------------------.
3078 | yyexhaustedlab -- memory exhaustion comes here.  |
3079 `-------------------------------------------------*/
3080 yyexhaustedlab:
3081   yyerror (YY_("memory exhausted"));
3082   yyresult = 2;
3083   /* Fall through.  */
3084 #endif
3085 
3086 yyreturn:
3087   if (yychar != YYEMPTY)
3088     {
3089       /* Make sure we have latest lookahead translation.  See comments at
3090          user semantic actions for why this is necessary.  */
3091       yytoken = YYTRANSLATE (yychar);
3092       yydestruct ("Cleanup: discarding lookahead",
3093                   yytoken, &yylval);
3094     }
3095   /* Do not reclaim the symbols of the rule whose action triggered
3096      this YYABORT or YYACCEPT.  */
3097   YYPOPSTACK (yylen);
3098   YY_STACK_PRINT (yyss, yyssp);
3099   while (yyssp != yyss)
3100     {
3101       yydestruct ("Cleanup: popping",
3102                   yystos[*yyssp], yyvsp);
3103       YYPOPSTACK (1);
3104     }
3105 #ifndef yyoverflow
3106   if (yyss != yyssa)
3107     YYSTACK_FREE (yyss);
3108 #endif
3109 #if YYERROR_VERBOSE
3110   if (yymsg != yymsgbuf)
3111     YYSTACK_FREE (yymsg);
3112 #endif
3113   return yyresult;
3114 }
3115 #line 649 "../../../svn/src/common/parser.y" /* yacc.c:1906  */
3116 
3117 
3118 int
yyerror(char * error_string,...)3119 yyerror(char *error_string, ...) {
3120     va_list ap;
3121 	char error[1000];
3122 
3123     ++synerrors;
3124 
3125     va_start(ap,error_string);
3126 	vsnprintf(error,1000,error_string,ap);
3127     va_end(ap);
3128 
3129 	report_error(error);
3130 	return 0;
3131 }
3132