parser.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. ! ==============================================================================
  2. ! PARSER: Front end to parser.
  3. !
  4. ! Supplied for use with Inform 6 -- Release 6/12 -- Serial number 151220
  5. !
  6. ! Copyright Graham Nelson 1993-2004 and David Griffith 2012-2015
  7. !
  8. ! This code is licensed under either the traditional Inform license as
  9. ! described by the DM4 or the Artistic License version 2.0. See the
  10. ! file COPYING in the distribution archive or at
  11. ! https://github.com/DavidGriffith/inform6lib/
  12. !
  13. ! In your game file, Include three library files in this order:
  14. ! Include "Parser";
  15. ! Include "VerbLib";
  16. ! Include "Grammar";
  17. ! ==============================================================================
  18. System_file;
  19. #Ifndef LIBRARY_STAGE; ! This file is the first one to define LIBRARY_STAGE.
  20. ! "This file already included" <=> "LIBRARY_STAGE exists"
  21. ! ------------------------------------------------------------------------------
  22. #Ifndef VN_1633;
  23. Message fatalerror "*** Library 6/12 needs Inform v6.33 or later to work ***";
  24. #Endif; ! VN_
  25. Constant LibSerial "151220";
  26. Constant LibRelease "6/12";
  27. Constant LIBRARY_VERSION 612;
  28. Constant Grammar__Version 2;
  29. Constant BEFORE_PARSER 10;
  30. Constant AFTER_PARSER 20;
  31. Constant AFTER_VERBLIB 30;
  32. Constant AFTER_GRAMMAR 40;
  33. Constant LIBRARY_STAGE = BEFORE_PARSER;
  34. Default COMMENT_CHARACTER '*';
  35. #Ifdef INFIX;
  36. Default DEBUG 0;
  37. #Endif; ! INFIX
  38. #Ifndef WORDSIZE; ! compiling with Z-code only compiler
  39. Default TARGET_ZCODE 0;
  40. Constant WORDSIZE 2;
  41. #Endif; ! WORDSIZE
  42. #Ifdef TARGET_ZCODE; ! offsets into Z-machine header
  43. Constant HDR_ZCODEVERSION $00; ! byte
  44. Constant HDR_TERPFLAGS $01; ! byte
  45. Constant HDR_GAMERELEASE $02; ! word
  46. Constant HDR_HIGHMEMORY $04; ! word
  47. Constant HDR_INITIALPC $06; ! word
  48. Constant HDR_DICTIONARY $08; ! word
  49. Constant HDR_OBJECTS $0A; ! word
  50. Constant HDR_GLOBALS $0C; ! word
  51. Constant HDR_STATICMEMORY $0E; ! word
  52. Constant HDR_GAMEFLAGS $10; ! word
  53. Constant HDR_GAMESERIAL $12; ! six ASCII characters
  54. Constant HDR_ABBREVIATIONS $18; ! word
  55. Constant HDR_FILELENGTH $1A; ! word
  56. Constant HDR_CHECKSUM $1C; ! word
  57. Constant HDR_TERPNUMBER $1E; ! byte
  58. Constant HDR_TERPVERSION $1F; ! byte
  59. Constant HDR_SCREENHLINES $20; ! byte
  60. Constant HDR_SCREENWCHARS $21; ! byte
  61. Constant HDR_SCREENWUNITS $22; ! word
  62. Constant HDR_SCREENHUNITS $24; ! word
  63. Constant HDR_FONTWUNITS $26; ! byte
  64. Constant HDR_FONTHUNITS $27; ! byte
  65. Constant HDR_ROUTINEOFFSET $28; ! word
  66. Constant HDR_STRINGOFFSET $2A; ! word
  67. Constant HDR_BGCOLOUR $2C; ! byte
  68. Constant HDR_FGCOLOUR $2D; ! byte
  69. Constant HDR_TERMCHARS $2E; ! word
  70. Constant HDR_PIXELSTO3 $30; ! word
  71. Constant HDR_TERPSTANDARD $32; ! two bytes
  72. Constant HDR_ALPHABET $34; ! word
  73. Constant HDR_EXTENSION $36; ! word
  74. Constant HDR_UNUSED $38; ! two words
  75. Constant HDR_INFORMVERSION $3C; ! four ASCII characters
  76. #Ifnot; ! TARGET_GLULX ! offsets into Glulx header and start of ROM
  77. Constant HDR_MAGICNUMBER $00; ! long word
  78. Constant HDR_GLULXVERSION $04; ! long word
  79. Constant HDR_RAMSTART $08; ! long word
  80. Constant HDR_EXTSTART $0C; ! long word
  81. Constant HDR_ENDMEM $10; ! long word
  82. Constant HDR_STACKSIZE $14; ! long word
  83. Constant HDR_STARTFUNC $18; ! long word
  84. Constant HDR_DECODINGTBL $1C; ! long word
  85. Constant HDR_CHECKSUM $20; ! long word
  86. Constant ROM_INFO $24; ! four ASCII characters
  87. Constant ROM_MEMORYLAYOUT $28; ! long word
  88. Constant ROM_INFORMVERSION $2C; ! four ASCII characters
  89. Constant ROM_COMPVERSION $30; ! four ASCII characters
  90. Constant ROM_GAMERELEASE $34; ! short word
  91. Constant ROM_GAMESERIAL $36; ! six ASCII characters
  92. #Endif; ! TARGET_
  93. Include "linklpa";
  94. Fake_Action LetGo;
  95. Fake_Action Receive;
  96. Fake_Action ThrownAt;
  97. Fake_Action Order;
  98. Fake_Action TheSame;
  99. Fake_Action PluralFound;
  100. Fake_Action ListMiscellany;
  101. Fake_Action Miscellany;
  102. Fake_Action Prompt;
  103. Fake_Action NotUnderstood;
  104. Fake_Action Going;
  105. #Ifdef NO_PLACES;
  106. Fake_Action Places;
  107. Fake_Action Objects;
  108. #Endif; ! NO_PLACES
  109. ! ------------------------------------------------------------------------------
  110. [ Main; InformLibrary.play(); ];
  111. ! ------------------------------------------------------------------------------
  112. #Ifdef USE_MODULES;
  113. Link "parserm";
  114. #Ifnot;
  115. Include "parserm";
  116. #Endif; ! USE_MODULES
  117. ! ==============================================================================
  118. Undef LIBRARY_STAGE; Constant LIBRARY_STAGE = AFTER_PARSER;
  119. #Ifnot;
  120. Message "Warning: 'parser' included twice; ignoring second inclusion. (Ignore this if this is on purpose.)";
  121. #Endif;
  122. ! ==============================================================================