18.6 Error messages. 4tH 4tH Forth compiler
Реклама
Реклама
CHAPTER 18. PREPROCESSOR MANUAL
18.5
Preprocessor commands
\ s
( s) char c
[char] c include s
[needs s]
:macro s ; scrap: s
[binary]
[octal]
[decimal]
[hex]
366
The remainder of the line s is discarded. Used for comment.
Discard comment s that is delimited by a right parenthesis. A blank after the leading parenthesis is required.
Replaces character c as with its ASCII value.
Replaces character c as with its ASCII value.
The contents of file s, delimited by whitespace, are inserted at this position.
The contents of file s, delimited by a right bracket, are inserted at this position.
Create a macro with the name s, delimited by a semi-colon. When s is encountered it is replaced by the contents of the macro. A macro may contain any sequence of valid 4tH words, including conditional and loop statements, but no macros or include files.
Delete a macro with the name s. After that, s will not be expanded anymore and name s can be used to define a new macro. Note that the macro space allocated by s is not freed.
Sets radix to binary.
Sets radix to octal.
Sets radix to decimal.
Sets radix to hexadecimal.
18.6
Error messages
Usage: pp4th infile outfile
Macro space exhausted
Unexpected macro
Too many macros
Duplicate macro
Undefined macro
Directive not allowed here
Unexpected end of file
String too long
Issue a preprocessor file and a source file on the commandline
The combined size of all macro definitions is too large
The preprocessor found a :MACRO word within a previously started macro definition
There are too many macro definitions in the currently processed file
A macro with this name is already defined
A SCRAP: directive was followed by an undefined macro name
You cannot use an INCLUDE, [NEEDS or SCRAP: directive within a macro
A number, character, string, name or other expression was expected in the currently processed file
The string parsed was too long to be stored in a variable
CHAPTER 18. PREPROCESSOR MANUAL
Missing string
Bad number
String stack empty
String stack full
String stack not empty
Seek failed
Cannot open <file>
Include file nested too deep
Cannot open include file
Cannot read include file
Internal error
367
A $1$, $2$, $3$, $4$, $#$ or >>> variable was not followed by a string
The top of the string stack is not a valid number
There were no strings left on the string stack
There were too many strings stored on the string stack
There were still items on the string stack after processing the current file
The preprocessor was unable to restore the file status after processing an include file
Could not find a preprocessor file
Too many include files included within other include files
Could not find an include file
Could not read the include file
An internal condition caused the preprocessor to stop, e.g. stack overflow
18.7
Known bugs and limitations
• Some programs use conditional compilation to accommodate large comments. The preprocessor can only assume such sections contain compilable code and will treat it as such. If these comments contain words that are identical to macro names or preprocessor commands the appropriate substitutions will be made, which may in some circumstances raise errors.
• Some programs will span ( comments across several lines. Although 4tH will accept such comments, it is a violation of the ANS-Forth standard. The preprocessor does not support such usage.
• Character literals are expanded under the current radix, so take care when using them in a macro.
• Back quoted strings offer no protection against macro expansion. If a back quoted string is recognized as a macro name, add a leading or trailing space.
• Although macro definitions may be nested, extreme nesting of macros is known to trigger internal errors.
• A runaway recursion may trigger internal or end-of-file errors.
• Severe violations of the ANS-Forth standard may trigger erratic behavior.
Изтегляне
Реклама