SPL to HP C/XL Migration Guide (30231-90001)
5-19
Logical Expressions
Table 5-22. Logical Expressions
---------------------------------------------------------------------------------------------
|||
| SPL | HP C/XL Equivalent |
|||
---------------------------------------------------------------------------------------------
|||
|
logical-expression
: | Same as SPL, except: |
|||
|*
logical-elem
[
log-bit-op logical-elem
]| |
|||
|*
lower
<=
test
<=
upper
|((
lower
)<=(
test
)&(
test
)<=(
upper
))|
|||
| | The parentheses may be necessary for |
|
lower
,
test
,
upper
: | correct evaluation if the elements are |
| | expressions or if the entire expression is |
| are integer expressions. | combined with other expressions. |
|||
|||
| | &: |
| | Same as SPL LAND. See below |
|||
---------------------------------------------------------------------------------------------
|||
|
logical-elem
: | Same as SPL. |
|||
|
logical-expression
||
|||
|
logical-primary
[
rel-op logical-primary
]| |
|||
|
arith-expression rel-op arith-expression
||
|||
|
logical-primary logical-op logical-primary
||
|||
|
byte-comparison
||
|||
---------------------------------------------------------------------------------------------
||
|
logical-primary
is one of: | Same as SPL, except: |
|||
|
logical-variable
||
|
logical/integer-constant
||
|
string-constant
||
|
logical-bit-operation
||
|(
logical-expression
)| |
|
logical-function-designator
||
|(
logical-assignment
)| |
| NOT
logical-primary (bitwise negation)
|~
logical-primary (bitwise negation;tilde)
|
|||
---------------------------------------------------------------------------------------------
|||
|
log-bit-op
:|
log-bit-op
:|
|||
| LAND
(logical bitwise AND)
|&
(bitwise AND)
|
| LOR
(logical bitwise inclusive OR)
||
(bitwise inclusive OR)
|
| XOR
(logical bitwise exclusive OR)
|^
(bitwise exclusive OR; circumflex)
|
|||
| | Note: The HP C/XL exclusive OR operator, |
| | "^", is the SPL exponentiation operator. |
|||
---------------------------------------------------------------------------------------------
|||
| The bit-wise operators, NOT, LAND, LOR, and | Similar to SPL. Operands may be any numeric |
| XOR, perform Boolean operations on the | types. Results correspond to operand |
| corresponding bits of their operands and | types. |
| produce a numeric result of type LOGICAL. | |
|||
---------------------------------------------------------------------------------------------
| | |
|
logical-op
: | Same as SPL, except: |