BlockCall

Runs the body of a block construct.

Declaration

Syntax

BlockCall(int label, symbol m)

Arguments

Argument

Description

label

the statement label of the block statement, or -1.

m

the Block symbol holding the scope and the statements.

Return values

None.

Description

The statements of a block live in the Block symbol, because the construct has a scope of its own. BlockCall is what marks the position in the enclosing statement list where they run.

Examples

(BlockCall
  :label -1
  :m (SymbolRef 1 "block")
)

It comes from this complete ASR text document:

(TranslationUnit
  :symtab (SymbolTable
    :id 0
    :symbols {
      "main" (Program
        :symtab (SymbolTable
          :id 1
          :symbols {
            "block" (Block
              :symtab (SymbolTable
                :id 2
                :symbols {
                  "m" (Variable
                    :parent_symtab 2
                    :name "m"
                    :dependencies []
                    :intent :Local
                    :symbolic_value nil
                    :value nil
                    :storage :Default
                    :type (Integer
                      :kind 4
                    )
                    :type_declaration nil
                    :abi :Source
                    :access :Public
                    :presence :Required
                    :value_attr false
                    :target_attr false
                    :contiguous_attr false
                    :bindc_name nil
                    :is_volatile false
                    :is_protected false
                    :pass_attr :NotMethod
                    :self_argument nil
                    :codims []
                  )
                }
              )
              :name "block"
              :body [
                (Assignment
                  :target (Var
                    :v (SymbolRef 2 "m")
                  )
                  :value (IntegerConstant
                    :n 3
                    :type (Integer
                      :kind 4
                    )
                    :intboz_type :Decimal
                  )
                  :overloaded nil
                  :realloc_lhs false
                  :move_allocation false
                )
                (Assignment
                  :target (Var
                    :v (SymbolRef 1 "x")
                  )
                  :value (Var
                    :v (SymbolRef 2 "m")
                  )
                  :overloaded nil
                  :realloc_lhs false
                  :move_allocation false
                )
              ]
            )
            "x" (Variable
              :parent_symtab 1
              :name "x"
              :dependencies []
              :intent :Local
              :symbolic_value nil
              :value nil
              :storage :Default
              :type (Integer
                :kind 4
              )
              :type_declaration nil
              :abi :Source
              :access :Public
              :presence :Required
              :value_attr false
              :target_attr false
              :contiguous_attr false
              :bindc_name nil
              :is_volatile false
              :is_protected false
              :pass_attr :NotMethod
              :self_argument nil
              :codims []
            )
          }
        )
        :name "main"
        :dependencies []
        :body [
          (BlockCall
            :label -1
            :m (SymbolRef 1 "block")
          )
        ]
      )
    }
  )
  :items []
)

See Also

Block, AssociateBlockCall