PyForTool
Python-fortran-tool
Loading...
Searching...
No Matches
Public Member Functions | List of all members
pyfortool.cpp.Cpp Class Reference
Inheritance diagram for pyfortool.cpp.Cpp:
Inheritance graph
[legend]

Public Member Functions

 applyCPPifdef (self, keys)
 

Detailed Description

Methods to deal with cpp directives

Definition at line 10 of file cpp.py.

Member Function Documentation

◆ applyCPPifdef()

pyfortool.cpp.Cpp.applyCPPifdef (   self,
  keys 
)
Apply #ifdef / #ifndef only on some keys
:param keys: list of defined and undefined keys. The latter are preceded by a
             percentage sign '%'.
             E.g. if K is in keys, "#ifdef K "will be evaluated to True
                  if %K is in keys, "#ifdef K" will be evaluated to False

Warning: only #ifdef and #ifndef are treated and not "#if defined ..."

If key K is in keys
  #ifdef K
  A
  #else
  B
  #endif
is reduced to A
If %K is in keys, code snippet is reduced to B.
If neither K nor %K are present in keys, code is kept untouched.

Definition at line 18 of file cpp.py.

Here is the call graph for this function:

The documentation for this class was generated from the following file: