ExpressionVisitor shipping in .NET 4.0
As an update to “I can’t believe Microsoft didn’t make [Enter API Name Here] public”, the Visual Studio Languages team (which own the System.Linq namespace as well as the C#, VB and F# compilers) have added a new public version of ExpressionVisitor.
This type allows you to traverse an entire expression graph by simply passing the expression to ExpressionVisitor.Visit(Expression). Each expression type has an associated VisitXXX method (such as VisitMember(MemberExpression), VisitCatchBlock(CatchBlock), etc) that you can override to get called back every time one of these expressions is encountered.
This should make Jeremy and Oren very happy. ;)