Documentation for module cp_parser_types

Utility routines to read data from files. Kept as close as possible to the old parser because 1. string handling is a weak point of fortran compilers, and it is easy to write correct things that do not work 2. conversion of old code

source: cp_parser_types.F
Loading...

public Types:

cp_parser_type
represent a parser

public Subroutines/Functions:

Start a parser run. Initial variables allow to @SET stuff before opening the file
SUBROUTINE
parser_release (parser)
releases the parser
SUBROUTINE
parser_reset (parser)
Resets the parser: rewinding the unit and re-initializing all parser structures

Parameters:

CHARACTER(1)
:: default_comment_character(2) = (/"#","!"/)
CHARACTER(1)
:: default_continuation_character = char(92)
CHARACTER(3)
:: default_end_section_label = "end"
CHARACTER(1)
:: default_section_character = "&"
CHARACTER(4)
:: default_separators = ",:;="
INTEGER
:: max_unit_number = 999

Other:

:: empty_initial_variables(2,1:0)

public Types:

TYPE :: cp_parser_type

represent a parser


INTEGER
:: id_nr ...
INTEGER
:: ref_count ...
:: end_section ...
:: start_section ...
CHARACTER(10)
:: separators ...
CHARACTER(1)
:: comment_character ...
CHARACTER(1)
:: continuation_character ...
CHARACTER(1)
:: section_character ...
:: input_file_name ...
CHARACTER(max_line_length)
:: input_line ...
INTEGER
:: icol Number of the current column in the current input line, -1 if at the end of the file icol1 : First column of the current input string icol2 : Last column of the current input string
INTEGER
:: icol1 ...
INTEGER
:: icol2 ...
INTEGER
:: input_unit Logical unit number of the input file
INTEGER
:: input_line_number Number of the current input line read from the input file
LOGICAL
:: first_separator ...
LOGICAL
:: apply_preprocessing ...
LOGICAL
:: parse_white_lines ...
DIMENSION(:,:), POINTER :: initial_variables ...
POINTER :: buffer ...
POINTER :: status ...
POINTER :: para_env ...
TYPE(inpp_type),
POINTER :: inpp ...
TYPE(ilist_type),
POINTER :: ilist ...

SUBROUTINEparser_create(parser, file_name, unit_nr, para_env, end_section_label, separator_chars, comment_char, continuation_char, section_char, parse_white_lines, initial_variables, apply_preprocessing)

Start a parser run. Initial variables allow to @SET stuff before opening the file

Arguments:
POINTER
:: parser ...
CHARACTER(*),
INTENT(in),
OPTIONAL
:: file_name ...
INTEGER,
INTENT(in),
OPTIONAL
:: unit_nr ...
OPTIONAL, POINTER
:: para_env ...
CHARACTER(*),
INTENT(in),
OPTIONAL
:: end_section_label ...
CHARACTER(*),
INTENT(in),
OPTIONAL
:: separator_chars ...
CHARACTER(1),
INTENT(in),
OPTIONAL
:: comment_char ...
CHARACTER(1),
INTENT(in),
OPTIONAL
:: continuation_char ...
CHARACTER(1),
INTENT(in),
OPTIONAL
:: section_char ...
LOGICAL,
INTENT(in),
OPTIONAL
:: parse_white_lines ...
CHARACTER(*),
OPTIONAL
:: initial_variables(:,:) ...
LOGICAL,
INTENT(in),
OPTIONAL
:: apply_preprocessing ...

SUBROUTINEparser_release(parser)

releases the parser

Arguments:
POINTER
:: parser ...

SUBROUTINEparser_reset(parser)

Resets the parser: rewinding the unit and re-initializing all parser structures

Arguments:
POINTER
:: parser ...