Skip to content
Aldo Salzberg edited this page Sep 14, 2021 · 13 revisions

Welcome to the csly wiki! Csly is a parser generator implementing some features of parser combinators-generators like lex and yacc, also known from their GNU implementations, Flex and Bison.

Why?

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

  • too complicated to integrate with an additional build step, such as ANTLR,
  • too different from the classical Backus–Naur form (BNF) notation used in parser combinators like sprache or Eto.Parse.

These tools are great, but I don't feel comfortable with them. More on this at How does csly compare to other options.

General principle

Csly is highly inspired by the Python lex yacc library (PLY). The parser and lexer implementations can be invoked from just two C# types:

  • 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 csly

Csly is a composite library containing:

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


Home ➡️ Getting started