As Ace say, no, not in a general sense. I did come up with a way to track a light source position and do basic diffuse (adding in Emitter) shading. But it will only consider the light(s) you specifically setup the shader to handle, and it will only take into account the lights origin (so a big area lamp would have the same effect). Environment lights will also be ignored, but you can do shading based on empties as some kind of weird hack.
See this post and the posts following it for improvements.
Can you track a sunlights infinite position? I think so. In the case shown, instead of calculating a distance based on its origin point (which I there use for squared light falloff), you would have to calculate an angle based on sunlights orientation, obtain a point far away on this vector, and use that instead. Off course drop the squared falloff thing. I’m not sure though if you can get more than only position out of this setup.
Again, this would be a hack to be used for specific projects, not a generic thing you would put in a material. I’m having HD issues right now, so I’m not sure if I’ll be able to try to setup something.