ReSharper Platform SDK
 
Because ReSharper Platform SDK undefined is still in development, this documentation may not be entirely accurate and is subject to change.

Using CsLex

Last modified: 04 July 2023

The SDK ships with a tool called CsLex, which is a C# utility for building lexers. It takes in a specially formatted file and generates a C# class that is then compiled into the project. The generated lexer is very efficient, implemented as a set of lookup decision tables that implement the regular expression rules that describe how to match a token.

The version of CsLex in the SDK is based on the version by Brad Merrill, with some modifications, most notably to add support for Unicode text.

This document is not intended to be a full guide to using CsLex. The original documentation is a very good introduction to the file format and how to implement a lexer, and should be considered essential reading before continuing with the version in the ReSharper SDK.