From b3548bdd49a58692f6648b04248056d10a3d5a23 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Wed, 9 Sep 2009 22:00:57 +0000 Subject: [PATCH] Played around with nitfol build process, adding rules to generate the generated source files. Dependencies are kept to a minimum, requiring only Perl and Awk. Partly fixes #17. git-svn-id: http://lassie.dyndns-server.com/svn/gargoyle-gtk@110 ddfedd41-794f-dd11-ae45-00112f111e67 --- .svnignore | 1 + autogen.sh | 4 +- configure.ac | 31 +- docs/reference/Makefile.am | 11 +- interpreters/nitfol/.svnignore | 1 + interpreters/nitfol/Makefile.am | 40 +- interpreters/nitfol/copying.c | 299 --- interpreters/nitfol/dbg_help.h | 58 - interpreters/nitfol/dbg_help.texi | 185 -- interpreters/nitfol/inform.c | 3414 ++++++++++++++++++----------- interpreters/nitfol/nitfol.6 | 178 -- interpreters/nitfol/nitfol.html | 1189 ---------- interpreters/nitfol/nitfol.info | 443 ++-- interpreters/nitfol/opt2glkc.pl | 2 +- interpreters/nitfol/options.texi | 93 - interpreters/nitfol/startunix.c | 614 ------ po/POTFILES.skip | 6 + 17 files changed, 2470 insertions(+), 4099 deletions(-) delete mode 100644 interpreters/nitfol/copying.c delete mode 100644 interpreters/nitfol/dbg_help.h delete mode 100644 interpreters/nitfol/dbg_help.texi delete mode 100644 interpreters/nitfol/nitfol.6 delete mode 100644 interpreters/nitfol/nitfol.html delete mode 100644 interpreters/nitfol/options.texi delete mode 100644 interpreters/nitfol/startunix.c create mode 100644 po/POTFILES.skip diff --git a/.svnignore b/.svnignore index b9a5d97..6537f73 100644 --- a/.svnignore +++ b/.svnignore @@ -20,6 +20,7 @@ missing mkinstalldirs stamp-h1 TODO.tasks +ylwrap .anjuta* .tm_project2.cache diff --git a/autogen.sh b/autogen.sh index 58bd374..ee8c4dd 100755 --- a/autogen.sh +++ b/autogen.sh @@ -8,12 +8,12 @@ mkdir -p m4 ### GTK-DOC ######################################################### # Run before autotools echo "Setting up Gtk-Doc" -gtkdocize --flavour no-tmpl || exit 1 +gtkdocize --copy --flavour no-tmpl || exit 1 ### AUTOTOOLS ####################################################### # Runs autoconf, autoheader, aclocal, automake, autopoint, libtoolize echo "Regenerating autotools files" -autoreconf --install --symlink || exit 1 +autoreconf --force --install || exit 1 ### INTLTOOL ######################################################## # Run after autopoint diff --git a/configure.ac b/configure.ac index fa88005..231c8b4 100644 --- a/configure.ac +++ b/configure.ac @@ -24,21 +24,30 @@ CHIMARA_AGE=0 # Increment if interfaces added; set 0 if removed LT_VERSION_INFO="$CHIMARA_CURRENT:$CHIMARA_REVISION:$CHIMARA_AGE" AC_SUBST(LT_VERSION_INFO) +### DECLARE COMPILERS ######################################################### + +AC_PROG_CC # C compiler +AC_USE_SYSTEM_EXTENSIONS # Define _GNU_SOURCE if using GCC +AM_PROG_CC_C_O # Automake requires this for per-target CFLAGS +AC_C_INLINE # Define inline keyword +AC_PROG_YACC # Building nitfol requires yacc + ### DECLARE PROGRAMS ########################################################## -AC_PROG_CC # C compiler -AM_PROG_CC_C_O # Automake requires this for per-target CFLAGS -AC_PROG_INSTALL # Install +AC_PROG_INSTALL # Install m4_defun([_LT_AC_LANG_CXX_CONFIG], [:]) # Disable unnecessary Libtool checks m4_defun([_LT_AC_LANG_F77_CONFIG], [:]) # to save time (1.5 only) -LT_INIT # Libtool 2.2.6 and up -#LT_INIT([dlopen]) # Should call it this way, but -#LT_PREREQ([2.2.6]) # ...goddamn Debian still has 1.5 -AC_PROG_LIBTOOL # Old way of declaring Libtool -AM_GNU_GETTEXT([external]) # Gettext, link to system libintl -IT_PROG_INTLTOOL([0.35.0]) # Intltool -PKG_PROG_PKG_CONFIG # pkg_config -GTK_DOC_CHECK(1.9) # Gtk-Doc +LT_INIT # Libtool 2.2.6 and up +#LT_INIT([dlopen]) # Should call it this way, but +#LT_PREREQ([2.2.6]) # ...goddamn Debian still has 1.5 +AC_PROG_LIBTOOL # Old way of declaring Libtool +AM_GNU_GETTEXT([external]) # Gettext, link to system libintl +IT_PROG_INTLTOOL([0.35.0]) # Intltool +PKG_PROG_PKG_CONFIG # pkg_config +GTK_DOC_CHECK(1.9) # Gtk-Doc +# Other utilities used in this package's various make scripts +AC_PROG_AWK +AC_PATH_PROG([PERL], [perl]) # Perl ### TYPES ##################################################################### diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am index 77789f7..6139eaf 100644 --- a/docs/reference/Makefile.am +++ b/docs/reference/Makefile.am @@ -114,8 +114,9 @@ EXTRA_DIST += version.xml.in # for --rebuild-sections in $(SCAN_OPTIONS), e.g. $(DOC_MODULE)-sections.txt DISTCLEANFILES = $(DOC_MODULE)-overrides.txt -# Comment this out if you want your docs-status tested during 'make check' -if ENABLE_GTK_DOC -TESTS_ENVIRONMENT = cd $(srcdir) && -TESTS = $(GTKDOC_CHECK) -endif +# Uncomment this if you want your docs-status tested during 'make check' +# Comment this while not all symbols are documented, otherwise distcheck fails +#if ENABLE_GTK_DOC +#TESTS_ENVIRONMENT = cd $(srcdir) && +#TESTS = $(GTKDOC_CHECK) +#endif diff --git a/interpreters/nitfol/.svnignore b/interpreters/nitfol/.svnignore index 3045c51..9c2b59c 100644 --- a/interpreters/nitfol/.svnignore +++ b/interpreters/nitfol/.svnignore @@ -2,3 +2,4 @@ .libs Makefile.in Makefile +texinfo.tex diff --git a/interpreters/nitfol/Makefile.am b/interpreters/nitfol/Makefile.am index 10ec132..2a27a0c 100644 --- a/interpreters/nitfol/Makefile.am +++ b/interpreters/nitfol/Makefile.am @@ -1,5 +1,3 @@ -# TODO: There are a lot more documentation files in the Nitfol distribution - PLUGIN_LIBTOOL_FLAGS=-module -avoid-version -export-symbols-regex "^glk" GRAPHICS = no_graph.c no_graph.h @@ -9,23 +7,51 @@ BLORB = blorb.c SOUND = no_snd.c no_snd.h # SOUND = sound.c sound.h +dist_noinst_SCRIPTS = copying.awk opt2glkc.pl y2help.pl + pkglib_LTLIBRARIES = nitfol.la nitfol_la_SOURCES = automap.c automap.h binary.h copying.h debug.c debug.h \ decode.c decode.h errmesg.c errmesg.h globals.c globals.h hash.c hash.h \ - iff.c iff.h infix.c infix.h inform.c inform.h init.c init.h io.c \ + iff.c iff.h infix.c infix.h inform.y inform.h init.c init.h io.c \ linkevil.h main.c main.h nio.h nitfol.h no_blorb.h objects.c objects.h \ op_call.c op_call.h op_jmp.c op_jmp.h oplist.c oplist.h op_math.c \ op_math.h op_save.c op_save.h op_table.c op_table.h op_v6.c op_v6.h \ portfunc.c portfunc.h quetzal.c quetzal.h solve.c solve.h stack.c stack.h \ - startunix.c struct.c struct.h tokenise.c tokenise.h undo.c undo.h z_io.c \ - z_io.h zscii.c zscii.h \ + struct.c struct.h tokenise.c tokenise.h undo.c undo.h z_io.c z_io.h \ + zscii.c zscii.h \ $(GRAPHICS) \ $(BLORB) \ $(SOUND) -nitfol_la_CPPFLAGS = -I$(top_srcdir) +nodist_nitfol_la_SOURCES = copying.c dbg_help.h startunix.c +nitfol_la_CPPFLAGS = -I$(top_srcdir) -DSMART_TOKENISER -DUSE_INLINE nitfol_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS) -EXTRA_DIST = crashme.inf test.inf +info_TEXINFOS = nitfol.texi +nitfol_TEXINFOS = dbg_help.texi options.texi +# man_MANS = nitfol.6 + +BUILT_SOURCES = copying.c dbg_help.h startunix.c +CLEANFILES = $(BUILT_SOURCES) dbg_help.texi nitfol.6 options.texi + +dbg_help.h: inform.y y2help.pl + $(PERL) $(srcdir)/y2help.pl $(srcdir)/inform.y + +dbg_help.texi: inform.y y2help.pl + $(PERL) $(srcdir)/y2help.pl $(srcdir)/inform.y + +copying.c: COPYING copying.awk + $(AWK) --file $(srcdir)/copying.awk <$(srcdir)/COPYING >copying.c + +# nitfol.6: nitfol.opt opt2glkc.pl +# $(PERL) $(srcdir)/opt2glkc.pl -man $(srcdir)/nitfol.opt + +options.texi: nitfol.opt opt2glkc.pl + $(PERL) $(srcdir)/opt2glkc.pl -info $(srcdir)/nitfol.opt + +startunix.c: nitfol.opt opt2glkc.pl + $(PERL) $(srcdir)/opt2glkc.pl -unix $(srcdir)/nitfol.opt + +EXTRA_DIST = nitfol.opt crashme.inf test.inf nitfoldocdir = $(datadir)/doc/$(PACKAGE)/nitfol dist_nitfoldoc_DATA = ChangeLog COPYING INSTALL README diff --git a/interpreters/nitfol/copying.c b/interpreters/nitfol/copying.c deleted file mode 100644 index 183a320..0000000 --- a/interpreters/nitfol/copying.c +++ /dev/null @@ -1,299 +0,0 @@ -/* ==> Do not modify this file!! It is created automatically - by copying.awk. Modify copying.awk instead. <== */ - -#ifdef DEBUGGING - -#include "nitfol.h" - -void show_copying(void) -{ - infix_print_fixed_string( - " GNU GENERAL PUBLIC LICENSE\n" - " Version 2, June 1991\n" - "\n" - " Copyright (C) 1989, 1991 Free Software Foundation, Inc.\n" - " 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n" - " Everyone is permitted to copy and distribute verbatim copies\n" - " of this license document, but changing it is not allowed.\n" - "\n" - " Preamble\n" - "\n" - " The licenses for most software are designed to take away your\n" - "freedom to share and change it. By contrast, the GNU General Public\n" - "License is intended to guarantee your freedom to share and change free\n" - "software--to make sure the software is free for all its users. This\n" - "General Public License applies to most of the Free Software\n" - "Foundation's software and to any other program whose authors commit to\n" - "using it. (Some other Free Software Foundation software is covered by\n" - "the GNU Library General Public License instead.) You can apply it to\n" - "your programs, too.\n" - "\n" - " When we speak of free software, we are referring to freedom, not\n" - "price. Our General Public Licenses are designed to make sure that you\n" - "have the freedom to distribute copies of free software (and charge for\n" - "this service if you wish), that you receive source code or can get it\n" - "if you want it, that you can change the software or use pieces of it\n" - "in new free programs; and that you know you can do these things.\n" - "\n" - " To protect your rights, we need to make restrictions that forbid\n" - "anyone to deny you these rights or to ask you to surrender the rights.\n" - "These restrictions translate to certain responsibilities for you if you\n" - "distribute copies of the software, or if you modify it.\n" - "\n" - " For example, if you distribute copies of such a program, whether\n" - "gratis or for a fee, you must give the recipients all the rights that\n" - "you have. You must make sure that they, too, receive or can get the\n" - "source code. And you must show them these terms so they know their\n" - "rights.\n" - "\n" - " We protect your rights with two steps: (1) copyright the software, and\n" - "(2) offer you this license which gives you legal permission to copy,\n" - "distribute and/or modify the software.\n" - "\n" - " Also, for each author's protection and ours, we want to make certain\n" - "that everyone understands that there is no warranty for this free\n" - "software. If the software is modified by someone else and passed on, we\n" - "want its recipients to know that what they have is not the original, so\n" - "that any problems introduced by others will not reflect on the original\n" - "authors' reputations.\n" - "\n" - " Finally, any free program is threatened constantly by software\n" - "patents. We wish to avoid the danger that redistributors of a free\n" - "program will individually obtain patent licenses, in effect making the\n" - "program proprietary. To prevent this, we have made it clear that any\n" - "patent must be licensed for everyone's free use or not licensed at all.\n" - "\n" - " The precise terms and conditions for copying, distribution and\n" - "modification follow.\n" - "\n\n" - " GNU GENERAL PUBLIC LICENSE\n" - " TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n" - "\n" - " 0. This License applies to any program or other work which contains\n" - "a notice placed by the copyright holder saying it may be distributed\n" - "under the terms of this General Public License. The Program, below,\n" - "refers to any such program or work, and a work based on the Program\n" - "means either the Program or any derivative work under copyright law:\n" - "that is to say, a work containing the Program or a portion of it,\n" - "either verbatim or with modifications and/or translated into another\n" - "language. (Hereinafter, translation is included without limitation in\n" - "the term modification.) Each licensee is addressed as you.\n" - "\n" - "Activities other than copying, distribution and modification are not\n" - "covered by this License; they are outside its scope. The act of\n" - "running the Program is not restricted, and the output from the Program\n" - "is covered only if its contents constitute a work based on the\n" - "Program (independent of having been made by running the Program).\n" - "Whether that is true depends on what the Program does.\n" - "\n" - " 1. You may copy and distribute verbatim copies of the Program's\n" - "source code as you receive it, in any medium, provided that you\n" - "conspicuously and appropriately publish on each copy an appropriate\n" - "copyright notice and disclaimer of warranty; keep intact all the\n" - "notices that refer to this License and to the absence of any warranty;\n" - "and give any other recipients of the Program a copy of this License\n" - "along with the Program.\n" - "\n" - "You may charge a fee for the physical act of transferring a copy, and\n" - "you may at your option offer warranty protection in exchange for a fee.\n" - "\n" - " 2. You may modify your copy or copies of the Program or any portion\n" - "of it, thus forming a work based on the Program, and copy and\n" - "distribute such modifications or work under the terms of Section 1\n" - "above, provided that you also meet all of these conditions:\n" - "\n" - " a) You must cause the modified files to carry prominent notices\n" - " stating that you changed the files and the date of any change.\n" - "\n" - " b) You must cause any work that you distribute or publish, that in\n" - " whole or in part contains or is derived from the Program or any\n" - " part thereof, to be licensed as a whole at no charge to all third\n" - " parties under the terms of this License.\n" - "\n" - " c) If the modified program normally reads commands interactively\n" - " when run, you must cause it, when started running for such\n" - " interactive use in the most ordinary way, to print or display an\n" - " announcement including an appropriate copyright notice and a\n" - " notice that there is no warranty (or else, saying that you provide\n" - " a warranty) and that users may redistribute the program under\n" - " these conditions, and telling the user how to view a copy of this\n" - " License. (Exception: if the Program itself is interactive but\n" - " does not normally print such an announcement, your work based on\n" - " the Program is not required to print an announcement.)\n" - "\n\n" - "These requirements apply to the modified work as a whole. If\n" - "identifiable sections of that work are not derived from the Program,\n" - "and can be reasonably considered independent and separate works in\n" - "themselves, then this License, and its terms, do not apply to those\n" - "sections when you distribute them as separate works. But when you\n" - "distribute the same sections as part of a whole which is a work based\n" - "on the Program, the distribution of the whole must be on the terms of\n" - "this License, whose permissions for other licensees extend to the\n" - "entire whole, and thus to each and every part regardless of who wrote it.\n" - "\n" - "Thus, it is not the intent of this section to claim rights or contest\n" - "your rights to work written entirely by you; rather, the intent is to\n" - "exercise the right to control the distribution of derivative or\n" - "collective works based on the Program.\n" - "\n" - "In addition, mere aggregation of another work not based on the Program\n" - "with the Program (or with a work based on the Program) on a volume of\n" - "a storage or distribution medium does not bring the other work under\n" - "the scope of this License.\n" - "\n" - " 3. You may copy and distribute the Program (or a work based on it,\n" - "under Section 2) in object code or executable form under the terms of\n" - "Sections 1 and 2 above provided that you also do one of the following:\n" - "\n" - " a) Accompany it with the complete corresponding machine-readable\n" - " source code, which must be distributed under the terms of Sections\n" - " 1 and 2 above on a medium customarily used for software interchange; or,\n" - "\n" - " b) Accompany it with a written offer, valid for at least three\n" - " years, to give any third party, for a charge no more than your\n" - " cost of physically performing source distribution, a complete\n" - " machine-readable copy of the corresponding source code, to be\n" - " distributed under the terms of Sections 1 and 2 above on a medium\n" - " customarily used for software interchange; or,\n" - "\n" - " c) Accompany it with the information you received as to the offer\n" - " to distribute corresponding source code. (This alternative is\n" - " allowed only for noncommercial distribution and only if you\n" - " received the program in object code or executable form with such\n" - " an offer, in accord with Subsection b above.)\n" - "\n" - "The source code for a work means the preferred form of the work for\n" - "making modifications to it. For an executable work, complete source\n" - "code means all the source code for all modules it contains, plus any\n" - "associated interface definition files, plus the scripts used to\n" - "control compilation and installation of the executable. However, as a\n" - "special exception, the source code distributed need not include\n" - "anything that is normally distributed (in either source or binary\n" - "form) with the major components (compiler, kernel, and so on) of the\n" - "operating system on which the executable runs, unless that component\n" - "itself accompanies the executable.\n" - "\n" - "If distribution of executable or object code is made by offering\n" - "access to copy from a designated place, then offering equivalent\n" - "access to copy the source code from the same place counts as\n" - "distribution of the source code, even though third parties are not\n" - "compelled to copy the source along with the object code.\n" - "\n\n" - " 4. You may not copy, modify, sublicense, or distribute the Program\n" - "except as expressly provided under this License. Any attempt\n" - "otherwise to copy, modify, sublicense or distribute the Program is\n" - "void, and will automatically terminate your rights under this License.\n" - "However, parties who have received copies, or rights, from you under\n" - "this License will not have their licenses terminated so long as such\n" - "parties remain in full compliance.\n" - "\n" - " 5. You are not required to accept this License, since you have not\n" - "signed it. However, nothing else grants you permission to modify or\n" - "distribute the Program or its derivative works. These actions are\n" - "prohibited by law if you do not accept this License. Therefore, by\n" - "modifying or distributing the Program (or any work based on the\n" - "Program), you indicate your acceptance of this License to do so, and\n" - "all its terms and conditions for copying, distributing or modifying\n" - "the Program or works based on it.\n" - "\n" - " 6. Each time you redistribute the Program (or any work based on the\n" - "Program), the recipient automatically receives a license from the\n" - "original licensor to copy, distribute or modify the Program subject to\n" - "these terms and conditions. You may not impose any further\n" - "restrictions on the recipients' exercise of the rights granted herein.\n" - "You are not responsible for enforcing compliance by third parties to\n" - "this License.\n" - "\n" - " 7. If, as a consequence of a court judgment or allegation of patent\n" - "infringement or for any other reason (not limited to patent issues),\n" - "conditions are imposed on you (whether by court order, agreement or\n" - "otherwise) that contradict the conditions of this License, they do not\n" - "excuse you from the conditions of this License. If you cannot\n" - "distribute so as to satisfy simultaneously your obligations under this\n" - "License and any other pertinent obligations, then as a consequence you\n" - "may not distribute the Program at all. For example, if a patent\n" - "license would not permit royalty-free redistribution of the Program by\n" - "all those who receive copies directly or indirectly through you, then\n" - "the only way you could satisfy both it and this License would be to\n" - "refrain entirely from distribution of the Program.\n" - "\n" - "If any portion of this section is held invalid or unenforceable under\n" - "any particular circumstance, the balance of the section is intended to\n" - "apply and the section as a whole is intended to apply in other\n" - "circumstances.\n" - "\n" - "It is not the purpose of this section to induce you to infringe any\n" - "patents or other property right claims or to contest validity of any\n" - "such claims; this section has the sole purpose of protecting the\n" - "integrity of the free software distribution system, which is\n" - "implemented by public license practices. Many people have made\n" - "generous contributions to the wide range of software distributed\n" - "through that system in reliance on consistent application of that\n" - "system; it is up to the author/donor to decide if he or she is willing\n" - "to distribute software through any other system and a licensee cannot\n" - "impose that choice.\n" - "\n" - "This section is intended to make thoroughly clear what is believed to\n" - "be a consequence of the rest of this License.\n" - "\n\n" - " 8. If the distribution and/or use of the Program is restricted in\n" - "certain countries either by patents or by copyrighted interfaces, the\n" - "original copyright holder who places the Program under this License\n" - "may add an explicit geographical distribution limitation excluding\n" - "those countries, so that distribution is permitted only in or among\n" - "countries not thus excluded. In such case, this License incorporates\n" - "the limitation as if written in the body of this License.\n" - "\n" - " 9. The Free Software Foundation may publish revised and/or new versions\n" - "of the General Public License from time to time. Such new versions will\n" - "be similar in spirit to the present version, but may differ in detail to\n" - "address new problems or concerns.\n" - "\n" - "Each version is given a distinguishing version number. If the Program\n" - "specifies a version number of this License which applies to it and any\n" - "later version, you have the option of following the terms and conditions\n" - "either of that version or of any later version published by the Free\n" - "Software Foundation. If the Program does not specify a version number of\n" - "this License, you may choose any version ever published by the Free Software\n" - "Foundation.\n" - "\n" - " 10. If you wish to incorporate parts of the Program into other free\n" - "programs whose distribution conditions are different, write to the author\n" - "to ask for permission. For software which is copyrighted by the Free\n" - "Software Foundation, write to the Free Software Foundation; we sometimes\n" - "make exceptions for this. Our decision will be guided by the two goals\n" - "of preserving the free status of all derivatives of our free software and\n" - "of promoting the sharing and reuse of software generally.\n" - "\n" - ); -} - -void show_warranty(void) -{ - infix_print_fixed_string( - " NO WARRANTY\n" - "\n" - " 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\n" - "FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN\n" - "OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\n" - "PROVIDE THE PROGRAM AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\n" - "OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n" - "MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS\n" - "TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE\n" - "PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\n" - "REPAIR OR CORRECTION.\n" - "\n" - " 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n" - "WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n" - "REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n" - "INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\n" - "OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\n" - "TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n" - "YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n" - "PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n" - "POSSIBILITY OF SUCH DAMAGES.\n" - "\n" - ); -} - -#endif diff --git a/interpreters/nitfol/dbg_help.h b/interpreters/nitfol/dbg_help.h deleted file mode 100644 index a60a648..0000000 --- a/interpreters/nitfol/dbg_help.h +++ /dev/null @@ -1,58 +0,0 @@ -static name_token command_help[] = { - { BREAKPOINTS, "List breakpoints.\nAn argument specifies a specific breakpoint to list." }, - { QUIT, "Exit nitfol." }, - { LANGUAGE, "Show the current source language." }, - { COND, "Set a condition for an existing breakpoint." }, - { RESTORE, "Restore a saved game." }, - { BREAK, "Set a breakpoint.\nAn 'if' clause specifies a condition." }, - { STEPI, "Step exactly one instruction.\nAn argument specifies a repeat count." }, - { RESTART, "Restart the game." }, - { OBJECT_TREE, "Display the object tree.\nAn argument says which object to use as the root of the tree." }, - { DISABLE_DISPLAY, "Temporarily disable an automatic display." }, - { SELECT_FRAME, "Select a specific stack frame." }, - { ALIAS, "Add an alias" }, - { DOWN_SILENTLY, "Silently select the child of the selected frame.\nAn argument specifies how many frames down to go." }, - { FRAME, "Show the selected stack frame.\nAn argument specifies a stack frame to show." }, - { GIVE, "Give an object an attribute.\nWith a tilde clears the attribute instead of setting it." }, - { SET, "Evaluate an expression without printing its value." }, - { PRINT, "Evaluates an expression and prints the result.\nThis can include function calls." }, - { UP_FRAME, "Select the parent of the selected frame.\nAn argument specifies how many frames up to go." }, - { '#', "Enter a comment" }, - { CONT, "Continue execution.\nAn argument sets the ignore count of the current breakpoint." }, - { DUMPMEM, "Dump memory to a file" }, - { UNDO, "Undo last move (not last debugger command)." }, - { DISPLAY, "Print value of an expression each time the program stops." }, - { MOVE, "Move an object around the object tree." }, - { UP_SILENTLY, "Select the parent of the selected frame silently.\nAn argument specifies how many frames up to go." }, - { COPYING, "Show licensing information." }, - { RECORDOFF, "Stop recording a script." }, - { JUMP, "Continue execution at a new location." }, - { RECORDON, "Start recording a script." }, - { RALIAS, "Add a recursive alias" }, - { LIST_GLOBALS, "List all global variables and their values.\nWith an argument, list all only those with a specific value." }, - { BACKTRACE, "Display the parent functions of the current frame.\nAn argument specifies how many frames back to show.\nIf the argument is negative, start from the first frame instead of the current." }, - { FIND, "Find objects whose shortnames contain a string." }, - { FINISH, "An argument specifies a repeat count." }, - { DOWN_FRAME, "Select the child of the selected frame.\nAn argument specifies how many frames down to go." }, - { IGNORE, "Set the ignore count for a breakpoint." }, - { REPLAYOFF, "Halt replay." }, - { NEXTI, "Step one instruction, stepping over subroutine calls.\nStep a specified number of instructions, stepping over subroutine calls." }, - { HELP, "Print list of commands." }, - { REDO, "Redo undid move. Only works immediately after an 'undo'." }, - { ENABLE_BREAK, "Re-enabled a breakpoint." }, - { UNTIL, "Resume execution until the program reaches a line number greater than the current line." }, - { REPLAY, "Replay a recorded script." }, - { UNALIAS, "Remove an alias" }, - { REMOVE, "Remove an object from the object tree." }, - { INFOSOURCES, "List source files." }, - { DELETE, "Delete a breakpoint." }, - { SYMBOL_FILE, "Load debugging info from a file (usually 'gameinfo.dbg')." }, - { AUTOMAP, "Start automapping" }, - { WARRANTY, "Show warranty information." }, - { DISABLE_BREAK, "Temporarily disable a breakpoint." }, - { UNDISPLAY, "Stop automatically displaying an expression." }, - { ENABLE_DISPLAY, "Re-enable an automatic display." }, - { STEP, "Step through program to a different source line.\nAn argument specifies a repeat count." }, - { INFOSOURCE, "Get information on the current source file." }, - { NEXT, "Step through program, stepping over subroutine calls.\nAn argument specifies a repeat count." } -}; diff --git a/interpreters/nitfol/dbg_help.texi b/interpreters/nitfol/dbg_help.texi deleted file mode 100644 index de1644f..0000000 --- a/interpreters/nitfol/dbg_help.texi +++ /dev/null @@ -1,185 +0,0 @@ -@item info breakpoints -@itemx info breakpoints @var{num} -List breakpoints. An argument specifies a specific breakpoint to list. - -@item quit -Exit nitfol. - -@item show language -Show the current source language. - -@item condition @var{num} @var{exp} -Set a condition for an existing breakpoint. - -@item restore -Restore a saved game. - -@item break @var{linespec} -@itemx break @var{linespec} if @var{exp} -Set a breakpoint. An @code{if} clause specifies a condition. - -@item stepi -@itemx stepi @var{num} -Step exactly one instruction. An argument specifies a repeat count. - -@item restart -Restart the game. - -@item object-tree -@itemx object-tree @var{exp} -Display the object tree. An argument says which object to use as the root of the tree. - -@item disable display @var{num} -Temporarily disable an automatic display. - -@item select-frame @var{num} -Select a specific stack frame. - -@item alias @var{name} @var{value} -Add an alias - -@item down-silently -@itemx down-silently @var{num} -Silently select the child of the selected frame. An argument specifies how many frames down to go. - -@item frame -@itemx frame @var{num} -Show the selected stack frame. An argument specifies a stack frame to show. - -@item give @var{exp} @var{num} -@itemx give @var{exp} ~ @var{num} -Give an object an attribute. With a tilde clears the attribute instead of setting it. - -@item set @var{exp} -Evaluate an expression without printing its value. - -@item print @var{exp} -Evaluates an expression and prints the result. This can include function calls. - -@item up -@itemx up @var{num} -Select the parent of the selected frame. An argument specifies how many frames up to go. - -@item # comment -Enter a comment - -@item continue -@itemx continue @var{num} -Continue execution. An argument sets the ignore count of the current breakpoint. - -@item dumpmem @var{file} -Dump memory to a file - -@item undo -Undo last move (not last debugger command). - -@item display @var{exp} -Print value of an expression each time the program stops. - -@item move @var{exp} to @var{exp} -Move an object around the object tree. - -@item up-silently -@itemx up-silently @var{num} -Select the parent of the selected frame silently. An argument specifies how many frames up to go. - -@item show copying -Show licensing information. - -@item recording off -Stop recording a script. - -@item jump @var{linespec} -Continue execution at a new location. - -@item recording on -Start recording a script. - -@item ralias @var{name} @var{value} -Add a recursive alias - -@item globals -@itemx globals @var{exp} -List all global variables and their values. With an argument, list all only those with a specific value. - -@item backtrace -@itemx backtrace @var{num} -@itemx backtrace - @var{num} -Display the parent functions of the current frame. An argument specifies how many frames back to show. If the argument is negative, start from the first frame instead of the current. - -@item find -Find objects whose shortnames contain a string. - -@item finish -An argument specifies a repeat count. - -@item down -@itemx down @var{num} -Select the child of the selected frame. An argument specifies how many frames down to go. - -@item ignore @var{num} @var{num} -Set the ignore count for a breakpoint. - -@item replay off -Halt replay. - -@item nexti -@itemx nexti @var{num} -Step one instruction, stepping over subroutine calls. Step a specified number of instructions, stepping over subroutine calls. - -@item help -Print list of commands. - -@item redo -Redo undid move. Only works immediately after an @code{undo}. - -@item enable @var{num} -Re-enabled a breakpoint. - -@item until -Resume execution until the program reaches a line number greater than the current line. - -@item replay -Replay a recorded script. - -@item unalias @var{name} -Remove an alias - -@item remove @var{exp} -Remove an object from the object tree. - -@item info sources -List source files. - -@item delete @var{num} -Delete a breakpoint. - -@item symbol-file @var{file} -Load debugging info from a file (usually @file{gameinfo.dbg}). - -@item automap @var{exp} -Start automapping - -@item show warranty -Show warranty information. - -@item disable @var{num} -Temporarily disable a breakpoint. - -@item undisplay @var{num} -Stop automatically displaying an expression. - -@item enable display @var{num} -Re-enable an automatic display. - -@item step -@itemx step @var{num} -Step through program to a different source line. An argument specifies a repeat count. - -@item info source -Get information on the current source file. - -@item next -@itemx next @var{num} -Step through program, stepping over subroutine calls. An argument specifies a repeat count. - diff --git a/interpreters/nitfol/inform.c b/interpreters/nitfol/inform.c index db615a7..f3e3e8c 100644 --- a/interpreters/nitfol/inform.c +++ b/interpreters/nitfol/inform.c @@ -1,95 +1,73 @@ -/* A Bison parser, made from inform.y - by GNU bison 1.35. */ - -#define YYBISON 1 /* Identify Bison output. */ - -# define NUM 257 -# define DFILE 258 -# define CONDITION 259 -# define ALIAS 260 -# define RALIAS 261 -# define UNALIAS 262 -# define DUMPMEM 263 -# define AUTOMAP 264 -# define HELP 265 -# define UNDO 266 -# define REDO 267 -# define LANGUAGE 268 -# define INFOSOURCE 269 -# define INFOSOURCES 270 -# define COPYING 271 -# define WARRANTY 272 -# define PRINT 273 -# define SET 274 -# define MOVE 275 -# define TO 276 -# define GIVE 277 -# define REMOVE 278 -# define JUMP 279 -# define CONT 280 -# define STEP 281 -# define NEXT 282 -# define UNTIL 283 -# define STEPI 284 -# define NEXTI 285 -# define FINISH 286 -# define BREAK 287 -# define DELETE 288 -# define IF 289 -# define COND 290 -# define IGNORE 291 -# define BREAKPOINTS 292 -# define RESTORE 293 -# define RESTART 294 -# define QUIT 295 -# define RECORDON 296 -# define RECORDOFF 297 -# define REPLAY 298 -# define REPLAYOFF 299 -# define SYMBOL_FILE 300 -# define FRAME 301 -# define SELECT_FRAME 302 -# define BACKTRACE 303 -# define UP_FRAME 304 -# define DOWN_FRAME 305 -# define UP_SILENTLY 306 -# define DOWN_SILENTLY 307 -# define DISPLAY 308 -# define UNDISPLAY 309 -# define DISABLE_DISPLAY 310 -# define ENABLE_DISPLAY 311 -# define DISABLE_BREAK 312 -# define ENABLE_BREAK 313 -# define OBJECT_TREE 314 -# define FIND 315 -# define LIST_GLOBALS 316 -# define BTRUE 317 -# define BFALSE 318 -# define NOTHING 319 -# define PARENT 320 -# define CHILD 321 -# define SIBLING 322 -# define CHILDREN 323 -# define RANDOM 324 -# define ANDAND 325 -# define OROR 326 -# define NOTNOT 327 -# define OR 328 -# define BYTEARRAY 329 -# define WORDARRAY 330 -# define precNEG 331 -# define NUMBER 332 -# define OBJECT 333 -# define ROUTINE 334 -# define STRING 335 -# define GLOBAL 336 -# define LOCAL 337 -# define INCREMENT 338 -# define DECREMENT 339 -# define PROPADDR 340 -# define PROPLENGTH 341 -# define SUPERCLASS 342 +/* A Bison parser, made by GNU Bison 2.4.1. */ + +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.4.1" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + + + +/* Copy the first part of user declarations. */ + +/* Line 189 of yacc.c */ #line 1 "inform.y" /* Nitfol - z-machine interpreter using Glk for output. @@ -173,9 +151,221 @@ */ + +/* Line 189 of yacc.c */ +#line 157 "inform.c" + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + NUM = 258, + DFILE = 259, + CONDITION = 260, + ALIAS = 261, + RALIAS = 262, + UNALIAS = 263, + DUMPMEM = 264, + AUTOMAP = 265, + HELP = 266, + UNDO = 267, + REDO = 268, + LANGUAGE = 269, + INFOSOURCE = 270, + INFOSOURCES = 271, + COPYING = 272, + WARRANTY = 273, + PRINT = 274, + SET = 275, + MOVE = 276, + TO = 277, + GIVE = 278, + REMOVE = 279, + JUMP = 280, + CONT = 281, + STEP = 282, + NEXT = 283, + UNTIL = 284, + STEPI = 285, + NEXTI = 286, + FINISH = 287, + BREAK = 288, + DELETE = 289, + IF = 290, + COND = 291, + IGNORE = 292, + BREAKPOINTS = 293, + RESTORE = 294, + RESTART = 295, + QUIT = 296, + RECORDON = 297, + RECORDOFF = 298, + REPLAY = 299, + REPLAYOFF = 300, + SYMBOL_FILE = 301, + FRAME = 302, + SELECT_FRAME = 303, + BACKTRACE = 304, + UP_FRAME = 305, + DOWN_FRAME = 306, + UP_SILENTLY = 307, + DOWN_SILENTLY = 308, + DISPLAY = 309, + UNDISPLAY = 310, + DISABLE_DISPLAY = 311, + ENABLE_DISPLAY = 312, + DISABLE_BREAK = 313, + ENABLE_BREAK = 314, + OBJECT_TREE = 315, + FIND = 316, + LIST_GLOBALS = 317, + BTRUE = 318, + BFALSE = 319, + NOTHING = 320, + PARENT = 321, + CHILD = 322, + SIBLING = 323, + CHILDREN = 324, + RANDOM = 325, + NOTNOT = 326, + OROR = 327, + ANDAND = 328, + OR = 329, + WORDARRAY = 330, + BYTEARRAY = 331, + precNEG = 332, + LOCAL = 333, + GLOBAL = 334, + STRING = 335, + ROUTINE = 336, + OBJECT = 337, + NUMBER = 338, + DECREMENT = 339, + INCREMENT = 340, + PROPLENGTH = 341, + PROPADDR = 342, + SUPERCLASS = 343 + }; +#endif +/* Tokens. */ +#define NUM 258 +#define DFILE 259 +#define CONDITION 260 +#define ALIAS 261 +#define RALIAS 262 +#define UNALIAS 263 +#define DUMPMEM 264 +#define AUTOMAP 265 +#define HELP 266 +#define UNDO 267 +#define REDO 268 +#define LANGUAGE 269 +#define INFOSOURCE 270 +#define INFOSOURCES 271 +#define COPYING 272 +#define WARRANTY 273 +#define PRINT 274 +#define SET 275 +#define MOVE 276 +#define TO 277 +#define GIVE 278 +#define REMOVE 279 +#define JUMP 280 +#define CONT 281 +#define STEP 282 +#define NEXT 283 +#define UNTIL 284 +#define STEPI 285 +#define NEXTI 286 +#define FINISH 287 +#define BREAK 288 +#define DELETE 289 +#define IF 290 +#define COND 291 +#define IGNORE 292 +#define BREAKPOINTS 293 +#define RESTORE 294 +#define RESTART 295 +#define QUIT 296 +#define RECORDON 297 +#define RECORDOFF 298 +#define REPLAY 299 +#define REPLAYOFF 300 +#define SYMBOL_FILE 301 +#define FRAME 302 +#define SELECT_FRAME 303 +#define BACKTRACE 304 +#define UP_FRAME 305 +#define DOWN_FRAME 306 +#define UP_SILENTLY 307 +#define DOWN_SILENTLY 308 +#define DISPLAY 309 +#define UNDISPLAY 310 +#define DISABLE_DISPLAY 311 +#define ENABLE_DISPLAY 312 +#define DISABLE_BREAK 313 +#define ENABLE_BREAK 314 +#define OBJECT_TREE 315 +#define FIND 316 +#define LIST_GLOBALS 317 +#define BTRUE 318 +#define BFALSE 319 +#define NOTHING 320 +#define PARENT 321 +#define CHILD 322 +#define SIBLING 323 +#define CHILDREN 324 +#define RANDOM 325 +#define NOTNOT 326 +#define OROR 327 +#define ANDAND 328 +#define OR 329 +#define WORDARRAY 330 +#define BYTEARRAY 331 +#define precNEG 332 +#define LOCAL 333 +#define GLOBAL 334 +#define STRING 335 +#define ROUTINE 336 +#define OBJECT 337 +#define NUMBER 338 +#define DECREMENT 339 +#define INCREMENT 340 +#define PROPLENGTH 341 +#define PROPADDR 342 +#define SUPERCLASS 343 + + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +{ + +/* Line 214 of yacc.c */ #line 84 "inform.y" -#ifndef YYSTYPE -typedef union { + glui32 pcoffset; infix_file *filenum; z_typed val; @@ -188,473 +378,213 @@ typedef union { } cond; BOOL flag; -} yystype; -# define YYSTYPE yystype -# define YYSTYPE_IS_TRIVIAL 1 -#endif -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#define YYFINAL 208 -#define YYFLAG -32768 -#define YYNTBASE 104 +/* Line 214 of yacc.c */ +#line 386 "inform.c" +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +#endif -/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ -#define YYTRANSLATE(x) ((unsigned)(x) <= 342 ? yytranslate[x] : 114) -/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ -static const char yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 101, 2, 81, 82, 2, - 98, 103, 79, 77, 71, 78, 99, 80, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 102, 2, - 2, 72, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 83, 2, 84, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 73, 74, 75, 76, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 100 -}; +/* Copy the second part of user declarations. */ -#if YYDEBUG -static const short yyprhs[] = -{ - 0, 0, 1, 3, 5, 7, 9, 11, 13, 15, - 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, - 38, 41, 43, 46, 49, 52, 57, 59, 62, 64, - 66, 69, 73, 78, 81, 84, 86, 89, 91, 94, - 96, 99, 101, 103, 106, 108, 111, 113, 116, 120, - 123, 127, 130, 132, 135, 138, 141, 143, 145, 147, - 149, 151, 153, 156, 159, 161, 164, 166, 169, 171, - 174, 176, 179, 181, 184, 188, 190, 193, 196, 200, - 203, 205, 209, 210, 214, 216, 218, 222, 226, 227, - 232, 234, 236, 238, 240, 244, 249, 254, 259, 264, - 269, 274, 275, 280, 281, 286, 289, 293, 297, 301, - 305, 309, 313, 317, 320, 324, 328, 331, 334, 337, - 340, 343, 347, 351, 355, 358, 361, 364, 367, 370, - 373 -}; -static const short yyrhs[] = -{ - -1, 101, 0, 9, 0, 6, 0, 7, 0, 8, - 0, 10, 0, 11, 0, 40, 0, 39, 0, 42, - 0, 43, 0, 44, 0, 45, 0, 41, 0, 12, - 0, 13, 0, 46, 0, 19, 108, 0, 20, 108, - 0, 54, 0, 55, 3, 0, 56, 3, 0, 57, - 3, 0, 21, 108, 22, 108, 0, 60, 0, 60, - 108, 0, 61, 0, 62, 0, 62, 108, 0, 23, - 108, 3, 0, 23, 108, 84, 3, 0, 24, 108, - 0, 25, 105, 0, 26, 0, 26, 3, 0, 27, - 0, 27, 3, 0, 28, 0, 28, 3, 0, 29, - 0, 30, 0, 30, 3, 0, 31, 0, 31, 3, - 0, 32, 0, 33, 105, 0, 33, 105, 35, 0, - 36, 3, 0, 37, 3, 3, 0, 34, 3, 0, - 38, 0, 38, 3, 0, 58, 3, 0, 59, 3, - 0, 14, 0, 15, 0, 16, 0, 17, 0, 18, - 0, 47, 0, 47, 3, 0, 48, 3, 0, 50, - 0, 50, 3, 0, 52, 0, 52, 3, 0, 51, - 0, 51, 3, 0, 53, 0, 53, 3, 0, 49, - 0, 49, 3, 0, 49, 78, 3, 0, 3, 0, - 77, 3, 0, 78, 3, 0, 4, 102, 3, 0, - 79, 3, 0, 111, 0, 106, 76, 111, 0, 0, - 111, 71, 107, 0, 111, 0, 109, 0, 108, 71, - 111, 0, 108, 71, 109, 0, 0, 111, 5, 110, - 106, 0, 3, 0, 64, 0, 63, 0, 65, 0, - 111, 72, 111, 0, 66, 98, 108, 103, 0, 67, - 98, 108, 103, 0, 68, 98, 108, 103, 0, 69, - 98, 108, 103, 0, 70, 98, 108, 103, 0, 111, - 98, 107, 103, 0, 0, 111, 73, 112, 111, 0, - 0, 111, 74, 113, 111, 0, 75, 111, 0, 111, - 77, 111, 0, 111, 78, 111, 0, 111, 79, 111, - 0, 111, 80, 111, 0, 111, 81, 111, 0, 111, - 82, 111, 0, 111, 83, 111, 0, 84, 111, 0, - 111, 85, 111, 0, 111, 86, 111, 0, 78, 111, - 0, 94, 111, 0, 111, 94, 0, 95, 111, 0, - 111, 95, 0, 111, 96, 111, 0, 111, 97, 111, - 0, 111, 99, 111, 0, 88, 111, 0, 89, 111, - 0, 90, 111, 0, 91, 111, 0, 92, 111, 0, - 93, 111, 0, 98, 108, 103, 0 -}; -#endif +/* Line 264 of yacc.c */ +#line 398 "inform.c" -#if YYDEBUG -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const short yyrline[] = -{ - 0, 130, 132, 134, 142, 144, 146, 148, 150, 152, - 154, 165, 167, 169, 171, 173, 175, 182, 189, 198, - 200, 202, 204, 206, 208, 210, 212, 214, 216, 221, - 239, 255, 257, 259, 261, 263, 265, 267, 269, 271, - 273, 275, 277, 279, 281, 283, 285, 287, 289, 291, - 293, 295, 297, 299, 301, 303, 305, 307, 309, 311, - 313, 315, 317, 319, 321, 323, 325, 327, 329, 331, - 333, 335, 337, 339, 341, 349, 350, 351, 352, 353, - 357, 364, 377, 378, 382, 383, 384, 385, 389, 389, - 394, 396, 398, 400, 403, 406, 408, 410, 412, 415, - 425, 443, 443, 445, 445, 447, 450, 452, 454, 456, - 458, 460, 462, 464, 467, 469, 472, 475, 477, 479, - 481, 484, 486, 489, 497, 499, 501, 503, 505, 507, - 509 -}; +#ifdef short +# undef short #endif - -#if (YYDEBUG) || defined YYERROR_VERBOSE - -/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */ -static const char *const yytname[] = -{ - "$", "error", "$undefined.", "NUM", "DFILE", "CONDITION", "ALIAS", - "RALIAS", "UNALIAS", "DUMPMEM", "AUTOMAP", "HELP", "UNDO", "REDO", - "LANGUAGE", "INFOSOURCE", "INFOSOURCES", "COPYING", "WARRANTY", "PRINT", - "SET", "MOVE", "TO", "GIVE", "REMOVE", "JUMP", "CONT", "STEP", "NEXT", - "UNTIL", "STEPI", "NEXTI", "FINISH", "BREAK", "DELETE", "IF", "COND", - "IGNORE", "BREAKPOINTS", "RESTORE", "RESTART", "QUIT", "RECORDON", - "RECORDOFF", "REPLAY", "REPLAYOFF", "SYMBOL_FILE", "FRAME", - "SELECT_FRAME", "BACKTRACE", "UP_FRAME", "DOWN_FRAME", "UP_SILENTLY", - "DOWN_SILENTLY", "DISPLAY", "UNDISPLAY", "DISABLE_DISPLAY", - "ENABLE_DISPLAY", "DISABLE_BREAK", "ENABLE_BREAK", "OBJECT_TREE", - "FIND", "LIST_GLOBALS", "BTRUE", "BFALSE", "NOTHING", "PARENT", "CHILD", - "SIBLING", "CHILDREN", "RANDOM", "','", "'='", "ANDAND", "OROR", - "NOTNOT", "OR", "'+'", "'-'", "'*'", "'/'", "'%'", "'&'", "'|'", "'~'", - "BYTEARRAY", "WORDARRAY", "precNEG", "NUMBER", "OBJECT", "ROUTINE", - "STRING", "GLOBAL", "LOCAL", "INCREMENT", "DECREMENT", "PROPADDR", - "PROPLENGTH", "'('", "'.'", "SUPERCLASS", "'#'", "':'", "')'", "input", - "linespec", "orlist", "arglist", "commaexp", "condexp", "@1", "exp", - "@2", "@3", 0 -}; +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; #endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const short yyr1[] = -{ - 0, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 105, 105, 105, 105, 105, - 106, 106, 107, 107, 108, 108, 108, 108, 110, 109, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 112, 111, 113, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const short yyr2[] = -{ - 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 2, 1, 2, 2, 2, 4, 1, 2, 1, 1, - 2, 3, 4, 2, 2, 1, 2, 1, 2, 1, - 2, 1, 1, 2, 1, 2, 1, 2, 3, 2, - 3, 2, 1, 2, 2, 2, 1, 1, 1, 1, - 1, 1, 2, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 3, 1, 2, 2, 3, 2, - 1, 3, 0, 3, 1, 1, 3, 3, 0, 4, - 1, 1, 1, 1, 3, 4, 4, 4, 4, 4, - 4, 0, 4, 0, 4, 2, 3, 3, 3, 3, - 3, 3, 3, 2, 3, 3, 2, 2, 2, 2, - 2, 3, 3, 3, 2, 2, 2, 2, 2, 2, - 3 -}; - -/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE - doesn't specify something else to do. Zero means the default is an - error. */ -static const short yydefact[] = -{ - 1, 4, 5, 6, 3, 7, 8, 16, 17, 56, - 57, 58, 59, 60, 0, 0, 0, 0, 0, 0, - 35, 37, 39, 41, 42, 44, 46, 0, 0, 0, - 0, 52, 10, 9, 15, 11, 12, 13, 14, 18, - 61, 0, 72, 64, 68, 66, 70, 21, 0, 0, - 0, 0, 0, 26, 28, 29, 2, 90, 92, 91, - 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 19, 85, - 84, 20, 0, 0, 33, 75, 0, 0, 0, 0, - 34, 36, 38, 40, 43, 45, 47, 51, 49, 0, - 53, 62, 63, 73, 0, 65, 69, 67, 71, 22, - 23, 24, 54, 55, 27, 30, 0, 0, 0, 0, - 0, 105, 116, 113, 124, 125, 126, 127, 128, 129, - 117, 119, 0, 0, 88, 0, 101, 103, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 118, 120, 0, - 0, 82, 0, 0, 31, 0, 0, 76, 77, 79, - 48, 50, 74, 0, 0, 0, 0, 0, 130, 87, - 86, 0, 94, 0, 0, 106, 107, 108, 109, 110, - 111, 112, 114, 115, 121, 122, 0, 0, 123, 25, - 32, 78, 95, 96, 97, 98, 99, 89, 80, 102, - 104, 100, 82, 0, 83, 81, 0, 0, 0 -}; - -static const short yydefgoto[] = -{ - 206, 90, 197, 186, 78, 79, 171, 80, 173, 174 -}; +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif -static const short yypact[] = -{ - 136,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - -32768,-32768,-32768,-32768, 155, 155, 155, 155, 155, 15, - 28, 33, 34,-32768, 44, 45,-32768, 15, 46, 47, - 48, 55,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - 56, 57, 13, 58, 60, 69, 71,-32768, 72, 83, - 92, 93, 94, 155,-32768, 155,-32768,-32768,-32768,-32768, - -32768, -59, 1, 2, 8, 9, 155, 155, 155, 155, - 155, 155, 155, 155, 155, 155, 155, 155, 37,-32768, - 194, 37, -7, 14, 37,-32768, 18, 107, 126, 133, - -32768,-32768,-32768,-32768,-32768,-32768, 102,-32768,-32768, 168, - -32768,-32768,-32768,-32768, 199,-32768,-32768,-32768,-32768,-32768, - -32768,-32768,-32768,-32768, 37, 37, 155, 155, 155, 155, - 155, 36, -29, 115, -29, -29, -29, -29, -29, -29, - 29, 29, -51, 155,-32768, 155,-32768,-32768, 155, 155, - 155, 155, 155, 155, 155, 155, 155,-32768,-32768, 155, - 155, 155, 155, 155,-32768, 200, 201,-32768,-32768,-32768, - -32768,-32768,-32768, -50, -49, -48, -47, -46,-32768,-32768, - 194, 155, 251, 155, 155, -53, -53, 115, 115, 115, - 115, 115, -29, -29, -64, -64, 103, 223,-32768, 37, - -32768,-32768,-32768,-32768,-32768,-32768,-32768, 63, 251, 36, - 36,-32768, 155, 155,-32768, 251, 205, 207,-32768 -}; +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif -static const short yypgoto[] = -{ - -32768, 181,-32768, 24, -15, 82,-32768, -62,-32768,-32768 -}; +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif -#define YYLAST 350 +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif -static const short yytable[] = -{ - 81, 82, 83, 84, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 153, 103, 154, 85, 86, - 133, 133, 133, 133, 133, 133, 140, 141, 142, 143, - 144, 91, 145, 146, 151, 152, 92, 93, 114, 116, - 115, 147, 148, 149, 150, 151, 152, 94, 95, 97, - 98, 99, 168, 192, 193, 194, 195, 196, 100, 101, - 102, 105, 132, 106, 133, 147, 148, 149, 150, 151, - 152, 170, 107, 172, 108, 109, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 133, 110, 184, 185, 187, - 188, 104, 87, 88, 89, 111, 112, 113, 155, 117, - 118, 163, 164, 165, 166, 167, 119, 120, 133, 198, - 157, 199, 200, 138, 139, 140, 141, 142, 143, 144, - 156, 145, 146,-32768,-32768, 149, 150, 151, 152, 158, - 147, 148, 149, 150, 151, 152, 159, 160, 189, 203, - 187, 205, 1, 2, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 57, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 161, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 134, - 145, 146, 162, 190, 191, 207, 201, 208, 96, 147, - 148, 149, 150, 151, 152, 169, 0, 0, 58, 59, - 60, 61, 62, 63, 64, 65, 204, 0, 0, 0, - 66, 0, 0, 67, 0, 0, 0, 56, 0, 68, - 0, 0, 0, 69, 70, 71, 72, 73, 74, 75, - 76, 0, 0, 77, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 135, 136, 137, 0, - 0, 138, 139, 140, 141, 142, 143, 144, 0, 145, - 146, 0, 0, 0, 0, 0, 0, 0, 147, 148, - 149, 150, 151, 152, 202, 135, 136, 137, 0, 0, - 138, 139, 140, 141, 142, 143, 144, 0, 145, 146, - 0, 0, 0, 0, 0, 0, 0, 147, 148, 149, - 150, 151, 152, 135, 136, 137, 0, 0, 138, 139, - 140, 141, 142, 143, 144, 0, 145, 146, 0, 0, - 0, 0, 0, 0, 0, 147, 148, 149, 150, 151, - 152 -}; +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif -static const short yycheck[] = +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int yyi) +#else +static int +YYID (yyi) + int yyi; +#endif { - 15, 16, 17, 18, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 22, 3, 3, 3, 4, - 71, 71, 71, 71, 71, 71, 79, 80, 81, 82, - 83, 3, 85, 86, 98, 99, 3, 3, 53, 98, - 55, 94, 95, 96, 97, 98, 99, 3, 3, 3, - 3, 3, 103, 103, 103, 103, 103, 103, 3, 3, - 3, 3, 77, 3, 71, 94, 95, 96, 97, 98, - 99, 133, 3, 135, 3, 3, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 71, 3, 149, 150, 151, - 152, 78, 77, 78, 79, 3, 3, 3, 84, 98, - 98, 116, 117, 118, 119, 120, 98, 98, 71, 171, - 3, 173, 174, 77, 78, 79, 80, 81, 82, 83, - 102, 85, 86, 94, 95, 96, 97, 98, 99, 3, - 94, 95, 96, 97, 98, 99, 3, 35, 153, 76, - 202, 203, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 3, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 3, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 5, - 85, 86, 3, 3, 3, 0, 103, 0, 27, 94, - 95, 96, 97, 98, 99, 133, -1, -1, 63, 64, - 65, 66, 67, 68, 69, 70, 202, -1, -1, -1, - 75, -1, -1, 78, -1, -1, -1, 101, -1, 84, - -1, -1, -1, 88, 89, 90, 91, 92, 93, 94, - 95, -1, -1, 98, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 72, 73, 74, -1, - -1, 77, 78, 79, 80, 81, 82, 83, -1, 85, - 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, - 96, 97, 98, 99, 71, 72, 73, 74, -1, -1, - 77, 78, 79, 80, 81, 82, 83, -1, 85, 86, - -1, -1, -1, -1, -1, -1, -1, 94, 95, 96, - 97, 98, 99, 72, 73, 74, -1, -1, 77, 78, - 79, 80, 81, 82, 83, -1, 85, 86, -1, -1, - -1, -1, -1, -1, -1, 94, 95, 96, 97, 98, - 99 -}; -/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/share/bison/bison.simple" - -/* Skeleton output parser for bison, - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software - Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* This is the parser code that is written into each bison parser when - the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ + return yyi; +} +#endif -#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) +#if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ -# if YYSTACK_USE_ALLOCA -# define YYSTACK_ALLOC alloca -# else -# ifndef YYSTACK_USE_ALLOCA -# if defined (alloca) || defined (_ALLOCA_H) -# define YYSTACK_ALLOC alloca +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca # else -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif # else -# if defined (__STDC__) || defined (__cplusplus) +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif # endif -# define YYSTACK_ALLOC malloc -# define YYSTACK_FREE free # endif -#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */ +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { - short yyss; - YYSTYPE yyvs; -# if YYLSP_NEEDED - YYLTYPE yyls; -# endif + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ -# if YYLSP_NEEDED -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ - + 2 * YYSTACK_GAP_MAX) -# else -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAX) -# endif +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY -# if 1 < __GNUC__ +# if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ - register YYSIZE_T yyi; \ + YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ - while (0) + while (YYID (0)) # endif # endif @@ -663,124 +593,683 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack) \ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ - while (0) + while (YYID (0)) #endif +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 117 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 351 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 104 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 11 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 131 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 208 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 343 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 101, 2, 81, 82, 2, + 98, 103, 79, 77, 71, 78, 99, 80, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 102, 2, + 2, 72, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 83, 2, 84, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 73, 74, 75, 76, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 100 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 4, 6, 8, 10, 12, 14, 16, + 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, + 38, 41, 44, 46, 49, 52, 55, 60, 62, 65, + 67, 69, 72, 76, 81, 84, 87, 89, 92, 94, + 97, 99, 102, 104, 106, 109, 111, 114, 116, 119, + 123, 126, 130, 133, 135, 138, 141, 144, 146, 148, + 150, 152, 154, 156, 159, 162, 164, 167, 169, 172, + 174, 177, 179, 182, 184, 187, 191, 193, 196, 199, + 203, 206, 208, 212, 213, 217, 219, 221, 225, 229, + 230, 235, 237, 239, 241, 243, 247, 252, 257, 262, + 267, 272, 277, 278, 283, 284, 289, 292, 296, 300, + 304, 308, 312, 316, 320, 323, 327, 331, 334, 337, + 340, 343, 346, 350, 354, 358, 361, 364, 367, 370, + 373, 376 +}; -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int8 yyrhs[] = +{ + 105, 0, -1, -1, 101, -1, 9, -1, 6, -1, + 7, -1, 8, -1, 10, -1, 11, -1, 40, -1, + 39, -1, 42, -1, 43, -1, 44, -1, 45, -1, + 41, -1, 12, -1, 13, -1, 46, -1, 19, 109, + -1, 20, 109, -1, 54, -1, 55, 3, -1, 56, + 3, -1, 57, 3, -1, 21, 109, 22, 109, -1, + 60, -1, 60, 109, -1, 61, -1, 62, -1, 62, + 109, -1, 23, 109, 3, -1, 23, 109, 84, 3, + -1, 24, 109, -1, 25, 106, -1, 26, -1, 26, + 3, -1, 27, -1, 27, 3, -1, 28, -1, 28, + 3, -1, 29, -1, 30, -1, 30, 3, -1, 31, + -1, 31, 3, -1, 32, -1, 33, 106, -1, 33, + 106, 35, -1, 36, 3, -1, 37, 3, 3, -1, + 34, 3, -1, 38, -1, 38, 3, -1, 58, 3, + -1, 59, 3, -1, 14, -1, 15, -1, 16, -1, + 17, -1, 18, -1, 47, -1, 47, 3, -1, 48, + 3, -1, 50, -1, 50, 3, -1, 52, -1, 52, + 3, -1, 51, -1, 51, 3, -1, 53, -1, 53, + 3, -1, 49, -1, 49, 3, -1, 49, 78, 3, + -1, 3, -1, 77, 3, -1, 78, 3, -1, 4, + 102, 3, -1, 79, 3, -1, 112, -1, 107, 76, + 112, -1, -1, 112, 71, 108, -1, 112, -1, 110, + -1, 109, 71, 112, -1, 109, 71, 110, -1, -1, + 112, 5, 111, 107, -1, 3, -1, 64, -1, 63, + -1, 65, -1, 112, 72, 112, -1, 66, 98, 109, + 103, -1, 67, 98, 109, 103, -1, 68, 98, 109, + 103, -1, 69, 98, 109, 103, -1, 70, 98, 109, + 103, -1, 112, 98, 108, 103, -1, -1, 112, 75, + 113, 112, -1, -1, 112, 74, 114, 112, -1, 73, + 112, -1, 112, 77, 112, -1, 112, 78, 112, -1, + 112, 79, 112, -1, 112, 80, 112, -1, 112, 81, + 112, -1, 112, 82, 112, -1, 112, 83, 112, -1, + 84, 112, -1, 112, 86, 112, -1, 112, 85, 112, + -1, 78, 112, -1, 95, 112, -1, 112, 95, -1, + 94, 112, -1, 112, 94, -1, 112, 97, 112, -1, + 112, 96, 112, -1, 112, 99, 112, -1, 93, 112, + -1, 92, 112, -1, 91, 112, -1, 90, 112, -1, + 89, 112, -1, 88, 112, -1, 98, 109, 103, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 130, 130, 132, 134, 142, 144, 146, 148, 150, + 152, 154, 165, 167, 169, 171, 173, 175, 182, 189, + 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, + 221, 239, 255, 257, 259, 261, 263, 265, 267, 269, + 271, 273, 275, 277, 279, 281, 283, 285, 287, 289, + 291, 293, 295, 297, 299, 301, 303, 305, 307, 309, + 311, 313, 315, 317, 319, 321, 323, 325, 327, 329, + 331, 333, 335, 337, 339, 341, 349, 350, 351, 352, + 353, 357, 364, 377, 378, 382, 383, 384, 385, 390, + 390, 394, 396, 398, 400, 403, 406, 408, 410, 412, + 415, 425, 443, 443, 445, 445, 447, 450, 452, 454, + 456, 458, 460, 462, 464, 467, 469, 472, 475, 477, + 479, 481, 484, 486, 489, 497, 499, 501, 503, 505, + 507, 509 +}; #endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t + +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "NUM", "DFILE", "CONDITION", "ALIAS", + "RALIAS", "UNALIAS", "DUMPMEM", "AUTOMAP", "HELP", "UNDO", "REDO", + "LANGUAGE", "INFOSOURCE", "INFOSOURCES", "COPYING", "WARRANTY", "PRINT", + "SET", "MOVE", "TO", "GIVE", "REMOVE", "JUMP", "CONT", "STEP", "NEXT", + "UNTIL", "STEPI", "NEXTI", "FINISH", "BREAK", "DELETE", "IF", "COND", + "IGNORE", "BREAKPOINTS", "RESTORE", "RESTART", "QUIT", "RECORDON", + "RECORDOFF", "REPLAY", "REPLAYOFF", "SYMBOL_FILE", "FRAME", + "SELECT_FRAME", "BACKTRACE", "UP_FRAME", "DOWN_FRAME", "UP_SILENTLY", + "DOWN_SILENTLY", "DISPLAY", "UNDISPLAY", "DISABLE_DISPLAY", + "ENABLE_DISPLAY", "DISABLE_BREAK", "ENABLE_BREAK", "OBJECT_TREE", "FIND", + "LIST_GLOBALS", "BTRUE", "BFALSE", "NOTHING", "PARENT", "CHILD", + "SIBLING", "CHILDREN", "RANDOM", "','", "'='", "NOTNOT", "OROR", + "ANDAND", "OR", "'+'", "'-'", "'*'", "'/'", "'%'", "'&'", "'|'", "'~'", + "WORDARRAY", "BYTEARRAY", "precNEG", "LOCAL", "GLOBAL", "STRING", + "ROUTINE", "OBJECT", "NUMBER", "DECREMENT", "INCREMENT", "PROPLENGTH", + "PROPADDR", "'('", "'.'", "SUPERCLASS", "'#'", "':'", "')'", "$accept", + "input", "linespec", "orlist", "arglist", "commaexp", "condexp", "$@1", + "exp", "$@2", "$@3", 0 +}; #endif -#if ! defined (YYSIZE_T) -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 44, 61, 326, 327, 328, 329, 43, 45, 42, + 47, 37, 38, 124, 126, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 40, 46, + 343, 35, 58, 41 +}; # endif -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 104, 105, 105, 105, 105, 105, 105, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, + 105, 105, 105, 105, 105, 105, 106, 106, 106, 106, + 106, 107, 107, 108, 108, 109, 109, 109, 109, 111, + 110, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 113, 112, 114, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, + 112, 112 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 0, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 1, 2, 2, 2, 4, 1, 2, 1, + 1, 2, 3, 4, 2, 2, 1, 2, 1, 2, + 1, 2, 1, 1, 2, 1, 2, 1, 2, 3, + 2, 3, 2, 1, 2, 2, 2, 1, 1, 1, + 1, 1, 1, 2, 2, 1, 2, 1, 2, 1, + 2, 1, 2, 1, 2, 3, 1, 2, 2, 3, + 2, 1, 3, 0, 3, 1, 1, 3, 3, 0, + 4, 1, 1, 1, 1, 3, 4, 4, 4, 4, + 4, 4, 0, 4, 0, 4, 2, 3, 3, 3, + 3, 3, 3, 3, 2, 3, 3, 2, 2, 2, + 2, 2, 3, 3, 3, 2, 2, 2, 2, 2, + 2, 3 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 2, 5, 6, 7, 4, 8, 9, 17, 18, 57, + 58, 59, 60, 61, 0, 0, 0, 0, 0, 0, + 36, 38, 40, 42, 43, 45, 47, 0, 0, 0, + 0, 53, 11, 10, 16, 12, 13, 14, 15, 19, + 62, 0, 73, 65, 69, 67, 71, 22, 0, 0, + 0, 0, 0, 27, 29, 30, 3, 0, 91, 93, + 92, 94, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, + 86, 85, 21, 0, 0, 34, 76, 0, 0, 0, + 0, 35, 37, 39, 41, 44, 46, 48, 52, 50, + 0, 54, 63, 64, 74, 0, 66, 70, 68, 72, + 23, 24, 25, 55, 56, 28, 31, 1, 0, 0, + 0, 0, 0, 106, 117, 114, 130, 129, 128, 127, + 126, 125, 120, 118, 0, 0, 89, 0, 104, 102, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 121, + 119, 0, 0, 83, 0, 0, 32, 0, 0, 77, + 78, 80, 49, 51, 75, 0, 0, 0, 0, 0, + 131, 88, 87, 0, 95, 0, 0, 107, 108, 109, + 110, 111, 112, 113, 116, 115, 123, 122, 0, 0, + 124, 26, 33, 79, 96, 97, 98, 99, 100, 90, + 81, 105, 103, 101, 83, 0, 84, 82 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 57, 91, 199, 188, 79, 80, 173, 81, 176, + 175 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -65 +static const yytype_int16 yypact[] = +{ + 137, -65, -65, -65, -65, -65, -65, -65, -65, -65, + -65, -65, -65, -65, 156, 156, 156, 156, 156, 16, + 28, 33, 34, -65, 36, 44, -65, 16, 46, 47, + 48, 49, -65, -65, -65, -65, -65, -65, -65, -65, + 55, 56, 14, 57, 58, 59, 68, -65, 70, 72, + 73, 84, 93, 156, -65, 156, -65, 97, -65, -65, + -65, -65, 0, 2, 3, 4, 10, 156, 156, 156, + 156, 156, 156, 156, 156, 156, 156, 156, 156, 38, + -65, 195, 38, -7, 15, 38, -65, 9, 118, 127, + 134, -65, -65, -65, -65, -65, -65, 103, -65, -65, + 136, -65, -65, -65, -65, 169, -65, -65, -65, -65, + -65, -65, -65, -65, -65, 38, 38, -65, 156, 156, + 156, 156, 156, 37, -29, 116, -29, -29, -29, -29, + -29, -29, 30, 30, -55, 156, -65, 156, -65, -65, + 156, 156, 156, 156, 156, 156, 156, 156, 156, -65, + -65, 156, 156, 156, 156, 156, -65, 200, 201, -65, + -65, -65, -65, -65, -65, -50, -49, -48, -47, -46, + -65, -65, 195, 156, 252, 156, 156, -53, -53, 116, + 116, 116, 116, 116, -29, -29, -64, -64, 102, 224, + -65, 38, -65, -65, -65, -65, -65, -65, -65, 130, + 252, 37, 37, -65, 156, 156, -65, 252 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -65, -65, 180, -65, 5, -15, 81, -65, -63, -65, + -65 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -1 +static const yytype_int16 yytable[] = +{ + 82, 83, 84, 85, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 155, 135, 104, 156, 86, + 87, 135, 135, 135, 135, 135, 142, 143, 144, 145, + 146, 92, 147, 148, 153, 154, 93, 94, 115, 95, + 116, 149, 150, 151, 152, 153, 154, 96, 170, 98, + 99, 100, 101, 194, 195, 196, 197, 198, 102, 103, + 106, 107, 108, 134, 135, 149, 150, 151, 152, 153, + 154, 109, 172, 110, 174, 111, 112, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 135, 113, 186, 187, + 189, 190, 105, 88, 89, 90, 114, 117, 118, 157, + 119, 120, 121, 165, 166, 167, 168, 169, 122, 135, + 200, 158, 201, 202, 140, 141, 142, 143, 144, 145, + 146, 159, 147, 148, -1, -1, 151, 152, 153, 154, + 160, 149, 150, 151, 152, 153, 154, 161, 162, 163, + 191, 189, 207, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 58, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 164, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 136, 147, 148, 192, 193, 203, 205, 97, 0, 206, + 149, 150, 151, 152, 153, 154, 171, 0, 0, 59, + 60, 61, 62, 63, 64, 65, 66, 0, 0, 67, + 0, 0, 0, 0, 68, 0, 0, 0, 56, 0, + 69, 0, 0, 0, 70, 71, 72, 73, 74, 75, + 76, 77, 0, 0, 78, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 137, 0, 138, + 139, 0, 140, 141, 142, 143, 144, 145, 146, 0, + 147, 148, 0, 0, 0, 0, 0, 0, 0, 149, + 150, 151, 152, 153, 154, 204, 137, 0, 138, 139, + 0, 140, 141, 142, 143, 144, 145, 146, 0, 147, + 148, 0, 0, 0, 0, 0, 0, 0, 149, 150, + 151, 152, 153, 154, 137, 0, 138, 139, 0, 140, + 141, 142, 143, 144, 145, 146, 0, 147, 148, 0, + 0, 0, 0, 0, 0, 0, 149, 150, 151, 152, + 153, 154 +}; + +static const yytype_int16 yycheck[] = +{ + 15, 16, 17, 18, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 22, 71, 3, 3, 3, + 4, 71, 71, 71, 71, 71, 79, 80, 81, 82, + 83, 3, 85, 86, 98, 99, 3, 3, 53, 3, + 55, 94, 95, 96, 97, 98, 99, 3, 103, 3, + 3, 3, 3, 103, 103, 103, 103, 103, 3, 3, + 3, 3, 3, 78, 71, 94, 95, 96, 97, 98, + 99, 3, 135, 3, 137, 3, 3, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 71, 3, 151, 152, + 153, 154, 78, 77, 78, 79, 3, 0, 98, 84, + 98, 98, 98, 118, 119, 120, 121, 122, 98, 71, + 173, 102, 175, 176, 77, 78, 79, 80, 81, 82, + 83, 3, 85, 86, 94, 95, 96, 97, 98, 99, + 3, 94, 95, 96, 97, 98, 99, 3, 35, 3, + 155, 204, 205, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 3, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 3, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 5, 85, 86, 3, 3, 103, 76, 27, -1, 204, + 94, 95, 96, 97, 98, 99, 135, -1, -1, 63, + 64, 65, 66, 67, 68, 69, 70, -1, -1, 73, + -1, -1, -1, -1, 78, -1, -1, -1, 101, -1, + 84, -1, -1, -1, 88, 89, 90, 91, 92, 93, + 94, 95, -1, -1, 98, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 72, -1, 74, + 75, -1, 77, 78, 79, 80, 81, 82, 83, -1, + 85, 86, -1, -1, -1, -1, -1, -1, -1, 94, + 95, 96, 97, 98, 99, 71, 72, -1, 74, 75, + -1, 77, 78, 79, 80, 81, 82, 83, -1, 85, + 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, + 96, 97, 98, 99, 72, -1, 74, 75, -1, 77, + 78, 79, 80, 81, 82, 83, -1, 85, 86, -1, + -1, -1, -1, -1, -1, -1, 94, 95, 96, 97, + 98, 99 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 101, 105, 3, 63, + 64, 65, 66, 67, 68, 69, 70, 73, 78, 84, + 88, 89, 90, 91, 92, 93, 94, 95, 98, 109, + 110, 112, 109, 109, 109, 109, 3, 4, 77, 78, + 79, 106, 3, 3, 3, 3, 3, 106, 3, 3, + 3, 3, 3, 3, 3, 78, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 109, 109, 0, 98, 98, + 98, 98, 98, 112, 112, 112, 112, 112, 112, 112, + 112, 112, 112, 112, 109, 71, 5, 72, 74, 75, + 77, 78, 79, 80, 81, 82, 83, 85, 86, 94, + 95, 96, 97, 98, 99, 22, 3, 84, 102, 3, + 3, 3, 35, 3, 3, 109, 109, 109, 109, 109, + 103, 110, 112, 111, 112, 114, 113, 112, 112, 112, + 112, 112, 112, 112, 112, 112, 112, 112, 108, 112, + 112, 109, 3, 3, 103, 103, 103, 103, 103, 107, + 112, 112, 112, 103, 71, 76, 108, 112 +}; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) -#define YYEMPTY -2 +#define YYEMPTY (-2) #define YYEOF 0 + #define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrlab1 +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ + #define YYFAIL goto yyerrlab + #define YYRECOVERING() (!!yyerrstatus) + #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ - yychar1 = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ goto yybackup; \ } \ else \ - { \ - yyerror ("syntax error: cannot back up"); \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ -while (0) +while (YYID (0)) + #define YYTERROR 1 #define YYERRCODE 256 -/* YYLLOC_DEFAULT -- Compute the default location (before the actions - are run). - - When YYLLOC_DEFAULT is run, CURRENT is set the location of the - first token. By default, to implement support for ranges, extend - its range to the last symbol. */ +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - Current.last_line = Rhs[N].last_line; \ - Current.last_column = Rhs[N].last_column; +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) #endif -/* YYLEX -- calling `yylex' with the right arguments. */ +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#ifdef YYLEX_PARAM +# define YYLEX yylex (YYLEX_PARAM) +#else +# define YYLEX yylex () +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +#else +static void +yy_stack_print (yybottom, yytop) + yytype_int16 *yybottom; + yytype_int16 *yytop; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) -#if YYPURE -# if YYLSP_NEEDED -# ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) -# else -# define YYLEX yylex (&yylval, &yylloc) -# endif -# else /* !YYLSP_NEEDED */ -# ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, YYLEX_PARAM) -# else -# define YYLEX yylex (&yylval) -# endif -# endif /* !YYLSP_NEEDED */ -#else /* !YYPURE */ -# define YYLEX yylex () -#endif /* !YYPURE */ +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ -/* Enable debugging if requested. */ -#if YYDEBUG +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +#else +static void +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; + int yyrule; +#endif +{ + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + YYFPRINTF (stderr, "\n"); + } +} -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ + /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 @@ -790,59 +1279,59 @@ int yydebug; if the built-in stack extension method is used). Do not make this value too large; the results are undefined if - SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ -#if YYMAXDEPTH == 0 -# undef YYMAXDEPTH -#endif - #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif + -#ifdef YYERROR_VERBOSE + +#if YYERROR_VERBOSE # ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) +# if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) -# else +#else +static YYSIZE_T yystrlen (yystr) - const char *yystr; -# endif + const char *yystr; +#endif { - register const char *yys = yystr; - - while (*yys++ != '\0') + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) continue; - - return yys - yystr - 1; + return yylen; } # endif # endif # ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static char * -# if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) -# else +#else +static char * yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif + char *yydest; + const char *yysrc; +#endif { - register char *yyd = yydest; - register const char *yys = yysrc; + char *yyd = yydest; + const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; @@ -851,149 +1340,314 @@ yystpcpy (yydest, yysrc) } # endif # endif -#endif - -#line 315 "/usr/share/bison/bison.simple" +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into yyparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ + if (! yyres) + return yystrlen (yystr); -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM -# define YYPARSE_PARAM_DECL -# else -# define YYPARSE_PARAM_ARG YYPARSE_PARAM -# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; + return yystpcpy (yyres, yystr) - yyres; +} # endif -#else /* !YYPARSE_PARAM */ -# define YYPARSE_PARAM_ARG -# define YYPARSE_PARAM_DECL -#endif /* !YYPARSE_PARAM */ - -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -# ifdef YYPARSE_PARAM -int yyparse (void *); -# else -int yyparse (void); + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) +{ + int yyn = yypact[yystate]; + + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); # endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } +} +#endif /* YYERROR_VERBOSE */ + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; #endif +{ + YYUSE (yyvaluep); -/* YY_DECL_VARIABLES -- depending whether we use a pure parser, - variables are global, or local to YYPARSE. */ - -#define YY_DECL_NON_LSP_VARIABLES \ -/* The lookahead symbol. */ \ -int yychar; \ - \ -/* The semantic value of the lookahead symbol. */ \ -YYSTYPE yylval; \ - \ -/* Number of parse errors so far. */ \ -int yynerrs; + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { -#if YYLSP_NEEDED -# define YY_DECL_VARIABLES \ -YY_DECL_NON_LSP_VARIABLES \ - \ -/* Location data for the lookahead symbol. */ \ -YYLTYPE yylloc; + default: + break; + } +} + +/* Prevent warnings from -Wmissing-prototypes. */ +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); #else -# define YY_DECL_VARIABLES \ -YY_DECL_NON_LSP_VARIABLES +int yyparse (); #endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ -/* If nonreentrant, generate the variables here. */ +/* The lookahead symbol. */ +int yychar; -#if !YYPURE -YY_DECL_VARIABLES -#endif /* !YYPURE */ +/* The semantic value of the lookahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; -int -yyparse (YYPARSE_PARAM_ARG) - YYPARSE_PARAM_DECL -{ - /* If reentrant, generate the variables here. */ -#if YYPURE - YY_DECL_VARIABLES -#endif /* !YYPURE */ - register int yystate; - register int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Lookahead token as an internal (translated) token number. */ - int yychar1 = 0; - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - short yyssa[YYINITDEPTH]; - short *yyss = yyssa; - register short *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - register YYSTYPE *yyvsp; - -#if YYLSP_NEEDED - /* The location stack. */ - YYLTYPE yylsa[YYINITDEPTH]; - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp; -#endif -#if YYLSP_NEEDED -# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) +/*-------------------------. +| yyparse or yypush_parse. | +`-------------------------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void) #else -# define YYPOPSTACK (yyvsp--, yyssp--) +int +yyparse () + +#endif #endif +{ + + + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. - YYSIZE_T yystacksize = YYINITDEPTH; + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + YYSIZE_T yystacksize; + + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; -#if YYLSP_NEEDED - YYLTYPE yyloc; + +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + yytoken = 0; + yyss = yyssa; + yyvs = yyvsa; + yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss; yyvsp = yyvs; -#if YYLSP_NEEDED - yylsp = yyls; -#endif + goto yysetstate; /*------------------------------------------------------------. @@ -1001,70 +1655,57 @@ yyparse (YYPARSE_PARAM_ARG) `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ + have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; - if (yyssp >= yyss + yystacksize - 1) + if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of + /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; + yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. */ -# if YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow ("parser stack overflow", - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yyls1, yysize * sizeof (*yylsp), - &yystacksize); - yyls = yyls1; -# else - yyoverflow ("parser stack overflow", + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); -# endif + yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE - goto yyoverflowlab; + goto yyexhaustedlab; # else /* Extend the stack our own way. */ - if (yystacksize >= YYMAXDEPTH) - goto yyoverflowlab; + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; yystacksize *= 2; - if (yystacksize > YYMAXDEPTH) + if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { - short *yyss1 = yyss; + yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) - goto yyoverflowlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); -# if YYLSP_NEEDED - YYSTACK_RELOCATE (yyls); -# endif -# undef YYSTACK_RELOCATE + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } @@ -1073,123 +1714,82 @@ yyparse (YYPARSE_PARAM_ARG) yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; -#if YYLSP_NEEDED - yylsp = yyls + yysize - 1; -#endif YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); - if (yyssp >= yyss + yystacksize - 1) + if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - goto yybackup; + if (yystate == YYFINAL) + YYACCEPT; + goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yyn == YYFLAG) + if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ - /* yychar is either YYEMPTY or YYEOF - or a valid token in external form. */ - + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } - /* Convert token to internal form (in yychar1) for indexing tables with */ - - if (yychar <= 0) /* This means end of input. */ + if (yychar <= YYEOF) { - yychar1 = 0; - yychar = YYEOF; /* Don't call YYLEX any more */ - + yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { - yychar1 = YYTRANSLATE (yychar); - -#if YYDEBUG - /* We have to keep this `#if YYDEBUG', since we use variables - which are defined only if `YYDEBUG' is set. */ - if (yydebug) - { - YYFPRINTF (stderr, "Next token is %d (%s", - yychar, yytname[yychar1]); - /* Give the individual parser a way to print the precise - meaning of a token, for further debugging info. */ -# ifdef YYPRINT - YYPRINT (stderr, yychar, yylval); -# endif - YYFPRINTF (stderr, ")\n"); - } -#endif + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } - yyn += yychar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; - yyn = yytable[yyn]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) + if (yyn <= 0) { - if (yyn == YYFLAG) + if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } - else if (yyn == 0) - goto yyerrlab; - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - YYDPRINTF ((stderr, "Shifting token %d (%s), ", - yychar, yytname[yychar1])); - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; -#if YYLSP_NEEDED - *++yylsp = yylloc; -#endif /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token. */ + yychar = YYEMPTY; + yystate = yyn; + *++yyvsp = yylval; + goto yynewstate; @@ -1213,46 +1813,29 @@ yyreduce: /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. - Otherwise, the following line sets YYVAL to the semantic value of - the lookahead token. This behavior is undocumented and Bison + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; -#if YYLSP_NEEDED - /* Similarly for the default location. Let the user run additional - commands if for instance locations are ranges. */ - yyloc = yylsp[1-yylen]; - YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); -#endif -#if YYDEBUG - /* We have to keep this `#if YYDEBUG', since we use variables which - are defined only if `YYDEBUG' is set. */ - if (yydebug) + YY_REDUCE_PRINT (yyn); + switch (yyn) { - int yyi; - - YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); + case 3: - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++) - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); - YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); - } -#endif - - switch (yyn) { - -case 2: +/* Line 1455 of yacc.c */ #line 132 "inform.y" -{ lex_offset = n_strlen(lex_expression); } + { lex_offset = n_strlen(lex_expression); } break; -case 3: + + case 4: + +/* Line 1455 of yacc.c */ #line 134 "inform.y" -{ + { strid_t f; f = n_file_name_or_prompt(fileusage_Data|fileusage_BinaryMode, filemode_Write, lex_tail()); @@ -1260,33 +1843,54 @@ case 3: glk_stream_close(f, NULL); } break; -case 4: + + case 5: + +/* Line 1455 of yacc.c */ #line 142 "inform.y" -{ parse_new_alias(lex_tail(), FALSE); } + { parse_new_alias(lex_tail(), FALSE); } break; -case 5: + + case 6: + +/* Line 1455 of yacc.c */ #line 144 "inform.y" -{ parse_new_alias(lex_tail(), TRUE); } + { parse_new_alias(lex_tail(), TRUE); } break; -case 6: + + case 7: + +/* Line 1455 of yacc.c */ #line 146 "inform.y" -{ remove_alias(lex_tail()); } + { remove_alias(lex_tail()); } break; -case 7: + + case 8: + +/* Line 1455 of yacc.c */ #line 148 "inform.y" -{ automap_init(object_count, lex_tail()); } + { automap_init(object_count, lex_tail()); } break; -case 8: + + case 9: + +/* Line 1455 of yacc.c */ #line 150 "inform.y" -{ inform_help(); } + { inform_help(); } break; -case 9: + + case 10: + +/* Line 1455 of yacc.c */ #line 152 "inform.y" -{ op_restart(); exit_debugger = TRUE; read_abort = TRUE; } + { op_restart(); exit_debugger = TRUE; read_abort = TRUE; } break; -case 10: + + case 11: + +/* Line 1455 of yacc.c */ #line 154 "inform.y" -{ + { if(restoregame()) { exit_debugger = TRUE; read_abort = TRUE; if(zversion <= 3) @@ -1297,47 +1901,71 @@ case 10: infix_print_string("Restore failed.\n"); } } break; -case 11: + + case 12: + +/* Line 1455 of yacc.c */ #line 165 "inform.y" -{ zword oldop0 = operand[0]; operand[0] = 4; op_output_stream(); operand[0] = oldop0; } + { zword oldop0 = operand[0]; operand[0] = 4; op_output_stream(); operand[0] = oldop0; } break; -case 12: + + case 13: + +/* Line 1455 of yacc.c */ #line 167 "inform.y" -{ zword oldop0 = operand[0]; operand[0] = neg(4); op_output_stream(); operand[0] = oldop0; } + { zword oldop0 = operand[0]; operand[0] = neg(4); op_output_stream(); operand[0] = oldop0; } break; -case 13: + + case 14: + +/* Line 1455 of yacc.c */ #line 169 "inform.y" -{ zword oldop0 = operand[0]; operand[0] = 1; op_input_stream(); operand[0] = oldop0; exit_debugger = TRUE; } + { zword oldop0 = operand[0]; operand[0] = 1; op_input_stream(); operand[0] = oldop0; exit_debugger = TRUE; } break; -case 14: + + case 15: + +/* Line 1455 of yacc.c */ #line 171 "inform.y" -{ zword oldop0 = operand[0]; operand[0] = 0; op_input_stream(); operand[0] = oldop0; } + { zword oldop0 = operand[0]; operand[0] = 0; op_input_stream(); operand[0] = oldop0; } break; -case 15: + + case 16: + +/* Line 1455 of yacc.c */ #line 173 "inform.y" -{ z_close(); glk_exit(); } + { z_close(); glk_exit(); } break; -case 16: + + case 17: + +/* Line 1455 of yacc.c */ #line 175 "inform.y" -{ + { if(restoreundo()) { read_abort = TRUE; exit_debugger = TRUE; } else { infix_print_string("No undo slots.\n"); } } break; -case 17: + + case 18: + +/* Line 1455 of yacc.c */ #line 182 "inform.y" -{ + { if(restoreredo()) { read_abort = TRUE; exit_debugger = TRUE; } else { infix_print_string("No redo slots.\n"); } } break; -case 18: + + case 19: + +/* Line 1455 of yacc.c */ #line 189 "inform.y" -{ + { strid_t f; f = n_file_name_or_prompt(fileusage_Data|fileusage_BinaryMode, filemode_Read, lex_tail()); @@ -1346,52 +1974,85 @@ case 18: init_infix(f); } } break; -case 19: + + case 20: + +/* Line 1455 of yacc.c */ #line 198 "inform.y" -{ infix_display(yyvsp[0].val); } + { infix_display((yyvsp[(2) - (2)].val)); } break; -case 20: + + case 21: + +/* Line 1455 of yacc.c */ #line 200 "inform.y" -{ inform_result = yyvsp[0].val; } + { inform_result = (yyvsp[(2) - (2)].val); } break; -case 21: + + case 22: + +/* Line 1455 of yacc.c */ #line 202 "inform.y" -{ infix_auto_display(lex_tail()); } + { infix_auto_display(lex_tail()); } break; -case 22: + + case 23: + +/* Line 1455 of yacc.c */ #line 204 "inform.y" -{ infix_auto_undisplay(yyvsp[0].val.v); } + { infix_auto_undisplay((yyvsp[(2) - (2)].val).v); } break; -case 23: + + case 24: + +/* Line 1455 of yacc.c */ #line 206 "inform.y" -{ infix_set_display_enabled(yyvsp[0].val.v, FALSE); } + { infix_set_display_enabled((yyvsp[(2) - (2)].val).v, FALSE); } break; -case 24: + + case 25: + +/* Line 1455 of yacc.c */ #line 208 "inform.y" -{ infix_set_display_enabled(yyvsp[0].val.v, TRUE); } + { infix_set_display_enabled((yyvsp[(2) - (2)].val).v, TRUE); } break; -case 25: + + case 26: + +/* Line 1455 of yacc.c */ #line 210 "inform.y" -{ infix_move(yyvsp[0].val.v, yyvsp[-2].val.v); } + { infix_move((yyvsp[(4) - (4)].val).v, (yyvsp[(2) - (4)].val).v); } break; -case 26: + + case 27: + +/* Line 1455 of yacc.c */ #line 212 "inform.y" -{ infix_object_tree(0); } + { infix_object_tree(0); } break; -case 27: + + case 28: + +/* Line 1455 of yacc.c */ #line 214 "inform.y" -{ infix_object_tree(yyvsp[0].val.v); } + { infix_object_tree((yyvsp[(2) - (2)].val).v); } break; -case 28: + + case 29: + +/* Line 1455 of yacc.c */ #line 216 "inform.y" -{ + { if(lex_expression[lex_offset]) infix_object_find(lex_tail()); } break; -case 29: + + case 30: + +/* Line 1455 of yacc.c */ #line 221 "inform.y" -{ + { z_typed v; v.t = Z_GLOBAL; for(v.o = 0; v.o <= 245; v.o++) { const char *name = infix_get_name(v); @@ -1409,13 +2070,16 @@ case 29: infix_print_char(10); } break; -case 30: + + case 31: + +/* Line 1455 of yacc.c */ #line 239 "inform.y" -{ + { z_typed v; v.t = Z_GLOBAL; for(v.o = 0; v.o <= 245; v.o++) { infix_get_val(&v); - if(v.v == yyvsp[0].val.v) { + if(v.v == (yyvsp[(2) - (2)].val).v) { const char *name = infix_get_name(v); if(name) { infix_print_string(name); @@ -1427,462 +2091,744 @@ case 30: } } } break; -case 31: + + case 32: + +/* Line 1455 of yacc.c */ #line 255 "inform.y" -{ infix_set_attrib(yyvsp[-1].val.v, yyvsp[0].val.v); } + { infix_set_attrib((yyvsp[(2) - (3)].val).v, (yyvsp[(3) - (3)].val).v); } break; -case 32: + + case 33: + +/* Line 1455 of yacc.c */ #line 257 "inform.y" -{ infix_clear_attrib(yyvsp[-2].val.v, yyvsp[0].val.v); } + { infix_clear_attrib((yyvsp[(2) - (4)].val).v, (yyvsp[(4) - (4)].val).v); } break; -case 33: + + case 34: + +/* Line 1455 of yacc.c */ #line 259 "inform.y" -{ infix_remove(yyvsp[0].val.v); } + { infix_remove((yyvsp[(2) - (2)].val).v); } break; -case 34: + + case 35: + +/* Line 1455 of yacc.c */ #line 261 "inform.y" -{ PC=yyvsp[0].pcoffset; exit_debugger = TRUE; } + { PC=(yyvsp[(2) - (2)].pcoffset); exit_debugger = TRUE; } break; -case 35: + + case 36: + +/* Line 1455 of yacc.c */ #line 263 "inform.y" -{ set_step(CONT_GO, 1); } + { set_step(CONT_GO, 1); } break; -case 36: + + case 37: + +/* Line 1455 of yacc.c */ #line 265 "inform.y" -{ set_step(CONT_GO, 1); infix_set_ignore(cur_break, yyvsp[0].val.v); } + { set_step(CONT_GO, 1); infix_set_ignore(cur_break, (yyvsp[(2) - (2)].val).v); } break; -case 37: + + case 38: + +/* Line 1455 of yacc.c */ #line 267 "inform.y" -{ set_step(CONT_STEP, 1); } + { set_step(CONT_STEP, 1); } break; -case 38: + + case 39: + +/* Line 1455 of yacc.c */ #line 269 "inform.y" -{ set_step(CONT_STEP, yyvsp[0].val.v); } + { set_step(CONT_STEP, (yyvsp[(2) - (2)].val).v); } break; -case 39: + + case 40: + +/* Line 1455 of yacc.c */ #line 271 "inform.y" -{ set_step(CONT_NEXT, 1); } + { set_step(CONT_NEXT, 1); } break; -case 40: + + case 41: + +/* Line 1455 of yacc.c */ #line 273 "inform.y" -{ set_step(CONT_NEXT, yyvsp[0].val.v); } + { set_step(CONT_NEXT, (yyvsp[(2) - (2)].val).v); } break; -case 41: + + case 42: + +/* Line 1455 of yacc.c */ #line 275 "inform.y" -{ set_step(CONT_UNTIL, 1); } + { set_step(CONT_UNTIL, 1); } break; -case 42: + + case 43: + +/* Line 1455 of yacc.c */ #line 277 "inform.y" -{ set_step(CONT_STEPI, 1); } + { set_step(CONT_STEPI, 1); } break; -case 43: + + case 44: + +/* Line 1455 of yacc.c */ #line 279 "inform.y" -{ set_step(CONT_STEPI, yyvsp[0].val.v); } + { set_step(CONT_STEPI, (yyvsp[(2) - (2)].val).v); } break; -case 44: + + case 45: + +/* Line 1455 of yacc.c */ #line 281 "inform.y" -{ set_step(CONT_NEXTI, 1); } + { set_step(CONT_NEXTI, 1); } break; -case 45: + + case 46: + +/* Line 1455 of yacc.c */ #line 283 "inform.y" -{ set_step(CONT_NEXTI, yyvsp[0].val.v); } + { set_step(CONT_NEXTI, (yyvsp[(2) - (2)].val).v); } break; -case 46: + + case 47: + +/* Line 1455 of yacc.c */ #line 285 "inform.y" -{ set_step(CONT_FINISH, 1); } + { set_step(CONT_FINISH, 1); } break; -case 47: + + case 48: + +/* Line 1455 of yacc.c */ #line 287 "inform.y" -{ infix_set_break(yyvsp[0].pcoffset); } + { infix_set_break((yyvsp[(2) - (2)].pcoffset)); } break; -case 48: + + case 49: + +/* Line 1455 of yacc.c */ #line 289 "inform.y" -{ int n = infix_set_break(yyvsp[-1].pcoffset); infix_set_cond(n, lex_tail()); } + { int n = infix_set_break((yyvsp[(2) - (3)].pcoffset)); infix_set_cond(n, lex_tail()); } break; -case 49: + + case 50: + +/* Line 1455 of yacc.c */ #line 291 "inform.y" -{ infix_set_cond(yyvsp[0].val.v, lex_tail()); } + { infix_set_cond((yyvsp[(2) - (2)].val).v, lex_tail()); } break; -case 50: + + case 51: + +/* Line 1455 of yacc.c */ #line 293 "inform.y" -{ infix_set_ignore(yyvsp[-1].val.v, yyvsp[0].val.v); } + { infix_set_ignore((yyvsp[(2) - (3)].val).v, (yyvsp[(3) - (3)].val).v); } break; -case 51: + + case 52: + +/* Line 1455 of yacc.c */ #line 295 "inform.y" -{ infix_delete_breakpoint(yyvsp[0].val.v); } + { infix_delete_breakpoint((yyvsp[(2) - (2)].val).v); } break; -case 52: + + case 53: + +/* Line 1455 of yacc.c */ #line 297 "inform.y" -{ infix_show_all_breakpoints(); } + { infix_show_all_breakpoints(); } break; -case 53: + + case 54: + +/* Line 1455 of yacc.c */ #line 299 "inform.y" -{ infix_show_breakpoint(yyvsp[0].val.v); } + { infix_show_breakpoint((yyvsp[(2) - (2)].val).v); } break; -case 54: + + case 55: + +/* Line 1455 of yacc.c */ #line 301 "inform.y" -{ infix_set_break_enabled(yyvsp[0].val.v, FALSE); } + { infix_set_break_enabled((yyvsp[(2) - (2)].val).v, FALSE); } break; -case 55: + + case 56: + +/* Line 1455 of yacc.c */ #line 303 "inform.y" -{ infix_set_break_enabled(yyvsp[0].val.v, TRUE); } + { infix_set_break_enabled((yyvsp[(2) - (2)].val).v, TRUE); } break; -case 56: + + case 57: + +/* Line 1455 of yacc.c */ #line 305 "inform.y" -{ infix_print_string("The current source language is \"inform\".\n"); } + { infix_print_string("The current source language is \"inform\".\n"); } break; -case 57: + + case 58: + +/* Line 1455 of yacc.c */ #line 307 "inform.y" -{ 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"); } + { 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"); } break; -case 58: + + case 59: + +/* Line 1455 of yacc.c */ #line 309 "inform.y" -{ infix_print_string("Source files for which symbols have been read in:\n\n"); infix_list_files(); infix_print_char('\n'); } + { infix_print_string("Source files for which symbols have been read in:\n\n"); infix_list_files(); infix_print_char('\n'); } break; -case 59: + + case 60: + +/* Line 1455 of yacc.c */ #line 311 "inform.y" -{ show_copying(); } + { show_copying(); } break; -case 60: + + case 61: + +/* Line 1455 of yacc.c */ #line 313 "inform.y" -{ show_warranty(); } + { show_warranty(); } break; -case 61: + + case 62: + +/* Line 1455 of yacc.c */ #line 315 "inform.y" -{ infix_show_frame(infix_selected_frame); } + { infix_show_frame(infix_selected_frame); } break; -case 62: + + case 63: + +/* Line 1455 of yacc.c */ #line 317 "inform.y" -{ infix_select_frame(yyvsp[0].val.v); infix_show_frame(yyvsp[0].val.v); } + { infix_select_frame((yyvsp[(2) - (2)].val).v); infix_show_frame((yyvsp[(2) - (2)].val).v); } break; -case 63: + + case 64: + +/* Line 1455 of yacc.c */ #line 319 "inform.y" -{ infix_select_frame(yyvsp[0].val.v); } + { infix_select_frame((yyvsp[(2) - (2)].val).v); } break; -case 64: + + case 65: + +/* Line 1455 of yacc.c */ #line 321 "inform.y" -{ infix_select_frame(infix_selected_frame - 1); infix_show_frame(infix_selected_frame); } + { infix_select_frame(infix_selected_frame - 1); infix_show_frame(infix_selected_frame); } break; -case 65: + + case 66: + +/* Line 1455 of yacc.c */ #line 323 "inform.y" -{ infix_select_frame(infix_selected_frame - yyvsp[0].val.v); infix_show_frame(infix_selected_frame); } + { infix_select_frame(infix_selected_frame - (yyvsp[(2) - (2)].val).v); infix_show_frame(infix_selected_frame); } break; -case 66: + + case 67: + +/* Line 1455 of yacc.c */ #line 325 "inform.y" -{ infix_select_frame(infix_selected_frame - 1); } + { infix_select_frame(infix_selected_frame - 1); } break; -case 67: + + case 68: + +/* Line 1455 of yacc.c */ #line 327 "inform.y" -{ infix_select_frame(infix_selected_frame - yyvsp[0].val.v); } + { infix_select_frame(infix_selected_frame - (yyvsp[(2) - (2)].val).v); } break; -case 68: + + case 69: + +/* Line 1455 of yacc.c */ #line 329 "inform.y" -{ infix_select_frame(infix_selected_frame + 1); infix_show_frame(infix_selected_frame); } + { infix_select_frame(infix_selected_frame + 1); infix_show_frame(infix_selected_frame); } break; -case 69: + + case 70: + +/* Line 1455 of yacc.c */ #line 331 "inform.y" -{ infix_select_frame(infix_selected_frame + yyvsp[0].val.v); infix_show_frame(infix_selected_frame); } + { infix_select_frame(infix_selected_frame + (yyvsp[(2) - (2)].val).v); infix_show_frame(infix_selected_frame); } break; -case 70: + + case 71: + +/* Line 1455 of yacc.c */ #line 333 "inform.y" -{ infix_select_frame(infix_selected_frame + 1); } + { infix_select_frame(infix_selected_frame + 1); } break; -case 71: + + case 72: + +/* Line 1455 of yacc.c */ #line 335 "inform.y" -{ infix_select_frame(infix_selected_frame + yyvsp[0].val.v); } + { infix_select_frame(infix_selected_frame + (yyvsp[(2) - (2)].val).v); } break; -case 72: + + case 73: + +/* Line 1455 of yacc.c */ #line 337 "inform.y" -{ infix_backtrace(0, stack_get_depth()); } + { infix_backtrace(0, stack_get_depth()); } break; -case 73: + + case 74: + +/* Line 1455 of yacc.c */ #line 339 "inform.y" -{ infix_backtrace(stack_get_depth() - yyvsp[0].val.v, yyvsp[0].val.v); } + { infix_backtrace(stack_get_depth() - (yyvsp[(2) - (2)].val).v, (yyvsp[(2) - (2)].val).v); } break; -case 74: + + case 75: + +/* Line 1455 of yacc.c */ #line 341 "inform.y" -{ infix_backtrace(0, yyvsp[0].val.v); } + { infix_backtrace(0, (yyvsp[(3) - (3)].val).v); } break; -case 75: + + case 76: + +/* Line 1455 of yacc.c */ #line 349 "inform.y" -{ if(yyvsp[0].val.t == Z_ROUTINE) yyval.pcoffset = infix_get_routine_PC(yyvsp[0].val.v); else { infix_location l; infix_decode_fileloc(&l, cur_file?cur_file->filename:"", yyvsp[0].val.v); yyval.pcoffset = l.thisPC; } } + { 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; } } break; -case 76: + + case 77: + +/* Line 1455 of yacc.c */ #line 350 "inform.y" -{ infix_location l; infix_decode_fileloc(&l, cur_file?cur_file->filename:"", cur_line + yyvsp[0].val.v); yyval.pcoffset = l.thisPC; } + { infix_location l; infix_decode_fileloc(&l, cur_file?cur_file->filename:"", cur_line + (yyvsp[(2) - (2)].val).v); (yyval.pcoffset) = l.thisPC; } break; -case 77: + + case 78: + +/* Line 1455 of yacc.c */ #line 351 "inform.y" -{ infix_location l; infix_decode_fileloc(&l, cur_file?cur_file->filename:"", cur_line - yyvsp[0].val.v); yyval.pcoffset = l.thisPC; } + { infix_location l; infix_decode_fileloc(&l, cur_file?cur_file->filename:"", cur_line - (yyvsp[(2) - (2)].val).v); (yyval.pcoffset) = l.thisPC; } break; -case 78: + + case 79: + +/* Line 1455 of yacc.c */ #line 352 "inform.y" -{ if(yyvsp[0].val.t == Z_ROUTINE) yyval.pcoffset = UNPACKR(yyvsp[0].val.v); else { infix_location l; infix_decode_fileloc(&l, yyvsp[-2].filenum->filename, yyvsp[0].val.v); yyval.pcoffset = l.thisPC; } } + { 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; } } break; -case 79: + + case 80: + +/* Line 1455 of yacc.c */ #line 353 "inform.y" -{ yyval.pcoffset = yyvsp[0].val.v; } + { (yyval.pcoffset) = (yyvsp[(2) - (2)].val).v; } break; -case 80: + + case 81: + +/* Line 1455 of yacc.c */ #line 357 "inform.y" -{ - if(condlist->condfunc(condlist->val, yyvsp[0].val.v) ^ condlist->opposite) { - yyval.flag = TRUE; + { + if(condlist->condfunc(condlist->val, (yyvsp[(1) - (1)].val).v) ^ condlist->opposite) { + (yyval.flag) = TRUE; ignoreeffects++; } else - yyval.flag = FALSE; + (yyval.flag) = FALSE; } break; -case 81: + + case 82: + +/* Line 1455 of yacc.c */ #line 364 "inform.y" -{ - if(yyvsp[-2].flag) - yyval.flag = TRUE; + { + if((yyvsp[(1) - (3)].flag)) + (yyval.flag) = TRUE; else { - if(condlist->condfunc(condlist->val, yyvsp[0].val.v) ^ condlist->opposite) { - yyval.flag = TRUE; + if(condlist->condfunc(condlist->val, (yyvsp[(3) - (3)].val).v) ^ condlist->opposite) { + (yyval.flag) = TRUE; ignoreeffects++; } - else yyval.flag = FALSE; + else (yyval.flag) = FALSE; } } break; -case 82: + + case 83: + +/* Line 1455 of yacc.c */ #line 377 "inform.y" -{ yyval.zlist = NULL; } + { (yyval.zlist) = NULL; } break; -case 83: + + case 84: + +/* Line 1455 of yacc.c */ #line 378 "inform.y" -{ zword_list g; yyval.zlist = yyvsp[0].zlist; g.item = yyvsp[-2].val.v; LEaddm(yyval.zlist, g, n_rmmalloc); } + { zword_list g; (yyval.zlist) = (yyvsp[(3) - (3)].zlist); g.item = (yyvsp[(1) - (3)].val).v; LEaddm((yyval.zlist), g, n_rmmalloc); } break; -case 86: + + case 87: + +/* Line 1455 of yacc.c */ #line 384 "inform.y" -{ yyval.val = yyvsp[0].val; } + { (yyval.val) = (yyvsp[(3) - (3)].val); } break; -case 87: + + case 88: + +/* Line 1455 of yacc.c */ #line 385 "inform.y" -{ yyval.val = yyvsp[0].val; } + { (yyval.val) = (yyvsp[(3) - (3)].val); } break; -case 88: + + case 89: + +/* Line 1455 of yacc.c */ #line 390 "inform.y" -{ cond_list newcond; newcond.val = yyvsp[-1].val.v; newcond.condfunc = yyvsp[0].cond.condfunc; newcond.opposite = yyvsp[0].cond.opposite; LEaddm(condlist, newcond, n_rmmalloc); } + { 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); } break; -case 89: + + case 90: + +/* Line 1455 of yacc.c */ #line 390 "inform.y" -{ if(yyvsp[0].flag) ignoreeffects--; yyval.val.v = yyvsp[0].flag; yyval.val.t = Z_BOOLEAN; LEremovem(condlist, n_rmfreeone); } + { if((yyvsp[(4) - (4)].flag)) ignoreeffects--; (yyval.val).v = (yyvsp[(4) - (4)].flag); (yyval.val).t = Z_BOOLEAN; LEremovem(condlist, n_rmfreeone); } break; -case 90: + + case 91: + +/* Line 1455 of yacc.c */ #line 395 "inform.y" -{ yyval.val = yyvsp[0].val; } + { (yyval.val) = (yyvsp[(1) - (1)].val); } break; -case 91: + + case 92: + +/* Line 1455 of yacc.c */ #line 397 "inform.y" -{ yyval.val.v = 0; yyval.val.t = Z_BOOLEAN; } + { (yyval.val).v = 0; (yyval.val).t = Z_BOOLEAN; } break; -case 92: + + case 93: + +/* Line 1455 of yacc.c */ #line 399 "inform.y" -{ yyval.val.v = 1; yyval.val.t = Z_BOOLEAN; } + { (yyval.val).v = 1; (yyval.val).t = Z_BOOLEAN; } break; -case 93: + + case 94: + +/* Line 1455 of yacc.c */ #line 401 "inform.y" -{ yyval.val.v = 0; yyval.val.t = Z_OBJECT; } + { (yyval.val).v = 0; (yyval.val).t = Z_OBJECT; } break; -case 94: + + case 95: + +/* Line 1455 of yacc.c */ #line 404 "inform.y" -{ yyval.val = yyvsp[0].val; infix_assign(&yyvsp[-2].val, yyvsp[0].val.v); } + { (yyval.val) = (yyvsp[(3) - (3)].val); infix_assign(&(yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val).v); } break; -case 95: + + case 96: + +/* Line 1455 of yacc.c */ #line 407 "inform.y" -{ yyval.val.v = infix_parent(yyvsp[-1].val.v); yyval.val.t = Z_OBJECT; } + { (yyval.val).v = infix_parent((yyvsp[(3) - (4)].val).v); (yyval.val).t = Z_OBJECT; } break; -case 96: + + case 97: + +/* Line 1455 of yacc.c */ #line 409 "inform.y" -{ yyval.val.v = infix_child(yyvsp[-1].val.v); yyval.val.t = Z_OBJECT; } + { (yyval.val).v = infix_child((yyvsp[(3) - (4)].val).v); (yyval.val).t = Z_OBJECT; } break; -case 97: + + case 98: + +/* Line 1455 of yacc.c */ #line 411 "inform.y" -{ yyval.val.v = infix_sibling(yyvsp[-1].val.v); yyval.val.t = Z_OBJECT; } + { (yyval.val).v = infix_sibling((yyvsp[(3) - (4)].val).v); (yyval.val).t = Z_OBJECT; } break; -case 98: + + case 99: + +/* Line 1455 of yacc.c */ #line 413 "inform.y" -{ int n = 0; zword o = infix_child(yyvsp[-1].val.v); while(o) { n++; o = infix_sibling(o); } yyval.val.v = n; yyval.val.t = Z_NUMBER; } + { 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; } break; -case 99: + + case 100: + +/* Line 1455 of yacc.c */ #line 416 "inform.y" -{ + { if(!ignoreeffects) { - yyval.val.v = z_random(yyvsp[-1].val.v); - yyval.val.t = Z_NUMBER; + (yyval.val).v = z_random((yyvsp[(3) - (4)].val).v); + (yyval.val).t = Z_NUMBER; } else { - yyval.val.v = 0; - yyval.val.t = Z_UNKNOWN; + (yyval.val).v = 0; + (yyval.val).t = Z_UNKNOWN; } } break; -case 100: + + case 101: + +/* Line 1455 of yacc.c */ #line 426 "inform.y" -{ + { zword locals[16]; int i = 0; zword_list *p; if(!ignoreeffects) { - for(p = yyvsp[-1].zlist; p && i < 16; p=p->next) { + for(p = (yyvsp[(3) - (4)].zlist); p && i < 16; p=p->next) { locals[i++] = p->item; } - mop_call(yyvsp[-3].val.v, i, locals, -2); + mop_call((yyvsp[(1) - (4)].val).v, i, locals, -2); decode(); exit_decoder = FALSE; - yyval.val.v = time_ret; yyval.val.t = Z_UNKNOWN; + (yyval.val).v = time_ret; (yyval.val).t = Z_UNKNOWN; } else { - yyval.val.v = 0; yyval.val.t = Z_UNKNOWN; + (yyval.val).v = 0; (yyval.val).t = Z_UNKNOWN; } } break; -case 101: + + case 102: + +/* Line 1455 of yacc.c */ #line 443 "inform.y" -{ if(yyvsp[-1].val.v == 0) ignoreeffects++; } + { if((yyvsp[(1) - (2)].val).v == 0) ignoreeffects++; } break; -case 102: + + case 103: + +/* Line 1455 of yacc.c */ #line 444 "inform.y" -{ if(yyvsp[-3].val.v == 0) ignoreeffects--; yyval.val = z_t(yyvsp[-3].val, yyvsp[0].val, yyvsp[-3].val.v && yyvsp[0].val.v); } + { 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); } break; -case 103: + + case 104: + +/* Line 1455 of yacc.c */ #line 445 "inform.y" -{ if(yyvsp[-1].val.v != 0) ignoreeffects++; } + { if((yyvsp[(1) - (2)].val).v != 0) ignoreeffects++; } break; -case 104: + + case 105: + +/* Line 1455 of yacc.c */ #line 446 "inform.y" -{ if(yyvsp[-3].val.v != 0) ignoreeffects--; yyval.val = z_t(yyvsp[-3].val, yyvsp[0].val, yyvsp[-3].val.v || yyvsp[0].val.v); } + { 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); } break; -case 105: + + case 106: + +/* Line 1455 of yacc.c */ #line 448 "inform.y" -{ yyval.val.v = !(yyvsp[0].val.v); yyval.val.t = Z_NUMBER; } + { (yyval.val).v = !((yyvsp[(2) - (2)].val).v); (yyval.val).t = Z_NUMBER; } break; -case 106: + + case 107: + +/* Line 1455 of yacc.c */ #line 451 "inform.y" -{ yyval.val = z_t(yyvsp[-2].val, yyvsp[0].val, yyvsp[-2].val.v + yyvsp[0].val.v); } + { (yyval.val) = z_t((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val), (yyvsp[(1) - (3)].val).v + (yyvsp[(3) - (3)].val).v); } break; -case 107: + + case 108: + +/* Line 1455 of yacc.c */ #line 453 "inform.y" -{ yyval.val = z_t(yyvsp[-2].val, yyvsp[0].val, yyvsp[-2].val.v + neg(yyvsp[0].val.v)); } + { (yyval.val) = z_t((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val), (yyvsp[(1) - (3)].val).v + neg((yyvsp[(3) - (3)].val).v)); } break; -case 108: + + case 109: + +/* Line 1455 of yacc.c */ #line 455 "inform.y" -{ yyval.val = z_t(yyvsp[-2].val, yyvsp[0].val, z_mult(yyvsp[-2].val.v, yyvsp[0].val.v)); } + { (yyval.val) = z_t((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val), z_mult((yyvsp[(1) - (3)].val).v, (yyvsp[(3) - (3)].val).v)); } break; -case 109: + + case 110: + +/* Line 1455 of yacc.c */ #line 457 "inform.y" -{ yyval.val = z_t(yyvsp[-2].val, yyvsp[0].val, z_div(yyvsp[-2].val.v, yyvsp[0].val.v)); } + { (yyval.val) = z_t((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val), z_div((yyvsp[(1) - (3)].val).v, (yyvsp[(3) - (3)].val).v)); } break; -case 110: + + case 111: + +/* Line 1455 of yacc.c */ #line 459 "inform.y" -{ yyval.val = z_t(yyvsp[-2].val, yyvsp[0].val, z_mod(yyvsp[-2].val.v, yyvsp[0].val.v)); } + { (yyval.val) = z_t((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val), z_mod((yyvsp[(1) - (3)].val).v, (yyvsp[(3) - (3)].val).v)); } break; -case 111: + + case 112: + +/* Line 1455 of yacc.c */ #line 461 "inform.y" -{ yyval.val = z_t(yyvsp[-2].val, yyvsp[0].val, yyvsp[-2].val.v & yyvsp[0].val.v); } + { (yyval.val) = z_t((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val), (yyvsp[(1) - (3)].val).v & (yyvsp[(3) - (3)].val).v); } break; -case 112: + + case 113: + +/* Line 1455 of yacc.c */ #line 463 "inform.y" -{ yyval.val = z_t(yyvsp[-2].val, yyvsp[0].val, yyvsp[-2].val.v | yyvsp[0].val.v); } + { (yyval.val) = z_t((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val), (yyvsp[(1) - (3)].val).v | (yyvsp[(3) - (3)].val).v); } break; -case 113: + + case 114: + +/* Line 1455 of yacc.c */ #line 465 "inform.y" -{ yyval.val = z_t(yyvsp[0].val, yyvsp[0].val, ~yyvsp[0].val.v); } + { (yyval.val) = z_t((yyvsp[(2) - (2)].val), (yyvsp[(2) - (2)].val), ~(yyvsp[(2) - (2)].val).v); } break; -case 114: + + case 115: + +/* Line 1455 of yacc.c */ #line 468 "inform.y" -{ yyval.val.t = Z_BYTEARRAY; yyval.val.o = yyvsp[-2].val.v; yyval.val.p = yyvsp[0].val.v; infix_get_val(&yyval.val); } + { (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)); } break; -case 115: + + case 116: + +/* Line 1455 of yacc.c */ #line 470 "inform.y" -{ yyval.val.t = Z_WORDARRAY; yyval.val.o = yyvsp[-2].val.v; yyval.val.p = yyvsp[0].val.v; infix_get_val(&yyval.val); } + { (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)); } break; -case 116: + + case 117: + +/* Line 1455 of yacc.c */ #line 473 "inform.y" -{ yyval.val = z_t(yyvsp[0].val, yyvsp[0].val, neg(yyvsp[0].val.v)); } + { (yyval.val) = z_t((yyvsp[(2) - (2)].val), (yyvsp[(2) - (2)].val), neg((yyvsp[(2) - (2)].val).v)); } break; -case 117: + + case 118: + +/* Line 1455 of yacc.c */ #line 476 "inform.y" -{ if(!ignoreeffects) infix_assign(&yyvsp[0].val, ARITHMASK(yyvsp[0].val.v + 1)); yyval.val = yyvsp[0].val; } + { if(!ignoreeffects) infix_assign(&(yyvsp[(2) - (2)].val), ARITHMASK((yyvsp[(2) - (2)].val).v + 1)); (yyval.val) = (yyvsp[(2) - (2)].val); } break; -case 118: + + case 119: + +/* Line 1455 of yacc.c */ #line 478 "inform.y" -{ yyval.val = yyvsp[-1].val; if(!ignoreeffects) infix_assign(&yyvsp[-1].val, ARITHMASK(yyvsp[-1].val.v + 1)); } + { (yyval.val) = (yyvsp[(1) - (2)].val); if(!ignoreeffects) infix_assign(&(yyvsp[(1) - (2)].val), ARITHMASK((yyvsp[(1) - (2)].val).v + 1)); } break; -case 119: + + case 120: + +/* Line 1455 of yacc.c */ #line 480 "inform.y" -{ if(!ignoreeffects) infix_assign(&yyvsp[0].val, ARITHMASK(yyvsp[0].val.v + neg(1))); yyval.val = yyvsp[0].val; } + { if(!ignoreeffects) infix_assign(&(yyvsp[(2) - (2)].val), ARITHMASK((yyvsp[(2) - (2)].val).v + neg(1))); (yyval.val) = (yyvsp[(2) - (2)].val); } break; -case 120: + + case 121: + +/* Line 1455 of yacc.c */ #line 482 "inform.y" -{ yyval.val = yyvsp[-1].val; if(!ignoreeffects) infix_assign(&yyvsp[-1].val, ARITHMASK(yyvsp[-1].val.v + neg(1))); } + { (yyval.val) = (yyvsp[(1) - (2)].val); if(!ignoreeffects) infix_assign(&(yyvsp[(1) - (2)].val), ARITHMASK((yyvsp[(1) - (2)].val).v + neg(1))); } break; -case 121: + + case 122: + +/* Line 1455 of yacc.c */ #line 485 "inform.y" -{ zword len; yyval.val.v = infix_get_proptable(yyvsp[-2].val.v, yyvsp[0].val.v, &len); yyval.val.t = Z_NUMBER; } + { zword len; (yyval.val).v = infix_get_proptable((yyvsp[(1) - (3)].val).v, (yyvsp[(3) - (3)].val).v, &len); (yyval.val).t = Z_NUMBER; } break; -case 122: + + case 123: + +/* Line 1455 of yacc.c */ #line 487 "inform.y" -{ infix_get_proptable(yyvsp[-2].val.v, yyvsp[0].val.v, &yyval.val.v); yyval.val.t = Z_NUMBER; } + { infix_get_proptable((yyvsp[(1) - (3)].val).v, (yyvsp[(3) - (3)].val).v, &(yyval.val).v); (yyval.val).t = Z_NUMBER; } break; -case 123: + + case 124: + +/* Line 1455 of yacc.c */ #line 490 "inform.y" -{ yyval.val.t = Z_OBJPROP; yyval.val.o = yyvsp[-2].val.v; yyval.val.p = yyvsp[0].val.v; infix_get_val(&yyval.val); } + { (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)); } break; -case 124: + + case 125: + +/* Line 1455 of yacc.c */ #line 498 "inform.y" -{ yyval.val.v = yyvsp[0].val.v; yyval.val.t = Z_NUMBER; } + { (yyval.val).v = (yyvsp[(2) - (2)].val).v; (yyval.val).t = Z_NUMBER; } break; -case 125: + + case 126: + +/* Line 1455 of yacc.c */ #line 500 "inform.y" -{ yyval.val.v = yyvsp[0].val.v; yyval.val.t = Z_OBJECT; } + { (yyval.val).v = (yyvsp[(2) - (2)].val).v; (yyval.val).t = Z_OBJECT; } break; -case 126: + + case 127: + +/* Line 1455 of yacc.c */ #line 502 "inform.y" -{ yyval.val.v = yyvsp[0].val.v; yyval.val.t = Z_ROUTINE; } + { (yyval.val).v = (yyvsp[(2) - (2)].val).v; (yyval.val).t = Z_ROUTINE; } break; -case 127: + + case 128: + +/* Line 1455 of yacc.c */ #line 504 "inform.y" -{ yyval.val.v = yyvsp[0].val.v; yyval.val.t = Z_STRING; } + { (yyval.val).v = (yyvsp[(2) - (2)].val).v; (yyval.val).t = Z_STRING; } break; -case 128: + + case 129: + +/* Line 1455 of yacc.c */ #line 506 "inform.y" -{ yyval.val.t = Z_WORDARRAY; yyval.val.o = z_globaltable; yyval.val.p = yyvsp[0].val.v; infix_get_val(&yyval.val); } + { (yyval.val).t = Z_WORDARRAY; (yyval.val).o = z_globaltable; (yyval.val).p = (yyvsp[(2) - (2)].val).v; infix_get_val(&(yyval.val)); } break; -case 129: + + case 130: + +/* Line 1455 of yacc.c */ #line 508 "inform.y" -{ yyval.val.t = Z_LOCAL; yyval.val.o = infix_selected_frame; yyval.val.p = yyvsp[0].val.v; infix_get_val(&yyval.val); } + { (yyval.val).t = Z_LOCAL; (yyval.val).o = infix_selected_frame; (yyval.val).p = (yyvsp[(2) - (2)].val).v; infix_get_val(&(yyval.val)); } break; -case 130: + + case 131: + +/* Line 1455 of yacc.c */ #line 510 "inform.y" -{ yyval.val = yyvsp[-1].val; } + { (yyval.val) = (yyvsp[(2) - (3)].val); } break; -} -#line 705 "/usr/share/bison/bison.simple" - - yyvsp -= yylen; - yyssp -= yylen; -#if YYLSP_NEEDED - yylsp -= yylen; -#endif -#if YYDEBUG - if (yydebug) - { - short *yyssp1 = yyss - 1; - YYFPRINTF (stderr, "state stack now"); - while (yyssp1 != yyssp) - YYFPRINTF (stderr, " %d", *++yyssp1); - YYFPRINTF (stderr, "\n"); +/* Line 1455 of yacc.c */ +#line 2823 "inform.c" + default: break; } -#endif + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; -#if YYLSP_NEEDED - *++yylsp = yyloc; -#endif /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule @@ -1890,11 +2836,11 @@ case 130: yyn = yyr1[yyn]; - yystate = yypgoto[yyn - YYNTBASE] + *yyssp; - if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else - yystate = yydefgoto[yyn - YYNTBASE]; + yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; @@ -1907,155 +2853,126 @@ yyerrlab: if (!yyerrstatus) { ++yynerrs; - -#ifdef YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (yyn > YYFLAG && yyn < YYLAST) - { - YYSIZE_T yysize = 0; - char *yymsg; - int yyx, yycount; - - yycount = 0; - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - for (yyx = yyn < 0 ? -yyn : 0; - yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) - if (yycheck[yyx + yyn] == yyx) - yysize += yystrlen (yytname[yyx]) + 15, yycount++; - yysize += yystrlen ("parse error, unexpected ") + 1; - yysize += yystrlen (yytname[YYTRANSLATE (yychar)]); - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg != 0) - { - char *yyp = yystpcpy (yymsg, "parse error, unexpected "); - yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]); - - if (yycount < 5) - { - yycount = 0; - for (yyx = yyn < 0 ? -yyn : 0; - yyx < (int) (sizeof (yytname) / sizeof (char *)); - yyx++) - if (yycheck[yyx + yyn] == yyx) - { - const char *yyq = ! yycount ? ", expecting " : " or "; - yyp = yystpcpy (yyp, yyq); - yyp = yystpcpy (yyp, yytname[yyx]); - yycount++; - } - } - yyerror (yymsg); +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); - } - else - yyerror ("parse error; also virtual memory exhausted"); - } - else -#endif /* defined (YYERROR_VERBOSE) */ - yyerror ("parse error"); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif } - goto yyerrlab1; -/*--------------------------------------------------. -| yyerrlab1 -- error raised explicitly by an action | -`--------------------------------------------------*/ -yyerrlab1: + if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ - /* return failure if at end of input */ - if (yychar == YYEOF) - YYABORT; - YYDPRINTF ((stderr, "Discarding token %d (%s).\n", - yychar, yytname[yychar1])); - yychar = YYEMPTY; + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error token. */ + goto yyerrlab1; - yyerrstatus = 3; /* Each real token shifted decrements this */ - - goto yyerrhandle; +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: -/*-------------------------------------------------------------------. -| yyerrdefault -- current state does not do anything special for the | -| error token. | -`-------------------------------------------------------------------*/ -yyerrdefault: -#if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; - /* If its default is to accept any token, ok. Otherwise pop it. */ - yyn = yydefact[yystate]; - if (yyn) - goto yydefault; -#endif + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; -/*---------------------------------------------------------------. -| yyerrpop -- pop the current state because it cannot handle the | -| error token | -`---------------------------------------------------------------*/ -yyerrpop: - if (yyssp == yyss) - YYABORT; - yyvsp--; - yystate = *--yyssp; -#if YYLSP_NEEDED - yylsp--; -#endif +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ -#if YYDEBUG - if (yydebug) + for (;;) { - short *yyssp1 = yyss - 1; - YYFPRINTF (stderr, "Error: state stack now"); - while (yyssp1 != yyssp) - YYFPRINTF (stderr, " %d", *++yyssp1); - YYFPRINTF (stderr, "\n"); - } -#endif + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } -/*--------------. -| yyerrhandle. | -`--------------*/ -yyerrhandle: - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yyerrdefault; + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; - yyn = yytable[yyn]; - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrpop; - yyn = -yyn; - goto yyreduce; + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); } - else if (yyn == 0) - goto yyerrpop; - if (yyn == YYFINAL) - YYACCEPT; + *++yyvsp = yylval; - YYDPRINTF ((stderr, "Shifting error token, ")); - *++yyvsp = yylval; -#if YYLSP_NEEDED - *++yylsp = yylloc; -#endif + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; @@ -2075,21 +2992,45 @@ yyabortlab: yyresult = 1; goto yyreturn; -/*---------------------------------------------. -| yyoverflowab -- parser overflow comes here. | -`---------------------------------------------*/ -yyoverflowlab: - yyerror ("parser stack overflow"); +#if !defined(yyoverflow) || YYERROR_VERBOSE +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ +#endif yyreturn: + if (yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif - return yyresult; +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); } + + + +/* Line 1675 of yacc.c */ #line 514 "inform.y" @@ -2469,7 +3410,7 @@ static void inform_help(void) void process_debug_command(const char *buffer) { -#if YYDEBUG +#ifdef YYDEBUG yydebug = 1; #endif lex_expression = buffer; @@ -2590,3 +3531,4 @@ static int yylex(void) } #endif /* DEBUGGING */ + diff --git a/interpreters/nitfol/nitfol.6 b/interpreters/nitfol/nitfol.6 deleted file mode 100644 index 8241d06..0000000 --- a/interpreters/nitfol/nitfol.6 +++ /dev/null @@ -1,178 +0,0 @@ -.TH NITFOL 6 -.SH NAME -nitfol \- Z-code interpreter and debugger. -.SH SYNOPSIS -.B nitfol -.I "[options] file" -.SH DESCRIPTION -This manpage was generated from bits of the info page. See the info page for complete documentation. - -Nitfol is a portable interpreter for Z-machine code, the game format used by Infocom and more recently, Inform . Nitfol handles versions one through eight of the format, and attempts to comply with version 1.0 of the Z-machine specification. - -You will need game files to use nitfol. The ``if-archive'' contains a large collection of these, available at or at the USA mirror . - -This manual describes how to use nitfol and how it differs from other Z-machine interpreters. This manual was written with unix-like systems in mind; ignore that which does not apply to your platform. Comments on and corrections for this manual and nitfol are appreciated and should be sent to . - -.SH OPTIONS -.TP -.B \-ignore, \-no\-ignore, \-i -Ignore Z-machine strictness errors. Normally nitfol checks for illegal and undefined Z-machine behaviour and alerts the user. If you're playing someone else's buggy game, this can be annoying and you should use this option. -.TP -.B \-fullname, \-no\-fullname, \-f -For running under Emacs or DDD. Tells nitfol to give machine-recognizeable markers when stack frames are displayed instead of displaying the line. Only useful if you are using nitfol as an inferior debugger. -.TP -.B \-command \fIfile\fB, \-x \fIfile -Read commands from this file. Load a script from a file for playback in the game. -.TP -.B \-pirate, \-no\-pirate, \-P -Aye, matey. Make the piracy opcode not branch, letting the game know the game disc is not ``genuine.'' Infocom never used this opcode and neither should you, but if obscurity amuses you... -.TP -.B \-quiet, \-no\-quiet, \-q -Do not print introductory messages. For GDB compatibility. -.TP -.B \-spell, \-no\-spell -Perform spelling correction. Normally Z-machine games are unforgiving of typos (though they do have an \fBoops\fP command). If you type in a word which isn't in the game's dictionary and have typo correction enabled, nitfol will search for a word which is off by one letter by a substitution, deletion, insertion or transposition. -.TP -.B \-expand, \-no\-expand -Expand one letter abbreviations. Early Z-machine games don't include `x' as a synonym for `examine' and such. If the first word in a sentence is one letter long and not recognized by the game, this will attempt to expand it to a full word. -.TP -.B \-symbols \fIfile\fB, \-s \fIfile -Specify symbol file for game. If you want to perform source-level debugging, you will need to specify a symbol file, which contains the names of variables and tells nitfol how source code corresponds to object code. -.TP -.B \-tandy, \-no\-tandy, \-t -Censors some Infocom games. Some version 3 games perform minor wording changes when this bit is set to appease the sensitivity of Tandy Corporation. -.TP -.B \-transcript \fIwfile\fB, \-T \fIwfile -Write transcript to this file. This transcript begins as soon as the game starts. -.TP -.B \-debug, \-no\-debug, \-d -Enter debugger immediatly. Imitate GDB by not automatically starting the story. -.TP -.B \-prompt \fIstring\fB -Specify debugging prompt. This is the prompt nitfol prints when it is waiting for a debugging command (as opposed to the > the game story prints when waiting for a game command). DDD requires this to be `(gdb) '. -.TP -.B \-path \fIstring\fB -Look for games in this directory. If nitfol cannot find the requested game in the current directory, it looks through the directories listed in the given colon separated string. The directories specified here are also used to search for gamefiles from saved games. If this option is not used, nitfol looks at the \fBINFOCOM_PATH\fP environment variable. -.TP -.B \-autoundo, \-no\-autoundo -Ensure \fB@save_undo\fP is called every turn. If a turn passes with no \fB@save_undo\fP between, this option performs the \fB@save_undo\fP automagically. Could cause problems with some games which have a different concept of a turn. -.TP -.B \-stacklimit \fInumber\fB, \-S \fInumber -Exit when the stack is this deep. If a game is infinitely recursing, nitfol will allocate large amounts of memory and take a long time before the problem is reported. This option makes it fatal to recurse more than the given number of stack frames. Setting this to 0 makes nitfol allow as many as fit contiguously in memory. The Z-machine Standards Document recommends games use no more than 1024 words of total stack (frames and pushed data) in ZIP, which roughly works out to 90 routine calls deep. -.TP -.B \-alias \fIstring\fB, \-a \fIstring -Specify an alias. Adds an alias which will be expanded in read lines before tokenisation. The alias is of the form \fIname\fP \fIvalue\fP; you will need to use quotes around it on the commandline. -.TP -.B \-ralias \fIstring\fB -Specify an recursive alias. Adds an alias whose result is checked for further alias expansion. Identical syntax to adding a normal alias. -.TP -.B \-unalias \fIstring\fB -Remove an alias. Removes an alias previously added by -alias. Useful for removing aliases in preference files. -.TP -.B \-random \fInumber\fB, \-r \fInumber -Set random seed. Normally the random number generator is initialized with the time of day. If this option is used with a non-zero argument, the given number will be used to initialize the generator and for \fB@random 0\fP. -.TP -.B \-mapsym \fIstring\fB -Specify mapping glyphs. Nitfol draws maps using ASCII characters; you can choose which characters it uses to draw rooms. Defaults to `*udb@UDB+', which is, in order: empty room, room with down exit, room with up exit, room with up and down exits, room with player, room with player and up exit, room with player and down exit, room with player and up and down exits, bend symbol. -.TP -.B \-mapsize \fInumber\fB -Specify map size. Determines the number of lines to be used for the map. -.TP -.B \-maploc \fIstring\fB -Specify map location. Nitfol creates a Glk window for the map it generates. The map can be placed `above', `below', to the `right', or the `left', of the main game window. Follow this option with one those locations. -.TP -.B \-terpnum \fInumber\fB -Specify interpreter number. Each port of Infocom's Z-machine interpreter was given a number. `1' for their own DECSystem-20, `2' for Apple IIe, `3' for Macintosh, `4' for Amiga, `5' for Atari ST, `6' for IBM PC, `7' for Commodore 128, `8' for Commodore 64, `9' for Apple IIc, `10' for Apple IIgs, `11' for Tandy Color. Giving this option makes nitfol claim to be running on the specified system. A few games change their behaviour slightly depending on which machine type they run. By default nitfol claims to be on an Apple IIe, as this makes Beyond Zork not do character graphics. -.TP -.B \-terpver \fIstring\fB -Specify interpreter version. Infocom's interpreters were given versions, typically a capital letter. Nitfol defaults to `N', Frotz uses `F', and ZIP uses `B'. Any single character version is allowed. Multicharacter options are read as a number instead of an ASCII character. Only known effect upon games is the letter printed by banners and the `version' command. Version 6 games interpret this as a number instead of a letter. -.SH BUGS - -A nitfol bug is any behaviour which makes nitfol reliably misbehave, with the exceptions of bugs in Glk libraries. These include: anything which makes nitfol crash (other than when nitfol reports `FATAL' errors), anything which causes nitfol to contradict the Z-machine standards documents (except for optional enhancements like spelling correction and debug mode), any buffer overflows, and anything which makes nitfol infinite loop other than infinite loops in the game itself. - -Before reporting a bug, make sure the bug is not listed below and your copy of nitfol is not compiled with `-DFAST'. Please report the version of nitfol, your system type and a series of commands which reliably cause the bug. - -Nitfol is lacking: -.IP \(bu -Graphical font (\fIBeyond Zork\fP) (should use images for this) -.IP \(bu -Terminating character support (mostly \fIBeyond Zork\fP) -.IP \(bu -Reverse video, full color (should querry Glk more aggressively) -.IP \(bu -Unicode support -.IP \(bu -keypad character codes -.IP \(bu -its own random number generator (relies on system one) -.PP - -Nitfol does incorrectly: -.IP \(bu -Play is not paused to wait for sounds to complete in \fIThe Lurking Horror\fP. -.IP \(bu -Pictures and text are not placed correctly for v6 games. -.IP \(bu -block quotes are placed in the upper window, so \fBcheapnitfol\fP can't see them. -.IP \(bu -Corrupted save files may make nitfol do bad things. -.IP \(bu -Should figure out a way to handle buggy games like \fIAMFV\fP and \fIVaricella\fP which assume the upper window is 80 columns wide. -.IP \(bu -Doesn't catch header writing other than \fB@storeb\fP and \fB@storew\fP. -.PP - -Debugger problems: -.IP \(bu -Sometimes says there's no code at a location where it could be clever and - find some. -.IP \(bu -\fBofclass\fP, superclass not implemented. -.IP \(bu -Should perform more sanity checks everywhere. -.IP \(bu -Lots of useful commands not yet implemented. -.IP \(bu -\fIobject\fP.\fIfunction\fP is handled incorrectly, both for assignments and calls. -.IP \(bu -Assumes you know what you're doing, so \fBquit\fP, \fBrun\fP, etc., don't prompt you for confirmation. -.PP - -Automapping problems: -.IP \(bu -Doesn't work well for random destinations (the forest in \fIAdvent\fP) -.IP \(bu -\fB@get_cursor\fP doesn't return the correct value during automapping since output is disabled. -.IP \(bu -Requires too much work for the end-user; should put in stuff to make it figure out the location global in 95% of games. -.IP \(bu -Doesn't really work if multiple locations are coded as being in the same room (long road in \fIEnchanter\fP). -.IP \(bu -Doesn't show exits which go nowhere, but change the game. -.IP \(bu -Perhaps should use graphics windows when available. -.IP \(bu -Movement causing teleportation confuses it. -.IP \(bu -Reincarnation handling isn't optimal. -.IP \(bu -Still very buggy. -.IP \(bu -It's too slow. -.IP \(bu -Should realize it can add extra bends (especially in one-way passages). -.IP \(bu -Should be able to output nice-looking Postscript. -.IP \(bu -Should store map in saved games (wait until automapping code stabilizes). -.PP - -.SH "SEE ALSO" -.RB "`\|" nitfol "\|'" -entry in -.B -info; -.BR frotz (6), -.BR txd (1). -.SH AUTHOR -nitfol was written by Evin Robertson, who can be reached at nitfol@my-deja.com. diff --git a/interpreters/nitfol/nitfol.html b/interpreters/nitfol/nitfol.html deleted file mode 100644 index 756cb25..0000000 --- a/interpreters/nitfol/nitfol.html +++ /dev/null @@ -1,1189 +0,0 @@ - - - - -Nitfol - - - -

