next_face_token Subroutine

public pure subroutine next_face_token(s, pos, first, last)

面行の pos 以降にある次の空白区切りトークンの範囲を返す。 計数パスと解析パスが同じ規則でトークンを数えるための共通 tokenizer。

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: s

f で始まる左詰めの面行。

integer, intent(inout) :: pos

走査開始位置。戻り値はトークン直後の位置。

integer, intent(out) :: first

トークン先頭位置。トークンがなければ first > last。

integer, intent(out) :: last

トークン先頭位置。トークンがなければ first > last。 トークン末尾位置。


Called by

proc~~next_face_token~~CalledByGraph proc~next_face_token next_face_token proc~count_face_tokens count_face_tokens proc~count_face_tokens->proc~next_face_token proc~parse_face_line parse_face_line proc~parse_face_line->proc~next_face_token proc~parse_face_line->proc~count_face_tokens proc~parse_obj parse_obj proc~parse_obj->proc~parse_face_line proc~scan_obj scan_obj proc~scan_obj->proc~count_face_tokens proc~load_obj_mesh load_obj_mesh proc~load_obj_mesh->proc~parse_obj proc~load_obj_mesh->proc~scan_obj proc~build_parts_mesh build_parts_mesh proc~build_parts_mesh->proc~load_obj_mesh proc~build_mesh_from_config build_mesh_from_config proc~build_mesh_from_config->proc~build_parts_mesh proc~load_or_init_run_state load_or_init_run_state proc~load_or_init_run_state->proc~build_mesh_from_config program~main main program~main->proc~load_or_init_run_state

Source Code

  pure subroutine next_face_token(s, pos, first, last)
    character(len=*), intent(in) :: s
    integer, intent(inout) :: pos
    integer, intent(out) :: first, last
    integer :: n

    n = len_trim(s)
    do while (pos <= n)
      if (s(pos:pos) /= ' ') exit
      pos = pos + 1
    end do
    first = pos
    last = pos - 1
    do while (pos <= n)
      if (s(pos:pos) == ' ') exit
      last = pos
      pos = pos + 1
    end do
  end subroutine next_face_token