Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=3), | private, | parameter | :: | COMMENT_SYMBOLS | = | '!#%' |
Allowed comment symbols |
integer, | private, | parameter | :: | MAX_LABEL_SIZE | = | 128 |
Maximum number of characters in a label |
integer, | private, | parameter | :: | MAX_LINE_SIZE | = | 4096 |
Maximum number of characters in a line |
character(len=1), | private, | parameter | :: | SEPARATOR | = | ':' |
Character used to seperate label form value |
integer, | private, | parameter | :: | TAB_ICHAR | = | 9 |
ichar of a tab character |
Type represents a parser that can be used to get information from an input file
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(entry_obj), | public, | allocatable | :: | entries(:) |
Entries in an input file |
procedure, public :: Finalize => parser_obj_final | |
generic, public :: Get => parser_obj_read0D, parser_obj_read1D | |
procedure, public :: Initialize => parser_obj_init | |
procedure, public :: IsDefined => parser_obj_IsDefined | |
procedure, public :: ParseFile => parser_obj_ParseFile | |
procedure, public :: Print => parser_obj_print | |
procedure, private :: AddEntry => parser_obj_AddEntry | |
generic, private :: AssignDefault => parser_obj_AssignDefault0D, parser_obj_AssignDefault1D | |
procedure, private :: FetchLabelID => parser_obj_FetchLabelID | |
procedure, private :: ParseLine => parser_obj_ParseLine | |
procedure, private, nopass :: parser_obj_AssignDefault0D | |
procedure, private, nopass :: parser_obj_AssignDefault1D | |
procedure, private, nopass :: parser_obj_ReformatLine | |
procedure, private :: parser_obj_read0D | |
procedure, private :: parser_obj_read1D |
Object representing an entry in the input file
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=:), | public, | allocatable | :: | label |
Column label |
||
character(len=:), | public, | allocatable | :: | value |
Value |
Return ID of label in the array of entries Returns 0 if label not found.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(parser_obj), | intent(in) | :: | this |
Parser object |
||
character(len=*), | intent(in) | :: | label |
label to look for |
Check whether the field is defined
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(parser_obj), | intent(inout) | :: | this |
Parser object |
||
character(len=*), | intent(in) | :: | label |
label to look for |
Resize entries array to add a new entry
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(parser_obj), | intent(inout) | :: | this |
Parser object |
||
type(entry_obj), | intent(in) | :: | entry |
New entrysize |
Assing default to value: 0D version
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(*), | intent(out) | :: | value |
Value to return |
||
class(*), | intent(in) | :: | default |
Default value to return in case label is not found |
Assing default to value: 1D version
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(*), | intent(out) | :: | value(:) |
Value to return |
||
class(*), | intent(in) | :: | default(:) |
Default value to return in case label is not found |
Read & parse the input file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(parser_obj), | intent(inout) | :: | this |
Parser object |
||
character(len=*), | intent(in), | optional | :: | optInput |
Optional input file name |
Parse a line
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(parser_obj), | intent(inout) | :: | this |
Parser object |
||
character(len=MAX_LINE_SIZE), | intent(inout) | :: | line |
A line from the input file |
Parse a line
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=MAX_LINE_SIZE), | intent(inout) | :: | line |
A line from the input file |
Finalization routine
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(parser_obj), | intent(inout) | :: | this |
Parser object |
Initialization the praser
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(parser_obj), | intent(inout) | :: | this |
Parser object |
Prints all variables found in the parsed file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(parser_obj), | intent(inout) | :: | this |
Parser object |
Read value: 0D version
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(parser_obj), | intent(inout) | :: | this |
Parser object |
||
character(len=*), | intent(in) | :: | label |
Label |
||
class(*), | intent(out) | :: | value |
Value to return |
||
class(*), | intent(in), | optional | :: | default |
Default value to return in case label is not found |
Read value: 1D version
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(parser_obj), | intent(inout) | :: | this |
Parser object |
||
character(len=*), | intent(in) | :: | label |
Label |
||
class(*), | intent(out) | :: | value(:) |
Value to return |
||
class(*), | intent(in), | optional | :: | default(:) |
Default value to return in case label is not found |