Nitfol

-

-


-

Table of Contents

- -


- - -

1 Introduction

- -

-Nitfol is a portable interpreter for Z-machine code, the game format used by Infocom and more recently, Inform. Nitfol handles versions one through eight of the format, and attempts to comply with version 1.0 of the Z-machine specification. - -

-

-You will need game files to use nitfol. The "if-archive" contains a large collection of these, available at ftp://ftp.gmd.de/if-archive/games/zcode/ or at the USA mirror http://ifarchive.org/indexes/if-archiveXgamesXzcode.html. - -

-

-This manual describes how to use nitfol and how it differs from other Z-machine interpreters. This manual was written with UNIX-like systems in mind; ignore that which does not apply to your platform. Comments on and corrections for this manual and nitfol are appreciated and should be sent to nitfol@my-deja.com. - -

- - - -

2 Invoking nitfol

- -

-Invoke nitfol with the game filename, and options. If you omit the game filename, nitfol will prompt you for one. The following options are recognized: - -

-
- -
-ignore -
-
-no-ignore -
-
-i -
-Ignore Z-machine strictness errors. Normally nitfol checks for illegal and undefined Z-machine behaviour and alerts the user. If you're playing someone else's buggy game, this can be annoying and you should use this option. - -
-fullname -
-
-no-fullname -
-
-f -
-For running under Emacs or DDD. Tells nitfol to give machine-recognizeable markers when stack frames are displayed instead of displaying the line. Only useful if you are using nitfol as an inferior debugger. - -
-command file -
-
-x file -
-Read commands from this file. Load a script from a file for playback in the game. - -
-pirate -
-
-no-pirate -
-
-P -
-Aye, matey. Make the piracy opcode not branch, letting the game know the game disc is not "genuine." Infocom never used this opcode and neither should you, but if obscurity amuses you... - -
-quiet -
-
-no-quiet -
-
-q -
-Do not print introductory messages. For GDB compatibility. - -
-spell -
-
-no-spell -
-Perform spelling correction. Normally Z-machine games are unforgiving of typos (though they do have an oops command). If you type in a word which isn't in the game's dictionary and have typo correction enabled, nitfol will search for a word which is off by one letter by a substitution, deletion, insertion or transposition. - -
-expand -
-
-no-expand -
-Expand one letter abbreviations. Early Z-machine games don't include x as a synonym for examine and such. If the first word in a sentence is one letter long and not recognized by the game, this will attempt to expand it to a full word. - -
-symbols file -
-
-s file -
-Specify symbol file for game. If you want to perform source-level debugging, you will need to specify a symbol file, which contains the names of variables and tells nitfol how source code corresponds to object code. - -
-tandy -
-
-no-tandy -
-
-t -
-Censors some Infocom games. Some version 3 games perform minor wording changes when this bit is set to appease the sensitivity of Tandy Corporation. - -
-transcript wfile -
-
-T wfile -
-Write transcript to this file. This transcript begins as soon as the game starts. - -
-debug -
-
-no-debug -
-
-d -
-Enter debugger immediatly. Imitate GDB by not automatically starting the story. - -
-prompt string -
-Specify debugging prompt. This is the prompt nitfol prints when it is waiting for a debugging command (as opposed to the > the game story prints when waiting for a game command). DDD requires this to be `(gdb) '. - -
-path string -
-Look for games in this directory. If nitfol cannot find the requested game in the current directory, it looks through the directories listed in the given colon separated string. The directories specified here are also used to search for gamefiles from saved games. If this option is not used, nitfol looks at the INFOCOM_PATH environment variable. - -
-autoundo -
-
-no-autoundo -
-Ensure @save_undo is called every turn. If a turn passes with no @save_undo between, this option performs the @save_undo automagically. Could cause problems with some games which have a different concept of a turn. - -
-stacklimit number -
-
-S number -
-Exit when the stack is this deep. If a game is infinitely recursing, nitfol will allocate large amounts of memory and take a long time before the problem is reported. This option makes it fatal to recurse more than the given number of stack frames. Setting this to 0 makes nitfol allow as many as fit contiguously in memory. The Z-machine Standards Document recommends games use no more than 1024 words of total stack (frames and pushed data) in ZIP, which roughly works out to 90 routine calls deep. - -
-alias string -
-
-a string -
-Specify an alias. Adds an alias which will be expanded in read lines before tokenisation. The alias is of the form name value; you will need to use quotes around it on the commandline. - -
-ralias string -
-Specify an recursive alias. Adds an alias whose result is checked for further alias expansion. Identical syntax to adding a normal alias. - -
-unalias string -
-Remove an alias. Removes an alias previously added by -alias. Useful for removing aliases in preference files. - -
-random number -
-
-r number -
-Set random seed. Normally the random number generator is initialized with the time of day. If this option is used with a non-zero argument, the given number will be used to initialize the generator and for @random 0. - -
-mapsym string -
-Specify mapping glyphs. Nitfol draws maps using ASCII characters; you can choose which characters it uses to draw rooms. Defaults to `*udb@UDB+', which is, in order: empty room, room with down exit, room with up exit, room with up and down exits, room with player, room with player and up exit, room with player and down exit, room with player and up and down exits, bend symbol. - -
-mapsize number -
-Specify map size. Determines the number of lines to be used for the map. - -
-maploc string -
-Specify map location. Nitfol creates a Glk window for the map it generates. The map can be placed `above', `below', to the `right', or the `left', of the main game window. Follow this option with one those locations. - -
-terpnum number -
-Specify interpreter number. Each port of Infocom's Z-machine interpreter was given a number. `1' for their own DECSystem-20, `2' for Apple IIe, `3' for Macintosh, `4' for Amiga, `5' for Atari ST, `6' for IBM PC, `7' for Commodore 128, `8' for Commodore 64, `9' for Apple IIc, `10' for Apple IIgs, `11' for Tandy Color. Giving this option makes nitfol claim to be running on the specified system. A few games change their behaviour slightly depending on which machine type they run. By default nitfol claims to be on an Apple IIe, as this makes Beyond Zork not do character graphics. - -
-terpver string -
-Specify interpreter version. Infocom's interpreters were given versions, typically a capital letter. Nitfol defaults to `N', Frotz uses `F', and ZIP uses `B'. Any single character version is allowed. Multicharacter options are read as a number instead of an ASCII character. Only known effect upon games is the letter printed by banners and the `version' command. Version 6 games interpret this as a number instead of a letter. - -
- - - -

