|
|
1 //! @file a68g-diagnostics.h 2 //! @author J. Marcel van der Veer 3 4 //! @section Copyright 5 //! 6 //! This file is part of Algol68G - an Algol 68 compiler-interpreter. 7 //! Copyright 2001-2026 J. Marcel van der Veer [algol68g@algol68genie.nl]. 8 9 //! @section License 10 //! 11 //! This program is free software; you can redistribute it and/or modify it 12 //! under the terms of the GNU General Public License as published by the 13 //! Free Software Foundation; either version 3 of the License, or 14 //! (at your option) any later version. 15 //! 16 //! This program is distributed in the hope that it will be useful, but 17 //! WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 18 //! or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 19 //! more details. You should have received a copy of the GNU General Public 20 //! License along with this program. If not, see [http://www.gnu.org/licenses/]. 21 22 //! @section Synopsis 23 //! 24 //! Macros and text strings for diagnostics. 25 26 #if !defined (A68G_DIAGNOSTICS_H) 27 #define A68G_DIAGNOSTICS_H 28 29 char *error_specification (void); 30 void diagnostic (STATUS_MASK_T, NODE_T *, char *, ...); 31 void diagnostics_to_terminal (LINE_T *, int); 32 void scan_error (LINE_T *, char *, char *); 33 void scan_error_info (LINE_T *, char *, char *, char *); 34 void scan_warning (LINE_T *, char *, char *); 35 void write_source_line (FILE_T, LINE_T *, NODE_T *, int); 36 37 // Error codes 38 39 #define A68G_NO_DIAGNOSTICS ((STATUS_MASK_T) 0x0) 40 #define A68G_ERROR ((STATUS_MASK_T) 0x1) 41 #define A68G_SYNTAX_ERROR ((STATUS_MASK_T) 0x2) 42 #define A68G_MATH_ERROR ((STATUS_MASK_T) 0x4) 43 #define A68G_MATH_WARNING ((STATUS_MASK_T) 0x8) 44 #define A68G_WARNING ((STATUS_MASK_T) 0x10) 45 #define A68G_RUNTIME_ERROR ((STATUS_MASK_T) 0x20) 46 #define A68G_NOTICE ((STATUS_MASK_T) 0x40) 47 #define A68G_ALL_DIAGNOSTICS ((STATUS_MASK_T) 0x80) 48 #define A68G_RERUN ((STATUS_MASK_T) 0x100) 49 #define A68G_FORCE_QUIT ((STATUS_MASK_T) 0x400) 50 #define A68G_NO_SYNTHESIS ((STATUS_MASK_T) 0x800) 51 #define A68G_SCANNER_ERROR ((STATUS_MASK_T) 0x1000) 52 #define A68G_SCANNER_WARNING ((STATUS_MASK_T) 0x2000) 53 54 // Diagnostic texts 55 56 #define ERROR_ACCESSING_NIL "attempt to access N" 57 #define ERROR_ACTION "action failed" 58 #define ERROR_ALIGNMENT "alignment error" 59 #define ERROR_ARGUMENT_NUMBER "incorrect number of arguments for M" 60 #define ERROR_ASSERTION "assertion failure" 61 #define ERROR_CANNOT_OPEN_NAME "cannot open Z" 62 #define ERROR_CANNOT_OPEN_PLUGIN "cannot open plugin" 63 #define ERROR_CANNOT_WIDEN "cannot widen M to M" 64 #define ERROR_CANNOT_WRITE_LISTING "cannot write listing file" 65 #define ERROR_CHANNEL_DOES_NOT_ALLOW "channel does not allow Y" 66 #define ERROR_CLAUSE_WITHOUT_VALUE "clause does not yield a value" 67 #define ERROR_CLOSING_DEVICE "error while closing device" 68 #define ERROR_CLOSING_FILE "error while closing file" 69 #define ERROR_CODE "clause should be compiled" 70 #define ERROR_COMMA_MUST_SEPARATE "A and A must be separated by a comma-symbol" 71 #define ERROR_COMMAND_LINE "command line only option" 72 #define ERROR_COMPONENT_NUMBER "M must have at least two components" 73 #define ERROR_COMPONENT_RELATED "M has firmly related components" 74 #define ERROR_CURSES "error in curses operation" 75 #define ERROR_CURSES_OFF_SCREEN "curses operation moves cursor off the screen" 76 #define ERROR_DEPRECATED "M in this construct is deprecated in V" 77 #define ERROR_DEVICE_ALREADY_SET "device parameters already set" 78 #define ERROR_DEVICE_CANNOT_ALLOCATE "cannot allocate device parameters" 79 #define ERROR_DEVICE_CANNOT_OPEN "cannot open device" 80 #define ERROR_DEVICE_NOT_OPEN "device is not open" 81 #define ERROR_DEVICE_NOT_SET "device parameters not set" 82 #define ERROR_DIFFERENT_BOUNDS "rows have different bounds" 83 #define ERROR_DIVISION_BY_ZERO "attempt at M division by zero" 84 #define ERROR_DYADIC_PRIORITY "dyadic operator S has no priority declaration" 85 #define ERROR_EMPTY_ARGUMENT "empty argument" 86 #define ERROR_EMPTY_VALUE "attempt to use an uninitialised M value" 87 #define ERROR_EMPTY_VALUE_FROM (ERROR_EMPTY_VALUE) 88 #define ERROR_EXPECTED_NEAR "B expected in A, near Z L" 89 #define ERROR_EXPECTED "Y expected" 90 #define ERROR_EXPONENT_DIGIT "invalid exponent digit" 91 #define ERROR_EXPONENT_INVALID "invalid M exponent" 92 #define ERROR_FALSE_ASSERTION "false assertion" 93 #define ERROR_FFT "fourier transform error; Y; Y" 94 #define ERROR_FILE_ACCESS "file access error" 95 #define ERROR_FILE_ALREADY_OPEN "file is already open" 96 #define ERROR_FILE_CANNOT_OPEN_FOR "cannot open Z for Y" 97 #define ERROR_FILE_CANT_RESET "cannot reset file" 98 #define ERROR_FILE_CANT_SET "cannot set file" 99 #define ERROR_FILE_CLOSE "error while closing file" 100 #define ERROR_FILE_ENDED "end of file reached" 101 #define ERROR_FILE_INCLUDE_CTRL "invalid characters in include file" 102 #define ERROR_FILE_LOCK "error while locking file" 103 #define ERROR_FILE_NO_TEMP "cannot create unique temporary file name" 104 #define ERROR_FILE_NOT_OPEN "file is not open" 105 #define ERROR_FILE_READ "error while reading file" 106 #define ERROR_FILE_RESET "error while resetting file" 107 #define ERROR_FILE_SCRATCH "error while scratching file" 108 #define ERROR_FILE_SET "error while setting file" 109 #define ERROR_FILE_SOURCE_CTRL "invalid characters in source file" 110 #define ERROR_FILE_TRANSPUT "error transputting M value" 111 #define ERROR_FILE_TRANSPUT_SIGN "error transputting sign in M value" 112 #define ERROR_FILE_WRONG_MOOD "file is in Y mood" 113 #define ERROR_FORMAT_CANNOT_TRANSPUT "cannot transput M value with A" 114 #define ERROR_FORMAT_EXHAUSTED "patterns exhausted in format" 115 #define ERROR_FORMAT_INTS_REQUIRED "1 .. 3 M arguments required" 116 #define ERROR_FORMAT_INVALID_REPLICATOR "negative replicator" 117 #define ERROR_FORMAT_PICTURE_NUMBER "incorrect number of pictures for A" 118 #define ERROR_FORMAT_PICTURES "number of pictures does not match number of arguments" 119 #define ERROR_FORMAT_UNDEFINED "cannot use undefined format" 120 #define ERROR_HIGH_PRECISION "unsupported precision" 121 #define ERROR_INCORRECT_FILENAME "incorrect filename" 122 #define ERROR_IN_DENOTATION "error in M denotation" 123 #define ERROR_INDEXER_NUMBER "incorrect number of indexers for M" 124 #define ERROR_INDEX_OUT_OF_BOUNDS "index out of bounds" 125 #define ERROR_INFINITE "infinite M value" 126 #define ERROR_INTERNAL_CONSISTENCY "internal consistency check failure" 127 #define ERROR_INVALID_ARGUMENT "invalid M argument" 128 #define ERROR_INVALID_DIMENSION "invalid dimension D" 129 #define ERROR_INVALID_OPERAND "M construct is an invalid operand" 130 #define ERROR_INVALID_OPERATOR_TAG "invalid operator tag" 131 #define ERROR_INVALID_OPTION "invalid option" 132 #define ERROR_INVALID_PARAMETER "invalid parameter (U Z)" 133 #define ERROR_INVALID_PRIORITY "invalid priority declaration" 134 #define ERROR_INVALID_RADIX "invalid radix D" 135 #define ERROR_INVALID_SIZE "object of invalid size" 136 #define ERROR_INVALID_VALUE "invalid value" 137 #define ERROR_IS_DIRECTORY "source file cannot be a directory" 138 #define ERROR_KEYWORD "check for missing or unmatched keyword in clause starting at S" 139 #define ERROR_LABEL_BEFORE_DECLARATION "declaration cannot follow a labeled unit" 140 #define ERROR_LABELED_UNIT_MUST_FOLLOW "S must be followed by a labeled unit" 141 #define ERROR_LAPLACE "laplace transform error; Y; Y" 142 #define ERROR_LONG_STRING "string exceeds end of line" 143 #define ERROR_MATH_CHEBYSHEV "error while evaluating chebyshev series" 144 #define ERROR_MATH_CONVERGENCE "no convergence" 145 #define ERROR_MATH_EXCEPTION "math exception" 146 #define ERROR_MATH_EXP "exp argument out of range" 147 #define ERROR_MATH "M math error" 148 #define ERROR_MEMORY_FULL "not enough memory" 149 #define ERROR_MISSING_STUFF "argument or value expected" 150 #define ERROR_MODE_SPECIFICATION "M construct must yield a routine, row or structured value" 151 #define ERROR_MP_OUT_OF_BOUNDS "multiprecision value out of bounds" 152 #define ERROR_MULTIPLE_FIELD "multiple declaration of field S" 153 #define ERROR_MULTIPLE_SOURCE_FILES "multiple source files" 154 #define ERROR_MULTIPLE_TAG "multiple declaration of tag S" 155 #define ERROR_NO_COMPONENT "M is neither component nor subset of M" 156 #define ERROR_NO_DYADIC "dyadic operator O S O has not been declared" 157 #define ERROR_NO_FIELD "M has no field Z" 158 #define ERROR_NO_FLEX_ARGUMENT "M value from A cannot be flexible" 159 #define ERROR_NO_MATRIX "M A does not yield a two-dimensional row" 160 #define ERROR_NO_MONADIC "monadic operator S O has not been declared" 161 #define ERROR_NO_NAME "M A does not yield a name" 162 #define ERROR_NO_NAME_REQUIRED "context does not require a name" 163 #define ERROR_NO_PARALLEL_CLAUSE "interpreter was built without parallel-clause support" 164 #define ERROR_NO_PRIORITY "S has no priority declaration" 165 #define ERROR_NO_REGULAR_FILE "source is not a regular file" 166 #define ERROR_NO_ROW_OR_PROC "M A does not yield a row or procedure" 167 #define ERROR_NO_SOURCE_FILE "no source file specified" 168 #define ERROR_NO_SQUARE_MATRIX "M matrix is not square" 169 #define ERROR_NO_STRUCT "M A does not yield a structured value" 170 #define ERROR_NOT_WELL_FORMED "M does not specify a well formed mode" 171 #define ERROR_NO_UNION "M is not a united mode" 172 #define ERROR_NO_UNIQUE_MODE "construct has no unique mode" 173 #define ERROR_NO_VECTOR "M A does not yield a one-dimensional row" 174 #define ERROR_OBJECT_TOO_LARGE "M object too large" 175 #define ERROR_OPERAND_NUMBER "incorrect number of operands for S" 176 #define ERROR_OPERATOR_INVALID_END "probably a missing symbol near invalid operator S" 177 #define ERROR_OPERATOR_INVALID "monadic S cannot start with a character from Z" 178 #define ERROR_OPERATOR_RELATED "M Z is firmly related to M Z" 179 #define ERROR_OUT_OF_BOUNDS "M value out of bounds" 180 #define ERROR_PAGE_SIZE "error in page size" 181 #define ERROR_PARALLEL_CANNOT_CREATE "cannot create thread" 182 #define ERROR_PARALLEL_JUMP "jump into different thread" 183 #define ERROR_PARALLEL_OUTSIDE "invalid outside a parallel-clause" 184 #define ERROR_PARALLEL_OVERFLOW "too many parallel units (Y)" 185 #define ERROR_PARENTHESIS_2 "encountered X L but expected X, check for Y" 186 #define ERROR_PARENTHESIS "incorrect nesting, check for Y" 187 #define ERROR_PLATFORM "not implemented for this platform" 188 #define ERROR_PRAGMENT "error in pragment" 189 #define ERROR_PRECISION_SET "K K precision already set" 190 #define ERROR_PRECISION_TOO_LOW "K K precision cannot be smaller than K precision" 191 #define ERROR_QUOTED_BOLD_TAG "error in quoted bold-tag" 192 #define ERROR_REDEFINED_KEYWORD "attempt to redefine keyword Y in A" 193 #define ERROR_REFINEMENT_APPLIED "refinement is applied more than once" 194 #define ERROR_REFINEMENT_DEFINED "refinement is already defined" 195 #define ERROR_REFINEMENT_EMPTY "empty refinement at end of source" 196 #define ERROR_REFINEMENT_INVALID "incorrect refinement" 197 #define ERROR_REFINEMENT_NOT_APPLIED "refinement is not applied" 198 #define ERROR_RESOLVE "cannot resolve symbol" 199 #define ERROR_SCOPE_DYNAMIC_0 "value is exported out of its scope" 200 #define ERROR_SCOPE_DYNAMIC_1 "M value is exported out of its scope" 201 #define ERROR_SCOPE_DYNAMIC_2 "M value from %s is exported out of its scope" 202 #define ERROR_SHELL_SCRIPT "source is a shell script" 203 #define ERROR_SOUND_INTERNAL "error while processing M value (Y)" 204 #define ERROR_SOUND_INTERNAL_STRING "error while processing M value (Y \"Y\")" 205 #define ERROR_SOURCE_FILE_EMPTY "source file contains no program" 206 #define ERROR_SOURCE_FILE_INCLUDE_OPEN "error opening include file" 207 #define ERROR_SOURCE_FILE_OPEN "error opening source file" 208 #define ERROR_STACK_OVERFLOW "stack overflow" 209 #define ERROR_SUBSET_RELATED "M has firmly related subset M" 210 #define ERROR_SYNTAX "detected in A" 211 #define ERROR_SYNTAX_EXPECTED "expected A" 212 #define ERROR_SYNTAX_MIXED_DECLARATION "possibly mixed identity-declaration and variable-declaration" 213 #define ERROR_SYNTAX_SENTENCE "incorrect sentence: Y" 214 #define ERROR_SYNTAX_STRANGE_TOKENS "possibly a missing or incorrect symbol nearby" 215 #define ERROR_TIME_LIMIT_EXCEEDED "time limit exceeded" 216 #define ERROR_TOO_MANY_ARGUMENTS "too many arguments" 217 #define ERROR_TOO_MANY_OPEN_FILES "too many open files" 218 #define ERROR_TORRIX "linear algebra error; Y; Y" 219 #define ERROR_TRANSIENT_NAME "attempt at storing a transient name" 220 #define ERROR_UNBALANCED_KEYWORD "missing or unbalanced keyword in A, near Z L" 221 #define ERROR_UNDECLARED_TAG_2 "tag Z has not been declared properly" 222 #define ERROR_UNDECLARED_TAG "tag S has not been declared properly" 223 #define ERROR_UNDEFINED_TRANSPUT "transput of M value by this procedure is not defined" 224 #define ERROR_UNDERDETERMINED_SYSTEM "underdetermined system of linear equations" 225 #define ERROR_UNIMPLEMENTED "S is either not implemented or not compiled" 226 #define ERROR_UNRECOGNISED_OPTION "unrecognised option" 227 #define ERROR_UNSPECIFIED "unspecified error" 228 #define ERROR_UNTERMINATED_COMMENT "unterminated comment" 229 #define ERROR_UNTERMINATED_PRAGMAT "unterminated pragmat" 230 #define ERROR_UNTERMINATED_PRAGMENT "unterminated pragment" 231 #define ERROR_UNTERMINATED_STRING "unterminated string" 232 #define ERROR_UNWORTHY_CHARACTER "unworthy character" 233 #define ERROR_VACUUM "vacuum cannot have row elements (use a Y generator)" 234 #define ERROR_VALUE_TOO_LARGE "value too large" 235 #define INFO_APPROPRIATE_DECLARER "appropriate declarer" 236 #define INFO_MISSING_KEYWORDS "missing or unmatched keyword" 237 #define WARNING_EXTENSION "@ is an extension" 238 #define WARNING_HIDES "declaration hides a declaration of S with larger reach" 239 #define WARNING_HIDES_PRELUDE "declaration hides prelude declaration of M S" 240 #define WARNING_HIP "@ should not be in C context" 241 #define WARNING_MATH_ACCURACY "accuracy loss due to choice of parameters" 242 #define WARNING_MATH_PRECISION "M A precision limited due to choice of parameters" 243 #define WARNING_OPTIMISATION "optimisation has no effect on this platform" 244 #define WARNING_OVERFLOW "M constant overflow" 245 #define WARNING_PRECISION "D digits precision impacts performance" 246 #define WARNING_SCOPE_STATIC "potential scope violation from M A" 247 #define WARNING_SKIPPED_SUPERFLUOUS "skipped superfluous A" 248 #define WARNING_TAG_NOT_PORTABLE "tag S is not portable" 249 #define WARNING_TAG_UNUSED "tag S is not used" 250 #define WARNING_TRAILING "ignoring trailing character H in A" 251 #define WARNING_UNDERFLOW "M constant underflow" 252 #define WARNING_UNINITIALISED "identifier S might be used uninitialised" 253 #define WARNING_UNINTENDED "possibly unintended M A in M A" 254 #define WARNING_VOIDED "value of M @ will be voided" 255 #define WARNING_WIDENING_NOT_PORTABLE "implicit widening is not portable" 256 257 #endif
© 2001-2026 J.M. van der Veer
jmvdveer@algol68genie.nl