eĿlipsis
a language independent preprocessor
 
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Loading...
Searching...
No Matches
ellipsis-contracts-macros.h
Go to the documentation of this file.
1#once
2#include_directives <ellipsis-defer.h>
3
4#ifndef DOXYGEN_SPECIAL
5
6<|
7#define ellipsis_contracts_ignore()
8__MULTI__(⸤ELLIPSIS_CONTRACTS_IGNORE⸥,
9 __EXPAND_DEC__(ELLIPSIS_CONTRACTS_DYNAMIC),
10 __EXPAND_DEC__(ELLIPSIS_CONTRACTS_UNCHECKED),
11 __EXPAND_DEC__(ELLIPSIS_CONTRACTS_PROCEED))()
12|>
13
14#define ELLIPSIS_CONTRACTS_IGNORE_0_0_0() (false)
15#define ELLIPSIS_CONTRACTS_IGNORE_0_0_1() (false)
16#define ELLIPSIS_CONTRACTS_IGNORE_0_1_0() (true)
17#define ELLIPSIS_CONTRACTS_IGNORE_0_1_1() (true)
18#define ELLIPSIS_CONTRACTS_IGNORE_1_0_0() (⸤ellipsis∷contracts∷ignore∷dynamic⸥)
19#define ELLIPSIS_CONTRACTS_IGNORE_1_0_1() (⸤ellipsis∷contracts∷ignore∷dynamic⸥)
20#define ELLIPSIS_CONTRACTS_IGNORE_1_1_0() (⸤ellipsis∷contracts∷ignore∷dynamic⸥)
21#define ELLIPSIS_CONTRACTS_IGNORE_1_1_1() (⸤ellipsis∷contracts∷ignore∷dynamic⸥)
22
23<|
24#define ellipsis_contracts_proceed()
25__MULTI__(⸤ELLIPSIS_CONTRACTS_PROCEED⸥,
26 __EXPAND_DEC__(ELLIPSIS_CONTRACTS_DYNAMIC),
27 __EXPAND_DEC__(ELLIPSIS_CONTRACTS_UNCHECKED),
28 __EXPAND_DEC__(ELLIPSIS_CONTRACTS_PROCEED))()
29|>
30
31#define ELLIPSIS_CONTRACTS_PROCEED_0_0_0() (false)
32#define ELLIPSIS_CONTRACTS_PROCEED_0_0_1() (true)
33#define ELLIPSIS_CONTRACTS_PROCEED_0_1_0() (false)
34#define ELLIPSIS_CONTRACTS_PROCEED_0_1_1() (true)
35#define ELLIPSIS_CONTRACTS_PROCEED_1_0_0() (⸤ellipsis∷contracts∷proceed∷dynamic⸥)
36#define ELLIPSIS_CONTRACTS_PROCEED_1_0_1() (⸤ellipsis∷contracts∷proceed∷dynamic⸥)
37#define ELLIPSIS_CONTRACTS_PROCEED_1_1_0() (⸤ellipsis∷contracts∷proceed∷dynamic⸥)
38#define ELLIPSIS_CONTRACTS_PROCEED_1_1_1() (⸤ellipsis∷contracts∷proceed∷dynamic⸥)
39
40<|
41#define ellipsis_contracts_verbose()
42__MULTI__(⸤ELLIPSIS_CONTRACTS_VERBOSE⸥,
43 __EXPAND_DEC__(ELLIPSIS_CONTRACTS_DYNAMIC),
44 __EXPAND_DEC__(ELLIPSIS_CONTRACTS_VERBOSE))()
45|>
46
47#define ELLIPSIS_CONTRACTS_VERBOSE_0_0() (false)
48#define ELLIPSIS_CONTRACTS_VERBOSE_0_1() (true)
49#define ELLIPSIS_CONTRACTS_VERBOSE_1_0() (⸤ellipsis∷contracts∷verbose∷dynamic⸥)
50#define ELLIPSIS_CONTRACTS_VERBOSE_1_1() (⸤ellipsis∷contracts∷verbose∷dynamic⸥)
51
52#endif
53
54#define ellipsis_contracts_assert(COND, ...) ELLIPSIS_CONTRACT_ASSERT_IMPL("assertion", COND, ⌗COND __VA_OPT__(,) __VA_ARGS__)
55#define ellipsis_contracts_pre(COND, ...) ELLIPSIS_CONTRACT_ASSERT_IMPL("precondition", COND, ⌗COND __VA_OPT__(,) __VA_ARGS__)
56#define ellipsis_contracts_post(COND, ...) defer { ELLIPSIS_CONTRACT_ASSERT_IMPL("postcondition", COND, ⌗COND __VA_OPT__(,) __VA_ARGS__); }
57
58<|
59#define ellipsis_contracts_invariant(COND, ...)
60ELLIPSIS_CONTRACT_ASSERT_IMPL("precondition", COND, ⌗COND __VA_OPT__(,) __VA_ARGS__);
61defer { ELLIPSIS_CONTRACT_ASSERT_IMPL("postcondition", COND, ⌗COND __VA_OPT__(,) __VA_ARGS__); }
62|>
63
64#define ellipsis_contracts_assume(COND, ...) ELLIPSIS_CONTRACT_ASSUME_IMPL("assumption", COND, ⌗COND __VA_OPT__(,) __VA_ARGS__)
65#define ellipsis_contracts_premise(COND, ...) ELLIPSIS_CONTRACT_ASSUME_IMPL("premise", COND, ⌗COND __VA_OPT__(,) __VA_ARGS__)
66#define ellipsis_contracts_conclusion(COND, ...) defer { ELLIPSIS_CONTRACT_ASSUME_IMPL("conclusion", COND, ⌗COND __VA_OPT__(,) __VA_ARGS__); }
67
68<|
69#define ellipsis_contracts_fact(COND, ...)
70ELLIPSIS_CONTRACT_ASSUME_IMPL("premise", COND, ⌗COND __VA_OPT__(,) __VA_ARGS__);
71defer { ELLIPSIS_CONTRACT_ASSUME_IMPL("conclusion", COND, ⌗COND __VA_OPT__(,) __VA_ARGS__); }
72|>
__directive__ define
The define directive as specified by the C standard.
Definition directives.c:33
__directive__ endif
The endif directive as specified by the C standard.
Definition directives.c:52
#define ellipsis_contracts_assert(COND,...)
Definition ellipsis-contracts-macros.h:54
#define ELLIPSIS_CONTRACT_ASSUME_IMPL(CTYPE, COND, CSTR,...)
Intermediate macro that remains from an assumption after a first step of preprocessing by eĿlipsis.
Definition ellipsis-contracts.h:36
#define ELLIPSIS_CONTRACT_ASSERT_IMPL(CTYPE, COND, CSTR,...)
Intermediate macro that remains from an assertion after a first step of preprocessing by eĿlipsis.
Definition ellipsis-contracts.h:26
#define defer
Mark the depending compound statement as being deferred until the current compound statement (the anc...
Definition ellipsis-defer.h:524
#define __MULTI__(...)
Definition ellipsis-predefined.dirs:22
#define __VA_OPT__
A pseudo macro that cannot be redefined.
Definition ellipsis-predefined.dirs:89
#define __EXPAND_DEC__(…)
expand all the arguments, evaluate the resulting integer expression and produce a decimal literal
Definition ellipsis-predefined.dirs:50