ArraySection

Section of Array.

Declaration

Sintaxe

ArraySection(expr v, array_index* args, ttype type, expr? value)

Argumentos

Argument Name

Argument Description

v

expressão

args

array index arguments

type

table entry type

value

expression value

Valores de retorno

The return value is the expression that the ArraySection represents.

Descrição

ArraySection represents section of the array.

Tipos

Only accepts section of arrays.

Exemplos

integer, dimension(3) :: x
x(0) = 0
x(1) = 1
x(2) = 2
print *, x(1:)

ASR:

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

        })
    [(=
        (ArrayItem
            (Var 1 x)
            [(()
            (IntegerConstant 0 (Integer 4 []))
            ())]
            (Integer 4 [])
            ()
        )
        (IntegerConstant 0 (Integer 4 []))
        ()
    )
    (=
        (ArrayItem
            (Var 1 x)
            [(()
            (IntegerConstant 1 (Integer 4 []))
            ())]
            (Integer 4 [])
            ()
        )
        (IntegerConstant 1 (Integer 4 []))
        ()
    )
    (=
        (ArrayItem
            (Var 1 x)
            [(()
            (IntegerConstant 2 (Integer 4 []))
            ())]
            (Integer 4 [])
            ()
        )
        (IntegerConstant 2 (Integer 4 []))
        ()
    )
    (Print
        ()
        [(ArraySection
            (Var 1 x)
            [((IntegerConstant 1 (Integer 4 []))
            ()
            (IntegerConstant 1 (Integer 4 [])))]
            (Integer 4 [((IntegerConstant 1 (Integer 4 []))
            (IntegerConstant 3 (Integer 4 [])))])
            ()
        )]
        ()
        ()
    )]
)

Veja Também