Designing syntax and grammar for a new C# language feature
Syntax and Grammar are the core elements for implementing a new language feature. This section will enable you to define the syntax (nodes and tokens) and grammar for a new C# language feature: Switch operator (?::)
. For details on the intended functionality of this operator, read the section New language feature:Switch Operator (?::) at the start of this chapter.
Getting Started
You need to ensure that you have enlisted and built Roslyn sources with VS2017 tag on your machine. For further guidance, refer to the recipe, Setting up Roslyn enlistment inChapter 8, Contribute Simple Functionality to Roslyn C# Compiler Open Source Code.
Note
For the steps in the recipe that mention Define ... in the C# language specification, the reader should create a new GitHub issue on (https://github.com/dotnet/roslyn/issues/new) with labels Language-C# and Area-Language Design and get the specification reviewed by the language team. If approved, the...