subroutineparse_testrecursiveprivate
recursive subroutine parse_test(c, s, id)
An expression, which may be conditional.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| c | type(fypp_t) | inout | the state | |
| s | type(scan_t) | inout | the expression | |
| id | integer | out | the result |
Calls
Source
Show the code
recursive subroutine parse_test(c, s, id)
type(fypp_t), intent(inout) :: c !! the state
type(scan_t), intent(inout) :: s !! the expression
integer, intent(out) :: id !! the result
integer :: condition, other, value
call parse_or(c, s, id)
if (.not. at_word(s, 'if')) return
value = id
call next_token(c, s)
call parse_or(c, s, condition)
call expect(c, s, 'else')
call parse_test(c, s, other)
id = new_expr(c, E_IF, condition, value, other)
end subroutine parse_test