ArraySection

Section of Array.

Declaración

Sintaxis

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

Argumentos

Argument Name

Argument Description

v

expresión

args

array index arguments

type

table entry type

value

expression value

Valores devueltos

The return value is the expression that the ArraySection represents.

Descripción

ArraySection represents section of the array.

Tipos

Only accepts section of arrays.

Ejemplos

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 [])))])
            ()
        )]
        ()
        ()
    )]
)

Ver también