Implementing lowering/code generation support for a new C# language feature
Lowering is an intermediate phase that executes after binding and transforms high level bound trees into simplified bound trees. These simplified bound trees are provided to the Code Generation phase and converted into MSIL and emitted into a .NET assembly. This section will enable you to add the lowering support for a new C# language feature: Switch operator (?::)
. This will enable you to write, compile, and correctly execute C# programs with the new operator. For details on the intended functionality of this operator, read the section, New language feature: Switch Operator (?::) at the start of this chapter. For details on the grammar and syntax definitions for this operator, read the first recipe of this chapter, Designing syntax and grammar for a new C# language feature.
Getting Started
You need to ensure that you have enlisted and built Roslyn sources with VS2017 tag on your machine. For further guidance, refer...