ArrayItem

Array item, value stored at each index.

Declaración

Sintaxis

ArrayItem(expr v, array_index* args, ttype type, arraystorage storage_format, expr? value)

Argumentos

Argument Name

Argument Description

v

expresión

args

array indeces

type

table entry type

storage_format

array storage format

value

expression value

Valores devueltos

The return value is the expression that the ArrayItem represents.

Descripción

ArrayItem represents Array Item.

Tipos

Only accepts array indexes.

Ejemplos

integer :: a(2)
a(0) = 0
a(1) = 1

ASR:

(TranslationUnit
    (SymbolTable
        1
        {
            a:
                (Variable
                    1
                    a
                    Local
                    ()
                    ()
                    Default
                    (Integer 4 [((IntegerConstant 1 (Integer 4 []))
                    (IntegerConstant 2 (Integer 4 [])))])
                    Source
                    Public
                    Required
                    .false.
                )

        })
    [(=
        (ArrayItem
            (Var 1 a)
            [(()
            (IntegerConstant 0 (Integer 4 []))
            ())]
            (Integer 4 [])
            ()
        )
        (IntegerConstant 0 (Integer 4 []))
        ()
    )
    (=
        (ArrayItem
            (Var 1 a)
            [(()
            (IntegerConstant 1 (Integer 4 []))
            ())]
            (Integer 4 [])
            ()
        )
        (IntegerConstant 1 (Integer 4 []))
        ()
    )]
)

Ver también

ArrayConstant