Tokens of free-form Fortran source.
Every byte of the source belongs to exactly one token, including blanks, comments, line breaks and continuation markers, so joining the text of all tokens reproduces the source exactly.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | parameter | :: | CM_CONDITIONAL | = | 2 |
OpenMP conditional compilation: |
| integer, | public, | parameter | :: | CM_DIRECTIVE | = | 1 |
compiler directive: |
| integer, | public, | parameter | :: | CM_FORMATTER | = | 3 |
formatter directive: |
| integer, | public, | parameter | :: | CM_PLAIN | = | 0 |
ordinary comment |
| integer, | public, | parameter | :: | CT_LEADING | = | 2 |
|
| integer, | public, | parameter | :: | CT_TRAILING | = | 1 |
|
| integer, | public, | parameter | :: | STR_MULTILINE | = | 2 |
continued across lines |
| integer, | public, | parameter | :: | STR_RAW_CONT | = | 4 |
a continuation line without a leading |
| integer, | public, | parameter | :: | STR_UNTERMINATED | = | 1 |
no closing quote before the end of the line |
| integer, | public, | parameter | :: | TK_BOM | = | 15 |
UTF-8 byte order mark at the start of the file |
| integer, | public, | parameter | :: | TK_BOZ | = | 10 |
|
| integer, | public, | parameter | :: | TK_COMMENT | = | 3 |
from |
| integer, | public, | parameter | :: | TK_CONT | = | 4 |
continuation |
| integer, | public, | parameter | :: | TK_DOTOP | = | 11 |
|
| integer, | public, | parameter | :: | TK_FYPP | = | 13 |
inline fypp: |
| integer, | public, | parameter | :: | TK_INT | = | 7 |
integer literal, possibly with a kind ( |
| integer, | public, | parameter | :: | TK_NAME | = | 6 |
names and keywords |
| integer, | public, | parameter | :: | TK_NEWLINE | = | 2 |
LF, CRLF or CR |
| integer, | public, | parameter | :: | TK_OP | = | 12 |
operators and punctuation: |
| integer, | public, | parameter | :: | TK_OTHER | = | 14 |
any other character |
| integer, | public, | parameter | :: | TK_PREPROC | = | 5 |
a cpp or fypp directive line, with its continuation lines |
| integer, | public, | parameter | :: | TK_REAL | = | 8 |
real literal ( |
| integer, | public, | parameter | :: | TK_SPACE | = | 1 |
blanks and tabs |
| integer, | public, | parameter | :: | TK_STRING | = | 9 |
character literal, possibly with a kind prefix |
| logical, | public, | parameter | :: | is_code_kind(0:15) | = | [.true., .false., .false., .false., .false., .false., .true., .true., .true., .true., .true., .true., .true., .true., .true., .false.] |
True for the kinds of tokens that are part of the code, as opposed to layout (blanks, line
breaks, continuation markers), comments and preprocessor lines. Indexed by kind,
|
One token: a byte range of the source with its kind.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | first | = | 1 |
first byte in the source |
|
| logical, | public | :: | glued | = | .false. |
joined to the previous code token across a line break, with no blank allowed between |
|
| integer, | public | :: | kind | = | 0 |
one of the TK_* constants |
|
| integer, | public | :: | last | = | 0 |
last byte in the source |
|
| integer, | public | :: | line | = | 1 |
line of the first byte |
|
| integer, | public | :: | sub | = | 0 |
sub-kind (CM_, CT_, STR_*) |
Join the text of all tokens.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | src |
the source the tokens were read from |
||
| type(token_list_t), | intent(in) | :: | tokens |
tokens of |
True if token t is a < or > operator directly next to another one, as in the CUDA
kernel launch call k<<<grid, block>>>(x), where they are not relational operators.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | src |
the source the tokens were read from |
||
| type(token_list_t), | intent(in) | :: | tokens |
tokens of |
||
| integer, | intent(in) | :: | t |
index into |
Token text in lowercase (ASCII).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | src |
the source the token was read from |
||
| type(token_t), | intent(in) | :: | t |
a token of |
Token text, as it appears in the source.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | src |
the source the token was read from |
||
| type(token_t), | intent(in) | :: | t |
a token of |
Append token t, growing the storage as needed.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(token_list_t), | intent(inout) | :: | self |
the token list |
||
| type(token_t), | intent(in) | :: | t |
token to append |