3 Features

- - - -

3.1 Preferences

- -

-If you don't like the default options and don't want to recompile, you can set your preferences by writing a `.nitfolrc' in your home directory. - -

-

-Each line should be of the form option=value. Blank lines and lines starting with a # are ignored. If you want to specify different options for different copies of nitfol, you can put those options in a block which will only be read by copies of nitfol with a specific name. - -

-

-Here's an example `.nitfolrc': - -

-path=/usr/local/games/infocom
-alias=v verbose
-alias=asierra tone cordial. ask sierra about
-ignore=true
-
-[strictnitfol]
-ignore=false
-spell=false
-expand=false
-autoundo=false
-unalias=v
-unalias=asierra
-
-[xnitfol]
-tandy=true
-pirate=true
-
- -

-Nitfol will look in `/usr/local/games/infocom' for game files. Copies of nitfol named `strictnitfol' will report Z-machine strictness errors, perform strict tokenisation, and not automatically @save_undo. All others will ignore strictness errors and have two aliases. `xnitfol' will set the Tandy bit and branch on the piracy opcode. - -

-

-Options specified in the preference file may be overruled by environment variables and command line options. - -

- - - -

3.2 Infinite undo/redo

- -

-Multiple @restore_undo opcodes with no intervening @save_undo will restore earlier and earlier saved states. However, Inform games will not do this, so if you want infinite undo, you must enter the commands /undo and /redo. The /... commands are part of the debugger, so you will need to compile in debugger support to use this feature. - -

