ParserObjects 6.0.0

dotnet add package ParserObjects --version 6.0.0
                    
NuGet\Install-Package ParserObjects -Version 6.0.0
                    
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" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ParserObjects" Version="6.0.0" />
                    
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
                    
#r "nuget: ParserObjects, 6.0.0"
                    
#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 ParserObjects@6.0.0
                    
#: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=ParserObjects&version=6.0.0
                    
Install as a Cake Addin
#tool nuget:?package=ParserObjects&version=6.0.0
                    
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. Version 6 is available on Nuget and is preferred over all previous versions.

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 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 0 8/24/2025
6.0.0-beta1 58 7/4/2025
5.4.0 71 7/4/2025
5.2.0 5,471 9/30/2023
5.1.0 143 9/29/2023
5.0.0 2,904 1/29/2023
5.0.0-beta1 338 1/24/2023
4.0.0 462 9/29/2022
4.0.0-alpha1 227 2/13/2022
3.1.0 368 12/4/2021
3.1.0-beta1 363 11/18/2021 3.1.0-beta1 is deprecated because it is no longer maintained.
3.1.0-alpha2 364 11/12/2021 3.1.0-alpha2 is deprecated because it is no longer maintained.
3.1.0-alpha1 432 1/29/2021 3.1.0-alpha1 is deprecated because it is no longer maintained.
3.0.1 1,157 1/29/2021
3.0.0 434 1/6/2021
3.0.0-beta3 461 12/27/2020 3.0.0-beta3 is deprecated because it is no longer maintained.
3.0.0-beta2 506 12/26/2020 3.0.0-beta2 is deprecated because it is no longer maintained.
3.0.0-beta1 522 12/24/2020 3.0.0-beta1 is deprecated because it is no longer maintained.
3.0.0-alpha5 541 12/11/2020 3.0.0-alpha5 is deprecated because it is no longer maintained.
3.0.0-alpha4 522 12/3/2020 3.0.0-alpha4 is deprecated because it is no longer maintained.
3.0.0-alpha3 533 11/21/2020 3.0.0-alpha3 is deprecated because it is no longer maintained.
3.0.0-alpha2 558 11/19/2020 3.0.0-alpha2 is deprecated because it is no longer maintained.
3.0.0-alpha1 613 11/18/2020 3.0.0-alpha1 is deprecated because it is no longer maintained.
2.1.0 495 11/10/2020
2.1.0-alpha1 829 11/7/2020 2.1.0-alpha1 is deprecated because it is no longer maintained.
2.0.0 1,827 9/13/2020
2.0.0-beta5 596 9/12/2020 2.0.0-beta5 is deprecated because it is no longer maintained.
2.0.0-beta4 644 5/22/2020 2.0.0-beta4 is deprecated because it is no longer maintained.
2.0.0-beta3 646 5/16/2020 2.0.0-beta3 is deprecated because it is no longer maintained.
2.0.0-beta2 648 5/10/2020 2.0.0-beta2 is deprecated because it is no longer maintained.
2.0.0-beta1 651 5/10/2020 2.0.0-beta1 is deprecated because it is no longer maintained.
1.1.1 595 5/8/2020
1.1.0 563 5/8/2020
1.0.0 5,327 3/14/2020
0.4.2 777 3/11/2020 0.4.2 is deprecated because it is no longer maintained.
0.4.1 837 3/8/2020 0.4.1 is deprecated because it is no longer maintained.
0.4.0 1,440 3/8/2020 0.4.0 is deprecated because it is no longer maintained.
0.3.2 831 3/5/2020 0.3.2 is deprecated because it is no longer maintained.
0.3.1 798 3/4/2020 0.3.1 is deprecated because it is no longer maintained.
0.3.0 820 3/4/2020 0.3.0 is deprecated because it is no longer maintained.
0.2.3 803 3/2/2020 0.2.3 is deprecated because it is no longer maintained.
0.2.2 810 2/26/2020 0.2.2 is deprecated because it is no longer maintained.
0.2.1 758 2/22/2020 0.2.1 is deprecated because it is no longer maintained.
0.2.0 1,180 2/18/2020 0.2.0 is deprecated because it is no longer maintained.
0.1.4 1,590 2/4/2020 0.1.4 is deprecated because it is no longer maintained.
0.1.3 1,436 1/23/2020 0.1.3 is deprecated because it is no longer maintained.
0.1.2 947 1/18/2020 0.1.2 is deprecated because it is no longer maintained.
0.1.0 1,602 1/13/2020 0.1.0 is deprecated because it is no longer maintained.
0.0.3 1,421 1/7/2020 0.0.3 is deprecated because it is no longer maintained.
0.0.2 771 1/4/2020 0.0.2 is deprecated because it is no longer maintained.
0.0.1-alpha 707 1/3/2020 0.0.1-alpha is deprecated because it is no longer maintained.