Skip to content
Olivier Duhart edited this page Mar 24, 2021 · 13 revisions

Welcome to the csly wiki!

this wiki presents the main functionnality of CSLY.

#LY is a parser generator halfway between parser combinators and parser generator like

Why?

I needed a solution for building parsers and found all existing solution either

  • too complicated to integrate with an additional build step as with ANTLR
  • or too different from the classical BNF notation as parser combinators like sprache or Eto.Parse. These tools are great, but I don't feel comfortable with them.

More on this here : How does it compare

General principle

SLY is highly inspired by the python lex yacc library (PLY)

The parser and lexer implementations fully reside in a only 2 C# artifacts :

  • a C# enum that describes every token ;
  • a C# class containing every grammar rule and its associated action to transform the syntaxic tree.

How to use

#LY is a composite library :

Installation

Install from the NuGet gallery GUI or with the Package Manager Console using the following command:

Install-Package sly

or with dotnet core

dotnet add package sly