IntegerUnaryMinus

Uniry minus operator as the second operand of binary arithmetic operators, a expr node.

声明

语法

IntegerUnaryMinus(expr arg, ttype type, expr? value)

参数

Argument Name

Argument Description

arg

expression arguments

type

table entry type

value

expression value

返回值

The return value is the expression that the IntegerUnaryMinus represents.

描述

IntegerUnaryMinus represents integer unary minus operand of binary arithmetic operators, to be used without parantheses.

Example : a = b * -c

类型

Only accepts integers.

示例

-1

ASR:

(TranslationUnit
    (SymbolTable
        1
        {

        })
    [(IntegerUnaryMinus
        (IntegerConstant 1 (Integer 4 []))
        (Integer 4 [])
        (IntegerConstant -1 (Integer 4 []))
    )]
)

也可以看看