Syntax
|
pragma-directive: |
<pragma-option> |
|
<pragma-itokens> |
|
<pragma-msg> |
|
<pragma-verblev> |
|
<pragma-include> |
|
<pragma-spansymb> |
| pragma-option:
| pragma (option | parseroption) - <letter> (+ | -) [- <letter> (+ | -) ]... |
| pragma-itokens:
| pragma (inlinestart | inlineend) <expr> |
| pragma-msg:
| pragma (message | warning | error) <expr> |
| pragma-verblev:
| pragma verboselevel <expr> |
| pragma-include:
| pragma include <expr> |
| pragma-spansymb:
| pragma spansymbol <expr> |
Description
pragma is a special directive. If ISPP can't parse its parameters (because of a typo or wrong syntax), no error occurs – only a warning is issued. This is done for compatibility with other preprocessors, which may have their own syntax for the pragma directive.
The "pragma-option" variant of the pragma directive controls the options that ISPP uses to read the source. Each option has an assigned letter. Specify options by typing the group name (option or parseroption),
then the letter prefixed by a dash. Use a plus after the letter to turn the option on and a minus to turn it off. Multiple options can be specified at once (see syntax).
The first group of options (option) controls the general options, while the second group (parseroption) controls options specific to the parser. The list of options is shown at the end of this topic.
The "pragma-itokens" variant specifies inline directive terminators: starting and ending, respectively. After the token description keyword (inlinestart or inlineend), a string type expression must follow. It must not evaluate to an empty string. You can specify the same token for both starting and ending terminators. By default, {# (opening brace and a pound sign) and } (closing brace) are assumed.
The "pragma-msg" variant issues a message of the type specified by the keyword following the directive name. Messages and warnings are sent to the messages window of the compiler. Errors are shown (by the compiler) using message boxes. The expression must be of type string. See the error directive.
The "pragma-verblev" variant turns on verbose mode and sets the level of verbosity, which controls the importance of messages (see below). The least important messages appear only when the highest verbose level is set.
The "pragma-include" variant sets the include path. The expression may specify multiple paths delimited with semicolons. ISPP uses the list of directories when trying to find a file mentioned in the include directive.
The "pragma-spansymb" variant sets the symbol used to span multiple lines together. The expression must not evaluate to an empty string. Only the first symbol in the string is used.
ISPP options
| c |
Send the preprocessor output to the compiler after preprocessing. Defaults to on. |
| e |
Keep empty lines and lines with only whitespace in the preprocessor output. Defaults to on. |
| v |
Verbose mode. Defaults to off. |
Parser options
| b |
Short-circuit boolean evaluation. Defaults to on. |
| m |
Short-circuit multiplication evaluation. (In "0 * A", A won't be evaluated because the result of the expression is known to be zero.) Defaults to off. |
| p |
Pascal-style string literals. When off, uses C-style string literals (with escape sequences). Defaults to on. |
| u |
Allow undeclared identifiers. If an undefined identifier is encountered, ISPP raises an error unless this option is turned on, in which case a standalone identifier (one that doesn't look like a function call) is considered a void value. Defaults to off. |
Verbose levels
| 0 |
Messages about changes to the verbosity level |
| 1 |
Messages about any temporary files created by #file
|
| 2 |
#insert and #append messages |
| 4 |
#dim, #define, and #undef messages |
| 6 |
Conditional inclusion messages |
| 8 |
#emit messages |
| 9 |
Function call messages |
| 10 |
Local array allocation messages |
Examples
#pragma
parseroption -b- -u+
#pragma
option -c-
#pragma
warning
"Variable value is: " + Str(MyVar)
#pragma
option -v+
#pragma
verboselevel
9
#pragma
inlinestart
"$("
#pragma
inlineend
")"
#pragma
include __INCLUDE__ + ";D:\INCLUDE"
#pragma
spansymbol
"_"
See also
Message, Warning, Error