SharpParser.Core 1.3.0

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

SharpParser.Core

NuGet License: MIT

A beginner-friendly, event-driven F# parsing library for language design and implementation.

Installation

dotnet add package SharpParser.Core

Quick Start

open SharpParser.Core

// Create your first parser
let parser =
    Parser.create()
    |> Parser.onSequence "hello" (fun ctx ->
        printfn "Hello found!"
        ctx)

Parser.runString "hello world" parser

Features

  • Event-driven parsing with intuitive handler functions
  • Context-sensitive modes for nested parsing contexts
  • Automatic tokenization and AST construction
  • Performance optimized with trie-based matching
  • Comprehensive error handling and debugging support

Documentation

📖 Full Documentation

🔧 API Reference

🚀 Quick Start Guide

Example

let parser =
    Parser.create()
    |> Parser.enableTokens()
    |> Parser.enableAST()
    |> Parser.onSequence "function" (fun ctx ->
        ParserContext.enterMode "functionBody" ctx)
    |> Parser.inMode "functionBody" (fun config ->
        config
        |> Parser.onChar '{' (fun ctx -> ctx)
        |> Parser.onChar '}' (fun ctx -> ParserContext.exitMode ctx))

let context = Parser.runString "function test() { return 42 }" parser
let tokens = Parser.getTokens context
let ast = Parser.getAST context

License

MIT License - see LICENSE file for details.

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

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
1.3.0 174 10/14/2025
1.2.0 111 10/11/2025
1.1.0 171 10/6/2025
1.0.1 158 10/5/2025
1.0.0 165 10/5/2025