LogicalCompare

Logical comparison expr ASR node.

声明

语法

LogicalCompare(expr left, cmpop op, expr right, ttype type, expr? value)

参数

Argument Name

Argument Description

left

left side of the comparison operand

right

right side of the comparison operand

op

comparison operator

type

table entry type

value

expression value

返回值

The return value is the expression that the LogicalCompare represents.

描述

LogicalCompare represents logical comparison operation.

Comparison operation can be:

  1. Equal to or not equal to .TRUE.

  2. Equal to or not equal to .FALSE.

类型

Only accepts .TRUE, .FALSE.

示例

.FALSE. == .TRUE.

ASR:

(TranslationUnit
    (SymbolTable
        1
        {

        })
    [(LogicalCompare
        (LogicalConstant
            .false.
            (Logical 4 [])
        )
        Eq
        (LogicalConstant
            .true.
            (Logical 4 [])
        )
        (Logical 4 [])
        (LogicalConstant
            .false.
            (Logical 4 [])
        )
    )]
)

也可以看看

IntegerCompare