Read text into s: tokenize it, group the tokens into items and find the protected ones.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | text |
the source text |
||
| type(source_t), | intent(out) | :: | s |
the result |
subroutine parse_source(text, s) !! Read `text` into `s`: tokenize it, group the tokens into items and find the protected ones. character(len=*), intent(in) :: text !! the source text type(source_t), intent(out) :: s !! the result s%text = text call tokenize(s%text, s%tokens) call split_statements(s%text, s%tokens, s%stmts) s%keep = protected_items(s%text, s%tokens, s%stmts) end subroutine parse_source