home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / games / volume16 / nethack31 / part84 < prev    next >
Internet Message Format  |  1993-02-06  |  59KB

  1. Path: uunet!news.tek.com!master!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v16i092:  nethack31 - display oriented dungeons & dragons (Ver. 3.1), Part84/108
  5. Message-ID: <4455@master.CNA.TEK.COM>
  6. Date: 5 Feb 93 19:21:45 GMT
  7. Sender: news@master.CNA.TEK.COM
  8. Lines: 1761
  9. Approved: billr@saab.CNA.TEK.COM
  10. Xref: uunet comp.sources.games:1643
  11.  
  12. Submitted-by: izchak@linc.cis.upenn.edu (Izchak Miller)
  13. Posting-number: Volume 16, Issue 92
  14. Archive-name: nethack31/Part84
  15. Supersedes: nethack3p9: Volume 10, Issue 46-102
  16. Environment: Amiga, Atari, Mac, MS-DOS, OS2, Unix, VMS, X11
  17.  
  18.  
  19.  
  20. #! /bin/sh
  21. # This is a shell archive.  Remove anything before this line, then unpack
  22. # it by saving it into a file and typing "sh file".  To overwrite existing
  23. # files, type "sh file -c".  You can also feed this as standard input via
  24. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  25. # will see the following message at the end:
  26. #        "End of archive 84 (of 108)."
  27. # Contents:  include/spell.h sys/msdos/Install.dos sys/msdos/ovlmgr.doc
  28. #   sys/share/dgn_lex.c
  29. # Wrapped by billr@saab on Wed Jan 27 16:09:20 1993
  30. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  31. if test -f 'include/spell.h' -a "${1}" != "-c" ; then 
  32.   echo shar: Will not clobber existing file \"'include/spell.h'\"
  33. else
  34. echo shar: Extracting \"'include/spell.h'\" \(326 characters\)
  35. sed "s/^X//" >'include/spell.h' <<'END_OF_FILE'
  36. X/*    SCCS Id: @(#)spell.h    3.1    90/22/02    */
  37. X/* Copyright 1986, M. Stephenson                  */
  38. X/* NetHack may be freely redistributed.  See license for details. */
  39. X
  40. X#ifndef SPELL_H
  41. X#define SPELL_H
  42. X
  43. Xstruct spell {
  44. X    int    sp_id;            /* spell id */
  45. X    int    sp_lev;            /* power level */
  46. X    int    sp_uses;        /* uses left to spell */
  47. X};
  48. X
  49. X#endif /* SPELL_H */
  50. END_OF_FILE
  51. if test 326 -ne `wc -c <'include/spell.h'`; then
  52.     echo shar: \"'include/spell.h'\" unpacked with wrong size!
  53. fi
  54. # end of 'include/spell.h'
  55. fi
  56. if test -f 'sys/msdos/Install.dos' -a "${1}" != "-c" ; then 
  57.   echo shar: Will not clobber existing file \"'sys/msdos/Install.dos'\"
  58. else
  59. echo shar: Extracting \"'sys/msdos/Install.dos'\" \(18184 characters\)
  60. sed "s/^X//" >'sys/msdos/Install.dos' <<'END_OF_FILE'
  61. X    SCCS Id: @(#)Install.dos     3.1        93/01/06
  62. X
  63. X        Copyright (c) NetHack PC Development Team 1990 - 1993.
  64. X        NetHack may be freely redistributed.  See license for details.
  65. X        ======================================================
  66. X            Instructions for compiling and installing
  67. X                 NetHack 3.1 on an MS-DOS system
  68. X        ======================================================
  69. X                 (or, How to make PC NetHack 3.1)
  70. X                    Last revision: Jan 6, 1993
  71. X
  72. XCredit for a runnable full PC NetHack 3.1 goes to the PC Development team
  73. Xof Norm Meluch, Kevin Smolkowski, Paul Winner and Steve VanDevender who
  74. Xbuilt on the work of Pierre Martineau, Stephen Spackman, Steve Creps,
  75. XMike Threepoint and Don Kneller.
  76. X
  77. XI.  Dispelling the Myths:
  78. X
  79. X    Compiling NetHack is not as easy as it sounds, nor as hard as it looks,
  80. X    however it will behoove you to read this entire file through before
  81. X    beginning the task.
  82. X
  83. X    We have provided the proper makefiles for building NetHack using the
  84. X    following compilers:
  85. X
  86. X    Microsoft C 6.0a
  87. X    Microsoft C 7.0
  88. X    DJGPP       1.9   (gcc version 2.2 for msdos,
  89. X                       free from your local archive sites)
  90. X
  91. X    For specific details concerning each compiler, please see the
  92. X    corresponding appendix.
  93. X
  94. X    All the makefiles were created for use with NDMAKE.  The make programs
  95. X    provided by the various vendors all seem to lack necessary features.
  96. X    NDMAKE is available free from your local archive site.
  97. X
  98. X    You may find it useful to obtain copies of lex (flex) and yacc (bison).
  99. X    While not strictly necessary to compile nethack, they are required should
  100. X    you desire to make any changes to the level and dungeon compilers.
  101. X    Flex and Bison are included with the DJGPP distribution and are also
  102. X    available on many archive sites.
  103. X
  104. XII. To compile your copy of NetHack on a MSDOS machine:
  105. X    (or "just follow these few 'simple' steps outlined below.")
  106. X
  107. X1.  It almost goes without saying that you should make sure that your tools
  108. X    are set up and running correctly.
  109. X
  110. X2.  Make sure all the NetHack files are in the appropriate directory
  111. X    structure.  You should have a main directory with subdirectories
  112. X    dat, doc, include, src, sys\share, sys\msdos, util and win\tty.
  113. X    Other subdirectories may also be included in your distribution, but
  114. X    they are not necessary for use with MSDOS.  You can delete them
  115. X    to save space.  If you are using MSC7, the makefile will create
  116. X    an additional directory src\o.
  117. X
  118. X    Check the file "Files" in your top level directory for an exact
  119. X    listing of what file is in which directory.  In order for the
  120. X    Makefiles to work, all the source files must be in the proper
  121. X    locations.
  122. X
  123. X    If you downloaded or ftp'd the sources from a UNIX system, the lines
  124. X    will probably end in UNIX-style newlines, instead of the carriage
  125. X    return and line feed pairs used by DOS.  Some programs have trouble
  126. X    with them, so you may need to convert them (with a utility like
  127. X    Rahul Dhesi's "flip").  Also, every file should end with an empty
  128. X    line, because both Microsoft C and MASM have a habit of ignoring the
  129. X    last line of each file. 
  130. X
  131. X3.  The file termcap.uu is the fixed version of the Fred Fish termcap library.
  132. X    You will need to run a uudecode utility on it to generate the file
  133. X    termcap.zip.  termcap.zip contains several files of termcap routines.
  134. X    Using them with NetHack involves very little knowledge of the UNIX concept
  135. X    of a termcap database; mostly you need to know enough to set a TERM
  136. X    environment variable.  You can unzip termcap.zip in the sys/msdos
  137. X    directory, but if you are going to use it, it is probably better to
  138. X    unzip a copy in a special directory and copy the library files to where
  139. X    your linker can find them.
  140. X
  141. X    Makefiles are included should you want to build your own termcap
  142. X    library file.  Makemsc.lib works with Microsoft C and generates
  143. X    termcap.lib, Makegcc.lib works with DJGPP and generates libtermc.a.
  144. X
  145. X4.  ovlmgr.uu (MS-DOS overlay manager) is the uuencoded assembled
  146. X    object module for the overlay manager used with Microsoft C 6.0
  147. X    and older.  This file is provided in case you do not have an assembler
  148. X    of your own.  You will need to run a uudecode utility on this file too,
  149. X    to generate ovlmgr.obj.  If you want to use this, put the ovlmgr.obj
  150. X    in the src directory; the makefile will access it when it needs it.
  151. X
  152. X5.  Go to the sys/msdos directory and run the setup.bat batch file
  153. X    with either MSC or GCC as the argument.  The necessary Makefile
  154. X    movements will be accomplished for you.  In addition, when used
  155. X    with the MSC option, certain compiler options will be set.  Make
  156. X    sure that you either run setup.bat each time you start compiling
  157. X    or copy the line that starts "SET CL" into your autoexec.bat file.
  158. X
  159. X6.  Now go to the include subdirectory to check a couple of the header
  160. X    files there.  Things *should* work as they are, but since you have
  161. X    probably set up your system in some sort of custom configuration
  162. X    it doesn't hurt to check out the following:
  163. X
  164. X    First check config.h according to the comments to match your system and
  165. X    desired set of features.  Mostly you need to check the WIZARD option,
  166. X    make sure the HACKDIR is set properly, and check TERMLIB and COMPRESS.
  167. X
  168. X    We've managed to enable all the special features.  You may include all
  169. X    or as few of them as you wish.
  170. X
  171. X    Also check pcconf.h, which should not need much editing (if you are
  172. X    including termcap.uu and random.c).  If you are not including these, you
  173. X    will need to comment out TERMLIB and/or RANDOM.  If you are using
  174. X    a Microsoft compiler you should make doubly certain that OVERLAY is
  175. X    defined in pcconf.h, since otherwise things will compile properly but
  176. X    very ugly things are likely to happen wherever function pointers
  177. X    cross overlay boundaries - the linker is a little thick about that.
  178. X
  179. X    Commenting out the #define TERMLIB in pcconf.h to disable use of termcap
  180. X    routines (relying on the ANSI_DEFAULT feature) will make your job a bit
  181. X    easier.  However, you can compile with both TERMLIB and ANSI_DEFAULT
  182. X    and simply not set your TERM variable if you do not wish to use the
  183. X    termcap file settings.
  184. X
  185. X7.  If you want to change the high score list behavior, examine the top of
  186. X    topten.c, in the src directory.  You may want to change the definitions of
  187. X    PERSMAX, POINTSMIN, and ENTRYMAX.  I set POINTSMIN to 51 and ENTRYMAX to
  188. X    50 to keep the size of the score list down.
  189. X
  190. X8.  Go to the src directory and edit the top of your Makefile.  Be sure the
  191. X    directory you want the game installed (GAMEDIR) in actually exists.
  192. X
  193. X    If you elected not to use the high-quality BSD random number routines by
  194. X    commenting out RANDOM in pcconf.h or tosconf.h, comment out (or set equal
  195. X    to nothing) the RANDOM macro in your Makefile.
  196. X
  197. X    If you are recompiling after patching your sources, or if you got your
  198. X    files from somewhere other than the official distribution, "touch
  199. X    makedefs.c" to ensure that certain files (onames.h and pm.h) are remade,
  200. X    lest potentially troublesome timestamps fool "make".
  201. X
  202. X9.  Now that everything is set up, go to the util directory and
  203. X    run ndmake.  If you get any errors along the way then something
  204. X    has not been set correctly.  Next do the same in the dat directory.
  205. X    Finally, go to the src directory and "make install".  Depending on
  206. X    your particular machine and compiler, you can either grab a cup
  207. X    of coffee or go home for the day.  Your computer will be occupied
  208. X    for a long time.  If all goes well, you will get an NetHack executable.
  209. X
  210. X10. Make sure the support files -- data, rumors, cmdhelp, opthelp, help, hh,
  211. X    history, and license -- were copied to the game directory.  If not,
  212. X    move them there from the dat directory yourself.  rumors. can be
  213. X    created manually be entering "makedefs -r", data. by entering
  214. X    "makedefs -d".
  215. X
  216. X    Make sure the files NetHack.cnf and termcap also made it to your game
  217. X    directory.  If not, go to sys\share and copy NetHack.cnf and
  218. X    termcap to your game directory.  Edit NetHack.cnf to reflect your
  219. X    particular setup and personal preferences, by following the comments.
  220. X
  221. X    If you'll be running NetHack from a different subdirectory, you will
  222. X    want to "set HACKDIR=c:\games\nethack" (or whatever drive and directory 
  223. X    you want to use) now.  Add it to your autoexec.bat (in DOS), as you'll
  224. X    be playing often.
  225. X
  226. X11. Play NetHack.  If it works, you're done!
  227. X
  228. X
  229. XAppendix A - Microsoft C Compilers
  230. X
  231. X    You can compile NetHack using almost any version of Microsoft C later
  232. X    than 5.1.  Versions 5.0 and earlier are broken in such a way that it
  233. X    is impossible to use them.  Version 6.0 requires a patch available
  234. X    from Microsoft; after applying you should have 6.0ax.  Version 7.0
  235. X    works with or without the August 1992 patch.
  236. X
  237. X    Officially, support is no longer provided for MSC versions prior to
  238. X    6.0ax.  NetHack v3.1 will compile with 5.1, but you will need to
  239. X    make a lot of modifications to the makefiles in order to avoid heap
  240. X    space problems.  We strongly recommend upgrading to 6.0ax if you
  241. X    intend to recompile NetHack often.
  242. X
  243. X    One Makefile is used for all versions.  Version 7.0 takes advantage
  244. X    of the CL environment variables to set the compiler flags, as they
  245. X    exceed the MSDOS limitation of 128 characters on the command line.
  246. X    Please read the Makefile carefully and select those options that
  247. X    go with the compiler.  Also, remember to run setup.bat to set the
  248. X    CL environment variable before you compile.
  249. X
  250. X    We use the following Makefiles:
  251. X    MakeMSC.src  - src directory
  252. X    MakeMSC.utl  - util directory
  253. X    Makefile.dat - dat directory
  254. X
  255. X    The Makefile uses a structured break-up of the object modules so that
  256. X    we can link heavily used functions together without actual source code
  257. X    movement.  This has provided a great speed improvement for this release.
  258. X    See the file sys\msdos\ovlmgr.doc for more information on this
  259. X    structuring.
  260. X
  261. X  Microsoft C version 6.0:
  262. X    The NetHack executable that you are about to get will be generated by an
  263. X    overlay linker.  The beauty of this overlay linker beastie is that it will
  264. X    create an executable that will function in much less memory than it would
  265. X    "normally" take to run.  Do not be deceived.  The RAM requirement for the
  266. X    overlay version is about 550k!  You can load the program in less RAM, but
  267. X    you will begin to experience a serious amount of disk thrashing at 530k
  268. X    or less.  Absolute minimum will probably be in the neighborhood of 380-400k.
  269. X    You do not want to run the program like that!  The more free RAM you have
  270. X    available for the program, the more smoothly it will run.
  271. X
  272. X    Microsoft's internal overlay management scheme was pretty useless prior
  273. X    to version 7.0.  However, the sheer size of NetHack requires some sort
  274. X    of overlay scheme.  The magic piece to this puzzle is a program called
  275. X    ovlmgr.asm.  This is a replacement for the Microsoft (and we use the
  276. X    term loosely) overlay manager.  This program has been enhanced since
  277. X    its release in November 1989.  It will now allow NetHack to use EMS
  278. X    memory if any is available.  Also, the overlay manager will now read
  279. X    overlays out of files completely separate from the EXE.  This will
  280. X    cut down on the size of files for NetHack making distribution to PCs
  281. X    with low density disk drives much easier.
  282. X
  283. X    If you have a MASM compatible Assembler, you may want to enable the option
  284. X    in the makefile to rebuild ovlmgr.obj, although a ready-made object file 
  285. X    is provided for those of you without.  Before assembling ovlmgr, be sure
  286. X    to read ovlmgr.doc as there are several options that you may or may not
  287. X    wish to enable/disable.
  288. X
  289. X  Microsoft C version 7.0
  290. X    Microsoft was finally able to come out with a workable overlay
  291. X    linker in version 7.0.  Instead of linking in the custom overlay
  292. X    manager, we just let Microsoft do the work.
  293. X
  294. XAppendix B - DJGPP Compiler (gcc ported to msdos)
  295. X
  296. X    If you have a 386 or better machine, you are in luck.  You can compile
  297. X    NetHack without spending money on a compiler.  DJGPP is available free
  298. X    from many archive sites.
  299. X
  300. X    Setting up DJGPP is more than adequately explained in the documentation
  301. X    that comes with it.  Be sure to pick up the yacc and flex built with
  302. X    DJGPP if you intend to do any modification of the special levels or
  303. X    dungeon compilers.  They should be available at the same place you got
  304. X    djgpp.
  305. X
  306. X    The executable version of NetHack built with DJGPP runs in protected mode
  307. X    without overlays and is quite fast.  It cannot run under Microsoft
  308. X    Windows.  See the DJGPP documentation for more details on particular
  309. X    memory requirements.
  310. X
  311. X    Building with DJGPP is easy, just follow the steps outlined in the
  312. X    main section.
  313. X
  314. XAppendix C - Borland C Compiler
  315. X
  316. X    NetHack will not compile at all with any version of Turbo C/C++.  It
  317. X    has been made to compile with Borland C v2.0 after much work, but the
  318. X    resulting binaries are far too slow to be playable.  It will not compile
  319. X    with Borland C/C++ v3.0 - the bugs in that version of the compiler
  320. X    related to the preprocessor make a total mess out of the macros that
  321. X    the NetHack code is laced with.  We haven't had much luck at
  322. X    compiling with v3.1 either.  If you successfully compile a playable
  323. X    binary using any version of Borland's compiler we would love to
  324. X    hear from you -- it would be a sure ticket to a position on the PC
  325. X    Development team and all the fame and fortune that goes along with
  326. X    it.  To get you started, here are a few hints.
  327. X
  328. X    0. This should almost go without saying, but if you just bought
  329. X       Borland (or Turbo C) and you are thinking that compiling
  330. X       NetHack would be a great way to learn C and your nifty new
  331. X       compiler at the same time, you are either going to prove
  332. X       yourself some kind of prodigy or get very frustrated and quit.
  333. X
  334. X    1. We left most of the __TURBOC__ defines in the code, some are
  335. X       necessary, others are not, and a few are misleading depending
  336. X       upon which compiler version you use as they relate to problems
  337. X       with Borland compilers long since fixed.  We left them in to
  338. X       provide some landmarks for future Borland hackers.
  339. X
  340. X    2. No makefiles are provided as nothing we have tried has really
  341. X       worked.  Most of our attempts have started off using the
  342. X       GCC makefiles.
  343. X
  344. X    3. Start off by working with the utility programs in the util
  345. X       directory.  They are the smallest and will give you some
  346. X       measure of success before you tackle the main code.  The
  347. X       programs contained in util are necessary to build the
  348. X       game so you will not be wasting your time.  Once you get
  349. X       the utility program compiled, run the makefile in the dat
  350. X       directory.  The utility programs you just compiled will attempt
  351. X       to convert the raw data files into game readable form.  If you
  352. X       get errors then something is wrong.
  353. X
  354. XAppendix D - Microsoft C Compiler Warnings
  355. X
  356. X    If you are using MSC for your compile with any of the /W levels set,
  357. X    you can expect warnings.  The list below are those warnings that we
  358. X    are aware of and our recommendation for dealing with them.  You can
  359. X    use the warning disable pragma to ignore them if you wish.  (NOTE:
  360. X    this is not a complete list of all warnings you might receive, only
  361. X    those for which we feel we can safely provide guidance on.)
  362. X
  363. XC4131 (function:uses old-style declarator)
  364. X    You should ignore this warning.  In order to make the source code as
  365. X    portable as possible, only old-style declarators are used so that as
  366. X    many compilers as possible can use the same code.
  367. XC4706 (Assignment within conditional expression)
  368. X    This is a perfectly valid construction.  These warnings have not
  369. X    produced any problems.
  370. XC4761 (Integral size mismatch in argument; conversion supplied)
  371. X    These should be no problem.  Prototyping compilers will do the con-
  372. X    version, and non-prototyping compilers will go through int anyway.
  373. X
  374. X
  375. XNotes:
  376. X
  377. X1)  Save files and bones files from previous versions of NetHack will not
  378. X    work with this NetHack.  Don't bother trying to keep them.  Record
  379. X    (score) files from before 3.0 patchlevel 7 will almost work, but you need
  380. X    to make one change manually to them:  At the end of each line is a word or
  381. X    phrase specifying what killed the player.  Change the string to start with
  382. X    the words "killed by", "killed by a", or "killed by an" (whichever is
  383. X    appropriate).  If the death was petrification, it should read "petrified
  384. X    by" instead of "killed by".  Don't change "starvation", "quit", "escaped",
  385. X    or "ascended".
  386. X
  387. X2)  To install an update of NetHack after changing something, enter "make45l"
  388. X    from the src directory.  If you add, delete, or reorder monsters or
  389. X    objects, or you change the format of saved level files, delete any save
  390. X    and bones files.  (Trying to use such files sometimes produces amusing
  391. X    confusions on the game's part, but usually crashes.)
  392. X
  393. X    If you made changes to any of the level compiler software, you may have
  394. X    to delete dgn_flex.c, dgn_yacc.c, lev_flex.c, and lev_yacc.c from the
  395. X    util directory to ensure that they are remade.
  396. X
  397. X3)  During linking the Microsoft Overlay Linker will need temporary storage
  398. X    space.  Make sure you have about a meg of free disk wherever you have
  399. X    defined your temporary storage.
  400. X
  401. X4)  If you have comments or suggestions, feel free to drop any one of
  402. X    us a line c/o nethack-bugs@linc.cis.upenn.edu.  From compuserve,
  403. X    try INTERNET:nethack-bugs@linc.cis.upenn.edu.  Should you be
  404. X    without email access, some of us can still be reached by lesser means:
  405. X
  406. X    For the west coast:
  407. X      Kevin D Smolkowski
  408. X      c/o OSLC
  409. X      207 E 5th
  410. X      Eugene, OR  97401
  411. X
  412. X    Compuserve users can also reach Paul Winner by sending compuserve mail
  413. X    to 73207,226.  The NetHack binaries and sources can be found in the
  414. X    GAMERS forum.
  415. END_OF_FILE
  416. if test 18184 -ne `wc -c <'sys/msdos/Install.dos'`; then
  417.     echo shar: \"'sys/msdos/Install.dos'\" unpacked with wrong size!
  418. fi
  419. # end of 'sys/msdos/Install.dos'
  420. fi
  421. if test -f 'sys/msdos/ovlmgr.doc' -a "${1}" != "-c" ; then 
  422.   echo shar: Will not clobber existing file \"'sys/msdos/ovlmgr.doc'\"
  423. else
  424. echo shar: Extracting \"'sys/msdos/ovlmgr.doc'\" \(18111 characters\)
  425. sed "s/^X//" >'sys/msdos/ovlmgr.doc' <<'END_OF_FILE'
  426. X    SCCS Id: @(#)ovlmgr.doc         3.1        91/02/02
  427. X    Copyright (c) 1989, 1990, 1991, 1992, 1993 Pierre G Martineau and
  428. X    Stephen P Spackman.  All Rights Reserved.
  429. X    NetHack may be freely redistributed.  See license for details.
  430. X         ====================================
  431. X         Brief notes about ovlmgr.asm [v30a0]
  432. X         ====================================
  433. X               (revised 1991february02)
  434. X
  435. XOVLMGR.ASM is a multiple-residency overlay manager for use with the
  436. XMicrosoft Overlay Linker.  It is functionally compatible with the one
  437. Xin the MSC library _except_:
  438. X
  439. X- it usually accesses the disk less often and is a lot faster in some
  440. X  applications.
  441. X- it permits overlays to be stored in the .EXE file and/or in separate
  442. X  .OVL files.
  443. X- it has different tuning characteristics.
  444. X- you must (of course) link OVLMGR.OBJ into the root overlay (that is,
  445. X  outside any parentheses in the link command).
  446. X
  447. XSee also the notes below.
  448. X
  449. X    As with other Microsoft-compatible overlay handlers you must
  450. Xbe *very* careful never to call a function in an overlay through a
  451. Xpointer, unless the initiator of the call resides in the *same*
  452. Xphysical overlay as the target (This is, of course, *not* the same
  453. Xthing as the called function being declared static, since the static
  454. Xdeclaration affects only the visibility of the name of the function,
  455. Xnot the distribution of pointers to it.) (1).  Furthermore, setjmp()
  456. Xand longjmp() are not supported.
  457. X
  458. X    Unlike the Microsoft system, most of the available memory is
  459. Xused to hold overlays.    Care must be taken to ensure that enough space
  460. Xis reserved for the C heap.  This can be accomplished through
  461. Xinformation stored in the .EXE file (currently the minalloc parameter,
  462. Xas described below).
  463. X
  464. X    Furthermore, expanded memory support (EMS) is now an integral
  465. Xpart of the overlay manager.  LIM EMS versions 3.2 and 4.0 are
  466. Xsupported.  Note that the page frame must be 4 pages long (64K bytes) to
  467. Xbe able to operate correctly (most drivers allocate a 64K frame by
  468. Xdefault).  The overlay manager will use as much EMS as is necessary in
  469. X64K chunks, up to a limit of 16 chunks (1 Meg).  Both hardware and
  470. Xsoftware EMS drivers have been tested and found to be completely
  471. Xcompatible.
  472. X
  473. X    Starting with version 30a0, overlays are not restricted to
  474. Xbeing stored in the main .EXE files (as they are with Microsoft's
  475. Xoverlay manager).  Using the utility EXESMURF arbitrary contiguous
  476. Xsequences of overlays can be unloaded into external overlay files.
  477. XAlthough EXESMURF provides some flexibility in naming these files,
  478. XOVLMGR presently only supports its default option, whereby the
  479. Xoverlays of a programme PROGRAM.EXE must match the pattern
  480. XPROGRAM?.OVL (if the basename had eight characters, as FILENAME.EXE,
  481. Xthen the last character is replaced: FILENAM?.EXE) and reside in the
  482. X*same* directory as the .EXE (not even a path search is performed).
  483. XThis mechanism permits large applications to be represented with small
  484. Xfiles, resulting in a slight performance improvement (due to less and
  485. Xshorter disk seeking) and easier transfer with floppy disks, at the
  486. Xcost of a heavier demand for file-handles.
  487. X
  488. X                ~ * ~
  489. X
  490. X    OVLMGR.ASM currently has three assembly-time options, which are
  491. Xspecified with the assembler's /D<symbol> option (or compatible).  They
  492. Xare:
  493. X
  494. X    /DNOEMS   Disable EMS support.
  495. X          OVLMGR normally detects the presence of EMS memory
  496. X          and makes use of it whenever it is present.  This
  497. X          flag instructs ovlmgr to ignore EMS and operate only
  498. X          out of conventional memory.  It should be used when
  499. X          overlaying programmes which expect to use EMS
  500. X          themselves.
  501. X
  502. X    /Di386      Use 80386-specific instruction sequences.
  503. X          Use of this flag will make ovlmgr perform better on
  504. X          machines with 80386 processors.  However, the
  505. X          resulting programme will not run at all on machines
  506. X          with less capable CPUs.  Use this option with
  507. X          caution, especially in the case of distribution
  508. X          code.
  509. X
  510. X    /DNOSPLIT Do not provide for external .OVL files.
  511. X          If this flag is NOT set, OVLMGR will look for
  512. X          overlays for the programme PROGRAM.EXE in all files
  513. X          matching the pattern PROGRAM?.OVL, as well as in the
  514. X          .EXE file itself.  This arrangement may be slightly
  515. X          faster and will result in more, smaller files, but
  516. X          is obviously less robust, since mismatched .OVL
  517. X          files can cause mayhem.  .OVL files can be generated
  518. X          with our EXESMURF .EXE file manipulation utility.
  519. X
  520. X                ~ * ~
  521. X
  522. X    Although using the overlay manager is in essence much like using
  523. XMicrosoft's, they operate on a slightly different principle, and tuning
  524. Xfor them is rather different.  Technical part begins.
  525. X
  526. X    When overlay linking is requested (see your linker manual), the
  527. XMS overlay linker changes all far calls into overlays from the (normal,
  528. X8086) format:
  529. X
  530. X    offset    contents
  531. X    ------    --------
  532. X    :0000    CALL
  533. X    :0001    target-offset
  534. X    :0003    target-segment
  535. X
  536. Xto this:
  537. X    :0000    INT
  538. X    :0001    int#    target-mod#
  539. X    :0003    target-offset
  540. X
  541. X(note that here we are looking at the actual layout of the machine
  542. Xcode, not at the assembly code as such) and relocates the code parts
  543. Xof all the different overlays into the *same* physical area.  The
  544. Xoverlaid code is all actually placed at the end of the .EXE file,
  545. Xafter the 'normal' executable image, along with all its administrative
  546. Xdata (fixups etc.).
  547. X
  548. X    When this altered 'call' is executed, of course, the interrupt
  549. Xhandler int# is invoked.  Its job is to ensure that the target overlay
  550. Xmodule is in memory (reading it from the tail of the .EXE file if it
  551. Xisn't already loaded) and then transfer to the given offset within it,
  552. X'faking up' the effect of the 'real' far call that would normally have
  553. Xoccurred.  Something similar must be done when the call returns, to
  554. Xensure that the thing being returned *into* is still (or is once more)
  555. Xloaded.
  556. X
  557. X    The Microsoft linker, as we have said, relocates all the
  558. Xoverlays to the same load address; and, in fact, it allocates am empty
  559. Xblock of memory there that is at least as large as the largest
  560. Xoverlay.  Into this area all the overlays are loaded without further
  561. Xchange; thus, there can only ever be one overlay in memory at one
  562. Xtime.  Transferring from one overlay to another causes one overlay to
  563. Xreplace the other in the allocated overlay swap area.
  564. X
  565. X    Our overlay manager does not use the space allocated by the
  566. Xlinker in the same way.  Rather, it allocates almost all of the memory
  567. Xavailable from MS-DOS (including the original overlay area and any high
  568. XDOS memory) as well as EMS memory if some is available and that option
  569. Xis being used.    As overlays are needed, they are loaded wherever they
  570. Xwill fit, and dynamically relocated to that address.  Thus, many more
  571. Xthan one overlay may be loaded at any given time, greatly increasing
  572. Xpotential performance.    Management of space is more or less according to
  573. Xan LRU policy - once all of memory is full, the least recently used
  574. Xoverlay is selected as the most likely candidate for replacement.
  575. X
  576. X    The implications of this difference are as follows:  while with
  577. Xthe conventional (default) overlay manager, the best strategy is to
  578. Xgroup object modules together in an overlay whenever they are known to
  579. Xbe used in rapid succession, to make each overlay as big as possible
  580. X(all things being equal) in order to take advantage of all available
  581. Xmemory, and to make as few overlays as possible (to reduce the amount of
  582. Xdisk access), the best strategy with our overlay manager is almost the
  583. Xreverse.  Having a lot of small overlays will increase the amount of
  584. Xuseful stuff that can be resident in memory at the same time; all of
  585. Xmemory will automatically be employed; and there is no advantage at all
  586. Xto uniformity of size (except perhaps in the unlikely case of *exact*
  587. Xuniformity!).
  588. X
  589. X    Although ovlmgr allocates all available memory while it is
  590. Xactive, you will find that the DOS exec() call works normally.    The
  591. Xmemory that is allocated for administering the overlay system is freed
  592. Xbefore the exec call is made and reallocated afterwards (we trap the DOS
  593. Xfunction request vector to do this, which isn't very nice as a
  594. Xprogramming practise but makes the existence of the overlay manager far
  595. Xmore transparent).  There is, however, one circumstance under which this
  596. Xcan be problematic:  if you use the exec() call to load a TSR
  597. Xapplication, thereby causing memory that the overlay manager was using
  598. Xto become unavailable, you may make it impossible for the overlaid
  599. Xapplication to proceed.  This is because code that is nominally
  600. X'running' (i.e. is currently on the stack) cannot be relocated and must
  601. Xbe reloaded at the *same address* that previously held it.  If another
  602. Xprocess now owns that area of memory, there is nothing we can do.  We
  603. Xbelieve that this should not be a serious concern in normal use.
  604. X
  605. X                ~ * ~
  606. X
  607. X    Since all available memory is potentially used by ovlmgr, there
  608. Xis one additional concern in using it with C programmes:  the allocation
  609. Xof sufficient space for the C heap (2).  While previous versions of
  610. Xovlmgr.asm required the change of an internal constant and re-assembly
  611. Xof ovlmgr to change the amount of space pre-allocated for this purpose,
  612. Xthe current version uses the DOS minalloc parameter in the executable
  613. Xfile to hold the size of the desired heap area.  This parameter can be
  614. Xset at any time after the link process with either Microsoft's exemod
  615. Xutility or with the supplied utility, exesmurf.
  616. X
  617. X                ~ * ~
  618. X
  619. XNOTA BENE: This is an early version of the overlay manager, but by now
  620. Xit should be fairly well debugged. If you are considering upgrading it
  621. Xplease be aware that the following improvements are planned for the
  622. Xnext version (though who knows when delivery will occur):
  623. X
  624. X      - compatible versions of setjmp() and longjmp()
  625. X      - integral malloc() to eliminate the heap size guesswork
  626. X      - support for swapped data areas (read-only and read/write)
  627. X      - improved performance through dynamic link-loading (maybe)
  628. X      - interlocking to permit floppy disk juggling use
  629. X      - XMS support and improved EMS support
  630. X      - support for divergent-functionality overlays (such as
  631. X      hardware-specific modules)
  632. X      - enabling the overlay locking code
  633. X      - more flexibility in naming and locating external overlay files
  634. X      - Major code revamping
  635. X
  636. XSwap On!
  637. X
  638. X------------------------------------------------------------------------
  639. XMESSAGES
  640. X
  641. XOVLMGR: EMS memory manager error.
  642. X
  643. X    An error occurred during an EMS access.  Either the hardware has
  644. X    reported a bug, the software driver has detected an anomaly or
  645. X    the page frame is not 64K bytes in length.
  646. X
  647. XOVLMGR: Executable or overlay header missing or damaged.
  648. X
  649. X    The end of a file was reached unexpectedly during
  650. X    initialisation, while trying to locate the overlays.  This is a
  651. X    very bad sign (though I am concerned that it might be triggered
  652. X    spuriously by debug information or other non-executable tails on
  653. X    files).
  654. X
  655. XOVLMGR: File I/O error.
  656. X
  657. X    An error occurred while trying to load an overlay.  We don't
  658. X    want this.
  659. X
  660. XOVLMGR: Inaccessible EXE file. Can't load overlays.
  661. X
  662. X    For some reason ovlmgr could not locate or read the original
  663. X    .EXE file in which the overlays reside.  This could be due to
  664. X    your attempting to use a very old version of DOS,
  665. X    an abject shortage of file handles, some strange event causing
  666. X    the file to be deleted, a disk error, or the diskette that
  667. X    contained the executable being removed.
  668. X
  669. XOVLMGR: Inaccessible OVL file. Can't load overlays.
  670. X
  671. X    An error was reported while attempting to open an .OVL file
  672. X    which was expected (from its name) to contain external overlays.
  673. X    The possible causes are similar to those of the previous
  674. X    message.
  675. X
  676. XOVLMGR: Incomplete executable.  OVL files missing?
  677. X
  678. X    OVLMGR was unable to locate all of its overlays for some reason.
  679. X    This could be due to I/O errors on the disk drive, but is more
  680. X    likely caused by an external .OVL file not being present in the
  681. X    same directory as the .EXE.
  682. X
  683. XOVLMGR: Incorrect DOS version. Must be 3.00 or later.
  684. X
  685. X    The current version of ovlmgr does not support versions of DOS
  686. X    prior to 3.0 because of the difficulty of locating the
  687. X    executable file (and hence the overlays) at runtime.
  688. X
  689. XOVLMGR: Internal memory allocation failure.
  690. X
  691. X    Either an internal error has occurred in ovlmgr or the
  692. X    application programme, or some event has caused memory that
  693. X    ovlmgr believed it could count on becoming unavailable.  A
  694. X    typical example of the latter would be the result of
  695. X    attempting to load a TSR while an overlaid application is
  696. X    running.
  697. X
  698. XOVLMGR: Not enough free memory left to run this program.
  699. X
  700. X    Although DOS successfully loaded the programme, it proved
  701. X    impossible to allocate enough additional contiguous memory to
  702. X    load one or more of the overlays.  Either reduce the
  703. X    RAM-loading of the application by reducing the size of either
  704. X    the root or the largest overlays, or increase the amount of
  705. X    memory available by unloading TSRs and/or simplifying your
  706. X    CONFIG.SYS.
  707. X
  708. XOVLMGR: Unable to resolve overlay file names.
  709. X
  710. X    Apparently the name reported to OVLMGR as being that of the
  711. X    executable file is ill-formed, and it is thus not possible to
  712. X    intuit what external overlay files would be called.  It is
  713. X    possible that this indicates that DOS has gone bonkers, but more
  714. X    likely (I guess) that the .EXE was not invoked by DOS as we know
  715. X    it.  Either way, you have entered the Twilight Zone....
  716. X
  717. X(xxxx:xxxx:xxxx:xxxx)
  718. X
  719. X    This is a diagnostic code composed of the following fields:
  720. X        - error code
  721. X        - version number
  722. X        - available conventional memory
  723. X        - EMS memory usage
  724. X    Please note it in any bug reports or correspondence with the
  725. X    development team.
  726. X
  727. X------------------------------------------------------------------------
  728. XKNOWN BUGS
  729. X
  730. XThe present version cannot always be used as a direct replacement for
  731. XMicrosoft's overlay manager (even granted the documented differences)
  732. Xbecause the minimum size required for an overlaid programme to run is at
  733. Xleast the size of the root plus TWICE the size of the largest overlay.
  734. XIf a programme has previously had its overlay structure tuned to take
  735. Xbest advantage of Microsoft overlays, this may well cause a problem.
  736. XThe overlays themselves will need to be split up.
  737. X
  738. XWhen the MicroSoft linker discovers that an overlay as requested
  739. Xcontains NO instructions at all (this can happen by mistake if you give
  740. Xa source file that winds up holding only data declarations its own
  741. Xoverlay), it does not emit an overlay record for it at all - there is
  742. Xsimply a gap in the overlay sequence in the file.  The current version
  743. Xof OVLMGR detects this as an error, since it assumes that such a gap
  744. Xshould have been filled by an external .OVL file.  It is presently your
  745. Xresponsibility to ensure that this does not occur.
  746. X
  747. XFiles containing overlays are kept open all the time the application
  748. Xis running.  Particularly if multiple external .OVL files are used,
  749. Xthis can result in less file handles being available to the user
  750. Xprogramme than would otherwise be expected.
  751. X
  752. XALL files that match the pattern for potential overlay files are
  753. Xopened, regardless of whether they actually contain overlays.
  754. X
  755. XThe names of external overlay files have a very restricted form, and
  756. Xthey must reside in the same directory with the .EXE.  These
  757. Xlimitations cause them to be useful for little else besides making
  758. Xdistribution easier.
  759. X
  760. XTransfers between overlays are very slow in machine terms, even if both
  761. Xoverlays happen to reside in memory at the time (still significantly
  762. Xfaster than Microsoft's, though).  This means that overlay patterns
  763. Xmust be chosen on the basis of more than just logical dependency.
  764. X
  765. XLocking overlays into memory is not really implemented even though
  766. Xreading the source code might make you think it was.  Actually, reading
  767. Xthe source code itself isn't very well implemented right now.  Comments
  768. Xand stuff would help.  Yup, yup.
  769. X
  770. XDue to limitations in the LIM EMS standard (to 4.0), programmes that
  771. Xthemselves use EMS memory cannot be overlaid with ovlmgr unless ovlmgr's
  772. Xown EMS support is disabled.  This is accomplished by assembling with
  773. Xthe /DNOEMS flag.
  774. X
  775. X------------------------------------------------------------------------
  776. XBUG ALERT
  777. X
  778. XTo repeat a point made above, if you ever try to call a function in an
  779. Xoverlay through a pointer, you *may* die with the Microsoft overlay
  780. Xmanager.  If you ever try to call a function in an overlay through a
  781. Xpointer, you *will* die with ours.  Nothing in an overlay ever ends up
  782. Xin the same segment as the linker anticipated.    You have been warned!
  783. X
  784. X------------------------------------------------------------------------
  785. XFOOTNOTES
  786. X
  787. X(1) This problem can be circumvented through the use of surrogate
  788. X'trampoline' functions:  functions that reside in the root overlay and
  789. Xsimply pass right through to the 'real', overlaid, implementations.
  790. XThis can even be made transparent to the source code through the use
  791. Xof the C macro preprocessor, with a locution of the form
  792. X    #define foo(x) foo_(x)
  793. Xvisible everywhere except at the actual definition point of the
  794. Xtrampoline.  This method was implemented in NetHack 3.0, and remains today.
  795. X
  796. X(2) If you should get a message to the effect that NetHack can't
  797. Xallocate 28000 and some bytes when entering a maze level, that
  798. Xisn't our problem!  In all probability you forgot to rebuild your
  799. Xspecial level files when you changed the compiler flags.  We got
  800. Xthat one, too, at one point.  The same applies to similar messages when
  801. Xreading bones files or saved games:  it is more likely that you forgot
  802. Xto discard them after recompiling your game than that the memory
  803. Xallowance is so greatly incorrect.
  804. X
  805. X----------------------------------------------------------------------
  806. XNOTICE
  807. X
  808. XOVLMGR.ASM is brought to you by Pierre Martineau and Stephen Spackman.
  809. XIt, and this document, are copyright.  They are, however, provided as
  810. Xpart of NetHack and may be freely distributed as described in the
  811. XNetHack license.
  812. X
  813. X----------------------------------------------------------------------
  814. XStephen P Spackman                 stephen@tira.uchicago.edu
  815. XPierre G Martineau           pierre%ozrout.uucp@altitude.cam.org
  816. X----------------------------------------------------------------------
  817. X    Copyright (c) 1989, 1990 Pierre G Martineau and Stephen P Spackman
  818. X    All Rights Reserved.
  819. END_OF_FILE
  820. if test 18111 -ne `wc -c <'sys/msdos/ovlmgr.doc'`; then
  821.     echo shar: \"'sys/msdos/ovlmgr.doc'\" unpacked with wrong size!
  822. fi
  823. # end of 'sys/msdos/ovlmgr.doc'
  824. fi
  825. if test -f 'sys/share/dgn_lex.c' -a "${1}" != "-c" ; then 
  826.   echo shar: Will not clobber existing file \"'sys/share/dgn_lex.c'\"
  827. else
  828. echo shar: Extracting \"'sys/share/dgn_lex.c'\" \(17477 characters\)
  829. sed "s/^X//" >'sys/share/dgn_lex.c' <<'END_OF_FILE'
  830. X# include "stdio.h"
  831. X# define U(x) x
  832. X# define NLSTATE yyprevious=YYNEWLINE
  833. X# define BEGIN yybgin = yysvec + 1 +
  834. X# define INITIAL 0
  835. X# define YYLERR yysvec
  836. X# define YYSTATE (yyestate-yysvec-1)
  837. X# define YYOPTIM 1
  838. X# define YYLMAX BUFSIZ
  839. X# define output(c) putc(c,yyout)
  840. X# define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)
  841. X# define unput(c) {yytchar= (c);if(yytchar=='\n')yylineno--;*yysptr++=yytchar;}
  842. X# define yymore() (yymorfg=1)
  843. X# define ECHO fprintf(yyout, "%s",yytext)
  844. X# define REJECT { nstr = yyreject(); goto yyfussy;}
  845. Xint yyleng; extern char yytext[];
  846. Xint yymorfg;
  847. Xextern char *yysptr, yysbuf[];
  848. Xint yytchar;
  849. XFILE *yyin = {stdin}, *yyout = {stdout};
  850. Xextern int yylineno;
  851. Xstruct yysvf { 
  852. X    struct yywork *yystoff;
  853. X    struct yysvf *yyother;
  854. X    int *yystops;};
  855. Xstruct yysvf *yyestate;
  856. Xextern struct yysvf yysvec[], *yybgin;
  857. X/*    SCCS Id: @(#)dgn_lex.c    3.1    92/10/23    */
  858. X/*    Copyright (c) 1989 by Jean-Christophe Collet */
  859. X/*    Copyright (c) 1990 by M. Stephenson         */
  860. X/* NetHack may be freely redistributed.  See license for details. */
  861. X
  862. X#define DGN_COMP
  863. X
  864. X#include "config.h"
  865. X#include "dgn_comp.h"
  866. X#include "dgn_file.h"
  867. X
  868. Xlong *FDECL(alloc, (unsigned int));
  869. X/*
  870. X * Most of these don't exist in flex, yywrap is macro and
  871. X * yyunput is properly declared in flex.skel.
  872. X */
  873. X#ifndef FLEX_SCANNER
  874. Xint FDECL (yyback, (int *, int));
  875. Xint NDECL (yylook);
  876. Xint NDECL (yyinput);
  877. Xint NDECL (yywrap);
  878. Xint NDECL (yylex);
  879. X    /* Traditional lexes let yyunput() and yyoutput() default to int;
  880. X     * newer ones may declare them as void since they don't return
  881. X     * values.  For even more fun, the lex supplied as part of the
  882. X     * newer unbundled compiler for SunOS 4.x adds the void declarations
  883. X     * (under __STDC__ or _cplusplus ifdefs -- otherwise they remain
  884. X     * int) while the bundled lex and the one with the older unbundled
  885. X     * compiler do not.  To detect this, we need help from outside --
  886. X     * sys/unix/Makefile.utl.
  887. X     */
  888. X# if defined(NeXT) || defined(SVR4)
  889. X#  define VOIDYYPUT
  890. X# endif
  891. X# if !defined(VOIDYYPUT)
  892. X#  if defined(POSIX_TYPES) && !defined(BOS) && !defined(HISX)
  893. X#   define VOIDYYPUT
  894. X#  endif
  895. X# endif
  896. X# if !defined(VOIDYYPUT) && defined(WEIRD_LEX)
  897. X#  if defined(SUNOS4) && defined(__STDC__) && (WEIRD_LEX != 0) 
  898. X#   define VOIDYYPUT
  899. X#  endif
  900. X# endif
  901. X# ifdef VOIDYYPUT
  902. Xvoid FDECL (yyunput, (int));
  903. Xvoid FDECL (yyoutput, (int));
  904. X# else
  905. Xint FDECL (yyunput, (int));
  906. Xint FDECL (yyoutput, (int));
  907. X# endif
  908. X#endif    /* FLEX_SCANNER */
  909. X
  910. Xvoid FDECL (init_yyin, (FILE *));
  911. Xvoid FDECL (init_yyout, (FILE *));
  912. X
  913. X#ifdef MICRO
  914. X#undef exit
  915. Xextern void FDECL(exit, (int));
  916. X#endif
  917. X
  918. X/* this doesn't always get put in dgn_comp.h
  919. X * (esp. when using older versions of bison)
  920. X */
  921. X
  922. Xextern YYSTYPE yylval;
  923. X
  924. Xint line_number = 1;
  925. X/*
  926. X *    This is a hack required by Michael Hamel to get things
  927. X *    working on the Mac.
  928. X */
  929. X#if defined(applec) && !defined(FLEX_SCANNER)
  930. X#undef input
  931. X#undef unput
  932. X#define unput(c) { yytchar = (c); if (yytchar == 10) yylineno--; *yysptr++ = yytchar; }                  
  933. X# ifndef YYNEWLINE
  934. X# define YYNEWLINE 10
  935. X# endif
  936. X
  937. Xchar
  938. Xinput() {    /* Under MPW \n is chr(13)! Compensate for this. */
  939. X
  940. X    if (yysptr > yysbuf) return(*--yysptr);
  941. X    else {
  942. X        yytchar = getc(yyin);
  943. X         if (yytchar == '\n') {
  944. X            yylineno++;
  945. X            return(YYNEWLINE);
  946. X        }
  947. X        if (yytchar == EOF) return(0);
  948. X        else            return(yytchar);
  949. X    }
  950. X}
  951. X#endif    /* applec && !FLEX_SCANNER */
  952. X
  953. X# define YYNEWLINE 10
  954. Xyylex(){
  955. Xint nstr; extern int yyprevious;
  956. Xwhile((nstr = yylook()) >= 0)
  957. Xyyfussy: switch(nstr){
  958. Xcase 0:
  959. Xif(yywrap()) return(0); break;
  960. Xcase 1:
  961. X    return(A_DUNGEON);
  962. Xbreak;
  963. Xcase 2:
  964. X    { yylval.i=1; return(UP_OR_DOWN); }
  965. Xbreak;
  966. Xcase 3:
  967. X    { yylval.i=0; return(UP_OR_DOWN); }
  968. Xbreak;
  969. Xcase 4:
  970. X    return(ENTRY);
  971. Xbreak;
  972. Xcase 5:
  973. X    return(STAIR);
  974. Xbreak;
  975. Xcase 6:
  976. X    return(NO_UP);
  977. Xbreak;
  978. Xcase 7:
  979. X    return(NO_DOWN);
  980. Xbreak;
  981. Xcase 8:
  982. X    return(PORTAL);
  983. Xbreak;
  984. Xcase 9:
  985. Xreturn(PROTOFILE);
  986. Xbreak;
  987. Xcase 10:
  988. Xreturn(DESCRIPTION);
  989. Xbreak;
  990. Xcase 11:
  991. Xreturn(LEVELDESC);
  992. Xbreak;
  993. Xcase 12:
  994. X      return(ALIGNMENT);
  995. Xbreak;
  996. Xcase 13:
  997. X       return(LEVALIGN);
  998. Xbreak;
  999. Xcase 14:
  1000. X    { yylval.i=TOWN ; return(DESCRIPTOR); }
  1001. Xbreak;
  1002. Xcase 15:
  1003. X    { yylval.i=HELLISH ; return(DESCRIPTOR); }
  1004. Xbreak;
  1005. Xcase 16:
  1006. X{ yylval.i=MAZELIKE ; return(DESCRIPTOR); }
  1007. Xbreak;
  1008. Xcase 17:
  1009. X{ yylval.i=ROGUELIKE ; return(DESCRIPTOR); }
  1010. Xbreak;
  1011. Xcase 18:
  1012. X      { yylval.i=D_ALIGN_NONE ; return(DESCRIPTOR); }
  1013. Xbreak;
  1014. Xcase 19:
  1015. X        { yylval.i=D_ALIGN_NONE ; return(DESCRIPTOR); }
  1016. Xbreak;
  1017. Xcase 20:
  1018. X         { yylval.i=D_ALIGN_LAWFUL ; return(DESCRIPTOR); }
  1019. Xbreak;
  1020. Xcase 21:
  1021. X        { yylval.i=D_ALIGN_NEUTRAL ; return(DESCRIPTOR); }
  1022. Xbreak;
  1023. Xcase 22:
  1024. X        { yylval.i=D_ALIGN_CHAOTIC ; return(DESCRIPTOR); }
  1025. Xbreak;
  1026. Xcase 23:
  1027. X    return(BRANCH);
  1028. Xbreak;
  1029. Xcase 24:
  1030. Xreturn(CHBRANCH);
  1031. Xbreak;
  1032. Xcase 25:
  1033. X    return(LEVEL);
  1034. Xbreak;
  1035. Xcase 26:
  1036. Xreturn(RNDLEVEL);
  1037. Xbreak;
  1038. Xcase 27:
  1039. Xreturn(CHLEVEL);
  1040. Xbreak;
  1041. Xcase 28:
  1042. Xreturn(RNDCHLEVEL);
  1043. Xbreak;
  1044. Xcase 29:
  1045. X    { yylval.i=atoi(yytext); return(INTEGER); }
  1046. Xbreak;
  1047. Xcase 30:
  1048. X{ yytext[yyleng-1] = 0; /* Discard the trailing \" */
  1049. X          yylval.str = (char *) alloc(strlen(yytext+1)+1);
  1050. X          strcpy(yylval.str, yytext+1); /* Discard the first \" */
  1051. X          return(STRING); }
  1052. Xbreak;
  1053. Xcase 31:
  1054. X    { line_number++; }
  1055. Xbreak;
  1056. Xcase 32:
  1057. X    { line_number++; }
  1058. Xbreak;
  1059. Xcase 33:
  1060. X    ;
  1061. Xbreak;
  1062. Xcase 34:
  1063. X    { return yytext[0]; }
  1064. Xbreak;
  1065. Xcase -1:
  1066. Xbreak;
  1067. Xdefault:
  1068. Xfprintf(yyout,"bad switch yylook %d",nstr);
  1069. X} return(0); }
  1070. X/* end of yylex */
  1071. X
  1072. X/* routine to switch to another input file; needed for flex */
  1073. Xvoid init_yyin( input_f )
  1074. XFILE *input_f;
  1075. X{
  1076. X#ifdef FLEX_SCANNER
  1077. X    if (yyin)
  1078. X        yyrestart(input_f);
  1079. X    else
  1080. X#endif
  1081. X        yyin = input_f;
  1082. X}
  1083. X/* analogous routine (for completeness) */
  1084. Xvoid init_yyout( output_f )
  1085. XFILE *output_f;
  1086. X{
  1087. X    yyout = output_f;
  1088. X}
  1089. X
  1090. Xint yyvstop[] = {
  1091. X0,
  1092. X
  1093. X34,
  1094. X0,
  1095. X
  1096. X33,
  1097. X34,
  1098. X0,
  1099. X
  1100. X32,
  1101. X0,
  1102. X
  1103. X34,
  1104. X0,
  1105. X
  1106. X29,
  1107. X34,
  1108. X0,
  1109. X
  1110. X34,
  1111. X0,
  1112. X
  1113. X34,
  1114. X0,
  1115. X
  1116. X34,
  1117. X0,
  1118. X
  1119. X34,
  1120. X0,
  1121. X
  1122. X34,
  1123. X0,
  1124. X
  1125. X34,
  1126. X0,
  1127. X
  1128. X34,
  1129. X0,
  1130. X
  1131. X34,
  1132. X0,
  1133. X
  1134. X34,
  1135. X0,
  1136. X
  1137. X34,
  1138. X0,
  1139. X
  1140. X34,
  1141. X0,
  1142. X
  1143. X34,
  1144. X0,
  1145. X
  1146. X34,
  1147. X0,
  1148. X
  1149. X34,
  1150. X0,
  1151. X
  1152. X34,
  1153. X0,
  1154. X
  1155. X34,
  1156. X0,
  1157. X
  1158. X34,
  1159. X0,
  1160. X
  1161. X34,
  1162. X0,
  1163. X
  1164. X34,
  1165. X0,
  1166. X
  1167. X34,
  1168. X0,
  1169. X
  1170. X33,
  1171. X0,
  1172. X
  1173. X30,
  1174. X0,
  1175. X
  1176. X29,
  1177. X0,
  1178. X
  1179. X2,
  1180. X0,
  1181. X
  1182. X31,
  1183. X0,
  1184. X
  1185. X3,
  1186. X0,
  1187. X
  1188. X14,
  1189. X0,
  1190. X
  1191. X4,
  1192. X0,
  1193. X
  1194. X25,
  1195. X0,
  1196. X
  1197. X6,
  1198. X0,
  1199. X
  1200. X5,
  1201. X0,
  1202. X
  1203. X23,
  1204. X0,
  1205. X
  1206. X20,
  1207. X0,
  1208. X
  1209. X8,
  1210. X0,
  1211. X
  1212. X1,
  1213. X0,
  1214. X
  1215. X22,
  1216. X0,
  1217. X
  1218. X15,
  1219. X0,
  1220. X
  1221. X21,
  1222. X0,
  1223. X
  1224. X7,
  1225. X0,
  1226. X
  1227. X19,
  1228. X0,
  1229. X
  1230. X13,
  1231. X0,
  1232. X
  1233. X26,
  1234. X0,
  1235. X
  1236. X16,
  1237. X0,
  1238. X
  1239. X12,
  1240. X0,
  1241. X
  1242. X11,
  1243. X0,
  1244. X
  1245. X9,
  1246. X0,
  1247. X
  1248. X17,
  1249. X0,
  1250. X
  1251. X18,
  1252. X0,
  1253. X
  1254. X27,
  1255. X0,
  1256. X
  1257. X28,
  1258. X0,
  1259. X
  1260. X24,
  1261. X0,
  1262. X
  1263. X10,
  1264. X0,
  1265. X0};
  1266. X# define YYTYPE int
  1267. Xstruct yywork { YYTYPE verify, advance; } yycrank[] = {
  1268. X0,0,    0,0,    1,3,    0,0,    
  1269. X0,0,    0,0,    6,29,    0,0,    
  1270. X27,54,    0,0,    1,4,    1,5,    
  1271. X0,0,    4,28,    6,29,    6,29,    
  1272. X27,54,    27,55,    0,0,    0,0,    
  1273. X0,0,    0,0,    0,0,    0,0,    
  1274. X0,0,    0,0,    0,0,    0,0,    
  1275. X0,0,    0,0,    0,0,    0,0,    
  1276. X0,0,    0,0,    0,0,    1,6,    
  1277. X4,28,    0,0,    0,0,    6,30,    
  1278. X0,0,    27,54,    0,0,    0,0,    
  1279. X0,0,    0,0,    1,7,    0,0,    
  1280. X0,0,    0,0,    6,29,    0,0,    
  1281. X27,54,    0,0,    0,0,    0,0,    
  1282. X0,0,    2,27,    0,0,    0,0,    
  1283. X0,0,    0,0,    0,0,    0,0,    
  1284. X0,0,    0,0,    1,8,    1,9,    
  1285. X1,10,    1,11,    1,12,    13,38,    
  1286. X33,57,    10,34,    32,56,    34,58,    
  1287. X11,35,    1,13,    8,32,    12,37,    
  1288. X15,40,    1,14,    36,60,    1,15,    
  1289. X9,33,    14,39,    35,59,    2,8,    
  1290. X2,9,    2,10,    2,11,    2,12,    
  1291. X11,36,    37,61,    38,62,    39,63,    
  1292. X40,64,    0,0,    2,13,    19,44,    
  1293. X1,16,    1,17,    2,14,    18,43,    
  1294. X2,15,    1,18,    16,41,    20,45,    
  1295. X41,65,    1,19,    1,20,    1,21,    
  1296. X17,42,    1,22,    21,46,    1,23,    
  1297. X1,24,    1,25,    1,26,    22,48,    
  1298. X23,49,    2,16,    2,17,    24,50,    
  1299. X21,47,    25,51,    2,18,    26,52,    
  1300. X42,66,    26,53,    2,19,    2,20,    
  1301. X2,21,    43,67,    2,22,    44,68,    
  1302. X2,23,    2,24,    2,25,    2,26,    
  1303. X7,31,    45,69,    46,70,    7,31,    
  1304. X7,31,    7,31,    7,31,    7,31,    
  1305. X7,31,    7,31,    7,31,    7,31,    
  1306. X7,31,    47,71,    48,73,    47,72,    
  1307. X49,74,    50,75,    51,76,    52,77,    
  1308. X56,78,    57,79,    58,80,    59,81,    
  1309. X60,82,    61,83,    62,84,    63,86,    
  1310. X64,87,    65,89,    62,85,    66,90,    
  1311. X67,91,    68,92,    69,93,    70,94,    
  1312. X71,95,    64,88,    72,97,    73,98,    
  1313. X74,99,    75,100,    76,101,    77,102,    
  1314. X78,103,    79,104,    80,105,    81,106,    
  1315. X82,107,    83,108,    84,109,    85,110,    
  1316. X86,111,    71,96,    87,112,    88,113,    
  1317. X89,114,    91,115,    92,116,    93,117,    
  1318. X94,118,    95,119,    96,120,    97,121,    
  1319. X98,122,    99,123,    100,124,    102,125,    
  1320. X103,126,    104,127,    105,128,    106,130,    
  1321. X107,131,    109,132,    110,133,    111,134,    
  1322. X112,135,    113,136,    114,137,    115,138,    
  1323. X105,129,    116,139,    117,140,    118,141,    
  1324. X119,142,    121,143,    122,144,    123,145,    
  1325. X125,146,    126,147,    128,148,    129,149,    
  1326. X130,150,    131,151,    132,152,    133,153,    
  1327. X134,154,    135,155,    136,156,    137,157,    
  1328. X138,158,    140,159,    141,160,    142,161,    
  1329. X143,162,    145,163,    146,164,    147,165,    
  1330. X148,166,    149,167,    150,168,    152,169,    
  1331. X153,170,    154,171,    155,172,    156,173,    
  1332. X159,174,    163,175,    164,176,    165,177,    
  1333. X166,178,    167,179,    168,180,    170,181,    
  1334. X171,182,    172,183,    175,184,    176,185,    
  1335. X178,186,    179,187,    180,188,    183,189,    
  1336. X186,190,    188,191,    0,0,    0,0,    
  1337. X0,0};
  1338. Xstruct yysvf yysvec[] = {
  1339. X0,    0,    0,
  1340. Xyycrank+-1,    0,        0,    
  1341. Xyycrank+-22,    yysvec+1,    0,    
  1342. Xyycrank+0,    0,        yyvstop+1,
  1343. Xyycrank+4,    0,        yyvstop+3,
  1344. Xyycrank+0,    0,        yyvstop+6,
  1345. Xyycrank+-5,    0,        yyvstop+8,
  1346. Xyycrank+95,    0,        yyvstop+10,
  1347. Xyycrank+2,    0,        yyvstop+13,
  1348. Xyycrank+2,    0,        yyvstop+15,
  1349. Xyycrank+1,    0,        yyvstop+17,
  1350. Xyycrank+7,    0,        yyvstop+19,
  1351. Xyycrank+1,    0,        yyvstop+21,
  1352. Xyycrank+2,    0,        yyvstop+23,
  1353. Xyycrank+3,    0,        yyvstop+25,
  1354. Xyycrank+2,    0,        yyvstop+27,
  1355. Xyycrank+2,    0,        yyvstop+29,
  1356. Xyycrank+1,    0,        yyvstop+31,
  1357. Xyycrank+2,    0,        yyvstop+33,
  1358. Xyycrank+2,    0,        yyvstop+35,
  1359. Xyycrank+10,    0,        yyvstop+37,
  1360. Xyycrank+13,    0,        yyvstop+39,
  1361. Xyycrank+8,    0,        yyvstop+41,
  1362. Xyycrank+9,    0,        yyvstop+43,
  1363. Xyycrank+7,    0,        yyvstop+45,
  1364. Xyycrank+14,    0,        yyvstop+47,
  1365. Xyycrank+17,    0,        yyvstop+49,
  1366. Xyycrank+-7,    0,        yyvstop+51,
  1367. Xyycrank+0,    yysvec+4,    yyvstop+53,
  1368. Xyycrank+0,    yysvec+6,    0,    
  1369. Xyycrank+0,    0,        yyvstop+55,
  1370. Xyycrank+0,    yysvec+7,    yyvstop+57,
  1371. Xyycrank+1,    0,        0,    
  1372. Xyycrank+7,    0,        0,    
  1373. Xyycrank+10,    0,        0,    
  1374. Xyycrank+3,    0,        0,    
  1375. Xyycrank+4,    0,        0,    
  1376. Xyycrank+9,    0,        0,    
  1377. Xyycrank+8,    0,        0,    
  1378. Xyycrank+16,    0,        0,    
  1379. Xyycrank+28,    0,        0,    
  1380. Xyycrank+11,    0,        0,    
  1381. Xyycrank+9,    0,        0,    
  1382. Xyycrank+25,    0,        0,    
  1383. Xyycrank+16,    0,        0,    
  1384. Xyycrank+19,    0,        0,    
  1385. Xyycrank+25,    0,        0,    
  1386. Xyycrank+58,    0,        0,    
  1387. Xyycrank+40,    0,        0,    
  1388. Xyycrank+53,    0,        0,    
  1389. Xyycrank+60,    0,        0,    
  1390. Xyycrank+39,    0,        0,    
  1391. Xyycrank+62,    0,        0,    
  1392. Xyycrank+0,    0,        yyvstop+59,
  1393. Xyycrank+0,    yysvec+27,    0,    
  1394. Xyycrank+0,    0,        yyvstop+61,
  1395. Xyycrank+89,    0,        0,    
  1396. Xyycrank+83,    0,        0,    
  1397. Xyycrank+89,    0,        0,    
  1398. Xyycrank+96,    0,        0,    
  1399. Xyycrank+93,    0,        0,    
  1400. Xyycrank+83,    0,        0,    
  1401. Xyycrank+101,    0,        0,    
  1402. Xyycrank+83,    0,        0,    
  1403. Xyycrank+101,    0,        0,    
  1404. Xyycrank+58,    0,        0,    
  1405. Xyycrank+61,    0,        0,    
  1406. Xyycrank+64,    0,        0,    
  1407. Xyycrank+71,    0,        0,    
  1408. Xyycrank+73,    0,        0,    
  1409. Xyycrank+59,    0,        0,    
  1410. Xyycrank+76,    0,        0,    
  1411. Xyycrank+70,    0,        0,    
  1412. Xyycrank+63,    0,        0,    
  1413. Xyycrank+63,    0,        0,    
  1414. Xyycrank+76,    0,        0,    
  1415. Xyycrank+72,    0,        0,    
  1416. Xyycrank+75,    0,        0,    
  1417. Xyycrank+106,    0,        0,    
  1418. Xyycrank+118,    0,        0,    
  1419. Xyycrank+108,    0,        0,    
  1420. Xyycrank+105,    0,        0,    
  1421. Xyycrank+119,    0,        0,    
  1422. Xyycrank+100,    0,        0,    
  1423. Xyycrank+114,    0,        0,    
  1424. Xyycrank+115,    0,        0,    
  1425. Xyycrank+113,    0,        0,    
  1426. Xyycrank+122,    0,        0,    
  1427. Xyycrank+126,    0,        0,    
  1428. Xyycrank+80,    0,        0,    
  1429. Xyycrank+0,    0,        yyvstop+63,
  1430. Xyycrank+92,    0,        0,    
  1431. Xyycrank+81,    0,        0,    
  1432. Xyycrank+91,    0,        0,    
  1433. Xyycrank+86,    0,        0,    
  1434. Xyycrank+90,    0,        0,    
  1435. Xyycrank+90,    0,        0,    
  1436. Xyycrank+98,    0,        0,    
  1437. Xyycrank+107,    0,        0,    
  1438. Xyycrank+104,    0,        0,    
  1439. Xyycrank+92,    0,        0,    
  1440. Xyycrank+0,    0,        yyvstop+65,
  1441. Xyycrank+102,    0,        0,    
  1442. Xyycrank+131,    0,        0,    
  1443. Xyycrank+137,    0,        0,    
  1444. Xyycrank+144,    0,        0,    
  1445. Xyycrank+138,    0,        0,    
  1446. Xyycrank+133,    0,        0,    
  1447. Xyycrank+0,    0,        yyvstop+67,
  1448. Xyycrank+140,    0,        0,    
  1449. Xyycrank+146,    0,        yyvstop+69,
  1450. Xyycrank+145,    0,        0,    
  1451. Xyycrank+140,    0,        0,    
  1452. Xyycrank+131,    0,        0,    
  1453. Xyycrank+113,    0,        0,    
  1454. Xyycrank+104,    0,        0,    
  1455. Xyycrank+113,    0,        0,    
  1456. Xyycrank+117,    0,        0,    
  1457. Xyycrank+126,    0,        0,    
  1458. Xyycrank+105,    0,        0,    
  1459. Xyycrank+0,    0,        yyvstop+71,
  1460. Xyycrank+122,    0,        0,    
  1461. Xyycrank+118,    0,        0,    
  1462. Xyycrank+119,    0,        0,    
  1463. Xyycrank+0,    0,        yyvstop+73,
  1464. Xyycrank+125,    0,        0,    
  1465. Xyycrank+160,    0,        0,    
  1466. Xyycrank+0,    0,        yyvstop+75,
  1467. Xyycrank+148,    0,        0,    
  1468. Xyycrank+162,    0,        0,    
  1469. Xyycrank+152,    0,        0,    
  1470. Xyycrank+155,    0,        0,    
  1471. Xyycrank+163,    0,        0,    
  1472. Xyycrank+166,    0,        0,    
  1473. Xyycrank+163,    0,        0,    
  1474. Xyycrank+168,    0,        0,    
  1475. Xyycrank+169,    0,        0,    
  1476. Xyycrank+140,    0,        0,    
  1477. Xyycrank+136,    0,        0,    
  1478. Xyycrank+0,    0,        yyvstop+77,
  1479. Xyycrank+134,    0,        0,    
  1480. Xyycrank+134,    0,        0,    
  1481. Xyycrank+133,    0,        0,    
  1482. Xyycrank+134,    0,        0,    
  1483. Xyycrank+0,    0,        yyvstop+79,
  1484. Xyycrank+140,    0,        0,    
  1485. Xyycrank+136,    0,        0,    
  1486. Xyycrank+169,    0,        0,    
  1487. Xyycrank+183,    0,        0,    
  1488. Xyycrank+163,    0,        0,    
  1489. Xyycrank+166,    0,        0,    
  1490. Xyycrank+0,    0,        yyvstop+81,
  1491. Xyycrank+173,    0,        0,    
  1492. Xyycrank+169,    0,        0,    
  1493. Xyycrank+177,    0,        0,    
  1494. Xyycrank+168,    0,        0,    
  1495. Xyycrank+179,    0,        0,    
  1496. Xyycrank+0,    0,        yyvstop+83,
  1497. Xyycrank+0,    0,        yyvstop+85,
  1498. Xyycrank+155,    0,        0,    
  1499. Xyycrank+0,    0,        yyvstop+87,
  1500. Xyycrank+0,    0,        yyvstop+89,
  1501. Xyycrank+0,    0,        yyvstop+91,
  1502. Xyycrank+150,    0,        0,    
  1503. Xyycrank+157,    0,        0,    
  1504. Xyycrank+175,    0,        0,    
  1505. Xyycrank+182,    0,        0,    
  1506. Xyycrank+192,    0,        0,    
  1507. Xyycrank+189,    0,        0,    
  1508. Xyycrank+0,    0,        yyvstop+93,
  1509. Xyycrank+196,    0,        0,    
  1510. Xyycrank+195,    0,        0,    
  1511. Xyycrank+196,    0,        0,    
  1512. Xyycrank+0,    0,        yyvstop+95,
  1513. Xyycrank+0,    0,        yyvstop+97,
  1514. Xyycrank+165,    0,        0,    
  1515. Xyycrank+167,    0,        0,    
  1516. Xyycrank+0,    0,        yyvstop+99,
  1517. Xyycrank+201,    0,        0,    
  1518. Xyycrank+193,    0,        0,    
  1519. Xyycrank+191,    0,        0,    
  1520. Xyycrank+0,    0,        yyvstop+101,
  1521. Xyycrank+0,    0,        yyvstop+103,
  1522. Xyycrank+195,    0,        0,    
  1523. Xyycrank+0,    0,        yyvstop+105,
  1524. Xyycrank+0,    0,        yyvstop+107,
  1525. Xyycrank+200,    0,        0,    
  1526. Xyycrank+0,    0,        yyvstop+109,
  1527. Xyycrank+195,    0,        0,    
  1528. Xyycrank+0,    0,        yyvstop+111,
  1529. Xyycrank+0,    0,        yyvstop+113,
  1530. Xyycrank+0,    0,        yyvstop+115,
  1531. X0,    0,    0};
  1532. Xstruct yywork *yytop = yycrank+273;
  1533. Xstruct yysvf *yybgin = yysvec+1;
  1534. Xchar yymatch[] = {
  1535. X00  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  1536. X01  ,011 ,012 ,01  ,01  ,01  ,01  ,01  ,
  1537. X01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  1538. X01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  1539. X011 ,01  ,'"' ,01  ,01  ,01  ,01  ,01  ,
  1540. X01  ,01  ,01  ,01  ,01  ,'-' ,01  ,01  ,
  1541. X'-' ,'-' ,'-' ,'-' ,'-' ,'-' ,'-' ,'-' ,
  1542. X'-' ,'-' ,01  ,01  ,01  ,01  ,01  ,01  ,
  1543. X01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  1544. X01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  1545. X01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  1546. X01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  1547. X01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  1548. X01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  1549. X01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  1550. X01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  1551. X0};
  1552. Xchar yyextra[] = {
  1553. X0,0,0,0,0,0,0,0,
  1554. X0,0,0,0,0,0,0,0,
  1555. X0,0,0,0,0,0,0,0,
  1556. X0,0,0,0,0,0,0,0,
  1557. X0,0,0,0,0,0,0,0,
  1558. X0};
  1559. X#ifndef lint
  1560. Xstatic    char ncform_sccsid[] = "@(#)ncform 1.6 88/02/08 SMI"; /* from S5R2 1.2 */
  1561. X#endif
  1562. X
  1563. Xint yylineno =1;
  1564. X# define YYU(x) x
  1565. X# define NLSTATE yyprevious=YYNEWLINE
  1566. Xchar yytext[YYLMAX];
  1567. Xstruct yysvf *yylstate [YYLMAX], **yylsp, **yyolsp;
  1568. Xchar yysbuf[YYLMAX];
  1569. Xchar *yysptr = yysbuf;
  1570. Xint *yyfnd;
  1571. Xextern struct yysvf *yyestate;
  1572. Xint yyprevious = YYNEWLINE;
  1573. Xyylook(){
  1574. X    register struct yysvf *yystate, **lsp;
  1575. X    register struct yywork *yyt;
  1576. X    struct yysvf *yyz;
  1577. X    int yych, yyfirst;
  1578. X    struct yywork *yyr;
  1579. X# ifdef LEXDEBUG
  1580. X    int debug;
  1581. X# endif
  1582. X    char *yylastch;
  1583. X    /* start off machines */
  1584. X# ifdef LEXDEBUG
  1585. X    debug = 0;
  1586. X# endif
  1587. X    yyfirst=1;
  1588. X    if (!yymorfg)
  1589. X        yylastch = yytext;
  1590. X    else {
  1591. X        yymorfg=0;
  1592. X        yylastch = yytext+yyleng;
  1593. X        }
  1594. X    for(;;){
  1595. X        lsp = yylstate;
  1596. X        yyestate = yystate = yybgin;
  1597. X        if (yyprevious==YYNEWLINE) yystate++;
  1598. X        for (;;){
  1599. X# ifdef LEXDEBUG
  1600. X            if(debug)fprintf(yyout,"state %d\n",yystate-yysvec-1);
  1601. X# endif
  1602. X            yyt = yystate->yystoff;
  1603. X            if(yyt == yycrank && !yyfirst){  /* may not be any transitions */
  1604. X                yyz = yystate->yyother;
  1605. X                if(yyz == 0)break;
  1606. X                if(yyz->yystoff == yycrank)break;
  1607. X                }
  1608. X            *yylastch++ = yych = input();
  1609. X            yyfirst=0;
  1610. X        tryagain:
  1611. X# ifdef LEXDEBUG
  1612. X            if(debug){
  1613. X                fprintf(yyout,"char ");
  1614. X                allprint(yych);
  1615. X                putchar('\n');
  1616. X                }
  1617. X# endif
  1618. X            yyr = yyt;
  1619. X            if ( (int)yyt > (int)yycrank){
  1620. X                yyt = yyr + yych;
  1621. X                if (yyt <= yytop && yyt->verify+yysvec == yystate){
  1622. X                    if(yyt->advance+yysvec == YYLERR)    /* error transitions */
  1623. X                        {unput(*--yylastch);break;}
  1624. X                    *lsp++ = yystate = yyt->advance+yysvec;
  1625. X                    goto contin;
  1626. X                    }
  1627. X                }
  1628. X# ifdef YYOPTIM
  1629. X            else if((int)yyt < (int)yycrank) {        /* r < yycrank */
  1630. X                yyt = yyr = yycrank+(yycrank-yyt);
  1631. X# ifdef LEXDEBUG
  1632. X                if(debug)fprintf(yyout,"compressed state\n");
  1633. X# endif
  1634. X                yyt = yyt + yych;
  1635. X                if(yyt <= yytop && yyt->verify+yysvec == yystate){
  1636. X                    if(yyt->advance+yysvec == YYLERR)    /* error transitions */
  1637. X                        {unput(*--yylastch);break;}
  1638. X                    *lsp++ = yystate = yyt->advance+yysvec;
  1639. X                    goto contin;
  1640. X                    }
  1641. X                yyt = yyr + YYU(yymatch[yych]);
  1642. X# ifdef LEXDEBUG
  1643. X                if(debug){
  1644. X                    fprintf(yyout,"try fall back character ");
  1645. X                    allprint(YYU(yymatch[yych]));
  1646. X                    putchar('\n');
  1647. X                    }
  1648. X# endif
  1649. X                if(yyt <= yytop && yyt->verify+yysvec == yystate){
  1650. X                    if(yyt->advance+yysvec == YYLERR)    /* error transition */
  1651. X                        {unput(*--yylastch);break;}
  1652. X                    *lsp++ = yystate = yyt->advance+yysvec;
  1653. X                    goto contin;
  1654. X                    }
  1655. X                }
  1656. X            if ((yystate = yystate->yyother) && (yyt= yystate->yystoff) != yycrank){
  1657. X# ifdef LEXDEBUG
  1658. X                if(debug)fprintf(yyout,"fall back to state %d\n",yystate-yysvec-1);
  1659. X# endif
  1660. X                goto tryagain;
  1661. X                }
  1662. X# endif
  1663. X            else
  1664. X                {unput(*--yylastch);break;}
  1665. X        contin:
  1666. X# ifdef LEXDEBUG
  1667. X            if(debug){
  1668. X                fprintf(yyout,"state %d char ",yystate-yysvec-1);
  1669. X                allprint(yych);
  1670. X                putchar('\n');
  1671. X                }
  1672. X# endif
  1673. X            ;
  1674. X            }
  1675. X# ifdef LEXDEBUG
  1676. X        if(debug){
  1677. X            fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1);
  1678. X            allprint(yych);
  1679. X            putchar('\n');
  1680. X            }
  1681. X# endif
  1682. X        while (lsp-- > yylstate){
  1683. X            *yylastch-- = 0;
  1684. X            if (*lsp != 0 && (yyfnd= (*lsp)->yystops) && *yyfnd > 0){
  1685. X                yyolsp = lsp;
  1686. X                if(yyextra[*yyfnd]){        /* must backup */
  1687. X                    while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate){
  1688. X                        lsp--;
  1689. X                        unput(*yylastch--);
  1690. X                        }
  1691. X                    }
  1692. X                yyprevious = YYU(*yylastch);
  1693. X                yylsp = lsp;
  1694. X                yyleng = yylastch-yytext+1;
  1695. X                yytext[yyleng] = 0;
  1696. X# ifdef LEXDEBUG
  1697. X                if(debug){
  1698. X                    fprintf(yyout,"\nmatch ");
  1699. X                    sprint(yytext);
  1700. X                    fprintf(yyout," action %d\n",*yyfnd);
  1701. X                    }
  1702. X# endif
  1703. X                return(*yyfnd++);
  1704. X                }
  1705. X            unput(*yylastch);
  1706. X            }
  1707. X        if (yytext[0] == 0  /* && feof(yyin) */)
  1708. X            {
  1709. X            yysptr=yysbuf;
  1710. X            return(0);
  1711. X            }
  1712. X        yyprevious = yytext[0] = input();
  1713. X        if (yyprevious>0)
  1714. X            output(yyprevious);
  1715. X        yylastch=yytext;
  1716. X# ifdef LEXDEBUG
  1717. X        if(debug)putchar('\n');
  1718. X# endif
  1719. X        }
  1720. X    }
  1721. Xyyback(p, m)
  1722. X    int *p;
  1723. X{
  1724. Xif (p==0) return(0);
  1725. Xwhile (*p)
  1726. X    {
  1727. X    if (*p++ == m)
  1728. X        return(1);
  1729. X    }
  1730. Xreturn(0);
  1731. X}
  1732. X    /* the following are only used in the lex library */
  1733. Xyyinput(){
  1734. X    return(input());
  1735. X    }
  1736. Xyyoutput(c)
  1737. X  int c; {
  1738. X    output(c);
  1739. X    }
  1740. Xyyunput(c)
  1741. X   int c; {
  1742. X    unput(c);
  1743. X    }
  1744. END_OF_FILE
  1745. if test 17477 -ne `wc -c <'sys/share/dgn_lex.c'`; then
  1746.     echo shar: \"'sys/share/dgn_lex.c'\" unpacked with wrong size!
  1747. fi
  1748. # end of 'sys/share/dgn_lex.c'
  1749. fi
  1750. echo shar: End of archive 84 \(of 108\).
  1751. cp /dev/null ark84isdone
  1752. MISSING=""
  1753. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 \
  1754. 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 \
  1755. 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 \
  1756. 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 \
  1757. 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 \
  1758. 101 102 103 104 105 106 107 108 ; do
  1759.     if test ! -f ark${I}isdone ; then
  1760.     MISSING="${MISSING} ${I}"
  1761.     fi
  1762. done
  1763. if test "${MISSING}" = "" ; then
  1764.     echo You have unpacked all 108 archives.
  1765.     echo "Now execute 'rebuild.sh'"
  1766.     rm -f ark10[0-8]isdone ark[1-9]isdone ark[1-9][0-9]isdone
  1767. else
  1768.     echo You still need to unpack the following archives:
  1769.     echo "        " ${MISSING}
  1770. fi
  1771. ##  End of shell archive.
  1772. exit 0
  1773.