Abstract base class for TOML lexers.
Extract a token
Extract string value of token, works for keypath, string, multiline string, literal, and mulitline literal tokens.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_lexer), | intent(in) | :: | lexer |
Instance of the lexer |
||
type(toml_token), | intent(in) | :: | token |
Token to extract string value from |
||
character(len=:), | intent(out), | allocatable | :: | string |
String value of token |
Extract integer value of token
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_lexer), | intent(in) | :: | lexer |
Instance of the lexer |
||
type(toml_token), | intent(in) | :: | token |
Token to extract integer value from |
||
integer(kind=tfi), | intent(out) | :: | val |
Integer value of token |
Extract floating point value of token
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_lexer), | intent(in) | :: | lexer |
Instance of the lexer |
||
type(toml_token), | intent(in) | :: | token |
Token to extract floating point value from |
||
real(kind=tfr), | intent(out) | :: | val |
Floating point value of token |
Extract boolean value of token
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_lexer), | intent(in) | :: | lexer |
Instance of the lexer |
||
type(toml_token), | intent(in) | :: | token |
Token to extract boolean value from |
||
logical, | intent(out) | :: | val |
Boolean value of token |
Extract datetime value of token
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(toml_lexer), | intent(in) | :: | lexer |
Instance of the lexer |
||
type(toml_token), | intent(in) | :: | token |
Token to extract datetime value from |
||
type(toml_datetime), | intent(out) | :: | val |
Datetime value of token |
Extract a boolean from a token
Extract boolean value of token
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_lexer), | intent(in) | :: | lexer |
Instance of the lexer |
||
type(toml_token), | intent(in) | :: | token |
Token to extract boolean value from |
||
logical, | intent(out) | :: | val |
Boolean value of token |
Extract a timestamp from a token
Extract datetime value of token
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_lexer), | intent(in) | :: | lexer |
Instance of the lexer |
||
type(toml_token), | intent(in) | :: | token |
Token to extract datetime value from |
||
type(toml_datetime), | intent(out) | :: | val |
Datetime value of token |
Extract a float from a token
Extract floating point value of token
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_lexer), | intent(in) | :: | lexer |
Instance of the lexer |
||
type(toml_token), | intent(in) | :: | token |
Token to extract floating point value from |
||
real(kind=tfr), | intent(out) | :: | val |
Floating point value of token |
Extract an integer from a token
Extract integer value of token
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_lexer), | intent(in) | :: | lexer |
Instance of the lexer |
||
type(toml_token), | intent(in) | :: | token |
Token to extract integer value from |
||
integer(kind=tfi), | intent(out) | :: | val |
Integer value of token |
Extract a string from a token
Extract string value of token, works for keypath, string, multiline string, literal, and mulitline literal tokens.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_lexer), | intent(in) | :: | lexer |
Instance of the lexer |
||
type(toml_token), | intent(in) | :: | token |
Token to extract string value from |
||
character(kind=tfc, len=:), | intent(out), | allocatable | :: | string |
String value of token |
Get information about the source
Extract information about the source
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_lexer), | intent(in) | :: | lexer |
Instance of the lexer |
||
character(kind=tfc, len=*), | intent(in) | :: | meta |
Query about the source |
||
character(kind=tfc, len=:), | intent(out), | allocatable | :: | output |
Metadata about the source |
Obtain the next token
Advance the lexer to the next token.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_lexer), | intent(inout) | :: | lexer |
Instance of the lexer |
||
type(toml_token), | intent(inout) | :: | token |
Current lexeme |
type, abstract :: abstract_lexer contains !> Obtain the next token procedure(next), deferred :: next !> Extract a token generic :: extract => & & extract_string, extract_integer, extract_float, extract_bool, extract_datetime !> Extract a string from a token procedure(extract_string), deferred :: extract_string !> Extract an integer from a token procedure(extract_integer), deferred :: extract_integer !> Extract a float from a token procedure(extract_float), deferred :: extract_float !> Extract a boolean from a token procedure(extract_bool), deferred :: extract_bool !> Extract a timestamp from a token procedure(extract_datetime), deferred :: extract_datetime !> Get information about the source procedure(get_info), deferred :: get_info end type abstract_lexer