Implementing parser support for a new C# language feature

Lexical analysis and Syntax analysis (Parsing) are initial phases of the C# compiler that transform the input source text into a syntax tree with nodes and tokens and reports syntax diagnostics. This section will enable you to add the lexer and parser support 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. For details on the grammar and syntax definitions for this operator, read the previous recipe.

Get Roslyn Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.