ParserObjects 6.0.0-beta1

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

ParserObjects

ParserObjects is a library for object-based parsers, combinators, parsing utilities and abstractions. See the Documentation for more details on usage.

Install-Package ParserObjects

See the Test Suite Examples for some examples of usage.

Project Goals

This project has several goals:

  1. To enable composing of parsers from smaller building blocks
  2. To enable crafting of parsers using a variety of techniques and algorithms, whichever is the best fit for your project
  3. To use streaming input from a variety of sources, instead of reading data into fixed memory buffers
  4. To be generic as much as possible, supporting common string-parsing algorithms but also being extensible to any structured input type
  5. Using good interface design to encourage proper use and good code style
  6. To provide an easy on-ramp for people who need to parse data, but are not experts in parsing theory

Sequences and Parsers

An ISequence is similar to an IEnumerable or IEnumerator in concept, though with a focus on supporting parsing operations. Sequences allow you to GetNext() items one at a time, to Peek() at items without consuming them, and rewind the sequence to a previous location. There are many ways to create a sequence:

using static ParserObjects.Sequences;

// Turn an existing IReadOnlyList<T> into an ISequence<T>
var sequence = FromList(myList);

// Get a character sequence from a string
var sequence = FromString("...");

// Get a character sequence from a file or stream
var sequence = FromCharacterFile("fileName.txt");
var sequence = FromCharacterStream(myStream);

An IParser is an object that attempts to match a pattern in an input sequence. If the pattern is matched, the items will be consumed by the parser and a result will be returned. If the parser cannot match at the beginning of the input sequence, it returns a failure and no items are consumed. There are several dozen types of parsers in the library, which can be found by including these lines in your file:

using static ParserObjects.Parsers;
using static ParserObjects.Parsers<char>;

Once you have a parser, you can pass it an input sequence to obtain a parse result:

var result = parser.Parse(sequence);

The ParserObjects library provides many small parsers and parser combinators that can be built up into parsers for large and complex grammars. In addition, ParserObjects provides several pre-made parsers for specialty parsing needs. Please see the Documentation for more information, and the Test Suite Examples for real-world usage patterns.

Contributing

We welcome contributions including code, feedback, bug reports and suggestions.

Current Status

ParserObjects library is currently in active development. v5.0.0 is available on Nuget and is preferred over all previous versions.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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 is compatible.  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 was computed.  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 (1)

Showing the top 1 NuGet packages that depend on ParserObjects:

Package Downloads
StoneFruit

CLI Commandlet host and execution engine

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
6.0.0-beta1 46 7/4/2025
5.4.0 54 7/4/2025
5.2.0 5,463 9/30/2023
5.1.0 137 9/29/2023
5.0.0 2,890 1/29/2023
5.0.0-beta1 323 1/24/2023
4.0.0 446 9/29/2022
4.0.0-alpha1 210 2/13/2022
3.1.0 351 12/4/2021
3.1.0-beta1 329 11/18/2021 3.1.0-beta1 is deprecated because it is no longer maintained.
3.1.0-alpha2 331 11/12/2021 3.1.0-alpha2 is deprecated because it is no longer maintained.
3.1.0-alpha1 397 1/29/2021 3.1.0-alpha1 is deprecated because it is no longer maintained.
3.0.1 1,139 1/29/2021
3.0.0 415 1/6/2021
3.0.0-beta3 427 12/27/2020 3.0.0-beta3 is deprecated because it is no longer maintained.
3.0.0-beta2 471 12/26/2020 3.0.0-beta2 is deprecated because it is no longer maintained.
3.0.0-beta1 488 12/24/2020 3.0.0-beta1 is deprecated because it is no longer maintained.
3.0.0-alpha5 505 12/11/2020 3.0.0-alpha5 is deprecated because it is no longer maintained.
3.0.0-alpha4 487 12/3/2020 3.0.0-alpha4 is deprecated because it is no longer maintained.
3.0.0-alpha3 499 11/21/2020 3.0.0-alpha3 is deprecated because it is no longer maintained.
3.0.0-alpha2 524 11/19/2020 3.0.0-alpha2 is deprecated because it is no longer maintained.
3.0.0-alpha1 578 11/18/2020 3.0.0-alpha1 is deprecated because it is no longer maintained.
2.1.0 477 11/10/2020
2.1.0-alpha1 778 11/7/2020 2.1.0-alpha1 is deprecated because it is no longer maintained.
2.0.0 1,807 9/13/2020
2.0.0-beta5 559 9/12/2020 2.0.0-beta5 is deprecated because it is no longer maintained.
2.0.0-beta4 607 5/22/2020 2.0.0-beta4 is deprecated because it is no longer maintained.
2.0.0-beta3 611 5/16/2020 2.0.0-beta3 is deprecated because it is no longer maintained.
2.0.0-beta2 612 5/10/2020 2.0.0-beta2 is deprecated because it is no longer maintained.
2.0.0-beta1 614 5/10/2020 2.0.0-beta1 is deprecated because it is no longer maintained.
1.1.1 574 5/8/2020
1.1.0 543 5/8/2020
1.0.0 5,307 3/14/2020
0.4.2 739 3/11/2020 0.4.2 is deprecated because it is no longer maintained.
0.4.1 799 3/8/2020 0.4.1 is deprecated because it is no longer maintained.
0.4.0 1,402 3/8/2020 0.4.0 is deprecated because it is no longer maintained.
0.3.2 792 3/5/2020 0.3.2 is deprecated because it is no longer maintained.
0.3.1 760 3/4/2020 0.3.1 is deprecated because it is no longer maintained.
0.3.0 781 3/4/2020 0.3.0 is deprecated because it is no longer maintained.
0.2.3 763 3/2/2020 0.2.3 is deprecated because it is no longer maintained.
0.2.2 773 2/26/2020 0.2.2 is deprecated because it is no longer maintained.
0.2.1 721 2/22/2020 0.2.1 is deprecated because it is no longer maintained.
0.2.0 1,144 2/18/2020 0.2.0 is deprecated because it is no longer maintained.
0.1.4 1,552 2/4/2020 0.1.4 is deprecated because it is no longer maintained.
0.1.3 1,400 1/23/2020 0.1.3 is deprecated because it is no longer maintained.
0.1.2 910 1/18/2020 0.1.2 is deprecated because it is no longer maintained.
0.1.0 1,565 1/13/2020 0.1.0 is deprecated because it is no longer maintained.
0.0.3 1,383 1/7/2020 0.0.3 is deprecated because it is no longer maintained.
0.0.2 733 1/4/2020 0.0.2 is deprecated because it is no longer maintained.
0.0.1-alpha 670 1/3/2020 0.0.1-alpha is deprecated because it is no longer maintained.