2 /* A Bison parser, made by GNU Bison 2.4.1. */
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 /* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
38 /* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
45 /* Identify Bison output. */
49 #define YYBISON_VERSION "2.4.1"
52 #define YYSKELETON_NAME "yacc.c"
63 /* Using locations. */
64 #define YYLSP_NEEDED 0
68 /* Copy the first part of user declarations. */
70 /* Line 189 of yacc.c */
73 /* Nitfol - z-machine interpreter using Glk for output.
74 Copyright (C) 1999 Evin Robertson
76 This program is free software; you can redistribute it and/or modify
77 it under the terms of the GNU General Public License as published by
78 the Free Software Foundation; either version 2 of the License, or
79 (at your option) any later version.
81 This program is distributed in the hope that it will be useful,
82 but WITHOUT ANY WARRANTY; without even the implied warranty of
83 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
84 GNU General Public License for more details.
86 You should have received a copy of the GNU General Public License
87 along with this program; if not, write to the Free Software
88 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
90 The author can be reached at ecr+@andrew.cmu.edu
96 /* bison uses str* functions; make it use n_str* instead... */
98 #define strcat(d, s) n_strcat(d, s)
101 #define strlen(s) n_strlen(s)
104 #define strcpy(d, s) n_strcpy(d, s)
110 typedef struct zword_list zword_list;
116 typedef struct cond_list cond_list;
120 BOOL (*condfunc)(zword a, zword b);
126 static z_typed z_t(z_typed a, z_typed b, zword v);
128 static const char *lex_expression;
129 static int lex_offset;
131 static const char *lex_tail(void) {
132 const char *t = lex_expression + lex_offset;
135 lex_offset = n_strlen(lex_expression);
139 static z_typed inform_result;
141 static int yylex(void);
142 static void yyerror(const char *s);
143 static void inform_help(void);
147 #define YYERROR_VERBOSE
155 /* Line 189 of yacc.c */
158 /* Enabling traces. */
163 /* Enabling verbose error messages. */
164 #ifdef YYERROR_VERBOSE
165 # undef YYERROR_VERBOSE
166 # define YYERROR_VERBOSE 1
168 # define YYERROR_VERBOSE 0
171 /* Enabling the token table. */
172 #ifndef YYTOKEN_TABLE
173 # define YYTOKEN_TABLE 0
180 /* Put the tokens into the symbol table, so that GDB and other debuggers
236 DISABLE_DISPLAY = 311,
237 ENABLE_DISPLAY = 312,
274 #define CONDITION 260
284 #define INFOSOURCE 270
285 #define INFOSOURCES 271
307 #define BREAKPOINTS 293
312 #define RECORDOFF 298
314 #define REPLAYOFF 300
315 #define SYMBOL_FILE 301
317 #define SELECT_FRAME 303
318 #define BACKTRACE 304
320 #define DOWN_FRAME 306
321 #define UP_SILENTLY 307
322 #define DOWN_SILENTLY 308
324 #define UNDISPLAY 310
325 #define DISABLE_DISPLAY 311
326 #define ENABLE_DISPLAY 312
327 #define DISABLE_BREAK 313
328 #define ENABLE_BREAK 314
329 #define OBJECT_TREE 315
331 #define LIST_GLOBALS 317
344 #define WORDARRAY 330
345 #define BYTEARRAY 331
353 #define DECREMENT 339
354 #define INCREMENT 340
355 #define PROPLENGTH 341
357 #define SUPERCLASS 343
362 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
363 typedef union YYSTYPE
366 /* Line 214 of yacc.c */
376 BOOL (*condfunc)(zword a, zword b);
384 /* Line 214 of yacc.c */
387 # define YYSTYPE_IS_TRIVIAL 1
388 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
389 # define YYSTYPE_IS_DECLARED 1
393 /* Copy the second part of user declarations. */
396 /* Line 264 of yacc.c */
404 typedef YYTYPE_UINT8 yytype_uint8;
406 typedef unsigned char yytype_uint8;
410 typedef YYTYPE_INT8 yytype_int8;
411 #elif (defined __STDC__ || defined __C99__FUNC__ \
412 || defined __cplusplus || defined _MSC_VER)
413 typedef signed char yytype_int8;
415 typedef short int yytype_int8;
419 typedef YYTYPE_UINT16 yytype_uint16;
421 typedef unsigned short int yytype_uint16;
425 typedef YYTYPE_INT16 yytype_int16;
427 typedef short int yytype_int16;
431 # ifdef __SIZE_TYPE__
432 # define YYSIZE_T __SIZE_TYPE__
433 # elif defined size_t
434 # define YYSIZE_T size_t
435 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
436 || defined __cplusplus || defined _MSC_VER)
437 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
438 # define YYSIZE_T size_t
440 # define YYSIZE_T unsigned int
444 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
449 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
450 # define YY_(msgid) dgettext ("bison-runtime", msgid)
454 # define YY_(msgid) msgid
458 /* Suppress unused-variable warnings by "using" E. */
459 #if ! defined lint || defined __GNUC__
460 # define YYUSE(e) ((void) (e))
462 # define YYUSE(e) /* empty */
465 /* Identity function, used to suppress warnings about constant conditions. */
469 #if (defined __STDC__ || defined __C99__FUNC__ \
470 || defined __cplusplus || defined _MSC_VER)
483 #if ! defined yyoverflow || YYERROR_VERBOSE
485 /* The parser invokes alloca or malloc; define the necessary symbols. */
487 # ifdef YYSTACK_USE_ALLOCA
488 # if YYSTACK_USE_ALLOCA
490 # define YYSTACK_ALLOC __builtin_alloca
491 # elif defined __BUILTIN_VA_ARG_INCR
492 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
494 # define YYSTACK_ALLOC __alloca
495 # elif defined _MSC_VER
496 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
497 # define alloca _alloca
499 # define YYSTACK_ALLOC alloca
500 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
501 || defined __cplusplus || defined _MSC_VER)
502 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
511 # ifdef YYSTACK_ALLOC
512 /* Pacify GCC's `empty if-body' warning. */
513 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
514 # ifndef YYSTACK_ALLOC_MAXIMUM
515 /* The OS might guarantee only one guard page at the bottom of the stack,
516 and a page size can be as small as 4096 bytes. So we cannot safely
517 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
518 to allow for a few compiler-allocated temporary stack slots. */
519 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
522 # define YYSTACK_ALLOC YYMALLOC
523 # define YYSTACK_FREE YYFREE
524 # ifndef YYSTACK_ALLOC_MAXIMUM
525 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
527 # if (defined __cplusplus && ! defined _STDLIB_H \
528 && ! ((defined YYMALLOC || defined malloc) \
529 && (defined YYFREE || defined free)))
530 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
536 # define YYMALLOC malloc
537 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
538 || defined __cplusplus || defined _MSC_VER)
539 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
544 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
545 || defined __cplusplus || defined _MSC_VER)
546 void free (void *); /* INFRINGES ON USER NAME SPACE */
550 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
553 #if (! defined yyoverflow \
554 && (! defined __cplusplus \
555 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
557 /* A type that is properly aligned for any stack member. */
560 yytype_int16 yyss_alloc;
564 /* The size of the maximum gap between one aligned stack and the next. */
565 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
567 /* The size of an array large to enough to hold all stacks, each with
569 # define YYSTACK_BYTES(N) \
570 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
571 + YYSTACK_GAP_MAXIMUM)
573 /* Copy COUNT objects from FROM to TO. The source and destination do
576 # if defined __GNUC__ && 1 < __GNUC__
577 # define YYCOPY(To, From, Count) \
578 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
580 # define YYCOPY(To, From, Count) \
584 for (yyi = 0; yyi < (Count); yyi++) \
585 (To)[yyi] = (From)[yyi]; \
591 /* Relocate STACK from its old location to the new one. The
592 local variables YYSIZE and YYSTACKSIZE give the old and new number of
593 elements in the stack, and YYPTR gives the new location of the
594 stack. Advance YYPTR to a properly aligned location for the next
596 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
599 YYSIZE_T yynewbytes; \
600 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
601 Stack = &yyptr->Stack_alloc; \
602 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
603 yyptr += yynewbytes / sizeof (*yyptr); \
609 /* YYFINAL -- State number of the termination state. */
611 /* YYLAST -- Last index in YYTABLE. */
614 /* YYNTOKENS -- Number of terminals. */
615 #define YYNTOKENS 104
616 /* YYNNTS -- Number of nonterminals. */
618 /* YYNRULES -- Number of rules. */
620 /* YYNRULES -- Number of states. */
621 #define YYNSTATES 208
623 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
625 #define YYMAXUTOK 343
627 #define YYTRANSLATE(YYX) \
628 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
630 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
631 static const yytype_uint8 yytranslate[] =
633 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
634 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
635 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
636 2, 2, 2, 2, 2, 101, 2, 81, 82, 2,
637 98, 103, 79, 77, 71, 78, 99, 80, 2, 2,
638 2, 2, 2, 2, 2, 2, 2, 2, 102, 2,
639 2, 72, 2, 2, 2, 2, 2, 2, 2, 2,
640 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
641 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
642 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
643 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
644 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
645 2, 2, 2, 2, 83, 2, 84, 2, 2, 2,
646 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
647 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
648 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
649 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
650 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
651 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
652 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
653 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
654 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
655 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
656 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
657 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
658 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
659 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
660 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
661 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
662 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
663 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
664 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
665 65, 66, 67, 68, 69, 70, 73, 74, 75, 76,
666 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
671 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
673 static const yytype_uint16 yyprhs[] =
675 0, 0, 3, 4, 6, 8, 10, 12, 14, 16,
676 18, 20, 22, 24, 26, 28, 30, 32, 34, 36,
677 38, 41, 44, 46, 49, 52, 55, 60, 62, 65,
678 67, 69, 72, 76, 81, 84, 87, 89, 92, 94,
679 97, 99, 102, 104, 106, 109, 111, 114, 116, 119,
680 123, 126, 130, 133, 135, 138, 141, 144, 146, 148,
681 150, 152, 154, 156, 159, 162, 164, 167, 169, 172,
682 174, 177, 179, 182, 184, 187, 191, 193, 196, 199,
683 203, 206, 208, 212, 213, 217, 219, 221, 225, 229,
684 230, 235, 237, 239, 241, 243, 247, 252, 257, 262,
685 267, 272, 277, 278, 283, 284, 289, 292, 296, 300,
686 304, 308, 312, 316, 320, 323, 327, 331, 334, 337,
687 340, 343, 346, 350, 354, 358, 361, 364, 367, 370,
691 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
692 static const yytype_int8 yyrhs[] =
694 105, 0, -1, -1, 101, -1, 9, -1, 6, -1,
695 7, -1, 8, -1, 10, -1, 11, -1, 40, -1,
696 39, -1, 42, -1, 43, -1, 44, -1, 45, -1,
697 41, -1, 12, -1, 13, -1, 46, -1, 19, 109,
698 -1, 20, 109, -1, 54, -1, 55, 3, -1, 56,
699 3, -1, 57, 3, -1, 21, 109, 22, 109, -1,
700 60, -1, 60, 109, -1, 61, -1, 62, -1, 62,
701 109, -1, 23, 109, 3, -1, 23, 109, 84, 3,
702 -1, 24, 109, -1, 25, 106, -1, 26, -1, 26,
703 3, -1, 27, -1, 27, 3, -1, 28, -1, 28,
704 3, -1, 29, -1, 30, -1, 30, 3, -1, 31,
705 -1, 31, 3, -1, 32, -1, 33, 106, -1, 33,
706 106, 35, -1, 36, 3, -1, 37, 3, 3, -1,
707 34, 3, -1, 38, -1, 38, 3, -1, 58, 3,
708 -1, 59, 3, -1, 14, -1, 15, -1, 16, -1,
709 17, -1, 18, -1, 47, -1, 47, 3, -1, 48,
710 3, -1, 50, -1, 50, 3, -1, 52, -1, 52,
711 3, -1, 51, -1, 51, 3, -1, 53, -1, 53,
712 3, -1, 49, -1, 49, 3, -1, 49, 78, 3,
713 -1, 3, -1, 77, 3, -1, 78, 3, -1, 4,
714 102, 3, -1, 79, 3, -1, 112, -1, 107, 76,
715 112, -1, -1, 112, 71, 108, -1, 112, -1, 110,
716 -1, 109, 71, 112, -1, 109, 71, 110, -1, -1,
717 112, 5, 111, 107, -1, 3, -1, 64, -1, 63,
718 -1, 65, -1, 112, 72, 112, -1, 66, 98, 109,
719 103, -1, 67, 98, 109, 103, -1, 68, 98, 109,
720 103, -1, 69, 98, 109, 103, -1, 70, 98, 109,
721 103, -1, 112, 98, 108, 103, -1, -1, 112, 75,
722 113, 112, -1, -1, 112, 74, 114, 112, -1, 73,
723 112, -1, 112, 77, 112, -1, 112, 78, 112, -1,
724 112, 79, 112, -1, 112, 80, 112, -1, 112, 81,
725 112, -1, 112, 82, 112, -1, 112, 83, 112, -1,
726 84, 112, -1, 112, 86, 112, -1, 112, 85, 112,
727 -1, 78, 112, -1, 95, 112, -1, 112, 95, -1,
728 94, 112, -1, 112, 94, -1, 112, 97, 112, -1,
729 112, 96, 112, -1, 112, 99, 112, -1, 93, 112,
730 -1, 92, 112, -1, 91, 112, -1, 90, 112, -1,
731 89, 112, -1, 88, 112, -1, 98, 109, 103, -1
734 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
735 static const yytype_uint16 yyrline[] =
737 0, 130, 130, 132, 134, 142, 144, 146, 148, 150,
738 152, 154, 165, 167, 169, 171, 173, 175, 182, 189,
739 198, 200, 202, 204, 206, 208, 210, 212, 214, 216,
740 221, 239, 255, 257, 259, 261, 263, 265, 267, 269,
741 271, 273, 275, 277, 279, 281, 283, 285, 287, 289,
742 291, 293, 295, 297, 299, 301, 303, 305, 307, 309,
743 311, 313, 315, 317, 319, 321, 323, 325, 327, 329,
744 331, 333, 335, 337, 339, 341, 349, 350, 351, 352,
745 353, 357, 364, 377, 378, 382, 383, 384, 385, 390,
746 390, 394, 396, 398, 400, 403, 406, 408, 410, 412,
747 415, 425, 443, 443, 445, 445, 447, 450, 452, 454,
748 456, 458, 460, 462, 464, 467, 469, 472, 475, 477,
749 479, 481, 484, 486, 489, 497, 499, 501, 503, 505,
754 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
755 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
756 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
757 static const char *const yytname[] =
759 "$end", "error", "$undefined", "NUM", "DFILE", "CONDITION", "ALIAS",
760 "RALIAS", "UNALIAS", "DUMPMEM", "AUTOMAP", "HELP", "UNDO", "REDO",
761 "LANGUAGE", "INFOSOURCE", "INFOSOURCES", "COPYING", "WARRANTY", "PRINT",
762 "SET", "MOVE", "TO", "GIVE", "REMOVE", "JUMP", "CONT", "STEP", "NEXT",
763 "UNTIL", "STEPI", "NEXTI", "FINISH", "BREAK", "DELETE", "IF", "COND",
764 "IGNORE", "BREAKPOINTS", "RESTORE", "RESTART", "QUIT", "RECORDON",
765 "RECORDOFF", "REPLAY", "REPLAYOFF", "SYMBOL_FILE", "FRAME",
766 "SELECT_FRAME", "BACKTRACE", "UP_FRAME", "DOWN_FRAME", "UP_SILENTLY",
767 "DOWN_SILENTLY", "DISPLAY", "UNDISPLAY", "DISABLE_DISPLAY",
768 "ENABLE_DISPLAY", "DISABLE_BREAK", "ENABLE_BREAK", "OBJECT_TREE", "FIND",
769 "LIST_GLOBALS", "BTRUE", "BFALSE", "NOTHING", "PARENT", "CHILD",
770 "SIBLING", "CHILDREN", "RANDOM", "','", "'='", "NOTNOT", "OROR",
771 "ANDAND", "OR", "'+'", "'-'", "'*'", "'/'", "'%'", "'&'", "'|'", "'~'",
772 "WORDARRAY", "BYTEARRAY", "precNEG", "LOCAL", "GLOBAL", "STRING",
773 "ROUTINE", "OBJECT", "NUMBER", "DECREMENT", "INCREMENT", "PROPLENGTH",
774 "PROPADDR", "'('", "'.'", "SUPERCLASS", "'#'", "':'", "')'", "$accept",
775 "input", "linespec", "orlist", "arglist", "commaexp", "condexp", "$@1",
776 "exp", "$@2", "$@3", 0
781 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
783 static const yytype_uint16 yytoknum[] =
785 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
786 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
787 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
788 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
789 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
790 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
791 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
792 325, 44, 61, 326, 327, 328, 329, 43, 45, 42,
793 47, 37, 38, 124, 126, 330, 331, 332, 333, 334,
794 335, 336, 337, 338, 339, 340, 341, 342, 40, 46,
799 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
800 static const yytype_uint8 yyr1[] =
802 0, 104, 105, 105, 105, 105, 105, 105, 105, 105,
803 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
804 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
805 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
806 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
807 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
808 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
809 105, 105, 105, 105, 105, 105, 106, 106, 106, 106,
810 106, 107, 107, 108, 108, 109, 109, 109, 109, 111,
811 110, 112, 112, 112, 112, 112, 112, 112, 112, 112,
812 112, 112, 113, 112, 114, 112, 112, 112, 112, 112,
813 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
814 112, 112, 112, 112, 112, 112, 112, 112, 112, 112,
818 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
819 static const yytype_uint8 yyr2[] =
821 0, 2, 0, 1, 1, 1, 1, 1, 1, 1,
822 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
823 2, 2, 1, 2, 2, 2, 4, 1, 2, 1,
824 1, 2, 3, 4, 2, 2, 1, 2, 1, 2,
825 1, 2, 1, 1, 2, 1, 2, 1, 2, 3,
826 2, 3, 2, 1, 2, 2, 2, 1, 1, 1,
827 1, 1, 1, 2, 2, 1, 2, 1, 2, 1,
828 2, 1, 2, 1, 2, 3, 1, 2, 2, 3,
829 2, 1, 3, 0, 3, 1, 1, 3, 3, 0,
830 4, 1, 1, 1, 1, 3, 4, 4, 4, 4,
831 4, 4, 0, 4, 0, 4, 2, 3, 3, 3,
832 3, 3, 3, 3, 2, 3, 3, 2, 2, 2,
833 2, 2, 3, 3, 3, 2, 2, 2, 2, 2,
837 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
838 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
839 means the default is an error. */
840 static const yytype_uint8 yydefact[] =
842 2, 5, 6, 7, 4, 8, 9, 17, 18, 57,
843 58, 59, 60, 61, 0, 0, 0, 0, 0, 0,
844 36, 38, 40, 42, 43, 45, 47, 0, 0, 0,
845 0, 53, 11, 10, 16, 12, 13, 14, 15, 19,
846 62, 0, 73, 65, 69, 67, 71, 22, 0, 0,
847 0, 0, 0, 27, 29, 30, 3, 0, 91, 93,
848 92, 94, 0, 0, 0, 0, 0, 0, 0, 0,
849 0, 0, 0, 0, 0, 0, 0, 0, 0, 20,
850 86, 85, 21, 0, 0, 34, 76, 0, 0, 0,
851 0, 35, 37, 39, 41, 44, 46, 48, 52, 50,
852 0, 54, 63, 64, 74, 0, 66, 70, 68, 72,
853 23, 24, 25, 55, 56, 28, 31, 1, 0, 0,
854 0, 0, 0, 106, 117, 114, 130, 129, 128, 127,
855 126, 125, 120, 118, 0, 0, 89, 0, 104, 102,
856 0, 0, 0, 0, 0, 0, 0, 0, 0, 121,
857 119, 0, 0, 83, 0, 0, 32, 0, 0, 77,
858 78, 80, 49, 51, 75, 0, 0, 0, 0, 0,
859 131, 88, 87, 0, 95, 0, 0, 107, 108, 109,
860 110, 111, 112, 113, 116, 115, 123, 122, 0, 0,
861 124, 26, 33, 79, 96, 97, 98, 99, 100, 90,
862 81, 105, 103, 101, 83, 0, 84, 82
865 /* YYDEFGOTO[NTERM-NUM]. */
866 static const yytype_int16 yydefgoto[] =
868 -1, 57, 91, 199, 188, 79, 80, 173, 81, 176,
872 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
874 #define YYPACT_NINF -65
875 static const yytype_int16 yypact[] =
877 137, -65, -65, -65, -65, -65, -65, -65, -65, -65,
878 -65, -65, -65, -65, 156, 156, 156, 156, 156, 16,
879 28, 33, 34, -65, 36, 44, -65, 16, 46, 47,
880 48, 49, -65, -65, -65, -65, -65, -65, -65, -65,
881 55, 56, 14, 57, 58, 59, 68, -65, 70, 72,
882 73, 84, 93, 156, -65, 156, -65, 97, -65, -65,
883 -65, -65, 0, 2, 3, 4, 10, 156, 156, 156,
884 156, 156, 156, 156, 156, 156, 156, 156, 156, 38,
885 -65, 195, 38, -7, 15, 38, -65, 9, 118, 127,
886 134, -65, -65, -65, -65, -65, -65, 103, -65, -65,
887 136, -65, -65, -65, -65, 169, -65, -65, -65, -65,
888 -65, -65, -65, -65, -65, 38, 38, -65, 156, 156,
889 156, 156, 156, 37, -29, 116, -29, -29, -29, -29,
890 -29, -29, 30, 30, -55, 156, -65, 156, -65, -65,
891 156, 156, 156, 156, 156, 156, 156, 156, 156, -65,
892 -65, 156, 156, 156, 156, 156, -65, 200, 201, -65,
893 -65, -65, -65, -65, -65, -50, -49, -48, -47, -46,
894 -65, -65, 195, 156, 252, 156, 156, -53, -53, 116,
895 116, 116, 116, 116, -29, -29, -64, -64, 102, 224,
896 -65, 38, -65, -65, -65, -65, -65, -65, -65, 130,
897 252, 37, 37, -65, 156, 156, -65, 252
900 /* YYPGOTO[NTERM-NUM]. */
901 static const yytype_int16 yypgoto[] =
903 -65, -65, 180, -65, 5, -15, 81, -65, -63, -65,
907 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
908 positive, shift that token. If negative, reduce the rule which
909 number is the opposite. If zero, do what YYDEFACT says.
910 If YYTABLE_NINF, syntax error. */
911 #define YYTABLE_NINF -1
912 static const yytype_int16 yytable[] =
914 82, 83, 84, 85, 123, 124, 125, 126, 127, 128,
915 129, 130, 131, 132, 133, 155, 135, 104, 156, 86,
916 87, 135, 135, 135, 135, 135, 142, 143, 144, 145,
917 146, 92, 147, 148, 153, 154, 93, 94, 115, 95,
918 116, 149, 150, 151, 152, 153, 154, 96, 170, 98,
919 99, 100, 101, 194, 195, 196, 197, 198, 102, 103,
920 106, 107, 108, 134, 135, 149, 150, 151, 152, 153,
921 154, 109, 172, 110, 174, 111, 112, 177, 178, 179,
922 180, 181, 182, 183, 184, 185, 135, 113, 186, 187,
923 189, 190, 105, 88, 89, 90, 114, 117, 118, 157,
924 119, 120, 121, 165, 166, 167, 168, 169, 122, 135,
925 200, 158, 201, 202, 140, 141, 142, 143, 144, 145,
926 146, 159, 147, 148, -1, -1, 151, 152, 153, 154,
927 160, 149, 150, 151, 152, 153, 154, 161, 162, 163,
928 191, 189, 207, 1, 2, 3, 4, 5, 6, 7,
929 8, 9, 10, 11, 12, 13, 14, 15, 16, 58,
930 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
931 27, 28, 164, 29, 30, 31, 32, 33, 34, 35,
932 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
933 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
934 136, 147, 148, 192, 193, 203, 205, 97, 0, 206,
935 149, 150, 151, 152, 153, 154, 171, 0, 0, 59,
936 60, 61, 62, 63, 64, 65, 66, 0, 0, 67,
937 0, 0, 0, 0, 68, 0, 0, 0, 56, 0,
938 69, 0, 0, 0, 70, 71, 72, 73, 74, 75,
939 76, 77, 0, 0, 78, 0, 0, 0, 0, 0,
940 0, 0, 0, 0, 0, 0, 0, 137, 0, 138,
941 139, 0, 140, 141, 142, 143, 144, 145, 146, 0,
942 147, 148, 0, 0, 0, 0, 0, 0, 0, 149,
943 150, 151, 152, 153, 154, 204, 137, 0, 138, 139,
944 0, 140, 141, 142, 143, 144, 145, 146, 0, 147,
945 148, 0, 0, 0, 0, 0, 0, 0, 149, 150,
946 151, 152, 153, 154, 137, 0, 138, 139, 0, 140,
947 141, 142, 143, 144, 145, 146, 0, 147, 148, 0,
948 0, 0, 0, 0, 0, 0, 149, 150, 151, 152,
952 static const yytype_int16 yycheck[] =
954 15, 16, 17, 18, 67, 68, 69, 70, 71, 72,
955 73, 74, 75, 76, 77, 22, 71, 3, 3, 3,
956 4, 71, 71, 71, 71, 71, 79, 80, 81, 82,
957 83, 3, 85, 86, 98, 99, 3, 3, 53, 3,
958 55, 94, 95, 96, 97, 98, 99, 3, 103, 3,
959 3, 3, 3, 103, 103, 103, 103, 103, 3, 3,
960 3, 3, 3, 78, 71, 94, 95, 96, 97, 98,
961 99, 3, 135, 3, 137, 3, 3, 140, 141, 142,
962 143, 144, 145, 146, 147, 148, 71, 3, 151, 152,
963 153, 154, 78, 77, 78, 79, 3, 0, 98, 84,
964 98, 98, 98, 118, 119, 120, 121, 122, 98, 71,
965 173, 102, 175, 176, 77, 78, 79, 80, 81, 82,
966 83, 3, 85, 86, 94, 95, 96, 97, 98, 99,
967 3, 94, 95, 96, 97, 98, 99, 3, 35, 3,
968 155, 204, 205, 6, 7, 8, 9, 10, 11, 12,
969 13, 14, 15, 16, 17, 18, 19, 20, 21, 3,
970 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
971 33, 34, 3, 36, 37, 38, 39, 40, 41, 42,
972 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
973 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
974 5, 85, 86, 3, 3, 103, 76, 27, -1, 204,
975 94, 95, 96, 97, 98, 99, 135, -1, -1, 63,
976 64, 65, 66, 67, 68, 69, 70, -1, -1, 73,
977 -1, -1, -1, -1, 78, -1, -1, -1, 101, -1,
978 84, -1, -1, -1, 88, 89, 90, 91, 92, 93,
979 94, 95, -1, -1, 98, -1, -1, -1, -1, -1,
980 -1, -1, -1, -1, -1, -1, -1, 72, -1, 74,
981 75, -1, 77, 78, 79, 80, 81, 82, 83, -1,
982 85, 86, -1, -1, -1, -1, -1, -1, -1, 94,
983 95, 96, 97, 98, 99, 71, 72, -1, 74, 75,
984 -1, 77, 78, 79, 80, 81, 82, 83, -1, 85,
985 86, -1, -1, -1, -1, -1, -1, -1, 94, 95,
986 96, 97, 98, 99, 72, -1, 74, 75, -1, 77,
987 78, 79, 80, 81, 82, 83, -1, 85, 86, -1,
988 -1, -1, -1, -1, -1, -1, 94, 95, 96, 97,
992 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
993 symbol of state STATE-NUM. */
994 static const yytype_uint8 yystos[] =
996 0, 6, 7, 8, 9, 10, 11, 12, 13, 14,
997 15, 16, 17, 18, 19, 20, 21, 23, 24, 25,
998 26, 27, 28, 29, 30, 31, 32, 33, 34, 36,
999 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
1000 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
1001 57, 58, 59, 60, 61, 62, 101, 105, 3, 63,
1002 64, 65, 66, 67, 68, 69, 70, 73, 78, 84,
1003 88, 89, 90, 91, 92, 93, 94, 95, 98, 109,
1004 110, 112, 109, 109, 109, 109, 3, 4, 77, 78,
1005 79, 106, 3, 3, 3, 3, 3, 106, 3, 3,
1006 3, 3, 3, 3, 3, 78, 3, 3, 3, 3,
1007 3, 3, 3, 3, 3, 109, 109, 0, 98, 98,
1008 98, 98, 98, 112, 112, 112, 112, 112, 112, 112,
1009 112, 112, 112, 112, 109, 71, 5, 72, 74, 75,
1010 77, 78, 79, 80, 81, 82, 83, 85, 86, 94,
1011 95, 96, 97, 98, 99, 22, 3, 84, 102, 3,
1012 3, 3, 35, 3, 3, 109, 109, 109, 109, 109,
1013 103, 110, 112, 111, 112, 114, 113, 112, 112, 112,
1014 112, 112, 112, 112, 112, 112, 112, 112, 108, 112,
1015 112, 109, 3, 3, 103, 103, 103, 103, 103, 107,
1016 112, 112, 112, 103, 71, 76, 108, 112
1019 #define yyerrok (yyerrstatus = 0)
1020 #define yyclearin (yychar = YYEMPTY)
1021 #define YYEMPTY (-2)
1024 #define YYACCEPT goto yyacceptlab
1025 #define YYABORT goto yyabortlab
1026 #define YYERROR goto yyerrorlab
1029 /* Like YYERROR except do call yyerror. This remains here temporarily
1030 to ease the transition to the new meaning of YYERROR, for GCC.
1031 Once GCC version 2 has supplanted version 1, this can go. */
1033 #define YYFAIL goto yyerrlab
1035 #define YYRECOVERING() (!!yyerrstatus)
1037 #define YYBACKUP(Token, Value) \
1039 if (yychar == YYEMPTY && yylen == 1) \
1043 yytoken = YYTRANSLATE (yychar); \
1049 yyerror (YY_("syntax error: cannot back up")); \
1056 #define YYERRCODE 256
1059 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1060 If N is 0, then set CURRENT to the empty location which ends
1061 the previous symbol: RHS[0] (always defined). */
1063 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1064 #ifndef YYLLOC_DEFAULT
1065 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1069 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1070 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1071 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1072 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1076 (Current).first_line = (Current).last_line = \
1077 YYRHSLOC (Rhs, 0).last_line; \
1078 (Current).first_column = (Current).last_column = \
1079 YYRHSLOC (Rhs, 0).last_column; \
1085 /* YY_LOCATION_PRINT -- Print the location on the stream.
1086 This macro was not mandated originally: define only if we know
1087 we won't break user code: when these are the locations we know. */
1089 #ifndef YY_LOCATION_PRINT
1090 # if YYLTYPE_IS_TRIVIAL
1091 # define YY_LOCATION_PRINT(File, Loc) \
1092 fprintf (File, "%d.%d-%d.%d", \
1093 (Loc).first_line, (Loc).first_column, \
1094 (Loc).last_line, (Loc).last_column)
1096 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1101 /* YYLEX -- calling `yylex' with the right arguments. */
1104 # define YYLEX yylex (YYLEX_PARAM)
1106 # define YYLEX yylex ()
1109 /* Enable debugging if requested. */
1113 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1114 # define YYFPRINTF fprintf
1117 # define YYDPRINTF(Args) \
1123 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1127 YYFPRINTF (stderr, "%s ", Title); \
1128 yy_symbol_print (stderr, \
1130 YYFPRINTF (stderr, "\n"); \
1135 /*--------------------------------.
1136 | Print this symbol on YYOUTPUT. |
1137 `--------------------------------*/
1140 #if (defined __STDC__ || defined __C99__FUNC__ \
1141 || defined __cplusplus || defined _MSC_VER)
1143 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1146 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
1149 YYSTYPE const * const yyvaluep;
1155 if (yytype < YYNTOKENS)
1156 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1168 /*--------------------------------.
1169 | Print this symbol on YYOUTPUT. |
1170 `--------------------------------*/
1172 #if (defined __STDC__ || defined __C99__FUNC__ \
1173 || defined __cplusplus || defined _MSC_VER)
1175 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
1178 yy_symbol_print (yyoutput, yytype, yyvaluep)
1181 YYSTYPE const * const yyvaluep;
1184 if (yytype < YYNTOKENS)
1185 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1187 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1189 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1190 YYFPRINTF (yyoutput, ")");
1193 /*------------------------------------------------------------------.
1194 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1196 `------------------------------------------------------------------*/
1198 #if (defined __STDC__ || defined __C99__FUNC__ \
1199 || defined __cplusplus || defined _MSC_VER)
1201 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1204 yy_stack_print (yybottom, yytop)
1205 yytype_int16 *yybottom;
1206 yytype_int16 *yytop;
1209 YYFPRINTF (stderr, "Stack now");
1210 for (; yybottom <= yytop; yybottom++)
1212 int yybot = *yybottom;
1213 YYFPRINTF (stderr, " %d", yybot);
1215 YYFPRINTF (stderr, "\n");
1218 # define YY_STACK_PRINT(Bottom, Top) \
1221 yy_stack_print ((Bottom), (Top)); \
1225 /*------------------------------------------------.
1226 | Report that the YYRULE is going to be reduced. |
1227 `------------------------------------------------*/
1229 #if (defined __STDC__ || defined __C99__FUNC__ \
1230 || defined __cplusplus || defined _MSC_VER)
1232 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
1235 yy_reduce_print (yyvsp, yyrule)
1240 int yynrhs = yyr2[yyrule];
1242 unsigned long int yylno = yyrline[yyrule];
1243 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1245 /* The symbols being reduced. */
1246 for (yyi = 0; yyi < yynrhs; yyi++)
1248 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1249 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1250 &(yyvsp[(yyi + 1) - (yynrhs)])
1252 YYFPRINTF (stderr, "\n");
1256 # define YY_REDUCE_PRINT(Rule) \
1259 yy_reduce_print (yyvsp, Rule); \
1262 /* Nonzero means print parse trace. It is left uninitialized so that
1263 multiple parsers can coexist. */
1265 #else /* !YYDEBUG */
1266 # define YYDPRINTF(Args)
1267 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1268 # define YY_STACK_PRINT(Bottom, Top)
1269 # define YY_REDUCE_PRINT(Rule)
1270 #endif /* !YYDEBUG */
1273 /* YYINITDEPTH -- initial size of the parser's stacks. */
1275 # define YYINITDEPTH 200
1278 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1279 if the built-in stack extension method is used).
1281 Do not make this value too large; the results are undefined if
1282 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1283 evaluated with infinite-precision integer arithmetic. */
1286 # define YYMAXDEPTH 10000
1294 # if defined __GLIBC__ && defined _STRING_H
1295 # define yystrlen strlen
1297 /* Return the length of YYSTR. */
1298 #if (defined __STDC__ || defined __C99__FUNC__ \
1299 || defined __cplusplus || defined _MSC_VER)
1301 yystrlen (const char *yystr)
1309 for (yylen = 0; yystr[yylen]; yylen++)
1317 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1318 # define yystpcpy stpcpy
1320 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1322 #if (defined __STDC__ || defined __C99__FUNC__ \
1323 || defined __cplusplus || defined _MSC_VER)
1325 yystpcpy (char *yydest, const char *yysrc)
1328 yystpcpy (yydest, yysrc)
1334 const char *yys = yysrc;
1336 while ((*yyd++ = *yys++) != '\0')
1345 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1346 quotes and backslashes, so that it's suitable for yyerror. The
1347 heuristic is that double-quoting is unnecessary unless the string
1348 contains an apostrophe, a comma, or backslash (other than
1349 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1350 null, do not copy; instead, return the length of what the result
1353 yytnamerr (char *yyres, const char *yystr)
1358 char const *yyp = yystr;
1365 goto do_not_strip_quotes;
1369 goto do_not_strip_quotes;
1382 do_not_strip_quotes: ;
1386 return yystrlen (yystr);
1388 return yystpcpy (yyres, yystr) - yyres;
1392 /* Copy into YYRESULT an error message about the unexpected token
1393 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1394 including the terminating null byte. If YYRESULT is null, do not
1395 copy anything; just return the number of bytes that would be
1396 copied. As a special case, return 0 if an ordinary "syntax error"
1397 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1398 size calculation. */
1400 yysyntax_error (char *yyresult, int yystate, int yychar)
1402 int yyn = yypact[yystate];
1404 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1408 int yytype = YYTRANSLATE (yychar);
1409 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1410 YYSIZE_T yysize = yysize0;
1412 int yysize_overflow = 0;
1413 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1414 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1418 /* This is so xgettext sees the translatable formats that are
1419 constructed on the fly. */
1420 YY_("syntax error, unexpected %s");
1421 YY_("syntax error, unexpected %s, expecting %s");
1422 YY_("syntax error, unexpected %s, expecting %s or %s");
1423 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1424 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1428 static char const yyunexpected[] = "syntax error, unexpected %s";
1429 static char const yyexpecting[] = ", expecting %s";
1430 static char const yyor[] = " or %s";
1431 char yyformat[sizeof yyunexpected
1432 + sizeof yyexpecting - 1
1433 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1434 * (sizeof yyor - 1))];
1435 char const *yyprefix = yyexpecting;
1437 /* Start YYX at -YYN if negative to avoid negative indexes in
1439 int yyxbegin = yyn < 0 ? -yyn : 0;
1441 /* Stay within bounds of both yycheck and yytname. */
1442 int yychecklim = YYLAST - yyn + 1;
1443 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1446 yyarg[0] = yytname[yytype];
1447 yyfmt = yystpcpy (yyformat, yyunexpected);
1449 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1450 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1452 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1456 yyformat[sizeof yyunexpected - 1] = '\0';
1459 yyarg[yycount++] = yytname[yyx];
1460 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1461 yysize_overflow |= (yysize1 < yysize);
1463 yyfmt = yystpcpy (yyfmt, yyprefix);
1467 yyf = YY_(yyformat);
1468 yysize1 = yysize + yystrlen (yyf);
1469 yysize_overflow |= (yysize1 < yysize);
1472 if (yysize_overflow)
1473 return YYSIZE_MAXIMUM;
1477 /* Avoid sprintf, as that infringes on the user's name space.
1478 Don't have undefined behavior even if the translation
1479 produced a string with the wrong number of "%s"s. */
1480 char *yyp = yyresult;
1482 while ((*yyp = *yyf) != '\0')
1484 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1486 yyp += yytnamerr (yyp, yyarg[yyi++]);
1499 #endif /* YYERROR_VERBOSE */
1502 /*-----------------------------------------------.
1503 | Release the memory associated to this symbol. |
1504 `-----------------------------------------------*/
1507 #if (defined __STDC__ || defined __C99__FUNC__ \
1508 || defined __cplusplus || defined _MSC_VER)
1510 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1513 yydestruct (yymsg, yytype, yyvaluep)
1523 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1533 /* Prevent warnings from -Wmissing-prototypes. */
1534 #ifdef YYPARSE_PARAM
1535 #if defined __STDC__ || defined __cplusplus
1536 int yyparse (void *YYPARSE_PARAM);
1540 #else /* ! YYPARSE_PARAM */
1541 #if defined __STDC__ || defined __cplusplus
1546 #endif /* ! YYPARSE_PARAM */
1549 /* The lookahead symbol. */
1552 /* The semantic value of the lookahead symbol. */
1555 /* Number of syntax errors so far. */
1560 /*-------------------------.
1561 | yyparse or yypush_parse. |
1562 `-------------------------*/
1564 #ifdef YYPARSE_PARAM
1565 #if (defined __STDC__ || defined __C99__FUNC__ \
1566 || defined __cplusplus || defined _MSC_VER)
1568 yyparse (void *YYPARSE_PARAM)
1571 yyparse (YYPARSE_PARAM)
1572 void *YYPARSE_PARAM;
1574 #else /* ! YYPARSE_PARAM */
1575 #if (defined __STDC__ || defined __C99__FUNC__ \
1576 || defined __cplusplus || defined _MSC_VER)
1589 /* Number of tokens to shift before error messages enabled. */
1592 /* The stacks and their tools:
1593 `yyss': related to states.
1594 `yyvs': related to semantic values.
1596 Refer to the stacks thru separate pointers, to allow yyoverflow
1597 to reallocate them elsewhere. */
1599 /* The state stack. */
1600 yytype_int16 yyssa[YYINITDEPTH];
1602 yytype_int16 *yyssp;
1604 /* The semantic value stack. */
1605 YYSTYPE yyvsa[YYINITDEPTH];
1609 YYSIZE_T yystacksize;
1613 /* Lookahead token as an internal (translated) token number. */
1615 /* The variables used to return semantic value and location from the
1620 /* Buffer for error messages, and its allocated size. */
1622 char *yymsg = yymsgbuf;
1623 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1626 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1628 /* The number of symbols on the RHS of the reduced rule.
1629 Keep to zero when no symbol should be popped. */
1635 yystacksize = YYINITDEPTH;
1637 YYDPRINTF ((stderr, "Starting parse\n"));
1642 yychar = YYEMPTY; /* Cause a token to be read. */
1644 /* Initialize stack pointers.
1645 Waste one element of value and location stack
1646 so that they stay on the same level as the state stack.
1647 The wasted elements are never initialized. */
1653 /*------------------------------------------------------------.
1654 | yynewstate -- Push a new state, which is found in yystate. |
1655 `------------------------------------------------------------*/
1657 /* In all cases, when you get here, the value and location stacks
1658 have just been pushed. So pushing a state here evens the stacks. */
1664 if (yyss + yystacksize - 1 <= yyssp)
1666 /* Get the current used size of the three stacks, in elements. */
1667 YYSIZE_T yysize = yyssp - yyss + 1;
1671 /* Give user a chance to reallocate the stack. Use copies of
1672 these so that the &'s don't force the real ones into
1674 YYSTYPE *yyvs1 = yyvs;
1675 yytype_int16 *yyss1 = yyss;
1677 /* Each stack pointer address is followed by the size of the
1678 data in use in that stack, in bytes. This used to be a
1679 conditional around just the two extra args, but that might
1680 be undefined if yyoverflow is a macro. */
1681 yyoverflow (YY_("memory exhausted"),
1682 &yyss1, yysize * sizeof (*yyssp),
1683 &yyvs1, yysize * sizeof (*yyvsp),
1689 #else /* no yyoverflow */
1690 # ifndef YYSTACK_RELOCATE
1691 goto yyexhaustedlab;
1693 /* Extend the stack our own way. */
1694 if (YYMAXDEPTH <= yystacksize)
1695 goto yyexhaustedlab;
1697 if (YYMAXDEPTH < yystacksize)
1698 yystacksize = YYMAXDEPTH;
1701 yytype_int16 *yyss1 = yyss;
1702 union yyalloc *yyptr =
1703 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1705 goto yyexhaustedlab;
1706 YYSTACK_RELOCATE (yyss_alloc, yyss);
1707 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1708 # undef YYSTACK_RELOCATE
1710 YYSTACK_FREE (yyss1);
1713 #endif /* no yyoverflow */
1715 yyssp = yyss + yysize - 1;
1716 yyvsp = yyvs + yysize - 1;
1718 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1719 (unsigned long int) yystacksize));
1721 if (yyss + yystacksize - 1 <= yyssp)
1725 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1727 if (yystate == YYFINAL)
1737 /* Do appropriate processing given the current state. Read a
1738 lookahead token if we need one and don't already have one. */
1740 /* First try to decide what to do without reference to lookahead token. */
1741 yyn = yypact[yystate];
1742 if (yyn == YYPACT_NINF)
1745 /* Not known => get a lookahead token if don't already have one. */
1747 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1748 if (yychar == YYEMPTY)
1750 YYDPRINTF ((stderr, "Reading a token: "));
1754 if (yychar <= YYEOF)
1756 yychar = yytoken = YYEOF;
1757 YYDPRINTF ((stderr, "Now at end of input.\n"));
1761 yytoken = YYTRANSLATE (yychar);
1762 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1765 /* If the proper action on seeing token YYTOKEN is to reduce or to
1766 detect an error, take that action. */
1768 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1773 if (yyn == 0 || yyn == YYTABLE_NINF)
1779 /* Count tokens shifted since error; after three, turn off error
1784 /* Shift the lookahead token. */
1785 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1787 /* Discard the shifted token. */
1796 /*-----------------------------------------------------------.
1797 | yydefault -- do the default action for the current state. |
1798 `-----------------------------------------------------------*/
1800 yyn = yydefact[yystate];
1806 /*-----------------------------.
1807 | yyreduce -- Do a reduction. |
1808 `-----------------------------*/
1810 /* yyn is the number of a rule to reduce with. */
1813 /* If YYLEN is nonzero, implement the default value of the action:
1816 Otherwise, the following line sets YYVAL to garbage.
1817 This behavior is undocumented and Bison
1818 users should not rely upon it. Assigning to YYVAL
1819 unconditionally makes the parser a bit smaller, and it avoids a
1820 GCC warning that YYVAL may be used uninitialized. */
1821 yyval = yyvsp[1-yylen];
1824 YY_REDUCE_PRINT (yyn);
1829 /* Line 1455 of yacc.c */
1830 #line 132 "inform.y"
1831 { lex_offset = n_strlen(lex_expression); }
1836 /* Line 1455 of yacc.c */
1837 #line 134 "inform.y"
1840 f = n_file_name_or_prompt(fileusage_Data|fileusage_BinaryMode,
1841 filemode_Write, lex_tail());
1842 w_glk_put_buffer_stream(f, (char *) z_memory, total_size);
1843 glk_stream_close(f, NULL);
1849 /* Line 1455 of yacc.c */
1850 #line 142 "inform.y"
1851 { parse_new_alias(lex_tail(), FALSE); }
1856 /* Line 1455 of yacc.c */
1857 #line 144 "inform.y"
1858 { parse_new_alias(lex_tail(), TRUE); }
1863 /* Line 1455 of yacc.c */
1864 #line 146 "inform.y"
1865 { remove_alias(lex_tail()); }
1870 /* Line 1455 of yacc.c */
1871 #line 148 "inform.y"
1872 { automap_init(object_count, lex_tail()); }
1877 /* Line 1455 of yacc.c */
1878 #line 150 "inform.y"
1884 /* Line 1455 of yacc.c */
1885 #line 152 "inform.y"
1886 { op_restart(); exit_debugger = TRUE; read_abort = TRUE; }
1891 /* Line 1455 of yacc.c */
1892 #line 154 "inform.y"
1895 exit_debugger = TRUE; read_abort = TRUE;
1899 mop_store_result(2);
1901 infix_print_string("Restore failed.\n");
1907 /* Line 1455 of yacc.c */
1908 #line 165 "inform.y"
1909 { zword oldop0 = operand[0]; operand[0] = 4; op_output_stream(); operand[0] = oldop0; }
1914 /* Line 1455 of yacc.c */
1915 #line 167 "inform.y"
1916 { zword oldop0 = operand[0]; operand[0] = neg(4); op_output_stream(); operand[0] = oldop0; }
1921 /* Line 1455 of yacc.c */
1922 #line 169 "inform.y"
1923 { zword oldop0 = operand[0]; operand[0] = 1; op_input_stream(); operand[0] = oldop0; exit_debugger = TRUE; }
1928 /* Line 1455 of yacc.c */
1929 #line 171 "inform.y"
1930 { zword oldop0 = operand[0]; operand[0] = 0; op_input_stream(); operand[0] = oldop0; }
1935 /* Line 1455 of yacc.c */
1936 #line 173 "inform.y"
1937 { z_close(); glk_exit(); }
1942 /* Line 1455 of yacc.c */
1943 #line 175 "inform.y"
1946 read_abort = TRUE; exit_debugger = TRUE;
1948 infix_print_string("No undo slots.\n");
1954 /* Line 1455 of yacc.c */
1955 #line 182 "inform.y"
1958 read_abort = TRUE; exit_debugger = TRUE;
1960 infix_print_string("No redo slots.\n");
1966 /* Line 1455 of yacc.c */
1967 #line 189 "inform.y"
1970 f = n_file_name_or_prompt(fileusage_Data|fileusage_BinaryMode,
1971 filemode_Read, lex_tail());
1980 /* Line 1455 of yacc.c */
1981 #line 198 "inform.y"
1982 { infix_display((yyvsp[(2) - (2)].val)); }
1987 /* Line 1455 of yacc.c */
1988 #line 200 "inform.y"
1989 { inform_result = (yyvsp[(2) - (2)].val); }
1994 /* Line 1455 of yacc.c */
1995 #line 202 "inform.y"
1996 { infix_auto_display(lex_tail()); }
2001 /* Line 1455 of yacc.c */
2002 #line 204 "inform.y"
2003 { infix_auto_undisplay((yyvsp[(2) - (2)].val).v); }
2008 /* Line 1455 of yacc.c */
2009 #line 206 "inform.y"
2010 { infix_set_display_enabled((yyvsp[(2) - (2)].val).v, FALSE); }
2015 /* Line 1455 of yacc.c */
2016 #line 208 "inform.y"
2017 { infix_set_display_enabled((yyvsp[(2) - (2)].val).v, TRUE); }
2022 /* Line 1455 of yacc.c */
2023 #line 210 "inform.y"
2024 { infix_move((yyvsp[(4) - (4)].val).v, (yyvsp[(2) - (4)].val).v); }
2029 /* Line 1455 of yacc.c */
2030 #line 212 "inform.y"
2031 { infix_object_tree(0); }
2036 /* Line 1455 of yacc.c */
2037 #line 214 "inform.y"
2038 { infix_object_tree((yyvsp[(2) - (2)].val).v); }
2043 /* Line 1455 of yacc.c */
2044 #line 216 "inform.y"
2046 if(lex_expression[lex_offset])
2047 infix_object_find(lex_tail());
2053 /* Line 1455 of yacc.c */
2054 #line 221 "inform.y"
2056 z_typed v; v.t = Z_GLOBAL;
2057 for(v.o = 0; v.o <= 245; v.o++) {
2058 const char *name = infix_get_name(v);
2059 if(v.o) infix_print_string("; ");
2061 infix_print_string(name);
2063 infix_print_char('G');
2064 infix_print_number(v.o);
2066 infix_print_char('=');
2068 infix_print_number(v.v);
2070 infix_print_char(10);
2076 /* Line 1455 of yacc.c */
2077 #line 239 "inform.y"
2079 z_typed v; v.t = Z_GLOBAL;
2080 for(v.o = 0; v.o <= 245; v.o++) {
2082 if(v.v == (yyvsp[(2) - (2)].val).v) {
2083 const char *name = infix_get_name(v);
2085 infix_print_string(name);
2087 infix_print_char('G');
2088 infix_print_number(v.o);
2090 infix_print_char(10);
2097 /* Line 1455 of yacc.c */
2098 #line 255 "inform.y"
2099 { infix_set_attrib((yyvsp[(2) - (3)].val).v, (yyvsp[(3) - (3)].val).v); }
2104 /* Line 1455 of yacc.c */
2105 #line 257 "inform.y"
2106 { infix_clear_attrib((yyvsp[(2) - (4)].val).v, (yyvsp[(4) - (4)].val).v); }
2111 /* Line 1455 of yacc.c */
2112 #line 259 "inform.y"
2113 { infix_remove((yyvsp[(2) - (2)].val).v); }
2118 /* Line 1455 of yacc.c */
2119 #line 261 "inform.y"
2120 { PC=(yyvsp[(2) - (2)].pcoffset); exit_debugger = TRUE; }
2125 /* Line 1455 of yacc.c */
2126 #line 263 "inform.y"
2127 { set_step(CONT_GO, 1); }
2132 /* Line 1455 of yacc.c */
2133 #line 265 "inform.y"
2134 { set_step(CONT_GO, 1); infix_set_ignore(cur_break, (yyvsp[(2) - (2)].val).v); }
2139 /* Line 1455 of yacc.c */
2140 #line 267 "inform.y"
2141 { set_step(CONT_STEP, 1); }
2146 /* Line 1455 of yacc.c */
2147 #line 269 "inform.y"
2148 { set_step(CONT_STEP, (yyvsp[(2) - (2)].val).v); }
2153 /* Line 1455 of yacc.c */
2154 #line 271 "inform.y"
2155 { set_step(CONT_NEXT, 1); }
2160 /* Line 1455 of yacc.c */
2161 #line 273 "inform.y"
2162 { set_step(CONT_NEXT, (yyvsp[(2) - (2)].val).v); }
2167 /* Line 1455 of yacc.c */
2168 #line 275 "inform.y"
2169 { set_step(CONT_UNTIL, 1); }
2174 /* Line 1455 of yacc.c */
2175 #line 277 "inform.y"
2176 { set_step(CONT_STEPI, 1); }
2181 /* Line 1455 of yacc.c */
2182 #line 279 "inform.y"
2183 { set_step(CONT_STEPI, (yyvsp[(2) - (2)].val).v); }
2188 /* Line 1455 of yacc.c */
2189 #line 281 "inform.y"
2190 { set_step(CONT_NEXTI, 1); }
2195 /* Line 1455 of yacc.c */
2196 #line 283 "inform.y"
2197 { set_step(CONT_NEXTI, (yyvsp[(2) - (2)].val).v); }
2202 /* Line 1455 of yacc.c */
2203 #line 285 "inform.y"
2204 { set_step(CONT_FINISH, 1); }
2209 /* Line 1455 of yacc.c */
2210 #line 287 "inform.y"
2211 { infix_set_break((yyvsp[(2) - (2)].pcoffset)); }
2216 /* Line 1455 of yacc.c */
2217 #line 289 "inform.y"
2218 { int n = infix_set_break((yyvsp[(2) - (3)].pcoffset)); infix_set_cond(n, lex_tail()); }
2223 /* Line 1455 of yacc.c */
2224 #line 291 "inform.y"
2225 { infix_set_cond((yyvsp[(2) - (2)].val).v, lex_tail()); }
2230 /* Line 1455 of yacc.c */
2231 #line 293 "inform.y"
2232 { infix_set_ignore((yyvsp[(2) - (3)].val).v, (yyvsp[(3) - (3)].val).v); }
2237 /* Line 1455 of yacc.c */
2238 #line 295 "inform.y"
2239 { infix_delete_breakpoint((yyvsp[(2) - (2)].val).v); }
2244 /* Line 1455 of yacc.c */
2245 #line 297 "inform.y"
2246 { infix_show_all_breakpoints(); }
2251 /* Line 1455 of yacc.c */
2252 #line 299 "inform.y"
2253 { infix_show_breakpoint((yyvsp[(2) - (2)].val).v); }
2258 /* Line 1455 of yacc.c */
2259 #line 301 "inform.y"
2260 { infix_set_break_enabled((yyvsp[(2) - (2)].val).v, FALSE); }
2265 /* Line 1455 of yacc.c */
2266 #line 303 "inform.y"
2267 { infix_set_break_enabled((yyvsp[(2) - (2)].val).v, TRUE); }
2272 /* Line 1455 of yacc.c */
2273 #line 305 "inform.y"
2274 { infix_print_string("The current source language is \"inform\".\n"); }
2279 /* Line 1455 of yacc.c */
2280 #line 307 "inform.y"
2281 { infix_print_string("Current source file is "); infix_print_string(cur_file?cur_file->filename:"unknown"); infix_print_string("\nContains "); infix_print_number(cur_file?cur_file->num_lines:0); infix_print_string(" lines.\nSource language is inform.\n"); }
2286 /* Line 1455 of yacc.c */
2287 #line 309 "inform.y"
2288 { infix_print_string("Source files for which symbols have been read in:\n\n"); infix_list_files(); infix_print_char('\n'); }
2293 /* Line 1455 of yacc.c */
2294 #line 311 "inform.y"
2300 /* Line 1455 of yacc.c */
2301 #line 313 "inform.y"
2302 { show_warranty(); }
2307 /* Line 1455 of yacc.c */
2308 #line 315 "inform.y"
2309 { infix_show_frame(infix_selected_frame); }
2314 /* Line 1455 of yacc.c */
2315 #line 317 "inform.y"
2316 { infix_select_frame((yyvsp[(2) - (2)].val).v); infix_show_frame((yyvsp[(2) - (2)].val).v); }
2321 /* Line 1455 of yacc.c */
2322 #line 319 "inform.y"
2323 { infix_select_frame((yyvsp[(2) - (2)].val).v); }
2328 /* Line 1455 of yacc.c */
2329 #line 321 "inform.y"
2330 { infix_select_frame(infix_selected_frame - 1); infix_show_frame(infix_selected_frame); }
2335 /* Line 1455 of yacc.c */
2336 #line 323 "inform.y"
2337 { infix_select_frame(infix_selected_frame - (yyvsp[(2) - (2)].val).v); infix_show_frame(infix_selected_frame); }
2342 /* Line 1455 of yacc.c */
2343 #line 325 "inform.y"
2344 { infix_select_frame(infix_selected_frame - 1); }
2349 /* Line 1455 of yacc.c */
2350 #line 327 "inform.y"
2351 { infix_select_frame(infix_selected_frame - (yyvsp[(2) - (2)].val).v); }
2356 /* Line 1455 of yacc.c */
2357 #line 329 "inform.y"
2358 { infix_select_frame(infix_selected_frame + 1); infix_show_frame(infix_selected_frame); }
2363 /* Line 1455 of yacc.c */
2364 #line 331 "inform.y"
2365 { infix_select_frame(infix_selected_frame + (yyvsp[(2) - (2)].val).v); infix_show_frame(infix_selected_frame); }
2370 /* Line 1455 of yacc.c */
2371 #line 333 "inform.y"
2372 { infix_select_frame(infix_selected_frame + 1); }
2377 /* Line 1455 of yacc.c */
2378 #line 335 "inform.y"
2379 { infix_select_frame(infix_selected_frame + (yyvsp[(2) - (2)].val).v); }
2384 /* Line 1455 of yacc.c */
2385 #line 337 "inform.y"
2386 { infix_backtrace(0, stack_get_depth()); }
2391 /* Line 1455 of yacc.c */
2392 #line 339 "inform.y"
2393 { infix_backtrace(stack_get_depth() - (yyvsp[(2) - (2)].val).v, (yyvsp[(2) - (2)].val).v); }
2398 /* Line 1455 of yacc.c */
2399 #line 341 "inform.y"
2400 { infix_backtrace(0, (yyvsp[(3) - (3)].val).v); }
2405 /* Line 1455 of yacc.c */
2406 #line 349 "inform.y"
2407 { if((yyvsp[(1) - (1)].val).t == Z_ROUTINE) (yyval.pcoffset) = infix_get_routine_PC((yyvsp[(1) - (1)].val).v); else { infix_location l; infix_decode_fileloc(&l, cur_file?cur_file->filename:"", (yyvsp[(1) - (1)].val).v); (yyval.pcoffset) = l.thisPC; } }
2412 /* Line 1455 of yacc.c */
2413 #line 350 "inform.y"
2414 { infix_location l; infix_decode_fileloc(&l, cur_file?cur_file->filename:"", cur_line + (yyvsp[(2) - (2)].val).v); (yyval.pcoffset) = l.thisPC; }
2419 /* Line 1455 of yacc.c */
2420 #line 351 "inform.y"
2421 { infix_location l; infix_decode_fileloc(&l, cur_file?cur_file->filename:"", cur_line - (yyvsp[(2) - (2)].val).v); (yyval.pcoffset) = l.thisPC; }
2426 /* Line 1455 of yacc.c */
2427 #line 352 "inform.y"
2428 { if((yyvsp[(3) - (3)].val).t == Z_ROUTINE) (yyval.pcoffset) = UNPACKR((yyvsp[(3) - (3)].val).v); else { infix_location l; infix_decode_fileloc(&l, (yyvsp[(1) - (3)].filenum)->filename, (yyvsp[(3) - (3)].val).v); (yyval.pcoffset) = l.thisPC; } }
2433 /* Line 1455 of yacc.c */
2434 #line 353 "inform.y"
2435 { (yyval.pcoffset) = (yyvsp[(2) - (2)].val).v; }
2440 /* Line 1455 of yacc.c */
2441 #line 357 "inform.y"
2443 if(condlist->condfunc(condlist->val, (yyvsp[(1) - (1)].val).v) ^ condlist->opposite) {
2444 (yyval.flag) = TRUE;
2447 (yyval.flag) = FALSE;
2453 /* Line 1455 of yacc.c */
2454 #line 364 "inform.y"
2456 if((yyvsp[(1) - (3)].flag))
2457 (yyval.flag) = TRUE;
2459 if(condlist->condfunc(condlist->val, (yyvsp[(3) - (3)].val).v) ^ condlist->opposite) {
2460 (yyval.flag) = TRUE;
2463 else (yyval.flag) = FALSE;
2469 /* Line 1455 of yacc.c */
2470 #line 377 "inform.y"
2471 { (yyval.zlist) = NULL; }
2476 /* Line 1455 of yacc.c */
2477 #line 378 "inform.y"
2478 { zword_list g; (yyval.zlist) = (yyvsp[(3) - (3)].zlist); g.item = (yyvsp[(1) - (3)].val).v; LEaddm((yyval.zlist), g, n_rmmalloc); }
2483 /* Line 1455 of yacc.c */
2484 #line 384 "inform.y"
2485 { (yyval.val) = (yyvsp[(3) - (3)].val); }
2490 /* Line 1455 of yacc.c */
2491 #line 385 "inform.y"
2492 { (yyval.val) = (yyvsp[(3) - (3)].val); }
2497 /* Line 1455 of yacc.c */
2498 #line 390 "inform.y"
2499 { cond_list newcond; newcond.val = (yyvsp[(1) - (2)].val).v; newcond.condfunc = (yyvsp[(2) - (2)].cond).condfunc; newcond.opposite = (yyvsp[(2) - (2)].cond).opposite; LEaddm(condlist, newcond, n_rmmalloc); }
2504 /* Line 1455 of yacc.c */
2505 #line 390 "inform.y"
2506 { if((yyvsp[(4) - (4)].flag)) ignoreeffects--; (yyval.val).v = (yyvsp[(4) - (4)].flag); (yyval.val).t = Z_BOOLEAN; LEremovem(condlist, n_rmfreeone); }
2511 /* Line 1455 of yacc.c */
2512 #line 395 "inform.y"
2513 { (yyval.val) = (yyvsp[(1) - (1)].val); }
2518 /* Line 1455 of yacc.c */
2519 #line 397 "inform.y"
2520 { (yyval.val).v = 0; (yyval.val).t = Z_BOOLEAN; }
2525 /* Line 1455 of yacc.c */
2526 #line 399 "inform.y"
2527 { (yyval.val).v = 1; (yyval.val).t = Z_BOOLEAN; }
2532 /* Line 1455 of yacc.c */
2533 #line 401 "inform.y"
2534 { (yyval.val).v = 0; (yyval.val).t = Z_OBJECT; }
2539 /* Line 1455 of yacc.c */
2540 #line 404 "inform.y"
2541 { (yyval.val) = (yyvsp[(3) - (3)].val); infix_assign(&(yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val).v); }
2546 /* Line 1455 of yacc.c */
2547 #line 407 "inform.y"
2548 { (yyval.val).v = infix_parent((yyvsp[(3) - (4)].val).v); (yyval.val).t = Z_OBJECT; }
2553 /* Line 1455 of yacc.c */
2554 #line 409 "inform.y"
2555 { (yyval.val).v = infix_child((yyvsp[(3) - (4)].val).v); (yyval.val).t = Z_OBJECT; }
2560 /* Line 1455 of yacc.c */
2561 #line 411 "inform.y"
2562 { (yyval.val).v = infix_sibling((yyvsp[(3) - (4)].val).v); (yyval.val).t = Z_OBJECT; }
2567 /* Line 1455 of yacc.c */
2568 #line 413 "inform.y"
2569 { int n = 0; zword o = infix_child((yyvsp[(3) - (4)].val).v); while(o) { n++; o = infix_sibling(o); } (yyval.val).v = n; (yyval.val).t = Z_NUMBER; }
2574 /* Line 1455 of yacc.c */
2575 #line 416 "inform.y"
2577 if(!ignoreeffects) {
2578 (yyval.val).v = z_random((yyvsp[(3) - (4)].val).v);
2579 (yyval.val).t = Z_NUMBER;
2582 (yyval.val).t = Z_UNKNOWN;
2589 /* Line 1455 of yacc.c */
2590 #line 426 "inform.y"
2595 if(!ignoreeffects) {
2596 for(p = (yyvsp[(3) - (4)].zlist); p && i < 16; p=p->next) {
2597 locals[i++] = p->item;
2599 mop_call((yyvsp[(1) - (4)].val).v, i, locals, -2);
2601 exit_decoder = FALSE;
2602 (yyval.val).v = time_ret; (yyval.val).t = Z_UNKNOWN;
2604 (yyval.val).v = 0; (yyval.val).t = Z_UNKNOWN;
2611 /* Line 1455 of yacc.c */
2612 #line 443 "inform.y"
2613 { if((yyvsp[(1) - (2)].val).v == 0) ignoreeffects++; }
2618 /* Line 1455 of yacc.c */
2619 #line 444 "inform.y"
2620 { if((yyvsp[(1) - (4)].val).v == 0) ignoreeffects--; (yyval.val) = z_t((yyvsp[(1) - (4)].val), (yyvsp[(4) - (4)].val), (yyvsp[(1) - (4)].val).v && (yyvsp[(4) - (4)].val).v); }
2625 /* Line 1455 of yacc.c */
2626 #line 445 "inform.y"
2627 { if((yyvsp[(1) - (2)].val).v != 0) ignoreeffects++; }
2632 /* Line 1455 of yacc.c */
2633 #line 446 "inform.y"
2634 { if((yyvsp[(1) - (4)].val).v != 0) ignoreeffects--; (yyval.val) = z_t((yyvsp[(1) - (4)].val), (yyvsp[(4) - (4)].val), (yyvsp[(1) - (4)].val).v || (yyvsp[(4) - (4)].val).v); }
2639 /* Line 1455 of yacc.c */
2640 #line 448 "inform.y"
2641 { (yyval.val).v = !((yyvsp[(2) - (2)].val).v); (yyval.val).t = Z_NUMBER; }
2646 /* Line 1455 of yacc.c */
2647 #line 451 "inform.y"
2648 { (yyval.val) = z_t((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val), (yyvsp[(1) - (3)].val).v + (yyvsp[(3) - (3)].val).v); }
2653 /* Line 1455 of yacc.c */
2654 #line 453 "inform.y"
2655 { (yyval.val) = z_t((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val), (yyvsp[(1) - (3)].val).v + neg((yyvsp[(3) - (3)].val).v)); }
2660 /* Line 1455 of yacc.c */
2661 #line 455 "inform.y"
2662 { (yyval.val) = z_t((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val), z_mult((yyvsp[(1) - (3)].val).v, (yyvsp[(3) - (3)].val).v)); }
2667 /* Line 1455 of yacc.c */
2668 #line 457 "inform.y"
2669 { (yyval.val) = z_t((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val), z_div((yyvsp[(1) - (3)].val).v, (yyvsp[(3) - (3)].val).v)); }
2674 /* Line 1455 of yacc.c */
2675 #line 459 "inform.y"
2676 { (yyval.val) = z_t((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val), z_mod((yyvsp[(1) - (3)].val).v, (yyvsp[(3) - (3)].val).v)); }
2681 /* Line 1455 of yacc.c */
2682 #line 461 "inform.y"
2683 { (yyval.val) = z_t((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val), (yyvsp[(1) - (3)].val).v & (yyvsp[(3) - (3)].val).v); }
2688 /* Line 1455 of yacc.c */
2689 #line 463 "inform.y"
2690 { (yyval.val) = z_t((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val), (yyvsp[(1) - (3)].val).v | (yyvsp[(3) - (3)].val).v); }
2695 /* Line 1455 of yacc.c */
2696 #line 465 "inform.y"
2697 { (yyval.val) = z_t((yyvsp[(2) - (2)].val), (yyvsp[(2) - (2)].val), ~(yyvsp[(2) - (2)].val).v); }
2702 /* Line 1455 of yacc.c */
2703 #line 468 "inform.y"
2704 { (yyval.val).t = Z_BYTEARRAY; (yyval.val).o = (yyvsp[(1) - (3)].val).v; (yyval.val).p = (yyvsp[(3) - (3)].val).v; infix_get_val(&(yyval.val)); }
2709 /* Line 1455 of yacc.c */
2710 #line 470 "inform.y"
2711 { (yyval.val).t = Z_WORDARRAY; (yyval.val).o = (yyvsp[(1) - (3)].val).v; (yyval.val).p = (yyvsp[(3) - (3)].val).v; infix_get_val(&(yyval.val)); }
2716 /* Line 1455 of yacc.c */
2717 #line 473 "inform.y"
2718 { (yyval.val) = z_t((yyvsp[(2) - (2)].val), (yyvsp[(2) - (2)].val), neg((yyvsp[(2) - (2)].val).v)); }
2723 /* Line 1455 of yacc.c */
2724 #line 476 "inform.y"
2725 { if(!ignoreeffects) infix_assign(&(yyvsp[(2) - (2)].val), ARITHMASK((yyvsp[(2) - (2)].val).v + 1)); (yyval.val) = (yyvsp[(2) - (2)].val); }
2730 /* Line 1455 of yacc.c */
2731 #line 478 "inform.y"
2732 { (yyval.val) = (yyvsp[(1) - (2)].val); if(!ignoreeffects) infix_assign(&(yyvsp[(1) - (2)].val), ARITHMASK((yyvsp[(1) - (2)].val).v + 1)); }
2737 /* Line 1455 of yacc.c */
2738 #line 480 "inform.y"
2739 { if(!ignoreeffects) infix_assign(&(yyvsp[(2) - (2)].val), ARITHMASK((yyvsp[(2) - (2)].val).v + neg(1))); (yyval.val) = (yyvsp[(2) - (2)].val); }
2744 /* Line 1455 of yacc.c */
2745 #line 482 "inform.y"
2746 { (yyval.val) = (yyvsp[(1) - (2)].val); if(!ignoreeffects) infix_assign(&(yyvsp[(1) - (2)].val), ARITHMASK((yyvsp[(1) - (2)].val).v + neg(1))); }
2751 /* Line 1455 of yacc.c */
2752 #line 485 "inform.y"
2753 { zword len; (yyval.val).v = infix_get_proptable((yyvsp[(1) - (3)].val).v, (yyvsp[(3) - (3)].val).v, &len); (yyval.val).t = Z_NUMBER; }
2758 /* Line 1455 of yacc.c */
2759 #line 487 "inform.y"
2760 { infix_get_proptable((yyvsp[(1) - (3)].val).v, (yyvsp[(3) - (3)].val).v, &(yyval.val).v); (yyval.val).t = Z_NUMBER; }
2765 /* Line 1455 of yacc.c */
2766 #line 490 "inform.y"
2767 { (yyval.val).t = Z_OBJPROP; (yyval.val).o = (yyvsp[(1) - (3)].val).v; (yyval.val).p = (yyvsp[(3) - (3)].val).v; infix_get_val(&(yyval.val)); }
2772 /* Line 1455 of yacc.c */
2773 #line 498 "inform.y"
2774 { (yyval.val).v = (yyvsp[(2) - (2)].val).v; (yyval.val).t = Z_NUMBER; }
2779 /* Line 1455 of yacc.c */
2780 #line 500 "inform.y"
2781 { (yyval.val).v = (yyvsp[(2) - (2)].val).v; (yyval.val).t = Z_OBJECT; }
2786 /* Line 1455 of yacc.c */
2787 #line 502 "inform.y"
2788 { (yyval.val).v = (yyvsp[(2) - (2)].val).v; (yyval.val).t = Z_ROUTINE; }
2793 /* Line 1455 of yacc.c */
2794 #line 504 "inform.y"
2795 { (yyval.val).v = (yyvsp[(2) - (2)].val).v; (yyval.val).t = Z_STRING; }
2800 /* Line 1455 of yacc.c */
2801 #line 506 "inform.y"
2802 { (yyval.val).t = Z_WORDARRAY; (yyval.val).o = z_globaltable; (yyval.val).p = (yyvsp[(2) - (2)].val).v; infix_get_val(&(yyval.val)); }
2807 /* Line 1455 of yacc.c */
2808 #line 508 "inform.y"
2809 { (yyval.val).t = Z_LOCAL; (yyval.val).o = infix_selected_frame; (yyval.val).p = (yyvsp[(2) - (2)].val).v; infix_get_val(&(yyval.val)); }
2814 /* Line 1455 of yacc.c */
2815 #line 510 "inform.y"
2816 { (yyval.val) = (yyvsp[(2) - (3)].val); }
2821 /* Line 1455 of yacc.c */
2822 #line 2823 "inform.c"
2825 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2829 YY_STACK_PRINT (yyss, yyssp);
2833 /* Now `shift' the result of the reduction. Determine what state
2834 that goes to, based on the state we popped back to and the rule
2835 number reduced by. */
2839 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2840 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2841 yystate = yytable[yystate];
2843 yystate = yydefgoto[yyn - YYNTOKENS];
2848 /*------------------------------------.
2849 | yyerrlab -- here on detecting error |
2850 `------------------------------------*/
2852 /* If not already recovering from an error, report this error. */
2856 #if ! YYERROR_VERBOSE
2857 yyerror (YY_("syntax error"));
2860 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2861 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2863 YYSIZE_T yyalloc = 2 * yysize;
2864 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2865 yyalloc = YYSTACK_ALLOC_MAXIMUM;
2866 if (yymsg != yymsgbuf)
2867 YYSTACK_FREE (yymsg);
2868 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2870 yymsg_alloc = yyalloc;
2874 yymsg_alloc = sizeof yymsgbuf;
2878 if (0 < yysize && yysize <= yymsg_alloc)
2880 (void) yysyntax_error (yymsg, yystate, yychar);
2885 yyerror (YY_("syntax error"));
2887 goto yyexhaustedlab;
2895 if (yyerrstatus == 3)
2897 /* If just tried and failed to reuse lookahead token after an
2898 error, discard it. */
2900 if (yychar <= YYEOF)
2902 /* Return failure if at end of input. */
2903 if (yychar == YYEOF)
2908 yydestruct ("Error: discarding",
2914 /* Else will try to reuse lookahead token after shifting the error
2919 /*---------------------------------------------------.
2920 | yyerrorlab -- error raised explicitly by YYERROR. |
2921 `---------------------------------------------------*/
2924 /* Pacify compilers like GCC when the user code never invokes
2925 YYERROR and the label yyerrorlab therefore never appears in user
2927 if (/*CONSTCOND*/ 0)
2930 /* Do not reclaim the symbols of the rule which action triggered
2934 YY_STACK_PRINT (yyss, yyssp);
2939 /*-------------------------------------------------------------.
2940 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2941 `-------------------------------------------------------------*/
2943 yyerrstatus = 3; /* Each real token shifted decrements this. */
2947 yyn = yypact[yystate];
2948 if (yyn != YYPACT_NINF)
2951 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2959 /* Pop the current state because it cannot handle the error token. */
2964 yydestruct ("Error: popping",
2965 yystos[yystate], yyvsp);
2968 YY_STACK_PRINT (yyss, yyssp);
2974 /* Shift the error token. */
2975 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2981 /*-------------------------------------.
2982 | yyacceptlab -- YYACCEPT comes here. |
2983 `-------------------------------------*/
2988 /*-----------------------------------.
2989 | yyabortlab -- YYABORT comes here. |
2990 `-----------------------------------*/
2995 #if !defined(yyoverflow) || YYERROR_VERBOSE
2996 /*-------------------------------------------------.
2997 | yyexhaustedlab -- memory exhaustion comes here. |
2998 `-------------------------------------------------*/
3000 yyerror (YY_("memory exhausted"));
3006 if (yychar != YYEMPTY)
3007 yydestruct ("Cleanup: discarding lookahead",
3009 /* Do not reclaim the symbols of the rule which action triggered
3010 this YYABORT or YYACCEPT. */
3012 YY_STACK_PRINT (yyss, yyssp);
3013 while (yyssp != yyss)
3015 yydestruct ("Cleanup: popping",
3016 yystos[*yyssp], yyvsp);
3021 YYSTACK_FREE (yyss);
3024 if (yymsg != yymsgbuf)
3025 YYSTACK_FREE (yymsg);
3027 /* Make sure YYID is used. */
3028 return YYID (yyresult);
3033 /* Line 1675 of yacc.c */
3034 #line 514 "inform.y"
3038 { /* fanagling to get emacs indentation sane */
3042 static z_typed z_t(z_typed a, z_typed b, zword v)
3046 if(a.t == Z_NUMBER && b.t == Z_NUMBER)
3060 static name_token infix_operators[] = {
3064 { BYTEARRAY, "->" },
3065 { WORDARRAY, "-->" },
3066 { NUMBER, "(number)" },
3067 { OBJECT, "(object)" },
3068 { ROUTINE, "(routine)" },
3069 { STRING, "(string)" },
3070 { GLOBAL, "(global)" },
3071 { LOCAL, "(local)" },
3072 { INCREMENT, "++" },
3073 { DECREMENT, "--" },
3074 { SUPERCLASS, "::" }
3078 static name_token infix_keywords[] = {
3083 { BFALSE, "false" },
3084 { NOTHING, "nothing" },
3085 { PARENT, "parent" },
3087 { SIBLING, "sibling" },
3088 { RANDOM, "random" },
3089 { CHILDREN, "children" }
3093 /* These are only valid as the first token in an expression. A single space
3094 matches at least one typed whitespace character */
3095 static name_token infix_commands[] = {
3099 { RALIAS, "ralias" },
3100 { UNALIAS, "unalias" },
3101 { DUMPMEM, "dumpmem" },
3102 { AUTOMAP, "automap" },
3106 { RESTORE, "restore" },
3107 { RESTART, "restart" },
3109 { RECORDON, "recording on" },
3110 { RECORDOFF, "recording off" },
3111 { REPLAY, "replay" },
3112 { REPLAYOFF, "replay off" },
3113 { SYMBOL_FILE, "symbol-file" },
3116 { PRINT, "call" }, /* No void functions in inform */
3119 { OBJECT_TREE, "object-tree" },
3120 { OBJECT_TREE, "tree" },
3122 { REMOVE, "remove" },
3124 { LIST_GLOBALS, "globals" },
3126 { CONT, "continue" },
3139 { FINISH, "finish" },
3141 { DELETE, "delete" },
3143 { DELETE, "delete breakpoints" },
3144 { COND, "condition" },
3145 { IGNORE, "ignore" },
3148 { SELECT_FRAME, "select-frame" },
3150 { DOWN_FRAME, "down" },
3151 { DOWN_FRAME, "do" },
3152 { UP_SILENTLY, "up-silently" },
3153 { DOWN_SILENTLY,"down-silently" },
3154 { BREAKPOINTS, "info breakpoints" },
3155 { BREAKPOINTS, "info watchpoints" },
3156 { BREAKPOINTS, "info break" },
3157 { DISABLE_BREAK,"disable" },
3158 { DISABLE_BREAK,"disable breakpoints" },
3159 { DISABLE_BREAK,"dis" },
3160 { DISABLE_BREAK,"dis breakpoints" },
3161 { ENABLE_BREAK, "enable" },
3162 { ENABLE_BREAK, "enable breakpoints" },
3163 { LANGUAGE, "show language" },
3164 { INFOSOURCE, "info source" },
3165 { INFOSOURCES, "info sources" },
3166 { COPYING, "show copying" },
3167 { WARRANTY, "show warranty" },
3168 { BACKTRACE, "backtrace" },
3169 { BACKTRACE, "bt" },
3170 { BACKTRACE, "where" },
3171 { BACKTRACE, "info stack" },
3172 { BACKTRACE, "info s" },
3173 { DISPLAY, "display" },
3174 { UNDISPLAY, "undisplay" },
3175 { UNDISPLAY, "delete display" },
3176 { DISABLE_DISPLAY,"disable display" },
3177 { DISABLE_DISPLAY,"dis display" },
3178 { ENABLE_DISPLAY,"enable display" }
3181 #include "dbg_help.h"
3183 static BOOL z_isequal(zword a, zword b)
3188 static BOOL z_isgreat(zword a, zword b)
3190 return is_greaterthan(a, b);
3193 static BOOL z_isless(zword a, zword b)
3195 return is_lessthan(a, b);
3198 static BOOL infix_provides(zword o, zword p)
3201 return (infix_get_proptable(o, p, &len) != 0);
3204 static BOOL infix_in(zword a, zword b)
3206 return infix_parent(a) == b;
3211 BOOL (*condfunc)(zword a, zword b);
3215 condition conditionlist[] = {
3216 { "==", z_isequal, FALSE },
3217 { "~=", z_isequal, TRUE },
3218 { ">", z_isgreat, FALSE },
3219 { "<", z_isless, FALSE },
3220 { "<=", z_isgreat, TRUE },
3221 { ">=", z_isless, TRUE },
3222 { "has", infix_test_attrib, FALSE },
3223 { "hasnt", infix_test_attrib, TRUE },
3224 { "in", infix_in, FALSE },
3225 { "notin", infix_in, TRUE },
3226 /*{ "ofclass", infix_ofclass, FALSE },*/
3227 { "provides",infix_provides, FALSE }
3231 static BOOL is_command_identifier(char c)
3233 return isalpha(c) || (c == '-');
3236 static BOOL is_identifier(char c)
3238 return isalpha(c) || isdigit(c) || (c == '_');
3241 static BOOL is_longer_identifier(char c)
3243 return isalpha(c) || isdigit(c) || (c == '_') || (c == '.') || (c == ':');
3246 static int grab_number(z_typed *val)
3250 char c = lex_expression[lex_offset + len];
3254 /* Don't handle negativity here */
3255 if(c == '-' || c == '+')
3261 c = lex_expression[lex_offset + len];
3265 c = lex_expression[lex_offset + len];
3269 num = n_strtol(lex_expression + lex_offset + len, &endptr, base);
3271 if(endptr != lex_expression + lex_offset) {
3272 len += endptr - lex_expression - lex_offset;
3281 typedef enum { match_None, match_Partial, match_Complete } match_type;
3283 static match_type command_matches(const char *command, const char *expression,
3284 unsigned *matchedlen)
3289 for(c = 0; command[c]; c++) {
3290 if(command[c] != expression[e]) {
3291 if(!is_command_identifier(expression[e])) {
3293 return match_Partial;
3300 if(command[c] == ' ') {
3301 while(expression[e] == ' ')
3306 if(!is_command_identifier(expression[e])) {
3308 return match_Complete;
3315 static int grab_command(void)
3321 match_type best_match = match_None;
3322 unsigned best_len = 0;
3326 while(isspace(lex_expression[lex_offset]))
3329 for(i = 0; i < sizeof(infix_commands) / sizeof(*infix_commands); i++) {
3330 switch(command_matches(infix_commands[i].name, lex_expression + lex_offset, &len)) {
3331 case match_Complete:
3332 if(len > best_len || best_match != match_Complete) {
3334 best_match = match_Complete;
3341 if(best_match != match_Complete) {
3345 best_match = match_Partial;
3355 if(ambig && best_match != match_Complete) {
3356 infix_print_string("Ambiguous command.\n");
3361 lex_offset += best_len;
3362 return infix_commands[best].token;
3365 infix_print_string("Undefined command.\n");
3370 static void inform_help(void)
3374 BOOL is_command = FALSE;
3376 for(i = lex_offset; lex_expression[i]; i++)
3377 if(!isspace(lex_expression[i]))
3381 infix_print_string("Help is available on the following commands:\n");
3382 for(i = 0; i < sizeof(command_help) / sizeof(*command_help); i++) {
3384 for(j = 0; j < sizeof(infix_commands) / sizeof(*infix_commands); j++)
3385 if(command_help[i].token == infix_commands[j].token) {
3386 infix_print_char('\'');
3387 infix_print_string(infix_commands[j].name);
3388 infix_print_char('\'');
3391 infix_print_char(' ');
3393 infix_print_string("\n");
3397 command = grab_command();
3399 for(i = 0; i < sizeof(command_help) / sizeof(*command_help); i++) {
3400 if(command_help[i].token == command) {
3401 infix_print_string(command_help[i].name);
3402 infix_print_char(10);
3406 infix_print_string("No help available for that command.\n");
3411 void process_debug_command(const char *buffer)
3416 lex_expression = buffer;
3423 BOOL exp_has_locals(const char *exp)
3428 z_typed evaluate_expression(const char *exp, unsigned frame)
3430 unsigned old_frame = infix_selected_frame;
3431 char *new_exp = (char *) n_malloc(n_strlen(exp) + 5);
3432 n_strcpy(new_exp, "set ");
3433 n_strcat(new_exp, exp);
3435 infix_selected_frame = frame;
3436 process_debug_command(new_exp);
3437 infix_selected_frame = old_frame;
3441 return inform_result;
3444 static void yyerror(const char *s)
3446 infix_print_string(s);
3447 infix_print_char(10);
3450 static int yylex(void)
3452 unsigned i, len, longer;
3453 BOOL check_command = FALSE;
3456 check_command = TRUE;
3458 while(isspace(lex_expression[lex_offset]))
3462 return grab_command();
3465 if((len = grab_number(&yylval.val)) != 0) {
3470 for(i = 0; i < sizeof(infix_operators) / sizeof(*infix_operators); i++) {
3471 if(n_strncmp(infix_operators[i].name, lex_expression + lex_offset,
3472 n_strlen(infix_operators[i].name)) == 0) {
3473 lex_offset += n_strlen(infix_operators[i].name);
3474 return infix_operators[i].token;
3478 for(i = 0; i < sizeof(conditionlist) / sizeof(*conditionlist); i++) {
3479 len = n_strlen(conditionlist[i].name);
3481 && n_strncmp(conditionlist[i].name,
3482 lex_expression + lex_offset, len) == 0
3483 && !(is_identifier(conditionlist[i].name[len-1])
3484 && is_identifier(lex_expression[lex_offset + len]))) {
3487 yylval.cond.condfunc = conditionlist[i].condfunc;
3488 yylval.cond.opposite = conditionlist[i].opposite;
3493 if((len = infix_find_file(&yylval.filenum, lex_expression + lex_offset)) != 0) {
3499 for(len = 0; is_identifier(lex_expression[lex_offset + len]); len++)
3503 return lex_expression[lex_offset++];
3505 for(i = 0; i < sizeof(infix_keywords) / sizeof(*infix_keywords); i++) {
3506 if(n_strmatch(infix_keywords[i].name, lex_expression + lex_offset, len)) {
3508 return infix_keywords[i].token;
3512 for(longer = len; is_longer_identifier(lex_expression[lex_offset + longer]); longer++)
3515 if(infix_find_symbol(&yylval.val, lex_expression + lex_offset, longer)) {
3516 lex_offset += longer;
3520 if(infix_find_symbol(&yylval.val, lex_expression + lex_offset, len)) {
3525 infix_print_string("Unknown identifier \"");
3526 for(i = 0; i < len; i++)
3527 infix_print_char(lex_expression[lex_offset + i]);
3528 infix_print_string("\"\n");
3533 #endif /* DEBUGGING */