-
Notifications
You must be signed in to change notification settings - Fork 1
/
operator_if.c
47 lines (31 loc) · 1.08 KB
/
operator_if.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# include <stdlib.h>
# include <stdio.h>
# include <assert.h>
# include "basic_type.h"
# include "operator_if.h"
# include "macro_operator_c.h"
# include "value_boolean.h"
# include "value_block.h"
# include "value_protected_label.h"
# include "value_error.h"
# include "operator_label.h"
# undef NDEBUG // FORCE ASSERT ACTIVATION
/*!
* \file
* \brief Operator \c if: when evaluated depending the \c value_boolean on top of the stack activates or not the next value on the stack.
*
* Both values are destroyed.
* Value on top must be a \c value_boolean and under should be a \c value_block or \c value_protected_label.
* If this last \c value is a \c value_block, the chunks evaluated in order.
* If this last \c value is a \c value_protected_label, then it as evaluated as the corresponding \c operator_label.
*
* If the stack is not deep enough or a wrong kind of \c value is found, then a \c basic_type_error is returned.
*
* assert is enforced.
*
* \author Jérôme DURAND-LOSE
* \version 1
* \date 2015
* \copyright GNU Public License.
*/
OPERATOR_DECLARE ( if )