| | 1 | #ifdef RCSID |
| | 2 | static char RCSid[] = |
| | 3 | "$Header$"; |
| | 4 | #endif |
| | 5 | |
| | 6 | /* |
| | 7 | * Copyright (c) 2000, 2002 Michael J. Roberts. All Rights Reserved. |
| | 8 | * |
| | 9 | * Please see the accompanying license file, LICENSE.TXT, for information |
| | 10 | * on using and copying this software. |
| | 11 | */ |
| | 12 | /* |
| | 13 | Name |
| | 14 | vmerrmsg.cpp - T3 VM error message strings |
| | 15 | Function |
| | 16 | Defines the message text for VM errors. All error text is isolated into |
| | 17 | this module for easy replacement in translated versions. |
| | 18 | Notes |
| | 19 | |
| | 20 | Modified |
| | 21 | 05/13/00 MJRoberts - Creation |
| | 22 | */ |
| | 23 | |
| | 24 | #include <stdarg.h> |
| | 25 | #include <stdlib.h> |
| | 26 | |
| | 27 | #include "t3std.h" |
| | 28 | #include "vmerr.h" |
| | 29 | |
| | 30 | /* ------------------------------------------------------------------------ */ |
| | 31 | /* |
| | 32 | * Enable or disable verbose messages. To conserve memory, verbose |
| | 33 | * messages can be omitted. To omit verbose messages, the platform |
| | 34 | * makefile should define the preprocessor symbol VMERR_OMIT_VERBOSE. |
| | 35 | */ |
| | 36 | #ifdef VMERR_OMIT_VERBOSE |
| | 37 | # define VMsg(msg) "" |
| | 38 | #else |
| | 39 | # define VMsg(msg) msg |
| | 40 | #endif |
| | 41 | |
| | 42 | #ifdef VMERR_BOOK_MSG |
| | 43 | # define VBook(msg) , msg |
| | 44 | #else |
| | 45 | # define VBook(msg) |
| | 46 | #endif |
| | 47 | |
| | 48 | /* |
| | 49 | * To conserve even more memory, the messages can be omitted entirely. To |
| | 50 | * disable all compiled-in messages, define VMERR_OMIT_MESSAGES. |
| | 51 | */ |
| | 52 | |
| | 53 | |
| | 54 | /* ------------------------------------------------------------------------ */ |
| | 55 | /* |
| | 56 | * T3 VM Error Messages |
| | 57 | * |
| | 58 | * The messages must be sorted by message number, so that we can perform |
| | 59 | * a binary search to look up a message by number. |
| | 60 | */ |
| | 61 | const err_msg_t vm_messages_english[] = |
| | 62 | { |
| | 63 | #ifdef VMERR_OMIT_MESSAGES |
| | 64 | |
| | 65 | { 0, 0, 0 VBook(0) } |
| | 66 | |
| | 67 | #else /* VMERR_OMIT_MESSAGES */ |
| | 68 | |
| | 69 | { VMERR_READ_FILE, |
| | 70 | "error reading file", |
| | 71 | VMsg("Error reading file. The file might be corrupted or a media error " |
| | 72 | "might have occurred.") }, |
| | 73 | |
| | 74 | { VMERR_WRITE_FILE, |
| | 75 | "error writing file", |
| | 76 | VMsg("Error writing file. The media might be full, or another media " |
| | 77 | "error might have occurred.") }, |
| | 78 | |
| | 79 | { VMERR_FILE_NOT_FOUND, |
| | 80 | "file not found", |
| | 81 | VMsg("Error opening file. The specified file might not exist, you " |
| | 82 | "might not have sufficient privileges to open the file, or " |
| | 83 | "a sharing violation might have occurred.") }, |
| | 84 | |
| | 85 | { VMERR_CREATE_FILE, |
| | 86 | "error creating file", |
| | 87 | VMsg("Error creating file. You might not have sufficient privileges " |
| | 88 | "to open the file, or a sharing violation might have occurred.") }, |
| | 89 | |
| | 90 | { VMERR_OBJ_IN_USE, |
| | 91 | "object ID in use - the image/save file might be corrupted", |
| | 92 | VMsg("An object ID requested by the image/save file is already in use " |
| | 93 | "and cannot be allocated to the file. This might indicate that " |
| | 94 | "the file is corrupted.") }, |
| | 95 | |
| | 96 | { VMERR_OUT_OF_MEMORY, |
| | 97 | "out of memory", |
| | 98 | VMsg("Out of memory. Try making more memory available by closing " |
| | 99 | "other applications if possible.") }, |
| | 100 | |
| | 101 | { VMERR_NO_MEM_FOR_PAGE, |
| | 102 | "out of memory allocating pool page", |
| | 103 | VMsg("Out of memory allocating pool page. Try making more memory " |
| | 104 | "available by closing other applications.") }, |
| | 105 | |
| | 106 | { VMERR_BAD_POOL_PAGE_SIZE, |
| | 107 | "invalid page size - file is not valid", |
| | 108 | VMsg("Invalid page size. The file being loaded is not valid.") }, |
| | 109 | |
| | 110 | { VMERR_OUT_OF_PROPIDS, |
| | 111 | "no more property ID's are available", |
| | 112 | VMsg("Out of property ID's. No more properties can be allocated.") }, |
| | 113 | |
| | 114 | { VMERR_CIRCULAR_INIT, |
| | 115 | "circular initialization dependency in intrinsic class (internal error)", |
| | 116 | VMsg("Circular initialization dependency detected in intrinsic class. " |
| | 117 | "This indicates an internal error in the interpreter. Please " |
| | 118 | "report this error to the interpreter's maintainer.") }, |
| | 119 | |
| | 120 | { VMERR_UNKNOWN_METACLASS, |
| | 121 | "this interpreter version cannot run this program (program requires " |
| | 122 | "intrinsic class %s, which is not available in this interpreter)", |
| | 123 | VMsg("This image file requires an intrinsic class with the identifier " |
| | 124 | "\"%s\", but the class is not available in this interpreter. This " |
| | 125 | "program cannot be executed with this interpreter.") }, |
| | 126 | |
| | 127 | { VMERR_UNKNOWN_FUNC_SET, |
| | 128 | "this interpreter version cannot run this program (program requires " |
| | 129 | "intrinsic function set %s, which is not available in this interpreter)", |
| | 130 | VMsg("This image file requires a function set with the identifier " |
| | 131 | "\"%s\", but the function set is not available in this " |
| | 132 | "intepreter. This program cannot be executed with this " |
| | 133 | "interpreter.") }, |
| | 134 | |
| | 135 | { VMERR_READ_PAST_IMG_END, |
| | 136 | "reading past end of image file - program might be corrupted", |
| | 137 | VMsg("Reading past end of image file. The image file might " |
| | 138 | "be corrupted.") }, |
| | 139 | |
| | 140 | { VMERR_NOT_AN_IMAGE_FILE, |
| | 141 | "this is not an image file (no valid signature found)", |
| | 142 | VMsg("This file is not a valid image file - the file has an invalid " |
| | 143 | "signature. The image file might be corrupted.") }, |
| | 144 | |
| | 145 | { VMERR_UNKNOWN_IMAGE_BLOCK, |
| | 146 | "this interpreter version cannot run this program (unknown block type " |
| | 147 | "in image file)", |
| | 148 | VMsg("Unknown block type. This image file is either incompatible with " |
| | 149 | "this version of the interpreter, or has been corrupted.") }, |
| | 150 | |
| | 151 | { VMERR_IMAGE_BLOCK_TOO_SMALL, |
| | 152 | "data block too small", |
| | 153 | VMsg("A data block in the image file is too small. The image file might " |
| | 154 | "be corrupted.") }, |
| | 155 | |
| | 156 | { VMERR_IMAGE_POOL_BEFORE_DEF, |
| | 157 | "invalid image file: pool page before pool definition", |
| | 158 | VMsg("This image file is invalid because it specifies a pool page " |
| | 159 | "before the pool's definition. The image file might be " |
| | 160 | "corrupted.") }, |
| | 161 | |
| | 162 | { VMERR_IMAGE_POOL_BAD_PAGE, |
| | 163 | "invalid image file: pool page out of range of definition", |
| | 164 | VMsg("This image file is invalid because it specifies a pool page " |
| | 165 | "outside of the range of the pool's definition. The image file " |
| | 166 | "might be corrupted.") }, |
| | 167 | |
| | 168 | { VMERR_IMAGE_BAD_POOL_ID, |
| | 169 | "invalid image file: invalid pool ID", |
| | 170 | VMsg("This image file is invalid because it specifies an invalid " |
| | 171 | "pool ID. The image file might be corrupted.") }, |
| | 172 | |
| | 173 | { VMERR_LOAD_BAD_PAGE_IDX, |
| | 174 | "invalid image file: bad page index", |
| | 175 | VMsg("This image file is invalid because it specifies an invalid " |
| | 176 | "page index. The image file might be corrupted.") }, |
| | 177 | |
| | 178 | { VMERR_LOAD_UNDEF_PAGE, |
| | 179 | "loading undefined pool page", |
| | 180 | VMsg("The program is attempting to load a pool page that is not present " |
| | 181 | "in the image file. The image file might be corrupted.") }, |
| | 182 | |
| | 183 | { VMERR_IMAGE_POOL_REDEF, |
| | 184 | "invalid image file: pool is defined more than once", |
| | 185 | VMsg("This image file is invalid because it defines a pool more than " |
| | 186 | "once. The image file might be corrupted.") }, |
| | 187 | |
| | 188 | { VMERR_IMAGE_METADEP_REDEF, |
| | 189 | "invalid image file: multiple intrinsic class dependency tables found", |
| | 190 | VMsg("This image file is invalid because it contains multiple " |
| | 191 | "intrinsic class tables. The image file might be corrupted.") }, |
| | 192 | |
| | 193 | { VMERR_IMAGE_NO_METADEP, |
| | 194 | "invalid image file: no intrinsic class dependency table found", |
| | 195 | VMsg("This image file is invalid because it contains no intrinsic class " |
| | 196 | "tables. The image file might be corrupted.") }, |
| | 197 | |
| | 198 | { VMERR_IMAGE_FUNCDEP_REDEF, |
| | 199 | "invalid image file: multiple function set dependency tables found", |
| | 200 | VMsg("This image file is invalid because it contains multiple " |
| | 201 | "function set tables. The image file might be corrupted.") }, |
| | 202 | |
| | 203 | { VMERR_IMAGE_NO_FUNCDEP, |
| | 204 | "invalid image file: no function set dependency table found", |
| | 205 | VMsg("This image file is invalid because it contains no function set " |
| | 206 | "tables. The image file might be corrupted.") }, |
| | 207 | |
| | 208 | { VMERR_IMAGE_ENTRYPT_REDEF, |
| | 209 | "invalid image file: multiple entrypoints found", |
| | 210 | VMsg("This image file is invalid because it contains multiple entrypoint " |
| | 211 | "definitions. The image file might be corrupted.") }, |
| | 212 | |
| | 213 | { VMERR_IMAGE_NO_ENTRYPT, |
| | 214 | "invalid image file: no entrypoint found", |
| | 215 | VMsg("This image file is invalid because it contains no entrypoint " |
| | 216 | "specification. The image file might be corrupted.") }, |
| | 217 | |
| | 218 | { VMERR_IMAGE_INCOMPAT_VSN, |
| | 219 | "incompatible image file format version", |
| | 220 | VMsg("This image file has an incompatible format version. You must " |
| | 221 | "obtain a newer version of the interpreter to execute this " |
| | 222 | "program.") }, |
| | 223 | |
| | 224 | { VMERR_IMAGE_NO_CODE, |
| | 225 | "image contains no code", |
| | 226 | VMsg("This image file contains no executable code. The file might " |
| | 227 | "be corrupted.") }, |
| | 228 | |
| | 229 | { VMERR_IMAGE_INCOMPAT_HDR_FMT, |
| | 230 | "incomptabile image file format: method header too old", |
| | 231 | VMsg("This image file has an incompatible method header format. " |
| | 232 | "This is an older image file version which this interpreter " |
| | 233 | "does not support.") }, |
| | 234 | |
| | 235 | { VMERR_UNAVAIL_INTRINSIC, |
| | 236 | "unavailable intrinsic function called (index %d in function set \"%s\")", |
| | 237 | VMsg("Unavailable intrinsic function called (the function is at " |
| | 238 | "index %d in function set \"%s\"). This function is not available " |
| | 239 | "in this version of the interpreter and cannot be called when " |
| | 240 | "running the program with this version. This normally indicates " |
| | 241 | "that the \"preinit\" function, or code invoked by preinit, " |
| | 242 | "called an intrinsic that is invalid during compile-time " |
| | 243 | "pre-initialization.") }, |
| | 244 | |
| | 245 | { VMERR_UNKNOWN_METACLASS_INTERNAL, |
| | 246 | "unknown internal intrinsic class ID %x", |
| | 247 | VMsg("Unknown internal intrinsic class ID %x. This indicates an " |
| | 248 | "internal error in the interpreter. Please report this error " |
| | 249 | "to the interpreter's maintainer.") }, |
| | 250 | |
| | 251 | { VMERR_XOR_MASK_BAD_IN_MEM, |
| | 252 | "page mask is not allowed for in-memory image file", |
| | 253 | VMsg("This image file cannot be loaded from memory because it contains " |
| | 254 | "masked data. Masked data is not valid with in-memory files. " |
| | 255 | "This probably indicates that the program file was not installed " |
| | 256 | "properly; you must convert this program file for in-memory use " |
| | 257 | "before you can load the program with this version of the " |
| | 258 | "interpreter.") }, |
| | 259 | |
| | 260 | { VMERR_NO_IMAGE_IN_EXE, |
| | 261 | "no embedded image file found in executable", |
| | 262 | VMsg("This executable does not contain an embedded image file. The " |
| | 263 | "application might not be configured properly or might need to " |
| | 264 | "be rebuilt. Re-install the application or obtain an updated " |
| | 265 | "version from the application's author.") }, |
| | 266 | |
| | 267 | { VMERR_OBJ_SIZE_OVERFLOW, |
| | 268 | "object size exceeds hardware limits of this computer", |
| | 269 | VMsg("An object defined in this program file exceeds the hardware limits " |
| | 270 | "of this computer. This program cannot be executed on this type " |
| | 271 | "of computer or operating system. Contact the program's author " |
| | 272 | "for assistance.") }, |
| | 273 | |
| | 274 | { VMERR_METACLASS_TOO_OLD, |
| | 275 | "this interpreter is too old to run this program (program requires " |
| | 276 | "intrinsic class version %s, interpreter provides version %s)", |
| | 277 | VMsg("This program needs the intrinsic class \"%s\". This VM " |
| | 278 | "implementation does not provide a sufficiently recent version " |
| | 279 | "of this intrinsic class; the latest version available in this " |
| | 280 | "VM is \"%s\". This program cannot run with this version of the " |
| | 281 | "VM; you must use a more recent version of the VM to execute this " |
| | 282 | "program.") }, |
| | 283 | |
| | 284 | { VMERR_INVAL_METACLASS_DATA, |
| | 285 | "invalid intrinsic class data - image file may be corrupted", |
| | 286 | VMsg("Invalid data were detected in an intrinsic class. This might " |
| | 287 | "indicate that the image file has been corrupted. You might need " |
| | 288 | "to re-install the program.") }, |
| | 289 | |
| | 290 | { VMERR_BAD_STATIC_NEW, |
| | 291 | "invalid object - class does not allow loading", |
| | 292 | VMsg("An object in the image file cannot be loaded because its class " |
| | 293 | "does not allow creation of objects of the class. This usually " |
| | 294 | "means that the class is abstract and cannot be instantiated " |
| | 295 | "as a concrete object.") }, |
| | 296 | |
| | 297 | { VMERR_FUNCSET_TOO_OLD, |
| | 298 | "this interpreter is too old to run this program (program requires " |
| | 299 | "function set version %s, interpreter provides version %s)", |
| | 300 | VMsg("This program needs the function set \"%s\". This VM " |
| | 301 | "implementation does not provide a sufficiently recent version " |
| | 302 | "of this function set; the latest version available in this VM " |
| | 303 | "is \"%s\". This program cannot run with this version of the " |
| | 304 | "VM; you must use a more recent version of the VM to execute " |
| | 305 | "this program.") }, |
| | 306 | |
| | 307 | { VMERR_INVAL_EXPORT_TYPE, |
| | 308 | "exported symbol \"%s\" is of incorrect datatype", |
| | 309 | VMsg("The exported symbol \"%s\" is of the incorrect datatype. Check " |
| | 310 | "the program and the library version.") }, |
| | 311 | |
| | 312 | { VMERR_INVAL_IMAGE_MACRO, |
| | 313 | "invalid data in macro definitions in image file (error code %d)", |
| | 314 | VMsg("The image file contains invalid data in the macro symbols " |
| | 315 | "in the debugging records: macro loader error code %d. This " |
| | 316 | "might indicate that the image file is corrupted.") }, |
| | 317 | |
| | 318 | { VMERR_NO_MAINRESTORE, |
| | 319 | "this program is not capable of restoring a saved state on startup", |
| | 320 | VMsg("This program is not capable of restoring a saved state on " |
| | 321 | "startup. To restore the saved state, you must run the program " |
| | 322 | "normally, then use the appropriate command or operation within " |
| | 323 | "the running program to restore the saved position file.") }, |
| | 324 | |
| | 325 | { VMERR_IMAGE_INCOMPAT_VSN_DBG, |
| | 326 | "image file is incompatible with debugger - recompile the program", |
| | 327 | VMsg("This image file was created with a version of the compiler " |
| | 328 | "that is incompatible with this debugger. Recompile the program " |
| | 329 | "with the compiler that's bundled with this debugger. If no " |
| | 330 | "compiler is bundled, check the debugger release notes for " |
| | 331 | "information on which compiler to use. ") }, |
| | 332 | |
| | 333 | { VMERR_INVALID_SETPROP, |
| | 334 | "property cannot be set for object", |
| | 335 | VMsg("Invalid property change - this property cannot be set for this " |
| | 336 | "object. This normally indicates that the object is of a type " |
| | 337 | "that does not allow setting of properties at all, or at least " |
| | 338 | "of certain properties. For example, a string object does not " |
| | 339 | "allow setting properties at all.") }, |
| | 340 | |
| | 341 | { VMERR_NOT_SAVED_STATE, |
| | 342 | "file is not a valid saved state file", |
| | 343 | VMsg("This file is not a valid saved state file. Either the file was " |
| | 344 | "not created as a saved state file, or its contents have been " |
| | 345 | "corrupted.") }, |
| | 346 | |
| | 347 | { VMERR_WRONG_SAVED_STATE, |
| | 348 | "saved state is for a different program or a different version of " |
| | 349 | "this program", |
| | 350 | VMsg("This file does not contain saved state information for " |
| | 351 | "this program. The file was saved by another program, or " |
| | 352 | "by a different version of this program; in either case, it " |
| | 353 | "cannot be restored with this version of this program.") }, |
| | 354 | |
| | 355 | { VMERR_SAVED_META_TOO_LONG, |
| | 356 | "intrinsic class name in saved state file is too long", |
| | 357 | VMsg("An intrinsic class name in the saved state file is too long. " |
| | 358 | "The file might be corrupted, or might have been saved by an " |
| | 359 | "incompatible version of the interpreter.") }, |
| | 360 | |
| | 361 | { VMERR_SAVED_OBJ_ID_INVALID, |
| | 362 | "invalid object ID in saved state file", |
| | 363 | VMsg("The saved state file contains an invalid object ID. The saved " |
| | 364 | "state file might be corrupted.") }, |
| | 365 | |
| | 366 | { VMERR_BAD_SAVED_STATE, |
| | 367 | "saved state file is corrupted (incorrect checksum)", |
| | 368 | VMsg("The saved state file's checksum is invalid. This usually " |
| | 369 | "indicates that the file has been corrupted (which could be " |
| | 370 | "due to a media error, modification by another application, " |
| | 371 | "or a file transfer that lost or changed data).") }, |
| | 372 | |
| | 373 | { VMERR_BAD_SAVED_META_DATA, |
| | 374 | "invalid intrinsic class data in saved state file", |
| | 375 | VMsg("The saved state file contains intrinsic class data that " |
| | 376 | "is not valid. This usually means that the file was saved " |
| | 377 | "with an incompatible version of the interpreter program.") }, |
| | 378 | |
| | 379 | { VMERR_NO_STR_CONV, |
| | 380 | "cannot convert value to string", |
| | 381 | VMsg("This value cannot be converted to a string.") }, |
| | 382 | |
| | 383 | { VMERR_CONV_BUF_OVF, |
| | 384 | "string conversion buffer overflow", |
| | 385 | VMsg("An internal buffer overflow occurred converting this value to " |
| | 386 | "a string.") }, |
| | 387 | |
| | 388 | { VMERR_BAD_TYPE_ADD, |
| | 389 | "invalid datatypes for addition operator", |
| | 390 | VMsg("Invalid datatypes for addition operator. The values being added " |
| | 391 | "cannot be combined in this manner.") }, |
| | 392 | |
| | 393 | { VMERR_NUM_VAL_REQD, |
| | 394 | "numeric value required", |
| | 395 | VMsg("Invalid value type - a numeric value is required.") }, |
| | 396 | |
| | 397 | { VMERR_INT_VAL_REQD, |
| | 398 | "integer value required", |
| | 399 | VMsg("Invalid value type - an integer value is required.") }, |
| | 400 | |
| | 401 | { VMERR_NO_LOG_CONV, |
| | 402 | "cannot convert value to logical (true/nil)", |
| | 403 | VMsg("This value cannot be converted to a logical (true/nil) value.") }, |
| | 404 | |
| | 405 | { VMERR_BAD_TYPE_SUB, |
| | 406 | "invalid datatypes for subtraction operator", |
| | 407 | VMsg("Invalid datatypes for subtraction operator. The values used " |
| | 408 | "cannot be combined in this manner.") }, |
| | 409 | |
| | 410 | { VMERR_DIVIDE_BY_ZERO, |
| | 411 | "division by zero", |
| | 412 | VMsg("Arithmetic error - Division by zero.") }, |
| | 413 | |
| | 414 | { VMERR_INVALID_COMPARISON, |
| | 415 | "invalid comparison", |
| | 416 | VMsg("Invalid comparison - these values cannot be compared " |
| | 417 | "to one another.") }, |
| | 418 | |
| | 419 | { VMERR_OBJ_VAL_REQD, |
| | 420 | "object value required", |
| | 421 | VMsg("An object value is required.") }, |
| | 422 | |
| | 423 | { VMERR_PROPPTR_VAL_REQD, |
| | 424 | "property pointer required", |
| | 425 | VMsg("A property pointer value is required.") }, |
| | 426 | |
| | 427 | { VMERR_LOG_VAL_REQD, |
| | 428 | "logical value required", |
| | 429 | VMsg("A logical (true/nil) value is required.") }, |
| | 430 | |
| | 431 | { VMERR_FUNCPTR_VAL_REQD, |
| | 432 | "function pointer required", |
| | 433 | VMsg("A function pointer value is required.") }, |
| | 434 | |
| | 435 | { VMERR_CANNOT_INDEX_TYPE, |
| | 436 | "invalid index operation - this type of value cannot be indexed", |
| | 437 | VMsg("This type of value cannot be indexed.") }, |
| | 438 | |
| | 439 | { VMERR_INDEX_OUT_OF_RANGE, |
| | 440 | "index out of range", |
| | 441 | VMsg("The index value is out of range for the value being indexed (it is " |
| | 442 | "too low or too high).") }, |
| | 443 | |
| | 444 | { VMERR_BAD_METACLASS_INDEX, |
| | 445 | "invalid intrinsic class index", |
| | 446 | VMsg("The intrinsic class index is out of range. This probably " |
| | 447 | "indicates that the image file is corrupted.") }, |
| | 448 | |
| | 449 | { VMERR_BAD_DYNAMIC_NEW, |
| | 450 | "invalid dynamic object creation (intrinsic class does not support NEW)", |
| | 451 | VMsg("This type of object cannot be dynamically created, because the " |
| | 452 | "intrinsic class does not support dynamic creation.") }, |
| | 453 | |
| | 454 | { VMERR_OBJ_VAL_REQD_SC, |
| | 455 | "object value required for base class", |
| | 456 | VMsg("An object value must be specified for the base class of a dynamic " |
| | 457 | "object creation operation. The superclass value is of a " |
| | 458 | "non-object type.") }, |
| | 459 | |
| | 460 | { VMERR_STRING_VAL_REQD, |
| | 461 | "string value required", |
| | 462 | VMsg("A string value is required.") }, |
| | 463 | |
| | 464 | { VMERR_LIST_VAL_REQD, |
| | 465 | "list value required", |
| | 466 | VMsg("A list value is required.") }, |
| | 467 | |
| | 468 | { VMERR_DICT_NO_CONST, |
| | 469 | "list or string reference found in dictionary (entry \"%s\") - this " |
| | 470 | "dictionary cannot be saved in the image file", |
| | 471 | VMsg("A dictionary entry (for the string \"%s\") referred to a string " |
| | 472 | "or list value for its associated value data. This dictionary " |
| | 473 | "cannot be stored in the image file, so the image file cannot " |
| | 474 | "be created. Check dictionary word additions and ensure that " |
| | 475 | "only objects are added to the dictionary.") }, |
| | 476 | |
| | 477 | { VMERR_INVAL_OBJ_TYPE, |
| | 478 | "invalid object type - cannot convert to required object type", |
| | 479 | VMsg("An object is not of the correct type. The object specified " |
| | 480 | "cannot be converted to the required object type.") }, |
| | 481 | |
| | 482 | { VMERR_NUM_OVERFLOW, |
| | 483 | "numeric overflow", |
| | 484 | VMsg("A numeric calculation overflowed the limits of the datatype.") }, |
| | 485 | |
| | 486 | { VMERR_BAD_TYPE_MUL, |
| | 487 | "invalid datatypes for multiplication operator", |
| | 488 | VMsg("Invalid datatypes for multiplication operator. The values " |
| | 489 | "being added cannot be combined in this manner.") }, |
| | 490 | |
| | 491 | { VMERR_BAD_TYPE_DIV, |
| | 492 | "invalid datatypes for division operator", |
| | 493 | VMsg("Invalid datatypes for division operator. The values being added " |
| | 494 | "cannot be combined in this manner.") }, |
| | 495 | |
| | 496 | { VMERR_BAD_TYPE_NEG, |
| | 497 | "invalid datatype for arithmetic negation operator", |
| | 498 | VMsg("Invalid datatype for arithmetic negation operator. The value " |
| | 499 | "cannot be negated.") }, |
| | 500 | |
| | 501 | { VMERR_OUT_OF_RANGE, |
| | 502 | "value is out of range", |
| | 503 | VMsg("A value that was outside of the legal range of inputs was " |
| | 504 | "specified for a calculation.") }, |
| | 505 | |
| | 506 | { VMERR_STR_TOO_LONG, |
| | 507 | "string is too long", |
| | 508 | VMsg("A string value is limited to 65535 bytes in length. This " |
| | 509 | "string exceeds the length limit.") }, |
| | 510 | |
| | 511 | { VMERR_LIST_TOO_LONG, |
| | 512 | "list too long", |
| | 513 | VMsg("A list value is limited to about 13100 elements. This list " |
| | 514 | "exceeds the limit.") }, |
| | 515 | |
| | 516 | { VMERR_TREE_TOO_DEEP_EQ, |
| | 517 | "maximum equality test/hash recursion depth exceeded", |
| | 518 | VMsg("This equality comparison or hash calculation is too complex and " |
| | 519 | "cannot be performed. This usually indicates that a value " |
| | 520 | "contains circular references, such as a Vector that contains " |
| | 521 | "a reference to itself, or to another Vector that contains a " |
| | 522 | "reference to the first one. This type of value cannot be " |
| | 523 | "compared for equality or used in a LookupTable.") }, |
| | 524 | |
| | 525 | { VMERR_WRONG_NUM_OF_ARGS, |
| | 526 | "wrong number of arguments", |
| | 527 | VMsg("The wrong number of arguments was passed to a function or method " |
| | 528 | "in the invocation of the function or method.") }, |
| | 529 | |
| | 530 | { VMERR_WRONG_NUM_OF_ARGS_CALLING, |
| | 531 | "argument mismatch calling %s - function definition is incorrect", |
| | 532 | VMsg("The number of arguments doesn't match the number expected " |
| | 533 | "calling %s. Check the function or method and correct the " |
| | 534 | "number of parameters that it is declared to receive.") }, |
| | 535 | |
| | 536 | { VMERR_NIL_DEREF, |
| | 537 | "nil object reference", |
| | 538 | VMsg("The value 'nil' was used to reference an object property. Only " |
| | 539 | "valid object references can be used in property evaluations.") }, |
| | 540 | |
| | 541 | { VMERR_CANNOT_CREATE_INST, |
| | 542 | "cannot create instance of object - object is not a class", |
| | 543 | VMsg("An instance of this object cannot be created, because this " |
| | 544 | "object is not a class.") }, |
| | 545 | |
| | 546 | { VMERR_ILLEGAL_NEW, |
| | 547 | "cannot create instance - class does not allow dynamic construction", |
| | 548 | VMsg("An instance of this class cannot be created, because this class " |
| | 549 | "does not allow dynamic construction.") }, |
| | 550 | |
| | 551 | { VMERR_INVALID_OPCODE, |
| | 552 | "invalid opcode - possible image file corruption", |
| | 553 | VMsg("Invalid instruction opcode - the image file might be corrupted.") }, |
| | 554 | |
| | 555 | { VMERR_UNHANDLED_EXC, |
| | 556 | "unhandled exception", |
| | 557 | VMsg("An exception was thrown but was not caught by the program. " |
| | 558 | "The interpreter is terminating execution of the program.") }, |
| | 559 | |
| | 560 | { VMERR_STACK_OVERFLOW, |
| | 561 | "stack overflow", |
| | 562 | VMsg("Stack overflow. This indicates that function or method calls " |
| | 563 | "were nested too deeply; this might have occurred because of " |
| | 564 | "unterminated recursion, which can happen when a function or method " |
| | 565 | "calls itself (either directly or indirectly).") }, |
| | 566 | |
| | 567 | { VMERR_BAD_TYPE_BIF, |
| | 568 | "invalid type for intrinsic function argument", |
| | 569 | VMsg("An invalid datatype was provided for an intrinsic " |
| | 570 | "function argument.") }, |
| | 571 | |
| | 572 | { VMERR_SAY_IS_NOT_DEFINED, |
| | 573 | "default output function is not defined", |
| | 574 | VMsg("The default output function is not defined. Implicit string " |
| | 575 | "display is not allowed until a default output function " |
| | 576 | "is specified.") }, |
| | 577 | |
| | 578 | { VMERR_BAD_VAL_BIF, |
| | 579 | "invalid value for intrinsic function argument", |
| | 580 | VMsg("An invalid value was specified for an intrinsic function argument. " |
| | 581 | "The value is out of range or is not an allowed value.") }, |
| | 582 | |
| | 583 | { VMERR_BREAKPOINT, |
| | 584 | "breakpoint encountered", |
| | 585 | VMsg("A breakpoint instruction was encountered, and no debugger is " |
| | 586 | "active. The compiler might have inserted this breakpoint to " |
| | 587 | "indicate an invalid or unreachable location in the code, so " |
| | 588 | "executing this instruction probably indicates an error in the " |
| | 589 | "program.") }, |
| | 590 | |
| | 591 | { VMERR_CALLEXT_NOT_IMPL, |
| | 592 | "external function calls are not implemented in this version", |
| | 593 | VMsg("This version of the interpreter does not implement external " |
| | 594 | "function calls. This program requires an interpreter that " |
| | 595 | "provides external function call capabilities, so this program " |
| | 596 | "is not compatible with this interpreter.") }, |
| | 597 | |
| | 598 | { VMERR_INVALID_OPCODE_MOD, |
| | 599 | "invalid opcode modifier - possible image file corruption", |
| | 600 | VMsg("Invalid instruction opcode modifier - the image file might " |
| | 601 | "be corrupted.") }, |
| | 602 | |
| | 603 | /* |
| | 604 | * Note - do NOT use the VMsg() macro on this message, since we always |
| | 605 | * want to have this verbose message available. |
| | 606 | */ |
| | 607 | { VMERR_NO_CHARMAP_FILE, |
| | 608 | "No mapping file available for local character set \"%.32s\"", |
| | 609 | "[Warning: no mapping file is available for the local character set " |
| | 610 | "\"%.32s\". The system will use a default ASCII character set " |
| | 611 | "mapping instead, so accented characters will be displayed without " |
| | 612 | "their accents.]" }, |
| | 613 | |
| | 614 | { VMERR_UNHANDLED_EXC_PARAM, |
| | 615 | "Unhandled exception: %s", |
| | 616 | VMsg("Unhandled exception: %s") }, |
| | 617 | |
| | 618 | { VMERR_VM_EXC_PARAM, |
| | 619 | "VM Error: %s", |
| | 620 | VMsg("VM Error: %s") |
| | 621 | VBook("This is used as a generic template for VM run-time " |
| | 622 | "exception messages. The interpreter uses this to " |
| | 623 | "display unhandled exceptions that terminate the program.") }, |
| | 624 | |
| | 625 | { VMERR_VM_EXC_CODE, |
| | 626 | "VM Error: code %d", |
| | 627 | VMsg("VM Error: code %d") |
| | 628 | VBook("This is used as a generic template for VM run-time " |
| | 629 | "exceptions. The interpreter uses this to report unhandled " |
| | 630 | "exceptions that terminate the program. When it can't find " |
| | 631 | "any message for the VM error code, the interpreter simply " |
| | 632 | "displays the error number using this template.") }, |
| | 633 | |
| | 634 | { VMERR_EXC_IN_STATIC_INIT, |
| | 635 | "Exception in static initializer for %s.%s: %s", |
| | 636 | VMsg("An exception occurred in the static initializer for " |
| | 637 | "%s.%s: %s") }, |
| | 638 | |
| | 639 | { VMERR_INTCLS_GENERAL_ERROR, |
| | 640 | "intrinsic class exception: %s", |
| | 641 | VMsg("Exception in intrinsic class method: %s") }, |
| | 642 | |
| | 643 | { VMERR_DBG_ABORT, |
| | 644 | "'abort' signal", |
| | 645 | VMsg("'abort' signal") |
| | 646 | VBook("This exception is used internally by the debugger to " |
| | 647 | "signal program termination via the debugger UI.") }, |
| | 648 | |
| | 649 | { VMERR_DBG_RESTART, |
| | 650 | "'restart' signal", |
| | 651 | VMsg("'restart' signal") |
| | 652 | VBook("This exception is used internally by the debugger to " |
| | 653 | "signal program restart via the debugger UI.") }, |
| | 654 | |
| | 655 | { VMERR_BAD_FRAME, |
| | 656 | "invalid frame in debugger local/parameter evaluation", |
| | 657 | VMsg("An invalid stack frame was specified in a debugger local/parameter " |
| | 658 | "evaluation. This probably indicates an internal problem in the " |
| | 659 | "debugger.") }, |
| | 660 | |
| | 661 | { VMERR_BAD_SPEC_EVAL, |
| | 662 | "invalid speculative expression", |
| | 663 | VMsg("This expression cannot be executed speculatively. (This does not " |
| | 664 | "indicate a problem; it's merely an internal condition in the " |
| | 665 | "debugger.)") }, |
| | 666 | |
| | 667 | { VMERR_INVAL_DBG_EXPR, |
| | 668 | "invalid debugger expression", |
| | 669 | VMsg("This expression cannot be evaluated in the debugger.") }, |
| | 670 | |
| | 671 | { VMERR_NO_IMAGE_DBG_INFO, |
| | 672 | "image file has no debugging information - recompile for debugging", |
| | 673 | VMsg("The image file has no debugging information. You must recompile " |
| | 674 | "the source code for this program with debugging information in " |
| | 675 | "order to run the program under the debugger.") }, |
| | 676 | |
| | 677 | { VMERR_BIGNUM_NO_REGS, |
| | 678 | "out of temporary floating point registers (calculation too complex)", |
| | 679 | VMsg("The interpreter is out of temporary floating point registers. " |
| | 680 | "This probably indicates that an excessively complex calculation " |
| | 681 | "has been attempted.") } |
| | 682 | |
| | 683 | #endif /* VMERR_OMIT_MESSAGES */ |
| | 684 | }; |
| | 685 | |
| | 686 | /* size of the english message array */ |
| | 687 | size_t vm_message_count_english = |
| | 688 | sizeof(vm_messages_english)/sizeof(vm_messages_english[0]); |
| | 689 | |
| | 690 | /* |
| | 691 | * the actual message array - we'll initialize this to the |
| | 692 | * english list that's linked in, but if we find an external message |
| | 693 | * file, we'll use the external file instead |
| | 694 | */ |
| | 695 | const err_msg_t *vm_messages = vm_messages_english; |
| | 696 | |
| | 697 | /* message count - initialize to the english message array count */ |
| | 698 | size_t vm_message_count = |
| | 699 | sizeof(vm_messages_english)/sizeof(vm_messages_english[0]); |
| | 700 | |
| | 701 | /* ------------------------------------------------------------------------ */ |
| | 702 | /* |
| | 703 | * we don't need the VMsg() (verbose message) cover macro any more |
| | 704 | */ |
| | 705 | #undef VMsg |