home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mitsch75.zip / scheme-7_5_17-src.zip / scheme-7.5.17 / src / microcode / errors.h < prev    next >
C/C++ Source or Header  |  2001-03-08  |  10KB  |  274 lines

  1. /* -*-C-*-
  2.  
  3. $Id: errors.h,v 9.43 2001/03/08 17:03:30 cph Exp $
  4.  
  5. Copyright (c) 1987-2001 Massachusetts Institute of Technology
  6.  
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or (at
  10. your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful, but
  13. WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15. General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21.  
  22. /* Error and termination code declarations. */
  23.  
  24. #ifndef SCM_ERRORS_H
  25. #define SCM_ERRORS_H
  26.  
  27. /* All error and termination codes must be positive
  28.  * to allow primitives to return either an error code
  29.  * or a primitive flow control value (see const.h)
  30.  */
  31.  
  32. #define ERR_BAD_ERROR_CODE            0x00
  33. #define ERR_UNBOUND_VARIABLE            0x01
  34. #define ERR_UNASSIGNED_VARIABLE            0x02
  35. #define ERR_INAPPLICABLE_OBJECT            0x03
  36. #define ERR_IN_SYSTEM_CALL            0x04
  37. #define ERR_WITH_ARGUMENT            0x05
  38. #define ERR_BAD_FRAME                0x06
  39. #define ERR_BROKEN_COMPILED_VARIABLE        0x07
  40. #define ERR_UNDEFINED_USER_TYPE            0x08
  41. #define ERR_UNDEFINED_PRIMITIVE            0x09
  42. #define ERR_EXTERNAL_RETURN            0x0A
  43. #define ERR_EXECUTE_MANIFEST_VECTOR        0x0B
  44. #define ERR_WRONG_NUMBER_OF_ARGUMENTS        0x0C
  45. #define ERR_ARG_1_WRONG_TYPE            0x0D
  46. #define ERR_ARG_2_WRONG_TYPE            0x0E
  47. #define ERR_ARG_3_WRONG_TYPE            0x0F
  48. #define ERR_ARG_1_BAD_RANGE            0x10
  49. #define ERR_ARG_2_BAD_RANGE            0x11
  50. #define ERR_ARG_3_BAD_RANGE            0x12
  51. /* #define ERR_BAD_COMBINATION            0x13 */
  52. /* #define ERR_FASDUMP_OVERFLOW            0x14 */
  53. #define ERR_BAD_INTERRUPT_CODE            0x15 /* Not generated */
  54. /* #define ERR_NO_ERRORS            0x16 */
  55. #define ERR_FASL_FILE_TOO_BIG            0x17
  56. #define ERR_FASL_FILE_BAD_DATA            0x18
  57. #define ERR_IMPURIFY_OUT_OF_SPACE        0x19
  58.  
  59. /* The following do not exist in the 68000 version */
  60. #define ERR_WRITE_INTO_PURE_SPACE        0x1A
  61. /* #define ERR_LOSING_SPARE_HEAP        0x1B */
  62. /* #define ERR_NO_HASH_TABLE            0x1C */
  63. #define ERR_BAD_SET                             0x1D
  64. #define ERR_ARG_1_FAILED_COERCION              0x1E
  65. #define ERR_ARG_2_FAILED_COERCION              0x1F
  66. #define ERR_OUT_OF_FILE_HANDLES            0x20
  67. /* #define ERR_SHELL_DIED            0x21 */
  68.  
  69. /* Late additions to both 68000 and C world */
  70. #define ERR_ARG_4_BAD_RANGE            0x22
  71. #define ERR_ARG_5_BAD_RANGE            0x23
  72. #define ERR_ARG_6_BAD_RANGE            0x24
  73. #define ERR_ARG_7_BAD_RANGE            0x25
  74. #define ERR_ARG_8_BAD_RANGE            0x26
  75. #define ERR_ARG_9_BAD_RANGE            0x27
  76. #define ERR_ARG_10_BAD_RANGE            0x28
  77. #define ERR_ARG_4_WRONG_TYPE            0x29
  78. #define ERR_ARG_5_WRONG_TYPE            0x2A
  79. #define ERR_ARG_6_WRONG_TYPE            0x2B
  80. #define ERR_ARG_7_WRONG_TYPE            0x2C
  81. #define ERR_ARG_8_WRONG_TYPE            0x2D
  82. #define ERR_ARG_9_WRONG_TYPE            0x2E
  83. #define ERR_ARG_10_WRONG_TYPE            0x2F
  84. #define ERR_INAPPLICABLE_CONTINUATION        0x30
  85. #define ERR_COMPILED_CODE_ERROR            0x31
  86. #define ERR_FLOATING_OVERFLOW            0x32
  87. #define ERR_UNIMPLEMENTED_PRIMITIVE        0x33
  88. #define ERR_ILLEGAL_REFERENCE_TRAP        0x34
  89. #define ERR_BROKEN_VARIABLE_CACHE        0x35
  90. #define ERR_WRONG_ARITY_PRIMITIVES        0x36
  91. #define ERR_IO_ERROR                0x37
  92. #define ERR_FASDUMP_ENVIRONMENT            0x38
  93. #define ERR_FASLOAD_BAND            0x39
  94. #define ERR_FASLOAD_COMPILED_MISMATCH        0x3A
  95. #define ERR_UNKNOWN_PRIMITIVE_CONTINUATION    0x3B
  96. #define ERR_ILLEGAL_CONTINUATION        0x3C
  97. #define ERR_STACK_HAS_SLIPPED            0x3D
  98. #define ERR_CANNOT_RECURSE            0x3E
  99.  
  100. /*
  101.   If you add any error codes here, add them to
  102.   the table below and to utabmd.scm as well.
  103.  */
  104.  
  105. #define MAX_ERROR                0x3E
  106.  
  107. #define ERROR_NAME_TABLE                        \
  108. {                                    \
  109. /* 0x00 */        "BAD-ERROR-CODE",                \
  110. /* 0x01 */        "UNBOUND-VARIABLE",                \
  111. /* 0x02 */        "UNASSIGNED-VARIABLE",                \
  112. /* 0x03 */        "INAPPLICABLE-OBJECT",                \
  113. /* 0x04 */        "OUT-OF-HASH-NUMBERS",                \
  114. /* 0x05 */        "ENVIRONMENT-CHAIN-TOO-DEEP",            \
  115. /* 0x06 */        "BAD-FRAME",                    \
  116. /* 0x07 */        "BROKEN-COMPILED-VARIABLE",            \
  117. /* 0x08 */        "UNDEFINED-USER-TYPE",                \
  118. /* 0x09 */        "UNDEFINED-PRIMITIVE",                \
  119. /* 0x0A */        "EXTERNAL-RETURN",                \
  120. /* 0x0B */        "EXECUTE-MANIFEST-VECTOR",            \
  121. /* 0x0C */        "WRONG-NUMBER-OF-ARGUMENTS",            \
  122. /* 0x0D */        "ARG-1-WRONG-TYPE",                \
  123. /* 0x0E */        "ARG-2-WRONG-TYPE",                \
  124. /* 0x0F */        "ARG-3-WRONG-TYPE",                \
  125. /* 0x10 */        "ARG-1-BAD-RANGE",                \
  126. /* 0x11 */        "ARG-2-BAD-RANGE",                \
  127. /* 0x12 */        "ARG-3-BAD-RANGE",                \
  128. /* 0x13 */        "BAD-COMBINATION",                \
  129. /* 0x14 */        "FASDUMP-OVERFLOW",                \
  130. /* 0x15 */        "BAD-INTERRUPT-CODE",                \
  131. /* 0x16 */        "NO-ERRORS",                    \
  132. /* 0x17 */        "FASL-FILE-TOO-BIG",                \
  133. /* 0x18 */        "FASL-FILE-BAD-DATA",                \
  134. /* 0x19 */        "IMPURIFY-OUT-OF-SPACE",            \
  135. /* 0x1A */        "WRITE-INTO-PURE-SPACE",            \
  136. /* 0x1B */        "LOSING-SPARE-HEAP",                \
  137. /* 0x1C */        "NO-HASH-TABLE",                \
  138. /* 0x1D */        "BAD-SET",                    \
  139. /* 0x1E */        "ARG-1-FAILED-COERCION",            \
  140. /* 0x1F */        "ARG-2-FAILED-COERCION",            \
  141. /* 0x20 */        "OUT-OF-FILE-HANDLES",                \
  142. /* 0x21 */        "SHELL-DIED",                    \
  143. /* 0x22 */        "ARG-4-BAD-RANGE",                \
  144. /* 0x23 */        "ARG-5-BAD-RANGE",                \
  145. /* 0x24 */        "ARG-6-BAD-RANGE",                \
  146. /* 0x25 */        "ARG-7-BAD-RANGE",                \
  147. /* 0x26 */        "ARG-8-BAD-RANGE",                \
  148. /* 0x27 */        "ARG-9-BAD-RANGE",                \
  149. /* 0x28 */        "ARG-10-BAD-RANGE",                \
  150. /* 0x29 */        "ARG-4-WRONG-TYPE",                \
  151. /* 0x2A */        "ARG-5-WRONG-TYPE",                \
  152. /* 0x2B */        "ARG-6-WRONG-TYPE",                \
  153. /* 0x2C */        "ARG-7-WRONG-TYPE",                \
  154. /* 0x2D */        "ARG-8-WRONG-TYPE",                \
  155. /* 0x2E */        "ARG-9-WRONG-TYPE",                \
  156. /* 0x2F */        "ARG-10-WRONG-TYPE",                \
  157. /* 0x30 */        "INAPPLICABLE-CONTINUATION",            \
  158. /* 0x31 */        "COMPILED-CODE-ERROR",                \
  159. /* 0x32 */        "FLOATING-OVERFLOW",                \
  160. /* 0x33 */        "UNIMPLEMENTED-PRIMITIVE",            \
  161. /* 0x34 */        "ILLEGAL-REFERENCE-TRAP",            \
  162. /* 0x35 */        "BROKEN-VARIABLE-CACHE",            \
  163. /* 0x36 */        "WRONG-ARITY-PRIMITIVES",            \
  164. /* 0x37 */        "IO-ERROR",                    \
  165. /* 0x38 */        "FASDUMP-ENVIRONMENT",                \
  166. /* 0x39 */        "FASLOAD-BAND",                    \
  167. /* 0x3A */        "FASLOAD-COMPILED-MISMATCH",            \
  168. /* 0x3B */        "UNKNOWN-PRIMITIVE-CONTINUATION",        \
  169. /* 0x3C */        "ILLEGAL-CONTINUATION",                \
  170. /* 0x3D */        "STACK-HAS-SLIPPED",                \
  171. /* 0x3E */        "CANNOT-RECURSE"                \
  172. }
  173.  
  174. /* Termination codes: the interpreter halts on these */
  175.  
  176. #define TERM_HALT                0x00
  177. #define TERM_DISK_RESTORE            0x01
  178. #define TERM_BROKEN_HEART            0x02
  179. #define TERM_NON_POINTER_RELOCATION        0x03
  180. #define TERM_BAD_ROOT                0x04
  181. #define TERM_NON_EXISTENT_CONTINUATION        0x05
  182. #define TERM_BAD_STACK                0x06
  183. #define TERM_STACK_OVERFLOW            0x07
  184. #define TERM_STACK_ALLOCATION_FAILED        0x08
  185. #define TERM_NO_ERROR_HANDLER            0x09
  186. #define TERM_NO_INTERRUPT_HANDLER        0x0A
  187. #define TERM_UNIMPLEMENTED_CONTINUATION        0x0B
  188. #define TERM_EXIT                0x0C
  189. #define TERM_BAD_PRIMITIVE_DURING_ERROR        0x0D
  190. #define TERM_EOF                0x0E
  191. #define TERM_BAD_PRIMITIVE            0x0F
  192. #define TERM_TERM_HANDLER            0x10
  193. #define TERM_END_OF_COMPUTATION            0x11
  194. #define TERM_INVALID_TYPE_CODE                  0x12
  195. #define TERM_COMPILER_DEATH            0x13
  196. #define TERM_GC_OUT_OF_SPACE            0x14
  197. #define TERM_NO_SPACE                0x15
  198. #define TERM_SIGNAL                0x16
  199. #define TERM_TOUCH                0x17
  200. #define TERM_SAVE_AND_EXIT            0x18
  201. #define TERM_TRAP                0x19
  202. #define TERM_BAD_BACK_OUT            0x1a
  203.  
  204. /*
  205.   If you add any termination codes here, add them to
  206.   the tables below as well!
  207.  */
  208.  
  209. #define MAX_TERMINATION                0x1a
  210.  
  211. #define TERM_NAME_TABLE                            \
  212. {                                    \
  213. /* 0x00 */        "HALT",                        \
  214. /* 0x01 */        "DISK-RESTORE",                    \
  215. /* 0x02 */        "BROKEN-HEART",                    \
  216. /* 0x03 */        "NON-POINTER-RELOCATION",            \
  217. /* 0x04 */        "BAD-ROOT",                    \
  218. /* 0x05 */        "NON-EXISTENT-CONTINUATION",            \
  219. /* 0x06 */        "BAD-STACK",                    \
  220. /* 0x07 */        "STACK-OVERFLOW",                \
  221. /* 0x08 */        "STACK-ALLOCATION-FAILED",            \
  222. /* 0x09 */        "NO-ERROR-HANDLER",                \
  223. /* 0x0A */        "NO-INTERRUPT-HANDLER",                \
  224. /* 0x0B */        "UNIMPLEMENTED-CONTINUATION",            \
  225. /* 0x0C */        "EXIT",                        \
  226. /* 0x0D */        "BAD-PRIMITIVE-DURING-ERROR",            \
  227. /* 0x0E */        "EOF",                        \
  228. /* 0x0F */        "BAD-PRIMITIVE",                \
  229. /* 0x10 */        "HANDLER",                    \
  230. /* 0x11 */        "END-OF-COMPUTATION",                \
  231. /* 0x12 */        "INVALID-TYPE-CODE",                \
  232. /* 0x13 */        "COMPILER-DEATH",                \
  233. /* 0x14 */        "GC-OUT-OF-SPACE",                \
  234. /* 0x15 */        "NO-SPACE",                    \
  235. /* 0x16 */        "SIGNAL",                    \
  236. /* 0x17 */        "TOUCH",                    \
  237. /* 0x18 */        "SAVE-AND-EXIT",                \
  238. /* 0x19 */        "TERM_TRAP",                    \
  239. /* 0x1a */        "BAD_BACK_OUT"                    \
  240. }
  241.  
  242. #define TERM_MESSAGE_TABLE                        \
  243. {                                    \
  244. /* 0x00 */        "Happy Happy Joy Joy",                \
  245. /* 0x01 */        "Unrecoverable error while loading a band",    \
  246. /* 0x02 */        "Broken heart encountered",            \
  247. /* 0x03 */        "Non pointer relocation",            \
  248. /* 0x04 */        "Cannot restore control state from band",    \
  249. /* 0x05 */        "Nonexistent return code",            \
  250. /* 0x06 */        "Control stack messed up",            \
  251. /* 0x07 */        "Stack overflow: Maximum recursion depth exceeded", \
  252. /* 0x08 */        "Not enough space for stack!",            \
  253. /* 0x09 */        "No error handler",                \
  254. /* 0x0A */        "No interrupt handler",                \
  255. /* 0x0B */        "Unimplemented return code",            \
  256. /* 0x0C */        "Inconsistency detected",            \
  257. /* 0x0D */        "Error during unknown primitive",        \
  258. /* 0x0E */        "End of input stream reached",            \
  259. /* 0x0F */        "Bad primitive invoked",            \
  260. /* 0x10 */        "Termination handler returned",            \
  261. /* 0x11 */        "End of computation",                \
  262. /* 0x12 */        "Unknown type encountered",            \
  263. /* 0x13 */        "Mismatch between compiled code and compiled code support", \
  264. /* 0x14 */        "Out of space after garbage collection",    \
  265. /* 0x15 */        "Out of memory: Available memory exceeded",    \
  266. /* 0x16 */        "Unhandled signal received",            \
  267. /* 0x17 */        "Touch without futures support",        \
  268. /* 0x18 */        "Halt requested by external source",        \
  269. /* 0x19 */        "User requested termination after trap",    \
  270. /* 0x1a */        "Backing out of non-primitive"            \
  271. }
  272.  
  273. #endif /* SCM_ERRORS_H */
  274.