File:  [gforth] / gforth / Attic / errore.fs
Revision 1.10: download - view: text, annotated - select for diffs
Sat Feb 1 14:59:29 1997 UTC (22 years, 8 months ago) by anton
Branches: MAIN
CVS tags: HEAD
documentation changes: added chapter on image files; added concept index
bug fixes

    1: \ ERRORE.FS English error strings                      9may93jaw
    2: 
    3: \ Copyright (C) 1995 Free Software Foundation, Inc.
    4: 
    5: \ This file is part of Gforth.
    6: 
    7: \ Gforth is free software; you can redistribute it and/or
    8: \ modify it under the terms of the GNU General Public License
    9: \ as published by the Free Software Foundation; either version 2
   10: \ of the License, or (at your option) any later version.
   11: 
   12: \ This program is distributed in the hope that it will be useful,
   13: \ but WITHOUT ANY WARRANTY; without even the implied warranty of
   14: \ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   15: \ GNU 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: \ The errors are defined by a linked list, for easy adding
   23: \ and deleting. Speed is not neccassary at this point.
   24: 
   25: AVARIABLE ErrLink              \ Linked list entry point
   26: NIL ErrLink !
   27: 
   28: : ERR" ( n -- )
   29:        ErrLink linked
   30:        ,
   31:        [char] " parse
   32:        string, align ;
   33: 
   34: decimal
   35: 
   36: -1 ERR" Aborted"
   37: -3 ERR" Stack overflow"
   38: -4 ERR" Stack underflow"
   39: -5 ERR" Return stack overflow"
   40: -6 ERR" Return stack undeflow"
   41: -7 ERR" Do-loops nested too deeply"
   42: -8 ERR" Dictionary overflow"
   43: -9 ERR" Invalid memory address"
   44: -10 ERR" Division by zero"
   45: -11 ERR" Result out of range"
   46: -12 ERR" Argument type mismatch"
   47: -13 ERR" Undefined word"
   48: -14 ERR" Interpreting a compile-only word"
   49: -15 ERR" Invalid FORGET"
   50: -16 ERR" Attempt to use zero-length string as a name"
   51: -17 ERR" Pictured numeric ouput string overflow"
   52: -18 ERR" Parsed string overflow"
   53: -19 ERR" Word name too long"
   54: -20 ERR" Write to a read-only location"
   55: -21 ERR" Unsupported operation"
   56: -22 ERR" Control structure mismatch"
   57: -23 ERR" Address alignment exception"
   58: -24 ERR" Invalid numeric argument"
   59: -25 ERR" Return stack imbalance"
   60: -26 ERR" Loop parameters unavailable"
   61: -27 ERR" Invalid recursion"
   62: -28 ERR" User interrupt"
   63: -29 ERR" Compiler nesting"
   64: -30 ERR" Obsolescent feature"
   65: -31 ERR" >BODY used on non-CREATEd definition"
   66: -32 ERR" Invalid name argument"
   67: -33 ERR" Block read exception"
   68: -34 ERR" Block write exception"
   69: -35 ERR" Invalid block number"
   70: -36 ERR" Invalid file position"
   71: -37 ERR" File I/O exception"
   72: -38 ERR" Non-existent file"
   73: -39 ERR" Unexpected end of file"
   74: -40 ERR" Invalid BASE for floating point conversion"
   75: -41 ERR" Loss of precision"
   76: -42 ERR" Floating-point divide by zero"
   77: -43 ERR" Floating-point result out of range"
   78: -44 ERR" Floating-point stack overflow"
   79: -45 ERR" Floating-point stack underflow"
   80: -46 ERR" Floating-point invalid argument"
   81: -47 ERR" Compilation word list deleted"
   82: -48 ERR" invalid POSTPONE"
   83: -49 ERR" Search-order overflow"
   84: -50 ERR" Search-order underflow"
   85: -51 ERR" Compilation word list changed"
   86: -52 ERR" Control-flow stack overflow"
   87: -53 ERR" Exception stack overflow"
   88: -54 ERR" Floating-point underflow"
   89: -55 ERR" Floating-point unidentified fault"
   90: -56 ERR" QUIT"
   91: -57 ERR" Error in sending or receiving a character"
   92: -58 ERR" [IF], [ELSE], [THEN] error"
   93: 
   94: \ error numbers between -256 and -511 represent signals
   95: \ signals are handled with strsignal
   96: \ but some signals produce throw-codes > -256, e.g., -28
   97: 
   98: \ error numbers between -512 and -2047 are for OS errors and are
   99: \ handled with strerror
  100: 
  101: : .error ( n -- )
  102:     cr ." Error: "
  103:     ErrLink
  104:     BEGIN @ dup
  105:     WHILE
  106: 	2dup cell+ @ =
  107: 	IF 2 cells + count type drop exit THEN
  108:     REPEAT
  109:     drop
  110:     dup -511 -255 within
  111:     IF
  112: 	256 + negate strsignal type exit
  113:     THEN
  114:     dup -2047 -511 within
  115:     IF
  116: 	512 + negate strerror type exit
  117:     THEN
  118:     . ;
  119: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>