Presentation is loading. Please wait.

Presentation is loading. Please wait.

Pre-Compiler Directives for TTCN-3 Ina Schieferdecker in response to CR5089 and 5090.

Similar presentations


Presentation on theme: "Pre-Compiler Directives for TTCN-3 Ina Schieferdecker in response to CR5089 and 5090."— Presentation transcript:

1 Pre-Compiler Directives for TTCN-3 Ina Schieferdecker in response to CR5089 and 5090

2 Directives in C# C# has conditional compilation symbols which can be used to affect compilation. These can be defined within code or with parameters to the compiler. The "pre-processing" directives in C# (named solely for consistency with C/C++, despite there being no separate pre- processing step) are (text taken from the ECMA specification): #define and #undef –Used to define and undefine conditional compilation symbols #if, #elif, #else and #endif –Used to conditionally skip sections of source code #line –Used to control line numbers emitted for errors and warnings. #error and #warning –Used to issue errors and warnings. #region and #endregion –Used to explicitly mark sections of source code.

3 No Directives in Java conditional compilation can be realized by public static final variables in if statements (based on the control flow analysis done by Java) also no include – import is to be used instead

4 Limited Directives in Standard ML conditional compilation can be realized by functors with boolean arguments, however, compilers do not necessarily support conditional compilation include in ML basis file that lists the SML source files that make up a project or a library – SML has no import however

5 Limited Directives in Prolog ISO Prolog defines no way for program transformations such as macro expansion or conditional compilation There is a Prolog directive for file inclusion, but no import

6 Directives in Erlang Erlang preprocessor supports file inclusion, macros, and conditional compilation File inclusion (Erlang has no import) –include(File) –include_lib(File) Macro definition: –define(Const, Replacement) –define(Func(Var1,...,VarN), Replacement). Flow control: –undef(Macro) Causes the macro to behave as if it had never been defined. –ifdef(Macro) Evaluate the following lines only if Macro is defined. –ifndef(Macro) Evaluate the following lines only if Macro is not defined. –else Only allowed after an ifdef or ifndef directive. If that condition was false, the lines following else are evaluated instead. –endif Specifies the end of an ifdef or ifndef directive.

7 My Thoughts The addition of –#def, #undef –#if, #elif, #else, #endif could be a valuable extension for TTCN-3 e.g. in relation to conditional import support of several TTCN-3 releases in one module support of different TSIs in a test suite debugging If added, we should also enable the logging/stringification of macros


Download ppt "Pre-Compiler Directives for TTCN-3 Ina Schieferdecker in response to CR5089 and 5090."

Similar presentations


Ads by Google