schema_parse_lines Subroutine

private subroutine schema_parse_lines(this, lines, n_lines, status, errors)

In-memory sibling of schema_parse: validate + apply a namelist already held as a lines(:) character array (no file touch). Same error-return convention as schema_parse.

Type Bound

nml_schema_t

Arguments

Type IntentOptional Attributes Name
class(nml_schema_t), intent(inout) :: this
character(len=*), intent(in) :: lines(:)
integer, intent(in) :: n_lines
integer, intent(out), optional :: status
character(len=:), intent(out), optional, allocatable :: errors(:)

Calls

proc~~schema_parse_lines~~CallsGraph proc~schema_parse_lines nml_schema_t%schema_parse_lines proc~parse_from_lines parse_from_lines proc~schema_parse_lines->proc~parse_from_lines proc~post_parse_validate post_parse_validate proc~schema_parse_lines->proc~post_parse_validate proc~reset_state reset_state proc~schema_parse_lines->proc~reset_state proc~add_err add_err proc~parse_from_lines->proc~add_err proc~dispatch_group dispatch_group proc~parse_from_lines->proc~dispatch_group proc~make_prefix make_prefix proc~parse_from_lines->proc~make_prefix proc~next_amp next_amp proc~parse_from_lines->proc~next_amp proc~read_group_name read_group_name proc~parse_from_lines->proc~read_group_name proc~skip_to_slash skip_to_slash proc~parse_from_lines->proc~skip_to_slash error error proc~post_parse_validate->error proc~post_parse_validate->proc~add_err proc~error_ring_push error_ring_push proc~post_parse_validate->proc~error_ring_push proc~dispatch_group->proc~add_err proc~dispatch_group->proc~skip_to_slash names names proc~dispatch_group->names proc~group_name_list group_name_list proc~dispatch_group->proc~group_name_list proc~parse_group_body parse_group_body proc~dispatch_group->proc~parse_group_body proc~schema_find_group nml_schema_t%schema_find_group proc~dispatch_group->proc~schema_find_group proc~schema_is_external nml_schema_t%schema_is_external proc~dispatch_group->proc~schema_is_external proc~strip_nml strip_nml proc~dispatch_group->proc~strip_nml proc~suggest suggest proc~dispatch_group->proc~suggest proc~fmt_int fmt_int proc~make_prefix->proc~fmt_int proc~strip_comment strip_comment proc~next_amp->proc~strip_comment proc~is_ident_char is_ident_char proc~read_group_name->proc~is_ident_char proc~read_group_name->proc~strip_comment proc~skip_to_slash->proc~strip_comment proc~apply_one_pair apply_one_pair proc~parse_group_body->proc~apply_one_pair proc~collect_tokens collect_tokens proc~parse_group_body->proc~collect_tokens proc~schema_find_group->proc~strip_nml proc~lower lower proc~schema_find_group->proc~lower proc~schema_is_external->proc~strip_nml proc~schema_is_external->proc~lower proc~strip_nml->proc~lower proc~levenshtein levenshtein proc~suggest->proc~levenshtein proc~suggest->proc~lower proc~apply_one_pair->proc~add_err proc~apply_one_pair->proc~make_prefix proc~apply_one_pair->names proc~apply_one_pair->proc~suggest parse_tokens parse_tokens proc~apply_one_pair->parse_tokens proc~append_val append_val proc~apply_one_pair->proc~append_val proc~group_find_key nml_group_t%group_find_key proc~apply_one_pair->proc~group_find_key proc~group_key_list group_key_list proc~apply_one_pair->proc~group_key_list proc~collect_tokens->proc~add_err proc~collect_tokens->proc~make_prefix proc~collect_tokens->proc~strip_comment proc~check_unsupported check_unsupported proc~collect_tokens->proc~check_unsupported proc~push_tok push_tok proc~collect_tokens->proc~push_tok

Called by

proc~~schema_parse_lines~~CalledByGraph proc~schema_parse_lines nml_schema_t%schema_parse_lines proc~read_config_from_string_impl read_config_from_string_impl proc~read_config_from_string_impl->proc~schema_parse_lines proc~read_config_from_string read_config_from_string proc~read_config_from_string->proc~read_config_from_string_impl proc~build_pending_handle build_pending_handle proc~build_pending_handle->proc~read_config_from_string proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~build_pending_handle proc~rdb_ocean_create_pending rdb_ocean_create_pending proc~rdb_ocean_create_pending->proc~build_pending_handle

Variables

Type Visibility Attributes Name Initial
character(len=*), private, parameter :: LABEL = "<config-string>"
character(len=:), private, allocatable :: err_buf(:)
integer, private :: n_err

Source Code

   subroutine schema_parse_lines(this, lines, n_lines, status, errors)
      !! In-memory sibling of `schema_parse`: validate + apply a namelist
      !! already held as a `lines(:)` character array (no file touch).
      !! Same error-return convention as `schema_parse`.
      class(nml_schema_t), intent(inout) :: this
      character(len=*), intent(in) :: lines(:)
      integer, intent(in) :: n_lines
      integer, intent(out), optional :: status
      character(len=:), allocatable, intent(out), optional :: errors(:)

      character(len=:), allocatable :: err_buf(:)
      integer :: n_err
      character(len=*), parameter :: LABEL = "<config-string>"

      n_err = 0
      call reset_state(this)
      call parse_from_lines(this, lines, n_lines, LABEL, err_buf, n_err)
      call post_parse_validate(this, LABEL, err_buf, n_err, status, errors)
   end subroutine schema_parse_lines