fson_value_add Subroutine

public subroutine fson_value_add(this, member)

Arguments

Type IntentOptional AttributesName
type(fson_value), pointer:: this
type(fson_value), pointer:: member

Contents

Source Code


Source Code

  subroutine fson_value_add(this, member)
    type(fson_value), pointer :: this, member, p

    ! associate the parent
    member % parent => this

    ! add to linked list
    if (associated(this % children)) then
       ! get to the tail of the linked list
       p => this % children
       do while (associated(p % next))
          p => p % next
       end do

       p % next => member
    else
       this % children => member
    end if

  end subroutine fson_value_add