Cogito.Irony 4.0.0

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

Cogito.Irony

Helpers for working with parse trees produced by Irony.

Why

Irony hands you a ParseTree and leaves navigation to you, so grammar code fills up with index arithmetic over child nodes. These extensions let you address nodes by term name and turn a tree into XML, which makes a grammar far easier to debug.

Install

dotnet add package Cogito.Irony

Use

var tree = parser.Parse(text);
tree.ThrowParseErrors();

var name = tree.Root.Node("identifier").SpanText();
foreach (var arg in tree.Root.Nodes("argument"))
    Handle(arg);

ToXDocument / ToXElement render a whole tree as XML — the quickest way to see what a grammar actually matched. ThrowParseErrors turns Irony's error collection into a ParseException.

License

MIT.

Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 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 Cogito.Irony:

Package Downloads
Cogito.Web.Razor

Basic Razor support library

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.0 148 10/15/2026
3.1.37 125 9/14/2026
3.1.36 4,884 11/30/2020
3.1.35 4,616 11/16/2020
3.1.34 4,675 11/16/2020
3.1.30 4,794 11/15/2020
3.1.29 4,647 11/11/2020
3.1.27 4,636 11/11/2020
3.1.26 4,628 11/11/2020
3.1.24 4,622 11/11/2020
3.1.23 4,830 11/11/2020
3.1.20 4,811 11/11/2020
3.1.18 4,653 8/7/2020
3.1.16 4,674 8/7/2020
3.1.13 4,801 2/25/2020
3.1.10 4,755 2/25/2020
3.1.8 4,717 2/25/2020
3.1.7 4,769 2/25/2020
3.1.6 4,780 2/25/2020
3.0.11 4,680 2/7/2020
Loading failed