Farkle 7.0.1

dotnet add package Farkle --version 7.0.1
                    
NuGet\Install-Package Farkle -Version 7.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Farkle" Version="7.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Farkle" Version="7.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Farkle" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Farkle --version 7.0.1
                    
#r "nuget: Farkle, 7.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Farkle@7.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Farkle&version=7.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Farkle&version=7.0.1
                    
Install as a Cake Tool

Farkle

Farkle is a .NET library for building fast, reliable text parsers in F# and C#. It creates LALR(1) parsers through an API that resembles parser combinators, letting you define grammars directly in source code without requiring a separate grammar definition language.

Farkle can also generate parsing tables at build time, providing fast startup performance on par with generated parsers, and compile-time grammar validation. Check out the Farkle.Tools.MSBuild package for more information.

Quick Start

C#

using Farkle;
using Farkle.Builder;

var number = Terminals.Int32("Number");
var expression = Nonterminal.Create("Addition",
    number.Extended().Append("+").Extend(number).Finish((left, right) => left + right)
);

var parser = expression.Build();
var result = parser.Parse("1 + 2"); // Whitespace is ignored by default.
Console.WriteLine(result); // 3

F#

open Farkle
open Farkle.Builder

let number = Terminals.Int32("Number")
let expression = "Addition" ||= [
    !@ number .>> "+" .>>. number => (fun left right -> left + right)
]

let parser = GrammarBuilder.build expression
let result = CharParser.parseString parser "1 + 2" // Whitespace is ignored by default.
printfn "%O" result // 3

Documentation

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
7.0.1 495 7/9/2026
7.0.0 207 6/28/2026
7.0.0-preview.3 69 5/18/2026
7.0.0-preview.2 215 10/30/2025
7.0.0-preview.1 164 9/6/2025
6.5.2 28,212 11/10/2024
6.5.1 30,878 1/25/2023
6.5.0 655 9/8/2022
6.4.0 875 3/11/2022
6.3.2 642 10/31/2021
6.3.1 561 10/18/2021
6.3.0 619 10/3/2021
6.2.0 647 5/16/2021
6.1.0 600 3/4/2021
6.0.0 625 2/22/2021
6.0.0-alpha.3 403 11/25/2020
6.0.0-alpha.2 486 8/22/2020
6.0.0-alpha.1 467 4/13/2020
5.4.1 893 3/23/2020
5.4.0 760 3/20/2020
Loading failed

You can see information about the latest releases on https://github.com/teo-tsirpanis/Farkle/releases