Bridging of length scales through gradient theory and diffusion equations of dislocations