Abnf.Net 0.1.0-preview.1

This is a prerelease version of Abnf.Net.
dotnet add package Abnf.Net --version 0.1.0-preview.1
                    
NuGet\Install-Package Abnf.Net -Version 0.1.0-preview.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="Abnf.Net" Version="0.1.0-preview.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Abnf.Net" Version="0.1.0-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="Abnf.Net" />
                    
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 Abnf.Net --version 0.1.0-preview.1
                    
#r "nuget: Abnf.Net, 0.1.0-preview.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 Abnf.Net@0.1.0-preview.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=Abnf.Net&version=0.1.0-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Abnf.Net&version=0.1.0-preview.1&prerelease
                    
Install as a Cake Tool

bnf.net

A .NET library for working with Augmented Backus-Naur Form grammars.

Overview

This library provides comprehensive support for working with ABNF grammars (https://datatracker.ietf.org/doc/html/rfc5234). Future versions may include support for EBNF.

Key components:

  1. ABNF Parser - Parse ABNF grammar definitions with a complete internal parse tree
  2. Abstract Grammar Representation - A recursive expression model consisting of:
    • Alternation (/) - choose between alternatives
    • Concatenation (space) - sequence of elements
    • Repetition (*, n*m) - repeat elements
    • Option ([...]) - optional elements
    • Group ((...)) - grouping
    • Literal - character values and ranges
    • Rule - named grammar rules
  3. Validation Engine - Validate input strings against grammar rules with detailed error reporting (position and reason for failures)

See the demo projects for practical examples of using the library.

Projects

  • abnf.net - Core class library
  • abnf.net.Demo - Arithmetic expression grammar demo (run with ws argument for whitespace support)
  • abnf.net.Tests - Unit tests

Running the Demo

# Basic mode (no whitespace around operators)
dotnet run --project samples/abnf.net.Demo

# With whitespace support
dotnet run --project samples/abnf.net.Demo -- ws

Building

dotnet build

Testing

dotnet test

NuGet Package

The library is available as a NuGet package: Abnf.Net

dotnet add package Abnf.Net --prerelease

For package publishing and release information, see docs/NUGET_PUBLISHING.md.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET 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.
  • net10.0

    • No dependencies.

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
0.1.0-preview.1 129 1/21/2026