-

-Z-machine games prior to version 5 do not provide undo (none of them provide redo), and some version 5 games don't use it (like Wishbringer). If the game performs two @read opcodes with no intervening @save_undo or @restore_undo, nitfol will perform a @save_undo. - -

- - - -

3.3 Aliases

- -

-If the game has long words which you wish to abbreviate, you can use aliases. Use the command /alias name value. All instances of name in line input will be replaced with value. name may not contain whitespace. - -

-

-Unlike abbreviation expansion and typo correction, alias expansion modifies the text buffer, inserting the requested text. This is necessary to allow multiple commands to be given in an alias through the use of periods. - -

-

-Aliases are not expanded recursively, so you could do something clever like this: - -

->/alias e w
-/alias w e
-/alias nw ne
-/alias ne nw
-/alias sw se
-/alias se sw
-
- -

-And your east-west movement will be swapped (e will do a w, though east will still do east). Aliases expand on all input the game receives using @read, including transcripts and directions from the automapper. - -

-

-If you want the expansion of the alias to be checked for further aliases, you must use the /ralias command. This expansion is stopped when an alias would expand itself. - -

->/ralias e w
-/ralias w e
-
- -

-Would do nothing, as e is expanded to w, which is expanded to e, and then it stops because the rule for expanding e has already taken place. - -

