A.5 LISA+ preprocessor statements

LISA+ preprocessor statements have the same syntax and semantics as the corresponding C preprocessor statements.

#define

Define a macro. Macros can have arguments. Converting to strings (# operator) and concatenating (## operator) are supported. The macro is defined in all LISA+ source in the same file that follows the #define statement unless it is explicitly #undefined.

Macros can be redefined several times without warning if the redefinition is identical. Macro expansion is disabled in LISA+ top-level code because of scope. Macros defined on the LISA+ top-level do not affect conditional statements in the includes and resources sections.

#undef
Undefine a macro. The macro is undefined in all LISA+ code in the same file that follows this statement. It is not an error if the macro was not defined before this statement.
#if, #elif, #else, #endif

Enable or disable the code enclosed by #if, #elif, #else, or #endif blocks, depending on the value of the expression following the #if and #elif statements. If the expression evaluates to 0 the code is disabled, for all other values the code is enabled.

Undefined identifiers in the expression have a numerical value of 0. The expression defined(SYM) evaluates to 1 if the preprocessor symbol SYM is defined or 0 if it is not defined.

#ifdef, #ifndef
Shortcuts for the #if defined(SYM) and #if !defined(SYM) statements, respectively.
#include
Include statements are ignored by the LISA+ preprocessor because of scope. However, #include statements in the includes sections of components have the required effect of making the declarations in the header files visible in the behavior code.
#error
Print the error message that follows the #error statement. Processing of the LISA+ code by the tool is unsuccessful and the tool performs as if an error has occurred.
#warning
Print the warning message that follows the #warning statement. Processing of the LISA+ code by the tool is successful and the tool performs as normal.
Non-ConfidentialPDF file icon PDF version101092_0100_03_en
Copyright © 2014–2018 Arm Limited or its affiliates. All rights reserved.