AndIn particular you might find this post interesting; here I list most of the tasks that the C# compiler performs for you during its semantic analysis. As you can see, there are a lot of steps. We break the big analysis problem down into a series of problems that we can solve individually.
http://blogs.msdn.com/b/ericlippert/archive/2010/02/04/how-many-passes.aspx
Finally, if you're looking for a job doing this stuff when you're older, then consider coming to Microsoft as a college intern and trying to get into the developer division. That's how I ended up with my job today!