- -
->/ralias hanoi2 move src to extra. move src to dest. move extra to dest
-/alias src left
-/alias dest center
-/alias extra right
-hanoi2
-You move the small disc from the left peg to the right peg.
-You move the medium disc from the left peg to the middle peg.
-You move the small disc from the right peg to the middle peg.
->move left to right
-You move the large disc from the left peg to the right peg.
->/alias src center
-/alias dest right
-/alias extra left
-hanoi2
-You move the small disc from the middle peg to the left peg.
-You move the medium disc from the middle peg to the right peg.
-You move the small disc from the left peg to the right peg.
-
- -

-Ideally you should be able to define an alias which recursively solves any depth by relying on lower levels being solvable, but this isn't yet possible. You must keep the expansion of aliases to a reasonable size, since Inform has a fairly small buffer size. - -

-

-You can remove aliases using the /unalias command. - -

->/unalias hanoi2
-
- -

-Aliases do not effect /... commands; if they did, it wouldn't be possible to /unalias. - -

- - - -

3.4 Abbreviation Expansion

- -

-Early Infocom games don't provide abbreviations like x for examine. If you enable abbreviation expansion, nitfol will attempt to expand one letter words at the beginning of inputs which are not in the game's dictionary. - -

-

-Nitfol supports the following expansions (note that some are non-standard): - -

