tree_graph__regex Subroutine

private pure recursive subroutine tree_graph__regex(self)

Type Bound

tree_t

Arguments

Type IntentOptional Attributes Name
class(tree_t), intent(inout) :: self

Source Code

   pure recursive subroutine tree_graph__regex(self)
      implicit none
      class(tree_t), intent(inout) :: self

      type(tree_node_t) :: node, left, right

      call self%term()
      left = self%get_top()

      do while (self%tape%current_token == tk_union)
         call self%tape%get_token()

         call self%term()
         right = self%get_top()

         node = make_tree_node(op_union)
         call self%register_connector(node, left, right)

         left = self%get_top()
      end do
   end subroutine tree_graph__regex