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" />
<PackageReference Include="SharpParser.Core" />
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
#tool nuget:?package=SharpParser.Core&version=1.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
SharpParser.Core
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
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 | Versions 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.
-
net9.0
- FSharp.Core (>= 9.0.303)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.