(git:0de0cc2)
cp_parser_status_types.F
Go to the documentation of this file.
1 !--------------------------------------------------------------------------------------------------!
2 ! CP2K: A general program to perform molecular dynamics simulations !
3 ! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
4 ! !
5 ! SPDX-License-Identifier: GPL-2.0-or-later !
6 !--------------------------------------------------------------------------------------------------!
7 
8 ! **************************************************************************************************
9 !> \brief a module to allow the storage of the parser status
10 !> \author Teodoro Laino [tlaino] - University of Zurich
11 !> \date 08.2008
12 ! **************************************************************************************************
14  USE cp_parser_buffer_types, ONLY: buffer_type,&
17  USE kinds, ONLY: max_line_length
18 #include "../base/base_uses.f90"
19 
20  IMPLICIT NONE
21  PRIVATE
22 
23  TYPE status_type
24  LOGICAL :: in_use = .false.
25  INTEGER :: old_input_line_number = huge(0)
26  INTEGER :: old_icol = huge(0)
27  INTEGER :: old_icol1 = huge(0)
28  INTEGER :: old_icol2 = huge(0)
29  CHARACTER(LEN=max_line_length) :: old_input_line = ""
30  ! Store status of the buffer
31  TYPE(buffer_type), POINTER :: buffer => null()
32  END TYPE status_type
33 
34  PUBLIC :: status_type, create_status_type, release_status_type
35  CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'cp_parser_status_types'
36 
37 CONTAINS
38 
39 ! ****************************************************************************
40 !> \brief creates the parser status type
41 !> \param status ...
42 !> \date 08.2008
43 !> \author Teodoro Laino [tlaino] - University of Zurich
44 ! **************************************************************************************************
45  SUBROUTINE create_status_type(status)
46  TYPE(status_type), POINTER :: status
47 
48  cpassert(.NOT. ASSOCIATED(status))
49  ALLOCATE (status)
50  CALL create_buffer_type(status%buffer)
51  END SUBROUTINE create_status_type
52 
53 ! ****************************************************************************
54 !> \brief releases the parser status type
55 !> \param status ...
56 !> \date 08.2008
57 !> \author Teodoro Laino [tlaino] - University of Zurich
58 ! **************************************************************************************************
59  SUBROUTINE release_status_type(status)
60  TYPE(status_type), POINTER :: status
61 
62  cpassert(ASSOCIATED(status))
63  CALL release_buffer_type(status%buffer)
64  DEALLOCATE (status)
65  END SUBROUTINE release_status_type
66 
67 END MODULE cp_parser_status_types
a module to allow simple buffering of read lines of a parser
subroutine, public create_buffer_type(buffer)
Creates the parser buffer type.
recursive subroutine, public release_buffer_type(buffer)
Releases the parser buffer type.
a module to allow the storage of the parser status
subroutine, public create_status_type(status)
creates the parser status type
subroutine, public release_status_type(status)
releases the parser status type
Defines the basic variable types.
Definition: kinds.F:23
integer, parameter, public max_line_length
Definition: kinds.F:59