[ < ][]   [Contents][Index]

B.2 Conditional expressions

A directive argument common to all the directives is the conditionnal expression. A conditionnal expression may be true or false, it is a combination of select flags. the select flags are combined with logical operators. A select flag itself is true if it was selected. A select flag selflag is selected by using the sel selflag instruction in cmz. It is selected by passing the -D selflag command line switch to the call of the cmz directives preprocessor when using make.

A ‘-’ negates the expression that follows. Parenthesis ‘(’ and ‘)’ are used for the grouping of subexpressions. ‘|’ and ‘,’ are for the boolean or: an expression with a or is true if the expression on the left or the expression on the right of the or is true. ‘&’ is for the boolean and: an expression with an and is true if the expression on the left and the expression on the right are true.

The grouping is left to right when there is no parenthesis, with or and ‘&’ having the same precedence. Therefore

a&b|c    ≡    (a&b)|c
a|b&c    ≡    (a|b)&c
a|b&c  is not  a|(b&c)
a&b|c  is not  a&(b|c)

[Contents][Index]