parser_obj Derived Type

type, public :: parser_obj

Type represents a parser that can be used to get information from an input file


Inherits

type~~parser_obj~~InheritsGraph type~parser_obj parser_obj type~entry_obj entry_obj type~parser_obj->type~entry_obj entries

Inherited by

type~~parser_obj~~InheritedByGraph type~parser_obj parser_obj type~case_obj case_obj type~case_obj->type~parser_obj parser type~marker_set marker_set type~marker_set->type~parser_obj parser type~timer_obj timer_obj type~marker_set->type~timer_obj timer type~respart_set ResPart_set type~respart_set->type~parser_obj parser type~respart_set->type~marker_set ib type~respart_set->type~timer_obj timer type~solver_obj solver_obj type~solver_obj->type~parser_obj parser type~solver_obj->type~timer_obj timer type~timer_obj->type~parser_obj parser type~cdifs_case_obj cdifs_case_obj type~cdifs_case_obj->type~case_obj type~cdifs_obj cdifs_obj type~cdifs_obj->type~marker_set IB type~cdifs_obj->type~respart_set RP type~cdifs_obj->type~solver_obj type~cdifs_obj->type~cdifs_case_obj case type~grans_case_obj grans_case_obj type~grans_case_obj->type~case_obj type~grans_obj grans_obj type~grans_obj->type~marker_set IB type~grans_obj->type~respart_set RP type~grans_obj->type~solver_obj type~grans_obj->type~grans_case_obj case type~solid_obj solid_obj type~solid_obj->type~marker_set type~solid_set solid_set type~solid_set->type~solid_obj p

Components

Type Visibility Attributes Name Initial
type(entry_obj), public, allocatable :: entries(:)

Entries in an input file


Type-Bound Procedures

procedure, public :: Finalize => parser_obj_final

  • private subroutine parser_obj_final(this)

    Finalization routine

    Arguments

    Type IntentOptional Attributes Name
    class(parser_obj), intent(inout) :: this

    Parser object

generic, public :: Get => parser_obj_read0D, parser_obj_read1D

  • private subroutine parser_obj_read0D(this, label, value, default)

    Read value: 0D version

    Arguments

    Type IntentOptional 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

  • private subroutine parser_obj_read1D(this, label, value, default)

    Read value: 1D version

    Arguments

    Type IntentOptional 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

procedure, public :: Initialize => parser_obj_init

  • private subroutine parser_obj_init(this)

    Initialization the praser

    Arguments

    Type IntentOptional Attributes Name
    class(parser_obj), intent(inout) :: this

    Parser object

procedure, public :: IsDefined => parser_obj_IsDefined

  • private function parser_obj_IsDefined(this, label) result(found)

    Check whether the field is defined

    Arguments

    Type IntentOptional Attributes Name
    class(parser_obj), intent(inout) :: this

    Parser object

    character(len=*), intent(in) :: label

    label to look for

    Return Value logical

procedure, public :: ParseFile => parser_obj_ParseFile

  • private subroutine parser_obj_ParseFile(this, optInput)

    Read & parse the input file

    Arguments

    Type IntentOptional Attributes Name
    class(parser_obj), intent(inout) :: this

    Parser object

    character(len=*), intent(in), optional :: optInput

    Optional input file name

procedure, public :: Print => parser_obj_print

  • private subroutine parser_obj_print(this)

    Prints all variables found in the parsed file

    Arguments

    Type IntentOptional Attributes Name
    class(parser_obj), intent(inout) :: this

    Parser object

procedure, private :: AddEntry => parser_obj_AddEntry

  • private subroutine parser_obj_AddEntry(this, entry)

    Resize entries array to add a new entry

    Arguments

    Type IntentOptional Attributes Name
    class(parser_obj), intent(inout) :: this

    Parser object

    type(entry_obj), intent(in) :: entry

    New entrysize

generic, private :: AssignDefault => parser_obj_AssignDefault0D, parser_obj_AssignDefault1D

  • private subroutine parser_obj_AssignDefault0D(value, default)

    Assing default to value: 0D version

    Arguments

    Type IntentOptional Attributes Name
    class(*), intent(out) :: value

    Value to return

    class(*), intent(in) :: default

    Default value to return in case label is not found

  • private subroutine parser_obj_AssignDefault1D(value, default)

    Assing default to value: 1D version

    Arguments

    Type IntentOptional Attributes Name
    class(*), intent(out) :: value(:)

    Value to return

    class(*), intent(in) :: default(:)

    Default value to return in case label is not found

procedure, private :: FetchLabelID => parser_obj_FetchLabelID

  • private function parser_obj_FetchLabelID(this, label) result(id)

    Return ID of label in the array of entries Returns 0 if label not found.

    Arguments

    Type IntentOptional Attributes Name
    class(parser_obj), intent(in) :: this

    Parser object

    character(len=*), intent(in) :: label

    label to look for

    Return Value integer

procedure, private :: ParseLine => parser_obj_ParseLine

  • private subroutine parser_obj_ParseLine(this, line)

    Parse a line

    Arguments

    Type IntentOptional Attributes Name
    class(parser_obj), intent(inout) :: this

    Parser object

    character(len=MAX_LINE_SIZE), intent(inout) :: line

    A line from the input file

procedure, private, nopass :: parser_obj_AssignDefault0D

  • private subroutine parser_obj_AssignDefault0D(value, default)

    Assing default to value: 0D version

    Arguments

    Type IntentOptional Attributes Name
    class(*), intent(out) :: value

    Value to return

    class(*), intent(in) :: default

    Default value to return in case label is not found

procedure, private, nopass :: parser_obj_AssignDefault1D

  • private subroutine parser_obj_AssignDefault1D(value, default)

    Assing default to value: 1D version

    Arguments

    Type IntentOptional Attributes Name
    class(*), intent(out) :: value(:)

    Value to return

    class(*), intent(in) :: default(:)

    Default value to return in case label is not found

procedure, private, nopass :: parser_obj_ReformatLine

  • private subroutine parser_obj_ReformatLine(line)

    Parse a line

    Arguments

    Type IntentOptional Attributes Name
    character(len=MAX_LINE_SIZE), intent(inout) :: line

    A line from the input file

procedure, private :: parser_obj_read0D

  • private subroutine parser_obj_read0D(this, label, value, default)

    Read value: 0D version

    Arguments

    Type IntentOptional 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

procedure, private :: parser_obj_read1D

  • private subroutine parser_obj_read1D(this, label, value, default)

    Read value: 1D version

    Arguments

    Type IntentOptional 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