38 byval msgex
as const zstring ptr _
39 )
as const zstring ptr
46 ( 1, @
"Passing scalar as pointer" ), _
47 ( 1, @
"Passing pointer to scalar" ), _
48 ( 1, @
"Passing different pointer types" ), _
49 ( 1, @
"Suspicious pointer assignment" ), _
50 ( 0, @
"Implicit conversion" ), _
51 ( 1, @
"Cannot export symbol without -export option" ), _
52 ( 1, @
"Identifier's name too big, truncated" ), _
53 ( 1, @
"Literal number too big, truncated" ), _
54 ( 1, @
"Literal string too big, truncated" ), _
55 ( 0, @
"UDT with pointer or var-len string fields" ), _
56 ( 0, @
"Implicit variable allocation" ), _
57 ( 0, @
"Missing closing quote in literal string" ), _
58 ( 0, @
"Function result was not explicitly set" ), _
59 ( 1, @
"Branch crossing local variable definition" ), _
60 ( 0, @
"No explicit BYREF or BYVAL" ), _
61 ( 0, @
"Possible escape sequence found in" ), _
62 ( 0, @
"The type length is too large, consider passing BYREF" ), _
63 ( 1, @
"The length of the parameters list is too large, consider passing UDT's BYREF" ), _
64 ( 1, @
"The ANY initializer has no effect on UDT's with default constructors" ), _
65 ( 2, @
"Object files or libraries with mixed multithreading (-mt) options" ), _
66 ( 2, @
"Object files or libraries with mixed language (-lang) options" ), _
67 ( 0, @
"Deleting ANY pointers is undefined" ), _
68 ( 2, @
"Array too large for stack, consider making it var-len or SHARED" ), _
69 ( 2, @
"Variable too large for stack, consider making it SHARED" ), _
70 ( 0, @
"Overflow in constant conversion" ), _
71 ( 0, @
"Variable following NEXT is meaningless" ), _
72 ( 0, @
"Cast to non-pointer" ), _
73 ( 0, @
"Return method mismatch" ), _
74 ( 0, @
"Passing Pointer" ), _
75 ( 0, @
"Command line option overrides directive" ), _
76 ( 0, @
"Directive ignored after first pass" ), _
77 ( 0, @
"'IF' statement found directly after multi-line 'ELSE'" ), _
78 ( 0, @
"Shift value greater than or equal to number of bits in data type" ), _
79 ( 0, @
"'BYVAL AS STRING' actually behaves like 'BYREF AS ZSTRING' (this is hoped to change in future releases)" ), _
80 ( 0, @
"'=' parsed as equality operator in function argument, not assignment to BYREF function result" ), _
81 ( 0, @
"Mixing signed/unsigned operands" ), _
82 ( 0, @
"Mismatching parameter initializer" ) _
85 dim shared errorMsgs( 1
to FB_ERRMSGS-1 )
as const zstring ptr => _
87 @
"Argument count mismatch", _
88 @
"Expected End-of-File", _
89 @
"Expected End-of-Line", _
90 @
"Duplicated definition", _
94 @
"Undefined symbol", _
95 @
"Expected expression", _
97 @
"Expected constant", _
100 @
"Expected identifier", _
104 @
"Element not defined", _
105 @
"Expected 'END TYPE' or 'END UNION'", _
108 @
"Parameter type mismatch", _
110 @
"Invalid data types", _
111 @
"Invalid character", _
112 @
"File access error", _
113 @
"Recursion level too deep", _
114 @
"Expected pointer", _
115 @
"Expected 'LOOP'", _
116 @
"Expected 'WEND'", _
117 @
"Expected 'THEN'", _
118 @
"Expected 'END IF'", _
120 @
"Expected 'CASE'", _
121 @
"Expected 'END SELECT'", _
122 @
"Wrong number of dimensions", _
123 @
"Array boundaries do not match the original EXTERN declaration", _
124 @
"'SUB' or 'FUNCTION' without 'END SUB' or 'END FUNCTION'", _
125 @
"Expected 'END SUB' or 'END FUNCTION'", _
126 @
"Illegal parameter specification", _
127 @
"Variable not declared", _
128 @
"Variable required", _
129 @
"Illegal outside a compound statement", _
130 @
"Expected 'END ASM'", _
131 @
"Function not declared", _
133 @
"Undefined label", _
134 @
"Too many array dimensions", _
136 @
"User Defined Type too big", _
137 @
"Expected scalar counter", _
138 @
"Illegal outside a CONSTRUCTOR, DESTRUCTOR, FUNCTION, OPERATOR, PROPERTY or SUB block", _
139 @
"Expected var-len array", _
140 @
"Fixed-len strings cannot be returned from functions", _
141 @
"Array already dimensioned", _
142 @
"Illegal without the -ex option", _
144 @
"Illegal specification", _
145 @
"Expected 'END WITH'", _
146 @
"Illegal inside functions", _
147 @
"Statement in between SELECT and first CASE", _
152 @
"Too many expressions", _
153 @
"Expected explicit result type", _
154 @
"Range too large", _
155 @
"Forward references not allowed", _
156 @
"Incomplete type", _
157 @
"Array not dimensioned", _
158 @
"Array access, index expected", _
159 @
"Expected 'END ENUM'", _
160 @
"Var-len arrays cannot be initialized", _
161 @
"Invalid bitfield", _
162 @
"Too many parameters", _
163 @
"Macro text too long", _
164 @
"Invalid command-line option", _
165 @
"Selected non-x86 CPU when compiling for DOS", _
166 @
"Selected -gen gas ASM backend for non-x86 CPU", _
167 @
"-asm att used for -gen gas, but -gen gas only supports -asm intel", _
168 @
"Var-len strings cannot be initialized", _
169 @
"Recursive TYPE or UNION not allowed", _
170 @
"Recursive DEFINE not allowed", _
171 @
"Array fields cannot be redimensioned", _
172 @
"Identifier cannot include periods", _
173 @
"Executable not found", _
174 @
"Array out-of-bounds", _
175 @
"Missing command-line option for", _
177 @
"Expected 'END SCOPE'", _
178 @
"Illegal inside a compound statement or scoped block", _
179 @
"UDT function results cannot be passed by reference", _
180 @
"Ambiguous call to overloaded function", _
181 @
"No matching overloaded function", _
182 @
"Division by zero", _
183 @
"Cannot pop stack, underflow", _
184 @
"UDT's containing var-len string fields cannot be initialized", _
185 @
"Branching to scope block containing local variables", _
186 @
"Branching to other functions or to module-level", _
187 @
"Branch crossing local array, var-len string or object definition", _
188 @
"LOOP without DO", _
189 @
"NEXT without FOR", _
190 @
"WEND without WHILE", _
191 @
"END WITH without WITH", _
192 @
"END IF without IF", _
193 @
"END SELECT without SELECT", _
194 @
"END SUB or FUNCTION without SUB or FUNCTION",_
195 @
"END SCOPE without SCOPE", _
196 @
"END NAMESPACE without NAMESPACE", _
197 @
"END EXTERN without EXTERN", _
198 @
"ELSEIF without IF", _
199 @
"ELSE without IF", _
200 @
"CASE without SELECT", _
201 @
"Cannot modify a constant", _
202 @
"Expected period ('.')", _
203 @
"Expected 'END NAMESPACE'", _
204 @
"Illegal inside a NAMESPACE block", _
205 @
"Symbols defined inside namespaces cannot be removed", _
206 @
"Expected 'END EXTERN'", _
207 @
"Expected 'END SUB'", _
208 @
"Expected 'END FUNCTION'", _
209 @
"Expected 'END CONSTRUCTOR'", _
210 @
"Expected 'END DESTRUCTOR'", _
211 @
"Expected 'END OPERATOR'", _
212 @
"Expected 'END PROPERTY'", _
213 @
"Declaration outside the original namespace", _
214 @
"No end of multi-line comment, expected ""'/""", _
215 @
"Too many errors, exiting", _
216 @
"Expected 'ENDMACRO'", _
217 @
"EXTERN or COMMON variables cannot be initialized", _
218 @
"At least one parameter must be a user-defined type", _
219 @
"Parameter or result must be a user-defined type", _
220 @
"Both parameters can't be of the same type", _
221 @
"Parameter and result can't be of the same type", _
222 @
"Invalid result type for this operator", _
223 @
"Invalid parameter type, it must be the same as the parent TYPE/CLASS", _
224 @
"Vararg parameters are not allowed in overloaded functions", _
225 @
"Illegal outside an OPERATOR block", _
226 @
"Parameter cannot be optional", _
227 @
"Only valid in -lang", _
228 @
"Default types or suffixes are only valid in -lang", _
229 @
"Suffixes are only valid in -lang", _
230 @
"Implicit variables are only valid in -lang", _
231 @
"Auto variables are only valid in -lang", _
232 @
"Invalid array index", _
233 @
"Operator must be a member function", _
234 @
"Operator cannot be a member function", _
235 @
"Method declared in anonymous UDT", _
236 @
"Constant declared in anonymous UDT", _
237 @
"Static variable declared in anonymous UDT", _
238 @
"Expected operator", _
239 @
"Declaration outside the original namespace or class", _
240 @
"A destructor should not have any parameters", _
241 @
"Expected class or UDT identifier", _
242 @
"Var-len strings cannot be part of UNION's or nested TYPE's", _
243 @
"Fields with constructors cannot be part of UNION's or nested TYPE's", _
244 @
"Fields with destructors cannot be part of UNION's or nested TYPE's", _
245 @
"Illegal outside a CONSTRUCTOR block", _
246 @
"Illegal outside a DESTRUCTOR block", _
247 @
"UDT's with methods must have unique names", _
248 @
"Parent is not a class or UDT", _
249 @
"CONSTRUCTOR() chain call not at top of constructor", _
250 @
"BASE() initializer not at top of constructor", _
251 @
"REDIM on UDT with non-CDECL constructor", _
252 @
"REDIM on UDT with non-CDECL destructor", _
253 @
"REDIM on UDT with non-parameterless default constructor", _
254 @
"ERASE on UDT with non-CDECL constructor", _
255 @
"ERASE on UDT with non-CDECL destructor", _
256 @
"ERASE on UDT with non-parameterless default constructor", _
257 @
"This symbol cannot be undefined", _
258 @
"RETURN mixed with 'FUNCTION =' or EXIT FUNCTION (using both styles together is unsupported when returning objects with constructors)", _
259 @
"'FUNCTION =' or EXIT FUNCTION mixed with RETURN (using both styles together is unsupported when returning objects with constructors)", _
260 @
"Missing RETURN to copy-construct function result", _
261 @
"Invalid assignment/conversion", _
262 @
"Invalid array subscript", _
263 @
"TYPE or CLASS has no default constructor", _
264 @
"Function result TYPE has no default constructor", _
265 @
"Base UDT without default constructor; missing BASE() initializer", _
266 @
"Base UDT without default constructor; missing default constructor implementation in derived UDT", _
267 @
"Base UDT without default constructor; missing copy constructor implementation in derived UDT", _
268 @
"Invalid priority attribute", _
269 @
"PROPERTY GET should have no parameter, or just one if indexed", _
270 @
"PROPERTY SET should have one parameter, or just two if indexed", _
271 @
"Expected 'PROPERTY'", _
272 @
"Illegal outside a PROPERTY block", _
273 @
"PROPERTY has no GET method/accessor", _
274 @
"PROPERTY has no SET method/accessor", _
275 @
"PROPERTY has no indexed GET method/accessor", _
276 @
"PROPERTY has no indexed SET method/accessor", _
277 @
"Missing overloaded operator: ", _
278 @
"The NEW[] operator does not allow explicit calls to constructors", _
279 @
"The NEW[] operator only supports the { ANY } initialization", _
280 @
"The NEW operator cannot be used with strings", _
281 @
"Illegal member access", _
283 @
"The default constructor has no public access", _
284 @
"Constructor has no public access", _
285 @
"Destructor has no public access", _
286 @
"Accessing base UDT's private default constructor", _
287 @
"Accessing base UDT's private destructor", _
288 @
"Illegal non-static member access", _
289 @
"Constructor declared ABSTRACT", _
290 @
"Constructor declared VIRTUAL", _
291 @
"Destructor declared ABSTRACT", _
292 @
"Member cannot be static", _
293 @
"Member isn't static", _
294 @
"Only static members can be accessed from static functions", _
295 @
"The PRIVATE and PUBLIC attributes are not allowed with REDIM, COMMON or EXTERN", _
296 @
"STATIC used here, but not the in the DECLARE statement", _
297 @
"CONST used here, but not the in the DECLARE statement", _
298 @
"VIRTUAL used here, but not the in the DECLARE statement", _
299 @
"ABSTRACT used here, but not the in the DECLARE statement", _
300 @
"Method declared VIRTUAL, but UDT does not extend OBJECT", _
301 @
"Method declared ABSTRACT, but UDT does not extend OBJECT", _
302 @
"Not overriding any virtual method", _
303 @
"Implemented body for an ABSTRACT method", _
304 @
"Override has different return type than overridden method", _
305 @
"Override has different calling convention than overridden method", _
306 @
"Implicit destructor override would have different calling convention", _
307 @
"Implicit LET operator override would have different calling convention", _
308 @
"Override has different parameters than overridden method", _
309 @
"This operator cannot be STATIC", _
310 @
"Parameter must be an integer", _
311 @
"Parameter must be a pointer", _
312 @
"Expected initializer", _
313 @
"Fields cannot be named as keywords in TYPE's that contain member functions or in CLASS'es", _
314 @
"Illegal outside a FOR compound statement", _
315 @
"Illegal outside a DO compound statement", _
316 @
"Illegal outside a WHILE compound statement", _
317 @
"Illegal outside a SELECT compound statement", _
320 @
"Expected 'WHILE'", _
321 @
"Expected 'SELECT'", _
322 @
"No outer FOR compound statement found", _
323 @
"No outer DO compound statement found", _
324 @
"No outer WHILE compound statement found", _
325 @
"No outer SELECT compound statement found", _
326 @
"Expected 'CONSTRUCTOR', 'DESTRUCTOR', 'DO', 'FOR', 'FUNCTION', 'OPERATOR', 'PROPERTY', 'SELECT', 'SUB' or 'WHILE'", _
327 @
"Expected 'DO', 'FOR' or 'WHILE'", _
328 @
"Illegal outside a SUB block", _
329 @
"Illegal outside a FUNCTION block", _
330 @
"Ambiguous symbol access, explicit scope resolution required", _
331 @
"An ENUM, TYPE or UNION cannot be empty", _
332 @
"STATIC used on non-member procedure", _
333 @
"CONST used on non-member procedure", _
334 @
"ABSTRACT used on non-member procedure", _
335 @
"VIRTUAL used on non-member procedure", _
336 @
"Invalid initializer", _
337 @
"Objects with default [con|de]structors or methods are only allowed in the module level", _
338 @
"Symbol not a CLASS, ENUM, TYPE or UNION type", _
339 @
"Too many elements", _
340 @
"Only data members supported", _
341 @
"UNIONs are not allowed", _
342 @
"Arrays are not allowed", _
343 @
"COMMON variables cannot be object instances of CLASS/TYPE's with cons/destructors", _
344 @
"Cloning operators (LET, Copy constructors) can't take a byval arg of the parent's type", _
345 @
"Local symbols can't be referenced", _
346 @
"Expected 'PTR' or 'POINTER'", _
347 @
"Too many levels of pointer indirection", _
348 @
"Dynamic arrays can't be const", _
349 @
"Const UDT cannot invoke non-const method", _
350 @
"Elements must be empty for strings and arrays", _
351 @
"GOSUB disabled, use 'OPTION GOSUB' to enable", _
353 @
"Can't use ANY as initializer in array with ellipsis bound", _
354 @
"Must have initializer with array with ellipsis bound", _
355 @
"Can't use ... as lower bound", _
356 @
"FOR/NEXT variable name mismatch", _
357 @
"Selected option requires an SSE FPU mode", _
358 @
"Expected relational operator ( =, >, <, <>, <=, >= )", _
359 @
"Unsupported statement in -gen gcc mode", _
360 @
"Too many labels", _
361 @
"Unsupported function", _
363 @
"Expected '#ENDIF'", _
364 @
"Resource file given for target system that does not support them", _
365 @
"-o <file> option without corresponding input file", _
366 @
"Not extending a TYPE/UNION (a TYPE/UNION can only extend other TYPEs/UNIONs)", _
367 @
"Illegal outside a CLASS, TYPE or UNION method", _
368 @
"CLASS, TYPE or UNION not derived", _
369 @
"CLASS, TYPE or UNION has no constructor", _
370 @
"Symbol type has no Run-Time Type Info (RTTI)", _
371 @
"Types have no hierarchical relation", _
372 @
"Expected a CLASS, TYPE or UNION symbol type", _
373 @
"Casting derived UDT pointer from incompatible pointer type", _
374 @
"Casting derived UDT pointer from unrelated UDT pointer type", _
375 @
"Casting derived UDT pointer to incompatible pointer type", _
376 @
"Casting derived UDT pointer to unrelated UDT pointer type", _
377 @
"ALIAS name string is empty", _
378 @
"LIB name string is empty", _
379 @
"UDT has unimplemented abstract methods", _
380 @
"Non-virtual call to ABSTRACT method", _
381 @
"#ASSERT condition failed", _
384 @
"ALIAS name here is different from ALIAS given in DECLARE prototype", _
385 @
"vararg parameters are only allowed in CDECL procedures", _
386 @
"the first parameter in a procedure may not be vararg", _
387 @
"CONST used on constructor (not needed)", _
388 @
"CONST used on destructor (not needed)" _
424 byval proc as FBSYMBOL
ptr, _
425 byval tk as integer, _
434 if( symbIsMethod(
proc ) )
then
460 byval errnum
as integer, _
461 byval msgex
as const zstring ptr, _
462 byval options
as FB_ERRMSGOPT, _
463 byval linenum
as integer, _
464 byval showerror
as integer =
TRUE, _
465 byval customText
as const zstring ptr = 0 _
468 dim as const zstring ptr msg
469 dim as string token_pos
471 if( (errnum < 1)
or (errnum >= FB_ERRMSGS) )
then
477 if( msgex =
NULL )
then
481 if(
len( env.inf.
name ) > 0 )
then
482 print env.inf.
name;
"(";
483 if( linenum > 0 )
then
484 print str( linenum );
491 if( errnum >= 0 )
then
492 print " " & errnum &
": " & *msg;
493 if( customText )
then
498 showerror = (linenum > 0)
501 if(
len( *msgex ) > 0 )
then
502 if( (options
and FB_ERRMSGOPT_ADDCOMMA) <> 0 )
then
504 elseif( (options
and FB_ERRMSGOPT_ADDCOLON) <> 0 )
then
510 if( (options
and FB_ERRMSGOPT_ADDQUOTES) <> 0 )
then
516 if( (options
and FB_ERRMSGOPT_ADDQUOTES) <> 0 )
then
525 if(
len( ln ) > 0 )
then
526 if( fbLangOptIsSet( FB_LANG_OPT_SINGERRLINE ) )
then
527 print " in '" & ln &
"'"
549 byval errnum
as integer, _
550 byval msgex
as const zstring ptr, _
551 byval linenum
as integer, _
552 byval options
as FB_ERRMSGOPT, _
553 byval customText
as const zstring ptr _
565 if( linenum = 0 )
then
571 if( lex.ctx <>
NULL )
then
572 linenum = lexLineNum( )
579 hPrintErrMsg( errnum, msgex, options, linenum, env.clopt.showerror, customText )
583 if(
errctx.
cnt >= env.clopt.maxerrors )
then
591 byval isbefore
as integer, _
592 byval addcomma
as integer, _
593 byval msgex
as zstring ptr =
NULL _
594 )
as const zstring ptr
596 static as string res, token
600 if( msgex =
NULL )
then
606 if(
len( token ) > 0 )
then
609 case is <= CHAR_SPACE, FB_TK_EOL, FB_TK_EOF
626 function =
strptr( res )
632 byval errnum
as integer, _
633 byval isbefore
as integer =
FALSE, _
634 byval customText
as const zstring ptr _
637 dim as const zstring ptr msgex =
any
652 byval msgnum
as integer, _
653 byval msgex
as const zstring ptr, _
654 byval linenum
as integer, _
655 byval options
as FB_ERRMSGOPT _
658 if( (msgnum < 1)
or (msgnum >= FB_WARNINGMSGS) )
then
674 if(
len( env.inf.
name ) > 0 )
then
677 if( msgex <>
NULL )
then
683 if( linenum > 0 )
then
684 print "(" & linenum &
")";
692 if( msgex <>
NULL )
then
693 if( (options
and FB_ERRMSGOPT_ADDCOMMA) <> 0 )
then
695 elseif( (options
and FB_ERRMSGOPT_ADDCOLON) <> 0 )
then
701 if( (options
and FB_ERRMSGOPT_ADDQUOTES) <> 0 )
then
707 if( (options
and FB_ERRMSGOPT_ADDQUOTES) <> 0 )
then
719 byval msgnum
as integer, _
720 byval msgex
as const zstring ptr, _
721 byval options
as FB_ERRMSGOPT _
731 byval opt
as FB_LANG_OPT, _
732 byval errnum
as integer, _
733 byval msgex
as zstring ptr _
736 dim as string msg =
""
737 dim as integer i, langs
740 for i = 0
to FB_LANGS-1
758 byval msgex
as const zstring ptr _
759 )
as const zstring ptr
761 static as string desc
763 dim as FBSYMBOL
ptr proc =
any
764 dim as zstring ptr pname =
any, pid =
any
765 dim as integer pnum =
any, addprnts =
any
768 if( paramloc =
NULL )
then
781 desc +=
"at parameter " +
str( pnum )
782 if( pid =
NULL )
then
784 dim as FBSYMBOL
ptr param = symbGetProcHeadParam(
proc )
785 dim as integer cnt =
iif( symbIsMethod(
proc ), 0, 1 )
787 do while( param <>
NULL )
788 if(
cnt = pnum )
then
795 if( param <>
NULL )
then
796 pid = symbGetName( param )
801 if( pid <>
NULL )
then
802 if(
len(*pid) > 0 )
then
811 dim as integer showname =
TRUE
815 if( symbGetIsRTL(
proc ) )
then
817 if( symbGetName(
proc ) <>
NULL )
then
819 if(
left( *symbGetName(
proc ), 3 ) =
"FB_" )
then
829 if( symbGetIsFuncPtr(
proc ) )
then
833 elseif( (symbGetAttrib(
proc )
and (FB_SYMBATTRIB_CONSTRUCTOR
or _
834 FB_SYMBATTRIB_DESTRUCTOR
or _
835 FB_SYMBATTRIB_OPERATOR)) <> 0 )
then
842 if( pname =
NULL )
then
844 pname = symbGetName(
proc )
845 if( pname <>
NULL )
then
846 if(
len( *pname ) = 0 )
then
854 if( pname <>
NULL )
then
871 function =
strptr( desc )
876 byval proc as FBSYMBOL
ptr, _
878 byval paramid as zstring ptr, _
879 byval msgnum
as integer _
890 byval proc as FBSYMBOL
ptr, _
892 byval paramid as zstring ptr, _
893 byval msgnum
as integer _
905 byval errnum
as integer, _
906 byval id
as zstring ptr _
910 dim as zstring ptr id_cpy
920 ZStrAssign( @id_cpy, id )