- - -c i o s x
close - d down - e east - g again -
-
inventory - k attack - l look - n north -
-
oops - p open - q quit - r drop -
-
south - t take - u up - w west -
-
examine - y yes - z wait -
- -From Zork I: - -
-West of House
-You are standing in an open field west of a white house, with a
-boarded front door.
-There is a small mailbox here.
-
->x mailbox
-[x -> examine]
-The small mailbox is closed.
-
->p it
-[p -> open]
-Opening the small mailbox reveals a leaflet.
-
->t leaflet
-[t -> take]
-Taken.
-
- - - -

3.5 Typo correction

- -

-In the Z-machine, the @read opcode provides the interpreter with a dictionary to search in order to do tokenisation and word matching. If you enable typo correction and enter a word not in the provided dictionary, nitfol will search for near misses. - -

-

-From Curses: - -

->ask jemmia about gloves
-[jemmia -> jemima]
-"Those are my gloves."
-
- -

-Nitfol takes the following steps to correct typos: - -

- -
    -
  1. - -If the entered word is in the dictionary, behave as normal. - -
  2. - -If the length of the word is less than 3 letters long, give up. We don't want to make assumptions about what so short words might be. - -
  3. - -If the word is the same as a dictionary word with one transposition, assume it is that word. exmaine becomes examine. - -
  4. - -If it is a dictionary word with one deleted letter, assume it is that word. botle becomes bottle. - -
  5. - -If it is a dictionary word with one inserted letter, assume it is that word. tastey becomes tasty. - -
  6. - -If it is a dictionary word with one substitution, assume it is that word. opin becomes open. -
- -

-This behavior can be annoying when nitfol "corrects" intentionally entered words which are similar to dictionary words. Usually this has no effect upon the game, perhaps slightly changing the game's error message, but may have negative effects when it causes an undesired action. Games like Beyond Zork expect you to type words not in their dictionary to name things. Nitfol might "correct" your entered word to a dictionary word, which the game might complain about. - -

-

-If typo correction is getting in your way, run nitfol with `-no-smart', compile it without applying `-DSMART_TOKENISER', or edit `nitfol.opt' to change the compile-time default. - -

- - - -

3.6 Automapping

- -

-Nitfol has the ability to display an on-screen map showing visited rooms and their connections on the current floor. Below is a map generated from Enchanter. - -

-                                   *-* *
-                                   |   |
-                   u-*-*-*-*-------*---*
-                   |               |
-       * *   *     |     *---*     |
-       |/ \ /      |    /|\ / \    |
-       *   *       *   / | X * \   *
-      /     \      |  /  |/ v|  \  |
-     /   *   *-*-*-*-*---*---u---*-*-*-@
-    /    |  /      | |\  |\ ^|  /  |    
- *-*     * *       | | \ | X * /   *-*
-    \    |/        | |  \|/ \ /    |  
-     *   *         * *   *---*     *
-      \ /          | |             |
-       *           u-d-*-----------*-u
-                                   |  
-                                   *
-                                    \
-                                     *
-
- -

-The `*'s designate rooms; the `@' the current room. Rooms containing staircases are shown with a `u' or `d', or `b' if the staircase is bi-directional. If the current room contains a staircase, nitfol draws it with a `U', `D', or `B'. Passageways are shown with lines; the `X's are crossed lines. One-way passages are shown as lines with arrows. Nitfol uses `v', `^', `<', and `>' for arrow heads. - -

-

-In Glks which provide mouse events, you can click on rooms and it will display the room name (and number) in the upper left hand corner of the map. Note that XGlk is slightly broken, so you need to click on the left-hand side of the room. Clicking on an empty map space clears the name. - -

-

-In order to use automapping, you must tell nitfol how to calculate the current location. You do this by specifying an Inform expression, so you must have debugging enabled. - -

-

-Typically the current location is available in a global. In Z-code versions 3 and prior, the current location is always stored in global zero, so typing /automap (global) 0 should work. In later versions, you must figure out an expression which evaluates to the current location. - -

-

-First, find out where the player object is. Typically, the player object is named `self', `cretin', `self-object', or the name of the PC. You can use the find command to search object names. If this all fails, try object-tree to find the location number. - -

-

-Once you have found the number of the location, you need to figure out which global keeps track of the location. You can use the globals command to search the globals. - -

-

-From Spider And Web: - -

->/find self
-20 "(self object)"
-25 "yourself" in 91 "End of Alley"
-26 "yourself" in 48 "chair"
-/globals 91
-G15 G36 G39
-s
-
-Mouth of Alley
-You're in the entrance of a narrow brick alley, which runs further
-in to the north. To the south a broad street courses by, congested
-with traffic and bicycles, although none of them seem to notice you.
-
->/find self
-20 "(self object)"
-25 "yourself" in 94 "Mouth of Alley"
-26 "yourself" in 48 "chair"
-/globals 94
-G15 G36 G39
-/automap (global) 15
-
- -

-Obviously we have 3 globals tracking the player location. Typically there are only two, but some games have more. In this, we just picked the first one, which is probably the Inform location variable; another is probably the real_location variable. Depending on how you want automapping to behave in the dark, or when dealing with game-specific stuff, you may want to pick a different one. - -

-

-To figure out what is in which direction, nitfol checks the current location, tells the game to go north, checks the new location, undoes the north movement, tries to go northeast, and so on. During all of this, output is disabled. - -

-

-Drawing the map is more complicated. First nitfol looks for cycles in the graph and makes the cycles connect properly. Then it draws the map. If parts of the map overlapp, it finds a path connecting the overlapping bits and tries increasing the length of each passage in this path by one, and recalculates cycle connections. If this solves the problem, it's done; otherwise, it tries increasing the length of two passages, or of one of the passages by two. If this fails, it gives up. - -

-

-This technique isn't perfect. The implementation of this technique isn't perfect either. So expect nitfol to misbehave a lot on complex maps, and a little on simple maps. If you clever ideas on how to improve it, let me know. - -

-

-Nitfol makes an effort to simplify the map. If multiple exits go from the barn to cornfield and you've been to both places, nitfol will draw a single two-way passage if possible. If both up and west go up the stairs and nitfol knows east returns from the top of the stairs, nitfol will draw it as a simple west-east passage ignoring the up/down. If east doesn't return from the top of the staircase, nitfol will draw it as up/down, leaving out the west passage. - -

-

-If you've been north of a gate, and come up to the gate from the south, -and unlock the gate, nitfol will draw it as a one-way passage since last -time it was north of the gate, it couldn't go south. - -

-

-Some games feature reincarnation, perhaps moving you to a new location. If movement leads to your death, this makes nitfol think the reincarnation location is in that direction. Nitfol watches for three asterisks in a row and will assume they mean death instead of a normal passage. - -

-

-Some of these problems could be avoided by having nitfol explore each neighboring room, but this would make automapping even slower. - -

- - - -

3.7 Quetzal

- -

-Nitfol uses Quetzal version 1.4 for its save format, so you can use your saves between different computers and interpreters. More information about Quetzal is available at http://www.geocities.com/SiliconValley/Vista/6631/. - -

-

-If you specify a save-file on the command-line on UNIX, nitfol uses a UNIX IntD chunk to locate the game file associated with the save name. This chunk is included in save games when nitfol can figure out the current filename. If you compile nitfol with -D__USE_GNU, -D__USE_BSD, or -D__USE_XOPEN_EXTENDED, nitfol will canonicalize the file name, so you don't have to worry about relative file name specifications no longer working if you invoke nitfol from a different directory. - -

-

-On MacOS, nitfol uses alias records from a MACS IntD chunk to locate the game file. This won't work for games built-in to the interpreter. - -

-

-If no IntD chunk is included, nitfol searches the environment variable INFOCOM_PATH for a game with matching release number, serial number, and checksum. - -

-

-Looking for games without an IntD chunk isn't foolproof, but it should work most of the time. Serial numbers are basically the date and it's extremely unlikely more than ten games will be compiled on the same day (the only time lots of games are compiled on same day is right before competition time). Assuming they all have the same release number, there's still only a .0686% chance that at least two of these ten will share the same checksum. If someone reports this as a problem, I'll make nitfol ensure the game contains a save opcode right before the restored PC. - -

- - - -

3.8 Blorb

- -

-If you wish to hear sounds or see graphics in your games, they must be packaged in Blorb files. The Z-machine game may included in the Blorb file or may be specified separately. Nitfol does not support the traditional Infocom `.mg1' and `.snd' files. - -

-

-Note that graphics are displayed incorrectly, and sound has not yet been tested. - -

- - -

4 Debugger

- -

-Nitfol debugging mode tries to imitate the GDB interface. If you're familiar with that, you should have no problem using nitfol (other than dealing with the current incompleteness). - -

-

-You need inform 6.21 or later, as earlier versions don't produce correct infix files without a patch. You then need to compile infix information for your game. I recommend doing: - -

-

-inform -k -~S -~X -~D MyGame.inf - -

-

-Then your debug information will be in `gameinfo.dbg'. If you have a command-line on your platform, run nitfol like nitfol MyGame.z5 -symbols gameinfo.dbg. Otherwise, start up your game and type /symbol-file gameinfo.dbg the first time you get a prompt. - -

-

-When the game stops to read a line of text, you can begin that line with / to give a debug command. If you want to pass a line beginning with a / to the game, double the / and the game will be passed the second one. When at a (nitfol) prompt, starting commands with / is neither necessary nor recommended. - -

-

-All expressions are like the ones used in Inform. - -

-

-You can perform casts to get the result in the form you want: - -

-
- -
(number) expression -
-Use expression as if it were a number. Useful when you want to know the number of something, not the object, routine, or string information nitfol normally gives. -
(object) expression -
-Use expression as if it were an object. Most useful when printing the result, as it will show the object's attributes and properties. -
(routine) expression -
-Use expression as if it were the packed address of a routine. Useful if you have the packed address of a routine which you want to set a breakpoint at. -
(string) expression -
-Use expression as if it were the packed address of a string. Useful for printing it. -
(global) expression -
-Evaluates to the value of a numbered global. (global) 0 is the player location for version 3 Infocom games. -
(local) expression -
-Evaluates to the value of a numbered local. Not terribly useful unless you're debugging something without source. -
- -

-Here are short descriptions of the debugger commands. See Info file `gdb', node `Top', for more information. Some of these were taken/adapted from GDB's help. - -

