Skip to content

CLR Expression Evaluators

Patrick Nelson edited this page Sep 4, 2015 · 14 revisions

Overview

If you've written or are writing a compiler for .NET, Visual Studio will use the C# Expression Evaluator (EE) by default if no custom EE exists. This might be acceptable for your purposes. However, if the C# experience isn't what you want/need, you have the option of replacing parts or all of the C# EE with your own implementation.

Microsoft has already implemented the Concord EE interface to support .NET languages (IDkmLanguageExpressionEvaluator). You do have the option to replace this implementation with your own, but this approach requires an enormous amount of work and is not recommended. Instead, you can customize the existing .NET EE to understand your language. There is a sample .NET expression evaluator you can look at in this repro.

Workflow

Here's a diagram of the .NET Expression Evaluator: .NET Expression Evaluator Architecture

When the user evaluates an expression in the Watch window, for example a + 1, the workflow is:

Clone this wiki locally