subroutinecompileprivate
subroutine compile(c, text, id)
Compile expression text.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| c | type(fypp_t) | inout | the state | |
| text | character(len=*) | in | the expression | |
| id | integer | out | the result |
Calls
Source
Show the code
subroutine compile(c, text, id)
type(fypp_t), intent(inout) :: c !! the state
character(len=*), intent(in) :: text !! the expression
integer, intent(out) :: id !! the result
type(scan_t) :: s
id = index_find(c%compiled, text)
if (id > 0) return
s%text = text
call next_token(c, s)
call parse_list(c, s, id)
if (s%kind /= T_END) call fail(c, 'cannot read the expression: '//text)
if (id > 0) call index_set(c%compiled, text, id)
end subroutine compile