-
- -
info breakpoints -
- -
info breakpoints num -
- -List breakpoints. An argument specifies a specific breakpoint to list. - -
quit -
- -Exit nitfol. - -
show language -
- -Show the current source language. - -
condition num exp -
- -Set a condition for an existing breakpoint. - -
restore -
- -Restore a saved game. - -
break linespec -
- -
break linespec if exp -
- -Set a breakpoint. An if clause specifies a condition. - -
stepi -
- -
stepi num -
- -Step exactly one instruction. An argument specifies a repeat count. - -
restart -
- -Restart the game. - -
object-tree -
- -
object-tree exp -
- -Display the object tree. An argument says which object to use as the root of the tree. - -
disable display num -
- -Temporarily disable an automatic display. - -
select-frame num -
- -Select a specific stack frame. - -
alias name value -
- -Add an alias - -
down-silently -
- -
down-silently num -
- -Silently select the child of the selected frame. An argument specifies how many frames down to go. - -
frame -
- -
frame num -
- -Show the selected stack frame. An argument specifies a stack frame to show. - -
give exp num -
- -
give exp ~ num -
- -Give an object an attribute. With a tilde clears the attribute instead of setting it. - -
set exp -
- -Evaluate an expression without printing its value. - -
print exp -
- -Evaluates an expression and prints the result. This can include function calls. - -
up -
- -
up num -
- -Select the parent of the selected frame. An argument specifies how many frames up to go. - -
# comment -
- -Enter a comment - -
continue -
- -
continue num -
- -Continue execution. An argument sets the ignore count of the current breakpoint. - -
dumpmem file -
- -Dump memory to a file - -
undo -
- -Undo last move (not last debugger command). - -
display exp -
- -Print value of an expression each time the program stops. - -
move exp to exp -
- -Move an object around the object tree. - -
up-silently -
- -
up-silently num -
- -Select the parent of the selected frame silently. An argument specifies how many frames up to go. - -
show copying -
- -Show licensing information. - -
recording off -
- -Stop recording a script. - -
jump linespec -
- -Continue execution at a new location. - -
recording on -
- -Start recording a script. - -
ralias name value -
- -Add a recursive alias - -
globals -
- -
globals exp -
- -List all global variables and their values. With an argument, list all only those with a specific value. - -
backtrace -
- -
backtrace num -
- -
backtrace - num -
- -Display the parent functions of the current frame. An argument specifies how many frames back to show. If the argument is negative, start from the first frame instead of the current. - -
find -
- -Find objects whose shortnames contain a string. - -
finish -
- -An argument specifies a repeat count. - -
down -
- -
down num -
- -Select the child of the selected frame. An argument specifies how many frames down to go. - -
ignore num num -
- -Set the ignore count for a breakpoint. - -
replay off -
- -Halt replay. - -
nexti -
- -
nexti num -
- -Step one instruction, stepping over subroutine calls. Step a specified number of instructions, stepping over subroutine calls. - -
help -
- -Print list of commands. - -
redo -
- -Redo undid move. Only works immediately after an undo. - -
enable num -
- -Re-enabled a breakpoint. - -
until -
- -Resume execution until the program reaches a line number greater than the current line. - -
replay -
- -Replay a recorded script. - -
unalias name -
- -Remove an alias - -
remove exp -
- -Remove an object from the object tree. - -
info sources -
- -List source files. - -
delete num -
- -Delete a breakpoint. - -
symbol-file file -
- -Load debugging info from a file (usually `gameinfo.dbg'). - -
automap exp -
- -Start automapping - -
show warranty -
- -Show warranty information. - -
disable num -
- -Temporarily disable a breakpoint. - -
undisplay num -
- -Stop automatically displaying an expression. - -
enable display num -
- -Re-enable an automatic display. - -
step -
- -
step num -
- -Step through program to a different source line. An argument specifies a repeat count. - -
info source -
- -Get information on the current source file. - -
next -
- -
next num -
- -Step through program, stepping over subroutine calls. An argument specifies a repeat count. - -
- -

-If you're on a UNIX and you don't like the GDB interface, you can compile cheapnitfol and run it as the inferior debugger under Emacs or DDD. You can also try compiling xnitfol with `-DSTDOUT_DEBUG' and trying that, but I haven't tested that much. - -

-

-ddd MyGame.z5 --debugger cheapnitfol -s gameinfo.dbg -prompt "(gdb) " - -

- - -

5 Bugs

- -

-A nitfol bug is any behaviour which makes nitfol reliably misbehave, with the exceptions of bugs in Glk libraries. These include: anything which makes nitfol crash (other than when nitfol reports `FATAL' errors), anything which causes nitfol to contradict the Z-machine standards documents (except for optional enhancements like spelling correction and debug mode), any buffer overflows, and anything which makes nitfol infinite loop other than infinite loops in the game itself. - -

-

-Before reporting a bug, make sure the bug is not listed below and your copy of nitfol is not compiled with `-DFAST'. Please report the version of nitfol, your system type and a series of commands which reliably cause the bug. - -

-

-Nitfol is lacking: - -

    -
  • Graphical font (Beyond Zork) (should use images for this) - -
  • Terminating character support (mostly Beyond Zork) - -
  • Reverse video, full color (should querry Glk more aggressively) - -
  • Unicode support - -
  • keypad character codes - -
  • its own random number generator (relies on system one) - -
- -

-Nitfol does incorrectly: - -

    -
  • Play is not paused to wait for sounds to complete in The Lurking Horror. - -
  • Pictures and text are not placed correctly for v6 games. - -
  • block quotes are placed in the upper window, so cheapnitfol can't see them. - -
  • Corrupted save files may make nitfol do bad things. - -
  • Should figure out a way to handle buggy games like AMFV and Varicella which assume the upper window is 80 columns wide. - -
  • Doesn't catch header writing other than @storeb and @storew. - -
- -

-Debugger problems: - -

    -
  • Sometimes says there's no code at a location where it could be clever and - - find some. -
  • ofclass, superclass not implemented. - -
  • Should perform more sanity checks everywhere. - -
  • Lots of useful commands not yet implemented. - -
  • object.function is handled incorrectly, both for assignments and calls. - -
  • Assumes you know what you're doing, so quit, run, etc., don't prompt you for confirmation. - -
- -

-Automapping problems: - -

    -
  • Doesn't work well for random destinations (the forest in Advent) - -
  • @get_cursor doesn't return the correct value during automapping since output is disabled. - -
  • Requires too much work for the end-user; should put in stuff to make it figure out the location global in 95% of games. - -
  • Doesn't really work if multiple locations are coded as being in the same room (long road in Enchanter). - -
  • Doesn't show exits which go nowhere, but change the game. - -
  • Perhaps should use graphics windows when available. - -
  • Movement causing teleportation confuses it. - -
  • Reincarnation handling isn't optimal. - -
  • Still very buggy. - -
  • It's too slow. - -
  • Should realize it can add extra bends (especially in one-way passages). - -
  • Should be able to output nice-looking Postscript. - -
  • Should store map in saved games (wait until automapping code stabilizes). - -
- - - -

6 Thanks

- -

-The following people have given comments, suggestions, bug reports, answered questions, or helped port nitfol (in alphabetical order): - -

    -
  • John Cater - -
  • Paul David Doherty - -
  • Martin Frost - -
  • Doug Jones - -
  • David Picton - -
  • Andrew Plotkin - -
  • Andrew Pontious - -
  • L. Ross Raszewski - -
  • Dan Shiovitz - -
- - - -

7 Games Cited

- -

-Wishbringer Copyright © 1985, 1988 Infocom Inc. - -

-

-
-Zork I Copyright © 1981-1986 Infocom Inc. - -

-

-
-Curses Copyright © 1993-1994 Graham Nelson. - -

-

-http://ifarchive.org/if-archive/games/zcode/curses.z5 - -

-

-
-Beyond Zork Copyright © 1987 Infocom Inc. - -

-

-
-Enchanter Copyright © 1983, 1984, 1986 Infocom Inc. - -

-

-
-Varicella by Adam Cadre 1999. - -

-

-http://adamcadre.ac/content/vgame.z8 - -

-

-
-Spider And Web Copyright © 1997-1998 Andrew Plotkin. - -

-

-http://ifarchive.org/if-archive/games/zcode/Tangle.z5 - -

-


-This document was generated on 24 October 1999 using the -texi2html -translator version 1.54.

- - diff --git a/interpreters/nitfol/nitfol.info b/interpreters/nitfol/nitfol.info index 00e9a49..fba02cc 100644 --- a/interpreters/nitfol/nitfol.info +++ b/interpreters/nitfol/nitfol.info @@ -1,5 +1,5 @@ -This is Info file nitfol.info, produced by Makeinfo version 1.68 from -the input file nitfol.texi. +This is ../../../interpreters/nitfol/nitfol.info, produced by makeinfo +version 4.13 from ../../../interpreters/nitfol/nitfol.texi. INFO-DIR-SECTION Games START-INFO-DIR-ENTRY @@ -12,11 +12,11 @@ File: nitfol.info, Node: Top, Next: Invoking nitfol, Prev: (dir), Up: (dir) Introduction ************ - Nitfol is a portable interpreter for Z-machine code, the game format -used by Infocom and more recently, -Inform (http://www.gnelson.demon.co.uk/inform.html). Nitfol handles -versions one through eight of the format, and attempts to comply with -version 1.0 of the Z-machine specification. +Nitfol is a portable interpreter for Z-machine code, the game format +used by Infocom and more recently, Inform +(http://www.gnelson.demon.co.uk/inform.html). Nitfol handles versions +one through eight of the format, and attempts to comply with version +1.0 of the Z-machine specification. You will need game files to use nitfol. The "if-archive" contains a large collection of these, available at @@ -42,10 +42,10 @@ and should be sent to .  File: nitfol.info, Node: Invoking nitfol, Next: Features, Prev: Top, Up: Top -Invoking nitfol -*************** +1 Invoking nitfol +***************** - Invoke nitfol with the game filename, and options. If you omit the +Invoke nitfol with the game filename, and options. If you omit the game filename, nitfol will prompt you for one. The following options are recognized: @@ -216,11 +216,12 @@ are recognized: printed by banners and the `version' command. Version 6 games interpret this as a number instead of a letter. +  File: nitfol.info, Node: Features, Next: Debugger, Prev: Invoking nitfol, Up: Top -Features -******** +2 Features +********** * Menu: @@ -236,11 +237,11 @@ Features  File: nitfol.info, Node: Preferences, Next: Infinite undo/redo, Prev: Features, Up: Features -Preferences -=========== +2.1 Preferences +=============== - If you don't like the default options and don't want to recompile, -you can set your preferences by writing a `.nitfolrc' in your home +If you don't like the default options and don't want to recompile, you +can set your preferences by writing a `.nitfolrc' in your home directory. Each line should be of the form `OPTION=VALUE'. Blank lines and @@ -254,7 +255,7 @@ specific name. alias=v verbose alias=asierra tone cordial. ask sierra about ignore=true - + [strictnitfol] ignore=false spell=false @@ -262,7 +263,7 @@ specific name. autoundo=false unalias=v unalias=asierra - + [xnitfol] tandy=true pirate=true @@ -280,15 +281,14 @@ environment variables and command line options.  File: nitfol.info, Node: Infinite undo/redo, Next: Aliases, Prev: Preferences, Up: Features -Infinite undo/redo -================== +2.2 Infinite undo/redo +====================== - Multiple `@restore_undo' opcodes with no intervening `@save_undo' -will restore earlier and earlier saved states. However, Inform games -will not do this, so if you want infinite undo, you must enter the -commands `/undo' and `/redo'. The `/...' commands are part of the -debugger, so you will need to compile in debugger support to use this -feature. +Multiple `@restore_undo' opcodes with no intervening `@save_undo' will +restore earlier and earlier saved states. However, Inform games will +not do this, so if you want infinite undo, you must enter the commands +`/undo' and `/redo'. The `/...' commands are part of the debugger, so +you will need to compile in debugger support to use this feature. Z-machine games prior to version 5 do not provide undo (none of them provide redo), and some version 5 games don't use it (like @@ -299,10 +299,10 @@ intervening `@save_undo' or `@restore_undo', nitfol will perform a  File: nitfol.info, Node: Aliases, Next: Abbreviation Expansion, Prev: Infinite undo/redo, Up: Features -Aliases -======= +2.3 Aliases +=========== - If the game has long words which you wish to abbreviate, you can use +If the game has long words which you wish to abbreviate, you can use aliases. Use the command `/alias NAME VALUE'. All instances of NAME in line input will be replaced with VALUE. NAME may not contain whitespace. @@ -368,37 +368,37 @@ possible to `/unalias'.  File: nitfol.info, Node: Abbreviation Expansion, Next: Typo correction, Prev: Aliases, Up: Features -Abbreviation Expansion -====================== +2.4 Abbreviation Expansion +========================== - Early Infocom games don't provide abbreviations like `x' for -`examine'. If you enable abbreviation expansion, nitfol will attempt -to expand one letter words at the beginning of inputs which are not in -the game's dictionary. +Early Infocom games don't provide abbreviations like `x' for `examine'. +If you enable abbreviation expansion, nitfol will attempt to expand one +letter words at the beginning of inputs which are not in the game's +dictionary. Nitfol supports the following expansions (note that some are non-standard): -c close d down e east g again -i inventory k attack l look n north -o oops p open q quit r drop -s south t take u up w west -x examine y yes z wait +c close d down e east g again +i inventory k attack l look n north +o oops p open q quit r drop +s south t take u up w west +x examine y yes z wait From `Zork I': *West of House* You are standing in an open field west of a white house, with a boarded front door. There is a small mailbox here. - + >x mailbox [x -> examine] The small mailbox is closed. - + >p it [p -> open] Opening the small mailbox reveals a leaflet. - + >t leaflet [t -> take] Taken. @@ -406,10 +406,10 @@ x examine y yes z wait  File: nitfol.info, Node: Typo correction, Next: Automapping, Prev: Abbreviation Expansion, Up: Features -Typo correction -=============== +2.5 Typo correction +=================== - In the Z-machine, the `@read' opcode provides the interpreter with a +In the Z-machine, the `@read' opcode provides the interpreter with a dictionary to search in order to do tokenisation and word matching. If you enable typo correction and enter a word not in the provided dictionary, nitfol will search for near misses. @@ -455,10 +455,10 @@ a dictionary word, which the game might complain about.  File: nitfol.info, Node: Automapping, Next: Quetzal, Prev: Typo correction, Up: Features -Automapping -=========== +2.6 Automapping +=============== - Nitfol has the ability to display an on-screen map showing visited +Nitfol has the ability to display an on-screen map showing visited rooms and their connections on the current floor. Below is a map generated from `Enchanter'. *-* * @@ -521,12 +521,12 @@ out which global keeps track of the location. You can use the /globals 91 G15 G36 G39 s - + *Mouth of Alley* You're in the entrance of a narrow brick alley, which runs further in to the north. To the south a broad street courses by, congested with traffic and bicycles, although none of them seem to notice you. - + >/find self 20 "(self object)" 25 "yourself" in 94 "Mouth of Alley" @@ -585,10 +585,10 @@ each neighboring room, but this would make automapping even slower.  File: nitfol.info, Node: Quetzal, Next: Blorb, Prev: Automapping, Up: Features -Quetzal -======= +2.7 Quetzal +=========== - Nitfol uses Quetzal version 1.4 for its save format, so you can use +Nitfol uses Quetzal version 1.4 for its save format, so you can use your saves between different computers and interpreters. More information about Quetzal is available at `http://www.geocities.com/SiliconValley/Vista/6631/'. @@ -623,12 +623,12 @@ right before the restored PC.  File: nitfol.info, Node: Blorb, Prev: Quetzal, Up: Features -Blorb -===== +2.8 Blorb +========= - If you wish to hear sounds or see graphics in your games, they must -be packaged in Blorb files. The Z-machine game may included in the -Blorb file or may be specified separately. Nitfol does not support the +If you wish to hear sounds or see graphics in your games, they must be +packaged in Blorb files. The Z-machine game may included in the Blorb +file or may be specified separately. Nitfol does not support the traditional Infocom `.mg1' and `.snd' files. Note that graphics are displayed incorrectly, and sound has not yet @@ -637,10 +637,10 @@ been tested.  File: nitfol.info, Node: Debugger, Next: Bugs, Prev: Features, Up: Top -Debugger -******** +3 Debugger +********** - Nitfol debugging mode tries to imitate the GDB interface. If you're +Nitfol debugging mode tries to imitate the GDB interface. If you're familiar with that, you should have no problem using nitfol (other than dealing with the current incompleteness). @@ -695,208 +695,209 @@ is neither necessary nor recommended. (gdb)Top::, for more information. Some of these were taken/adapted from GDB's help. -`info breakpoints' -`info breakpoints NUM' - List breakpoints. An argument specifies a specific breakpoint to - list. - -`quit' - Exit nitfol. - -`show language' - Show the current source language. +`up-silently' +`up-silently NUM' + Select the parent of the selected frame silently. An argument + specifies how many frames up to go. -`condition NUM EXP' - Set a condition for an existing breakpoint. +`set EXP' + Evaluate an expression without printing its value. -`restore' - Restore a saved game. +`backtrace' +`backtrace NUM' +`backtrace - NUM' + Display the parent functions of the current frame. An argument + specifies how many frames back to show. If the argument is + negative, start from the first frame instead of the current. `break LINESPEC' `break LINESPEC if EXP' Set a breakpoint. An `if' clause specifies a condition. -`stepi' -`stepi NUM' - Step exactly one instruction. An argument specifies a repeat - count. - -`restart' - Restart the game. - -`object-tree' -`object-tree EXP' - Display the object tree. An argument says which object to use as - the root of the tree. - -`disable display NUM' - Temporarily disable an automatic display. - -`select-frame NUM' - Select a specific stack frame. +`recording off' + Stop recording a script. -`alias NAME VALUE' - Add an alias +`recording on' + Start recording a script. `down-silently' `down-silently NUM' Silently select the child of the selected frame. An argument specifies how many frames down to go. -`frame' -`frame NUM' - Show the selected stack frame. An argument specifies a stack - frame to show. +`show copying' + Show licensing information. -`give EXP NUM' -`give EXP ~ NUM' - Give an object an attribute. With a tilde clears the attribute - instead of setting it. +`condition NUM EXP' + Set a condition for an existing breakpoint. -`set EXP' - Evaluate an expression without printing its value. +`step' +`step NUM' + Step through program to a different source line. An argument + specifies a repeat count. -`print EXP' - Evaluates an expression and prints the result. This can include - function calls. +`remove EXP' + Remove an object from the object tree. -`up' -`up NUM' - Select the parent of the selected frame. An argument specifies - how many frames up to go. +`replay' + Replay a recorded script. -`# comment' - Enter a comment +`down' +`down NUM' + Select the child of the selected frame. An argument specifies how + many frames down to go. -`continue' -`continue NUM' - Continue execution. An argument sets the ignore count of the - current breakpoint. +`globals' +`globals EXP' + List all global variables and their values. With an argument, + list all only those with a specific value. -`dumpmem FILE' - Dump memory to a file +`enable display NUM' + Re-enable an automatic display. -`undo' - Undo last move (not last debugger command). +`nexti' +`nexti NUM' + Step one instruction, stepping over subroutine calls. Step a + specified number of instructions, stepping over subroutine calls. -`display EXP' - Print value of an expression each time the program stops. +`until' + Resume execution until the program reaches a line number greater + than the current line. -`move EXP to EXP' - Move an object around the object tree. +`object-tree' +`object-tree EXP' + Display the object tree. An argument says which object to use as + the root of the tree. -`up-silently' -`up-silently NUM' - Select the parent of the selected frame silently. An argument - specifies how many frames up to go. +`stepi' +`stepi NUM' + Step exactly one instruction. An argument specifies a repeat + count. -`show copying' - Show licensing information. +`show warranty' + Show warranty information. -`recording off' - Stop recording a script. +`restart' + Restart the game. -`jump LINESPEC' - Continue execution at a new location. +`undo' + Undo last move (not last debugger command). -`recording on' - Start recording a script. +`frame' +`frame NUM' + Show the selected stack frame. An argument specifies a stack + frame to show. -`ralias NAME VALUE' - Add a recursive alias +`select-frame NUM' + Select a specific stack frame. -`globals' -`globals EXP' - List all global variables and their values. With an argument, - list all only those with a specific value. +`continue' +`continue NUM' + Continue execution. An argument sets the ignore count of the + current breakpoint. -`backtrace' -`backtrace NUM' -`backtrace - NUM' - Display the parent functions of the current frame. An argument - specifies how many frames back to show. If the argument is - negative, start from the first frame instead of the current. +`finish' + An argument specifies a repeat count. + +`give EXP NUM' +`give EXP ~ NUM' + Give an object an attribute. With a tilde clears the attribute + instead of setting it. `find' Find objects whose shortnames contain a string. -`finish' - An argument specifies a repeat count. +`jump LINESPEC' + Continue execution at a new location. -`down' -`down NUM' - Select the child of the selected frame. An argument specifies how - many frames down to go. +`show language' + Show the current source language. -`ignore NUM NUM' - Set the ignore count for a breakpoint. +`dumpmem FILE' + Dump memory to a file -`replay off' - Halt replay. +`undisplay NUM' + Stop automatically displaying an expression. -`nexti' -`nexti NUM' - Step one instruction, stepping over subroutine calls. Step a - specified number of instructions, stepping over subroutine calls. +`disable NUM' + Temporarily disable a breakpoint. -`help' - Print list of commands. +`restore' + Restore a saved game. `redo' Redo undid move. Only works immediately after an `undo'. -`enable NUM' - Re-enabled a breakpoint. +`info sources' + List source files. -`until' - Resume execution until the program reaches a line number greater - than the current line. +`symbol-file FILE' + Load debugging info from a file (usually `gameinfo.dbg'). -`replay' - Replay a recorded script. +`display EXP' + Print value of an expression each time the program stops. + +`next' +`next NUM' + Step through program, stepping over subroutine calls. An argument + specifies a repeat count. + +`info breakpoints' +`info breakpoints NUM' + List breakpoints. An argument specifies a specific breakpoint to + list. `unalias NAME' Remove an alias -`remove EXP' - Remove an object from the object tree. +`help' + Print list of commands. -`info sources' - List source files. +`move EXP to EXP' + Move an object around the object tree. `delete NUM' Delete a breakpoint. -`symbol-file FILE' - Load debugging info from a file (usually `gameinfo.dbg'). +`quit' + Exit nitfol. + +`up' +`up NUM' + Select the parent of the selected frame. An argument specifies + how many frames up to go. + +`alias NAME VALUE' + Add an alias + +`enable NUM' + Re-enabled a breakpoint. `automap EXP' Start automapping -`show warranty' - Show warranty information. +`info source' + Get information on the current source file. -`disable NUM' - Temporarily disable a breakpoint. +`replay off' + Halt replay. -`undisplay NUM' - Stop automatically displaying an expression. +`# comment' + Enter a comment -`enable display NUM' - Re-enable an automatic display. +`ralias NAME VALUE' + Add a recursive alias -`step' -`step NUM' - Step through program to a different source line. An argument - specifies a repeat count. +`ignore NUM NUM' + Set the ignore count for a breakpoint. -`info source' - Get information on the current source file. +`print EXP' + Evaluates an expression and prints the result. This can include + function calls. + +`disable display NUM' + Temporarily disable an automatic display. -`next' -`next NUM' - Step through program, stepping over subroutine calls. An argument - specifies a repeat count. If you're on a UNIX and you don't like the GDB interface, you can compile cheapnitfol and run it as the inferior debugger under Emacs or @@ -908,10 +909,10 @@ trying that, but I haven't tested that much.  File: nitfol.info, Node: Bugs, Next: Thanks, Prev: Debugger, Up: Top -Bugs -**** +4 Bugs +****** - A nitfol bug is any behaviour which makes nitfol reliably misbehave, +A nitfol bug is any behaviour which makes nitfol reliably misbehave, with the exceptions of bugs in Glk libraries. These include: anything which makes nitfol crash (other than when nitfol reports `FATAL' errors), anything which causes nitfol to contradict the Z-machine @@ -1004,10 +1005,10 @@ reliably cause the bug.  File: nitfol.info, Node: Thanks, Next: Games Cited, Prev: Bugs, Up: Top -Thanks -****** +5 Thanks +******** - The following people have given comments, suggestions, bug reports, +The following people have given comments, suggestions, bug reports, answered questions, or helped port nitfol (in alphabetical order): - John Cater @@ -1030,8 +1031,8 @@ answered questions, or helped port nitfol (in alphabetical order):  File: nitfol.info, Node: Games Cited, Prev: Thanks, Up: Top -Games Cited -*********** +6 Games Cited +************* `Wishbringer' Copyright (C) 1985, 1988 Infocom Inc. @@ -1056,20 +1057,20 @@ Games Cited  Tag Table: -Node: Top230 -Node: Invoking nitfol1572 -Node: Features8446 -Node: Preferences9091 -Node: Infinite undo/redo10452 -Node: Aliases11221 -Node: Abbreviation Expansion13740 -Node: Typo correction14870 -Node: Automapping16779 -Node: Quetzal22563 -Node: Blorb24279 -Node: Debugger24700 -Node: Bugs31673 -Node: Thanks34727 -Node: Games Cited35142 +Node: Top263 +Node: Invoking nitfol1602 +Node: Features8478 +Node: Preferences9127 +Node: Infinite undo/redo10483 +Node: Aliases11257 +Node: Abbreviation Expansion13781 +Node: Typo correction14898 +Node: Automapping16812 +Node: Quetzal22591 +Node: Blorb24312 +Node: Debugger24738 +Node: Bugs31713 +Node: Thanks34768 +Node: Games Cited35184  End Tag Table diff --git a/interpreters/nitfol/opt2glkc.pl b/interpreters/nitfol/opt2glkc.pl index 6f60a64..96a9b41 100644 --- a/interpreters/nitfol/opt2glkc.pl +++ b/interpreters/nitfol/opt2glkc.pl @@ -236,7 +236,7 @@ sub make_glk_unix #include #include #include \"$header\" -#include \"glkstart.h\" +#include static char *game_filename = NULL; diff --git a/interpreters/nitfol/options.texi b/interpreters/nitfol/options.texi deleted file mode 100644 index fd8e146..0000000 --- a/interpreters/nitfol/options.texi +++ /dev/null @@ -1,93 +0,0 @@ -@item -ignore -@itemx -no-ignore -@itemx -i -Ignore Z-machine strictness errors. Normally nitfol checks for illegal and undefined Z-machine behaviour and alerts the user. If you're playing someone else's buggy game, this can be annoying and you should use this option. - -@item -fullname -@itemx -no-fullname -@itemx -f -For running under Emacs or DDD. Tells nitfol to give machine-recognizeable markers when stack frames are displayed instead of displaying the line. Only useful if you are using nitfol as an inferior debugger. - -@item -command @var{file} -@itemx -x @var{file} -Read commands from this file. Load a script from a file for playback in the game. - -@item -pirate -@itemx -no-pirate -@itemx -P -Aye, matey. Make the piracy opcode not branch, letting the game know the game disc is not ``genuine.'' Infocom never used this opcode and neither should you, but if obscurity amuses you... - -@item -quiet -@itemx -no-quiet -@itemx -q -Do not print introductory messages. For GDB compatibility. - -@item -spell -@itemx -no-spell -Perform spelling correction. Normally Z-machine games are unforgiving of typos (though they do have an @code{oops} command). If you type in a word which isn't in the game's dictionary and have typo correction enabled, nitfol will search for a word which is off by one letter by a substitution, deletion, insertion or transposition. - -@item -expand -@itemx -no-expand -Expand one letter abbreviations. Early Z-machine games don't include @kbd{x} as a synonym for @kbd{examine} and such. If the first word in a sentence is one letter long and not recognized by the game, this will attempt to expand it to a full word. - -@item -symbols @var{file} -@itemx -s @var{file} -Specify symbol file for game. If you want to perform source-level debugging, you will need to specify a symbol file, which contains the names of variables and tells nitfol how source code corresponds to object code. - -@item -tandy -@itemx -no-tandy -@itemx -t -Censors some Infocom games. Some version 3 games perform minor wording changes when this bit is set to appease the sensitivity of Tandy Corporation. - -@item -transcript @var{wfile} -@itemx -T @var{wfile} -Write transcript to this file. This transcript begins as soon as the game starts. - -@item -debug -@itemx -no-debug -@itemx -d -Enter debugger immediatly. Imitate GDB by not automatically starting the story. - -@item -prompt @var{string} -Specify debugging prompt. This is the prompt nitfol prints when it is waiting for a debugging command (as opposed to the > the game story prints when waiting for a game command). DDD requires this to be @samp{(gdb) }. - -@item -path @var{string} -Look for games in this directory. If nitfol cannot find the requested game in the current directory, it looks through the directories listed in the given colon separated string. The directories specified here are also used to search for gamefiles from saved games. If this option is not used, nitfol looks at the @code{INFOCOM_PATH} environment variable. - -@item -autoundo -@itemx -no-autoundo -Ensure @code{@@save_undo} is called every turn. If a turn passes with no @code{@@save_undo} between, this option performs the @code{@@save_undo} automagically. Could cause problems with some games which have a different concept of a turn. - -@item -stacklimit @var{number} -@itemx -S @var{number} -Exit when the stack is this deep. If a game is infinitely recursing, nitfol will allocate large amounts of memory and take a long time before the problem is reported. This option makes it fatal to recurse more than the given number of stack frames. Setting this to 0 makes nitfol allow as many as fit contiguously in memory. The Z-machine Standards Document recommends games use no more than 1024 words of total stack (frames and pushed data) in ZIP, which roughly works out to 90 routine calls deep. - -@item -alias @var{string} -@itemx -a @var{string} -Specify an alias. Adds an alias which will be expanded in read lines before tokenisation. The alias is of the form @var{name} @var{value}; you will need to use quotes around it on the commandline. - -@item -ralias @var{string} -Specify an recursive alias. Adds an alias whose result is checked for further alias expansion. Identical syntax to adding a normal alias. - -@item -unalias @var{string} -Remove an alias. Removes an alias previously added by -alias. Useful for removing aliases in preference files. - -@item -random @var{number} -@itemx -r @var{number} -Set random seed. Normally the random number generator is initialized with the time of day. If this option is used with a non-zero argument, the given number will be used to initialize the generator and for @code{@@random 0}. - -@item -mapsym @var{string} -Specify mapping glyphs. Nitfol draws maps using ASCII characters; you can choose which characters it uses to draw rooms. Defaults to @samp{*udb@@UDB+}, which is, in order: empty room, room with down exit, room with up exit, room with up and down exits, room with player, room with player and up exit, room with player and down exit, room with player and up and down exits, bend symbol. - -@item -mapsize @var{number} -Specify map size. Determines the number of lines to be used for the map. - -@item -maploc @var{string} -Specify map location. Nitfol creates a Glk window for the map it generates. The map can be placed @samp{above}, @samp{below}, to the @samp{right}, or the @samp{left}, of the main game window. Follow this option with one those locations. - -@item -terpnum @var{number} -Specify interpreter number. Each port of Infocom's Z-machine interpreter was given a number. @samp{1} for their own DECSystem-20, @samp{2} for Apple IIe, @samp{3} for Macintosh, @samp{4} for Amiga, @samp{5} for Atari ST, @samp{6} for IBM PC, @samp{7} for Commodore 128, @samp{8} for Commodore 64, @samp{9} for Apple IIc, @samp{10} for Apple IIgs, @samp{11} for Tandy Color. Giving this option makes nitfol claim to be running on the specified system. A few games change their behaviour slightly depending on which machine type they run. By default nitfol claims to be on an Apple IIe, as this makes Beyond Zork not do character graphics. - -@item -terpver @var{string} -Specify interpreter version. Infocom's interpreters were given versions, typically a capital letter. Nitfol defaults to @samp{N}, Frotz uses @samp{F}, and ZIP uses @samp{B}. Any single character version is allowed. Multicharacter options are read as a number instead of an ASCII character. Only known effect upon games is the letter printed by banners and the @samp{version} command. Version 6 games interpret this as a number instead of a letter. - diff --git a/interpreters/nitfol/startunix.c b/interpreters/nitfol/startunix.c deleted file mode 100644 index b9e56d1..0000000 --- a/interpreters/nitfol/startunix.c +++ /dev/null @@ -1,614 +0,0 @@ -#line 228 "opt2glkc.pl" -#include "nitfol.h" -#include -#ifdef DEBUGGING -#include -#endif -#include -#include -#include -#include -#include -#include -#include - -static char *game_filename = NULL; - -static void set_game_filename(const char *name) -{ - n_free(game_filename); - game_filename = 0; - -#if defined(_GNU_SOURCE) - game_filename = canonicalize_file_name(name); -#else -#if defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE) - game_filename = (char *) n_malloc(PATH_MAX); - if(!realpath(name, game_filename)) { - n_free(game_filename); - game_filename = 0; - } -#else -#ifdef __DJGPP__ - game_filename = (char *) n_malloc(FILENAME_MAX); - _fixpath(name, game_filename); -#endif -#endif -#endif - - if(!game_filename) - game_filename = n_strdup(name); -} - - -strid_t startup_findfile(void) -{ - static DIR *dir = NULL; - static char *pathstart = NULL; - static char *path = NULL; - strid_t stream; - struct dirent *d; - char *name = NULL; - - if(!pathstart) { - char *p = search_path; - if(!p) - return 0; - pathstart = n_strdup(p); - if(!(path = n_strtok(pathstart, ":"))) { - n_free(pathstart); - pathstart = 0; - return 0; - } - } - - do { - if(!dir) { - dir = opendir(path); - if(!dir) { - n_free(pathstart); - pathstart = 0; - return 0; - } - } - d = readdir(dir); - if(!d) { - closedir(dir); - dir = NULL; - if(!(path = n_strtok(NULL, ":"))) { - n_free(pathstart); - pathstart = 0; - return 0; - } - } - } while(!dir); - - name = (char *) n_malloc(n_strlen(path) + n_strlen(d->d_name) + 2); - n_strcpy(name, path); - n_strcat(name, "/"); - n_strcat(name, d->d_name); - stream = glkunix_stream_open_pathname(name, fileusage_Data | - fileusage_BinaryMode, 0); - if(stream) - set_game_filename(name); - n_free(name); - return stream; -} - - -strid_t intd_filehandle_open(strid_t savefile, glui32 operating_id, - glui32 contents_id, glui32 interp_id, - glui32 length) -{ - char *name; - strid_t str; - if(operating_id != 0x554e4958 /* 'UNIX' */) - return 0; - if(contents_id != 0) - return 0; - if(interp_id != 0x20202020 /* ' ' */) - return 0; - - name = (char *) n_malloc(length+1); - glk_get_buffer_stream(savefile, name, length); - name[length] = 0; - str = glkunix_stream_open_pathname(name, fileusage_Data | - fileusage_BinaryMode, 0); - if(str) - set_game_filename(name); - n_free(name); - return str; -} - -void intd_filehandle_make(strid_t savefile) -{ - if(!game_filename) - return; - w_glk_put_string_stream(savefile, "UNIX"); - glk_put_char_stream(savefile, b00000010); /* Flags */ - glk_put_char_stream(savefile, 0); /* Contents ID */ - glk_put_char_stream(savefile, 0); /* Reserved */ - glk_put_char_stream(savefile, 0); /* Reserved */ - w_glk_put_string_stream(savefile, " "); /* Interpreter ID */ - w_glk_put_string_stream(savefile, game_filename); -} - -glui32 intd_get_size(void) -{ - if(!game_filename) - return 0; - return n_strlen(game_filename) + 12; -} - -strid_t startup_open(const char *name) -{ - strid_t str; - char *s; - - str = glkunix_stream_open_pathname((char *) name, fileusage_Data | fileusage_BinaryMode, 0); - if(str) { - set_game_filename(name); - s = strrchr(name, '\\'); - if (!s) s = strrchr(name, '/'); - /* garglk_set_story_name(s ? s + 1 : name); */ - } else { - char *path = search_path; - if(path) { - char *p; - char *newname = (char *) n_malloc(strlen(path) + strlen(name) + 2); - path = n_strdup(path); - for(p = n_strtok(path, ":"); p; p = n_strtok(NULL, ":")) { - n_strcpy(newname, p); - n_strcat(newname, "/"); - n_strcat(newname, name); - str = glkunix_stream_open_pathname((char *) newname, fileusage_Data | - fileusage_BinaryMode, 0); - if(str) { - set_game_filename(newname); - s = strrchr(newname, '\\'); - if (!s) s = strrchr(newname, '/'); - /* garglk_set_story_name(s ? s + 1 : newname); */ - break; - } - } - n_free(path); - } - } - - if(!str) - fprintf(stderr, "Cannot open '%s'\n", name); - - return str; -} - -#line 717 "opt2glkc.pl" -static strid_t startup_wopen(const char *name) -{ - return n_file_name(fileusage_Data | fileusage_BinaryMode, - filemode_Write, name); -} -glkunix_argumentlist_t glkunix_arguments[] = { - { (char *) "", glkunix_arg_ValueCanFollow, (char *) "filename file to load" }, - { (char *) "-help", glkunix_arg_NoValue, (char *) "list command-line options" }, - { (char *) "--help", glkunix_arg_NoValue, (char *) "list command-line options" }, - { (char *) "-version", glkunix_arg_NoValue, (char *) "get version number" }, - { (char *) "--version", glkunix_arg_NoValue, (char *) "get version number" }, - { (char *) "-i", glkunix_arg_NoValue, (char *) "-i" }, - { (char *) "-no-ignore", glkunix_arg_NoValue, (char *) "-no-ignore" }, - { (char *) "--no-ignore", glkunix_arg_NoValue, (char *) "--no-ignore" }, - { (char *) "-ignore", glkunix_arg_NoValue, (char *) "-ignore" }, - { (char *) "--ignore", glkunix_arg_NoValue, (char *) "--ignore Ignore Z-machine strictness errors" }, - { (char *) "-f", glkunix_arg_NoValue, (char *) "-f" }, - { (char *) "-no-fullname", glkunix_arg_NoValue, (char *) "-no-fullname" }, - { (char *) "--no-fullname", glkunix_arg_NoValue, (char *) "--no-fullname" }, - { (char *) "-fullname", glkunix_arg_NoValue, (char *) "-fullname" }, - { (char *) "--fullname", glkunix_arg_NoValue, (char *) "--fullname For running under Emacs or DDD" }, - { (char *) "-x", glkunix_arg_ValueFollows, (char *) "-x" }, - { (char *) "-command", glkunix_arg_ValueFollows, (char *) "-command" }, - { (char *) "--command", glkunix_arg_ValueFollows, (char *) "--command Read commands from this file" }, - { (char *) "-P", glkunix_arg_NoValue, (char *) "-P" }, - { (char *) "-no-pirate", glkunix_arg_NoValue, (char *) "-no-pirate" }, - { (char *) "--no-pirate", glkunix_arg_NoValue, (char *) "--no-pirate" }, - { (char *) "-pirate", glkunix_arg_NoValue, (char *) "-pirate" }, - { (char *) "--pirate", glkunix_arg_NoValue, (char *) "--pirate Aye, matey" }, - { (char *) "-q", glkunix_arg_NoValue, (char *) "-q" }, - { (char *) "-no-quiet", glkunix_arg_NoValue, (char *) "-no-quiet" }, - { (char *) "--no-quiet", glkunix_arg_NoValue, (char *) "--no-quiet" }, - { (char *) "-quiet", glkunix_arg_NoValue, (char *) "-quiet" }, - { (char *) "--quiet", glkunix_arg_NoValue, (char *) "--quiet Do not print introductory messages" }, - { (char *) "-no-spell", glkunix_arg_NoValue, (char *) "-no-spell" }, - { (char *) "--no-spell", glkunix_arg_NoValue, (char *) "--no-spell" }, - { (char *) "-spell", glkunix_arg_NoValue, (char *) "-spell" }, - { (char *) "--spell", glkunix_arg_NoValue, (char *) "--spell Perform spelling correction" }, - { (char *) "-no-expand", glkunix_arg_NoValue, (char *) "-no-expand" }, - { (char *) "--no-expand", glkunix_arg_NoValue, (char *) "--no-expand" }, - { (char *) "-expand", glkunix_arg_NoValue, (char *) "-expand" }, - { (char *) "--expand", glkunix_arg_NoValue, (char *) "--expand Expand one letter abbreviations" }, - { (char *) "-s", glkunix_arg_ValueFollows, (char *) "-s" }, - { (char *) "-symbols", glkunix_arg_ValueFollows, (char *) "-symbols" }, - { (char *) "--symbols", glkunix_arg_ValueFollows, (char *) "--symbols Specify symbol file for game" }, - { (char *) "-t", glkunix_arg_NoValue, (char *) "-t" }, - { (char *) "-no-tandy", glkunix_arg_NoValue, (char *) "-no-tandy" }, - { (char *) "--no-tandy", glkunix_arg_NoValue, (char *) "--no-tandy" }, - { (char *) "-tandy", glkunix_arg_NoValue, (char *) "-tandy" }, - { (char *) "--tandy", glkunix_arg_NoValue, (char *) "--tandy Censors some Infocom games" }, - { (char *) "-T", glkunix_arg_ValueFollows, (char *) "-T" }, - { (char *) "-transcript", glkunix_arg_ValueFollows, (char *) "-transcript" }, - { (char *) "--transcript", glkunix_arg_ValueFollows, (char *) "--transcript Write transcript to this file" }, - { (char *) "-d", glkunix_arg_NoValue, (char *) "-d" }, - { (char *) "-no-debug", glkunix_arg_NoValue, (char *) "-no-debug" }, - { (char *) "--no-debug", glkunix_arg_NoValue, (char *) "--no-debug" }, - { (char *) "-debug", glkunix_arg_NoValue, (char *) "-debug" }, - { (char *) "--debug", glkunix_arg_NoValue, (char *) "--debug Enter debugger immediatly" }, - { (char *) "-prompt", glkunix_arg_ValueFollows, (char *) "-prompt" }, - { (char *) "--prompt", glkunix_arg_ValueFollows, (char *) "--prompt Specify debugging prompt" }, - { (char *) "-path", glkunix_arg_ValueFollows, (char *) "-path" }, - { (char *) "--path", glkunix_arg_ValueFollows, (char *) "--path Look for games in this directory" }, - { (char *) "-no-autoundo", glkunix_arg_NoValue, (char *) "-no-autoundo" }, - { (char *) "--no-autoundo", glkunix_arg_NoValue, (char *) "--no-autoundo" }, - { (char *) "-autoundo", glkunix_arg_NoValue, (char *) "-autoundo" }, - { (char *) "--autoundo", glkunix_arg_NoValue, (char *) "--autoundo Ensure @code{@@save_undo} is called every turn" }, - { (char *) "-S", glkunix_arg_NumberValue, (char *) "-S" }, - { (char *) "-stacklimit", glkunix_arg_NumberValue, (char *) "-stacklimit" }, - { (char *) "--stacklimit", glkunix_arg_NumberValue, (char *) "--stacklimit Exit when the stack is this deep" }, - { (char *) "-a", glkunix_arg_ValueFollows, (char *) "-a" }, - { (char *) "-alias", glkunix_arg_ValueFollows, (char *) "-alias" }, - { (char *) "--alias", glkunix_arg_ValueFollows, (char *) "--alias Specify an alias" }, - { (char *) "-ralias", glkunix_arg_ValueFollows, (char *) "-ralias" }, - { (char *) "--ralias", glkunix_arg_ValueFollows, (char *) "--ralias Specify an recursive alias" }, - { (char *) "-unalias", glkunix_arg_ValueFollows, (char *) "-unalias" }, - { (char *) "--unalias", glkunix_arg_ValueFollows, (char *) "--unalias Remove an alias" }, - { (char *) "-r", glkunix_arg_NumberValue, (char *) "-r" }, - { (char *) "-random", glkunix_arg_NumberValue, (char *) "-random" }, - { (char *) "--random", glkunix_arg_NumberValue, (char *) "--random Set random seed" }, - { (char *) "-mapsym", glkunix_arg_ValueFollows, (char *) "-mapsym" }, - { (char *) "--mapsym", glkunix_arg_ValueFollows, (char *) "--mapsym Specify mapping glyphs" }, - { (char *) "-mapsize", glkunix_arg_NumberValue, (char *) "-mapsize" }, - { (char *) "--mapsize", glkunix_arg_NumberValue, (char *) "--mapsize Specify map size" }, - { (char *) "-maploc", glkunix_arg_ValueFollows, (char *) "-maploc" }, - { (char *) "--maploc", glkunix_arg_ValueFollows, (char *) "--maploc Specify map location" }, - { (char *) "-terpnum", glkunix_arg_NumberValue, (char *) "-terpnum" }, - { (char *) "--terpnum", glkunix_arg_NumberValue, (char *) "--terpnum Specify interpreter number" }, - { (char *) "-terpver", glkunix_arg_ValueFollows, (char *) "-terpver" }, - { (char *) "--terpver", glkunix_arg_ValueFollows, (char *) "--terpver Specify interpreter version" }, - { NULL, glkunix_arg_End, NULL } -}; - -static void code_ignore(int flag) -#line 6 "nitfol.opt" -{ ignore_errors = flag; } - -static void code_fullname(int flag) -#line 9 "nitfol.opt" -{ fullname = flag; } - -static void code_command(strid_t stream) -#line 12 "nitfol.opt" -{ if(stream) input_stream1 = stream; } - -static void code_pirate(int flag) -#line 15 "nitfol.opt" -{ aye_matey = flag; } - -static void code_quiet(int flag) -#line 18 "nitfol.opt" -{ quiet = flag; } - -static void code_spell(int flag) -#line 21 "nitfol.opt" -{ do_spell_correct = flag; } - -static void code_expand(int flag) -#line 24 "nitfol.opt" -{ do_expand = flag; } - -static void code_symbols(strid_t stream) -#line 27 "nitfol.opt" -{ if(stream) init_infix(stream); } - -static void code_tandy(int flag) -#line 30 "nitfol.opt" -{ do_tandy = flag; } - -static void code_transcript(strid_t stream) -#line 33 "nitfol.opt" -{ if(stream) set_transcript(stream); } - -static void code_debug(int flag) -#line 36 "nitfol.opt" -{ enter_debugger = flag; do_check_watches = flag; } - -static void code_prompt(const char *string) -#line 39 "nitfol.opt" -{ n_free(db_prompt); db_prompt = n_strdup(string); } - -static void code_path(const char *string) -#line 42 "nitfol.opt" -{ n_free(search_path); search_path = n_strdup(string); } - -static void code_autoundo(int flag) -#line 45 "nitfol.opt" -{ auto_save_undo = flag; } - -static void code_stacklimit(int number) -#line 52 "nitfol.opt" -{ stacklimit = number; } - -static void code_alias(const char *string) -#line 55 "nitfol.opt" -{ if(string) parse_new_alias(string, FALSE); } - -static void code_ralias(const char *string) -#line 58 "nitfol.opt" -{ if(string) parse_new_alias(string, TRUE); } - -static void code_unalias(const char *string) -#line 61 "nitfol.opt" -{ if(string) remove_alias(string); } - -static void code_random(int number) -#line 64 "nitfol.opt" -{ faked_random_seed = number; } - -static void code_mapsym(const char *string) -#line 67 "nitfol.opt" -{ n_free(roomsymbol); roomsymbol = n_strdup(string); } - -static void code_mapsize(int number) -#line 70 "nitfol.opt" -{ automap_size = number; } - -static void code_maploc(const char *string) -#line 73 "nitfol.opt" -{ switch(glk_char_to_lower(*string)) { case 'a': case 't': case 'u': automap_split = winmethod_Above; break; case 'b': case 'd': automap_split = winmethod_Below; break; case 'l': automap_split = winmethod_Left; break; case 'r': automap_split = winmethod_Right; } } - -static void code_terpnum(int number) -#line 76 "nitfol.opt" -{ interp_num = number; } - -static void code_terpver(const char *string) -#line 79 "nitfol.opt" -{ if(string) { if(n_strlen(string) == 1) interp_ver = *string; else interp_ver = n_strtol(string, NULL, 10); } } - -#line 760 "opt2glkc.pl" -typedef enum { option_flag, option_file, option_wfile, option_number, option_string } option_type; -typedef struct { const char *longname; char shortname; const char *description; option_type type; void (*int_func)(int); int defint; void (*str_func)(strid_t); strid_t defstream; void (*string_func)(const char *); const char *defstring; } option_option; - -static option_option options[] = { - { "ignore", 'i', "Ignore Z-machine strictness errors", option_flag, code_ignore, 1, NULL, NULL, NULL, NULL }, - { "fullname", 'f', "For running under Emacs or DDD", option_flag, code_fullname, 0, NULL, NULL, NULL, NULL }, - { "command", 'x', "Read commands from this file", option_file, NULL, 0, code_command, NULL, NULL, NULL }, - { "pirate", 'P', "Aye, matey", option_flag, code_pirate, 0, NULL, NULL, NULL, NULL }, - { "quiet", 'q', "Do not print introductory messages", option_flag, code_quiet, 1, NULL, NULL, NULL, NULL }, - { "spell", '-', "Perform spelling correction", option_flag, code_spell, 1, NULL, NULL, NULL, NULL }, - { "expand", '-', "Expand one letter abbreviations", option_flag, code_expand, 1, NULL, NULL, NULL, NULL }, - { "symbols", 's', "Specify symbol file for game", option_file, NULL, 0, code_symbols, NULL, NULL, NULL }, - { "tandy", 't', "Censors some Infocom games", option_flag, code_tandy, 0, NULL, NULL, NULL, NULL }, - { "transcript", 'T', "Write transcript to this file", option_wfile, NULL, 0, code_transcript, NULL, NULL, NULL }, - { "debug", 'd', "Enter debugger immediatly", option_flag, code_debug, 0, NULL, NULL, NULL, NULL }, - { "prompt", '-', "Specify debugging prompt", option_string, NULL, 0, NULL, NULL, code_prompt, "(nitfol) " }, - { "path", '-', "Look for games in this directory", option_string, NULL, 0, NULL, NULL, code_path, NULL }, - { "autoundo", '-', "Ensure '@save_undo' is called every turn", option_flag, code_autoundo, 1, NULL, NULL, NULL, NULL }, - { "stacklimit", 'S', "Exit when the stack is this deep", option_number, code_stacklimit, 0, NULL, NULL, NULL, NULL }, - { "alias", 'a', "Specify an alias", option_string, NULL, 0, NULL, NULL, code_alias, NULL }, - { "ralias", '-', "Specify an recursive alias", option_string, NULL, 0, NULL, NULL, code_ralias, NULL }, - { "unalias", '-', "Remove an alias", option_string, NULL, 0, NULL, NULL, code_unalias, NULL }, - { "random", 'r', "Set random seed", option_number, code_random, 0, NULL, NULL, NULL, NULL }, - { "mapsym", '-', "Specify mapping glyphs", option_string, NULL, 0, NULL, NULL, code_mapsym, "*udb@UDB+" }, - { "mapsize", '-', "Specify map size", option_number, code_mapsize, 12, NULL, NULL, NULL, NULL }, - { "maploc", '-', "Specify map location", option_string, NULL, 0, NULL, NULL, code_maploc, "above" }, - { "terpnum", '-', "Specify interpreter number", option_number, code_terpnum, 2, NULL, NULL, NULL, NULL }, - { "terpver", '-', "Specify interpreter version", option_string, NULL, 0, NULL, NULL, code_terpver, "N" } -}; - -#line 811 "opt2glkc.pl" -static void set_defaults(void) -{ - unsigned n; - for(n = 0; n < sizeof(options) / sizeof(*options); n++) { - if(options[n].int_func) - options[n].int_func(options[n].defint); - if(options[n].str_func) - options[n].str_func(options[n].defstream); - if(options[n].string_func) - options[n].string_func(options[n].defstring); - } -} - -#line 829 "opt2glkc.pl" -static void read_textpref(strid_t pref, const char *progname) -{ - unsigned n; - char buffer[1024]; - int prognamelen = n_strlen(progname); - if(!pref) - return; - while(glk_get_line_stream(pref, buffer, sizeof(buffer))) { - char *optname; - char *optval; - long int optnum; - - if(buffer[0] == '#') - continue; - while(buffer[0] == '[') { - if(n_strncasecmp(buffer+1, progname, prognamelen) != 0 - || buffer[1+prognamelen] != ']') { - while(glk_get_line_stream(pref, buffer, sizeof(buffer))) - if(buffer[0] == '[') - break; - } else { - glk_get_line_stream(pref, buffer, sizeof(buffer)); - } - } - - optname = buffer; - while(isspace(*optname)) - optname++; - if((optval = n_strchr(optname, '=')) != NULL) { - char *p; - *optval = 0; - optval++; - - if((p = n_strchr(optname, ' ')) != NULL) - *p = 0; - - while(isspace(*optval)) - optval++; - - while(isspace(optval[strlen(optval)-1])) - optval[strlen(optval)-1] = 0; - - optnum = n_strtol(optval, NULL, 0); - if(n_strcasecmp(optval, "false") == 0 - || n_strcasecmp(optval, "f") == 0) - optnum = FALSE; - if(n_strcasecmp(optval, "true") == 0 - || n_strcasecmp(optval, "t") == 0) - optnum = TRUE; - - for(n = 0; n < sizeof(options) / sizeof(*options); n++) { - if(n_strcmp(options[n].longname, optname) == 0) { - switch(options[n].type) { - case option_flag: - case option_number: - options[n].int_func(optnum); - break; - case option_file: - options[n].str_func(startup_open(optval)); - break; - case option_wfile: - options[n].str_func(startup_wopen(optval)); - break; - case option_string: - options[n].string_func(optval); - break; - } - break; - } - } - } - } - glk_stream_close(pref, NULL); -} - -#line 910 "opt2glkc.pl" -static void show_help(void) -{ - unsigned n; - printf("Usage: nitfol [OPTIONS] gamefile\n"); - for(n = 0; n < sizeof(options) / sizeof(*options); n++) { - if(options[n].shortname != '-') - printf(" -%c, ", options[n].shortname); - else - printf(" "); - printf("-%-15s %s\n", options[n].longname, options[n].description); - } -} - -#line 928 "opt2glkc.pl" -static BOOL parse_commands(int argc, char **argv) -{ - int i; - unsigned n; - - for(i = 1; i < argc; i++) { - BOOL flag = TRUE; - - const char *p = argv[i]; - - if(p[0] == '-') { - BOOL found = FALSE; - - while(*p == '-') - p++; - if(n_strncmp(p, "no-", 3) == 0) { - flag = FALSE; - p+=3; - } - - if(n_strcasecmp(p, "help") == 0) { - show_help(); - exit(0); - } - if(n_strcasecmp(p, "version") == 0) { - printf("nitfol version %d.%d\n", NITFOL_MAJOR, NITFOL_MINOR); - exit(0); - } - - for(n = 0; n < sizeof(options) / sizeof(*options); n++) { - if((n_strlen(p) == 1 && *p == options[n].shortname) || - n_strcmp(options[n].longname, p) == 0) { - found = TRUE; - - switch(options[n].type) { - case option_flag: - options[n].int_func(flag); - break; - - case option_file: - i++; - options[n].str_func(startup_open(argv[i])); - break; - - case option_wfile: - i++; - options[n].str_func(startup_wopen(argv[i])); - break; - - case option_number: - i++; - options[n].int_func(n_strtol(argv[i], NULL, 0)); - break; - - case option_string: - i++; - options[n].string_func(argv[i]); - break; - } - } - } - - if(!found) - return FALSE; - - } else { - strid_t s = startup_open(argv[i]); - if(!s) - return FALSE; - if(!game_use_file(s)) - return FALSE; - } - } - - return TRUE; -} - -#line 415 "opt2glkc.pl" - -#ifdef DEBUGGING -static void sighandle(int unused); - -static void sighandle(int unused) -{ -/* signal(SIGINT, sighandle); */ /* SysV resets default behaviour - foil it */ - enter_debugger = TRUE; -} -#endif - -#ifdef __cplusplus -extern "C" { -#endif -int glkunix_startup_code(glkunix_startup_t *data) -{ - set_defaults(); - - /* garglk_set_program_name("Nitfol 0.5"); */ - /* garglk_set_program_info( - "Nitfol 0.5 by Evin Robertson\n" - "With countless patches by other people.\n"); */ - - return parse_commands(data->argc, data->argv); -} -#ifdef __cplusplus -} -#endif diff --git a/po/POTFILES.skip b/po/POTFILES.skip new file mode 100644 index 0000000..ce59acd --- /dev/null +++ b/po/POTFILES.skip @@ -0,0 +1,6 @@ +# List of source files that look like they contain translatable strings +# but don't. + +interpreters/nitfol/inform.c +tests/chimara.ui + -- 2.30.2