StringCompare

String comparison.

Declaración

Sintaxis

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

Argumentos

Argument Name

Argument Description

left

left side of comparison operator

right

right side of comparison operator

type

table entry type

value

expression value

op

operand

Valores devueltos

The return value is the expression that the StringCompare represents.

Descripción

StringCompare represents string comparison expression type. Comparisons are:

  1. lexicographically less than, or less than equal to

  2. lexicographically greater than, or greater than or equal to

  3. Equal to

  4. Not equal to

Tipos

Only accepts strings.

Ejemplos

"aaa" > "bbb"

ASR:

(TranslationUnit
    (SymbolTable
        1
        {

        })
    [(StringCompare
        (StringConstant
            "aaa"
            (Character 1 3 () [])
        )
        Gt
        (StringConstant
            "bbb"
            (Character 1 3 () [])
        )
        (Logical 4 [])
        (LogicalConstant
            .false.
            (Logical 4 [])
        )
    )]
)

Ver también