fson_library Module

JSON file reading module author: P J Knight, CCFE, Culham Science Centre N/A This module uses a local copy of the freely-available FSON library, written by Joseph A. Levin and distributed via github, to enable PROCESS to read in information from JSON-formatted files. None



Contents


Variables

TypeVisibility AttributesNameInitial
integer, private, parameter:: end_of_file =-1
integer, private, parameter:: end_of_record =-2
integer, private, parameter:: STATE_LOOKING_FOR_VALUE =1
integer, private, parameter:: STATE_IN_OBJECT =2
integer, private, parameter:: STATE_IN_PAIR_NAME =3
integer, private, parameter:: STATE_IN_PAIR_VALUE =4
integer, private :: pushed_index
character(len=10), private :: pushed_char

Functions

public function fson_parse(file, unit) result(p)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: file
integer, intent(inout), optional :: unit

Return Value type(fson_value), pointer

private function parse_string(unit) result(string)

Arguments

Type IntentOptional AttributesName
integer, intent(inout) :: unit

Return Value type(fson_string), pointer

private function parse_integer(unit, digit_count) result(integral)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: unit
integer, intent(inout), optional :: digit_count

Return Value integer(kind=8)

private recursive function pop_char(unit, eof, skip_ws) result(popped)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: unit
logical, intent(out) :: eof
logical, intent(in), optional :: skip_ws

Return Value character


Subroutines

public subroutine init_fson_library()

Initialise fson library module variables

Arguments

None

private recursive subroutine parse_value(unit, value)

Arguments

Type IntentOptional AttributesName
integer, intent(inout) :: unit
type(fson_value), pointer:: value

private recursive subroutine parse_object(unit, parent)

Arguments

Type IntentOptional AttributesName
integer, intent(inout) :: unit
type(fson_value), pointer:: parent

private recursive subroutine parse_array(unit, array)

Arguments

Type IntentOptional AttributesName
integer, intent(inout) :: unit
type(fson_value), pointer:: array

private subroutine parse_for_chars(unit, chars)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: unit
character(len=*), intent(in) :: chars

private subroutine parse_number(unit, value)

Arguments

Type IntentOptional AttributesName
integer, intent(inout) :: unit
type(fson_value), pointer:: value

private subroutine push_char(c)

Arguments

Type IntentOptional AttributesName
character, intent(inout) :: c