All Projects → acple → ParsecSharp

acple / ParsecSharp

Licence: MIT license
The faster monadic parser combinator library for C#

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to ParsecSharp

Lug
Parsing expression grammar (PEG) embedded domain specific language and parsing machine for C++17
Stars: ✭ 44 (+91.3%)
Mutual labels:  parsing, parser-combinators, peg
Pom
PEG parser combinators using operator overloading without macros.
Stars: ✭ 310 (+1247.83%)
Mutual labels:  parsing, parser-combinators, peg
Pegtl
Parsing Expression Grammar Template Library
Stars: ✭ 1,295 (+5530.43%)
Mutual labels:  parsing, parser-combinators, peg
metal
A Java library for parsing binary data formats, using declarative descriptions.
Stars: ✭ 13 (-43.48%)
Mutual labels:  parsing, parser-combinators
Parsing With Haskell Parser Combinators
🔍 A step-by-step guide to parsing using Haskell parser combinators.
Stars: ✭ 72 (+213.04%)
Mutual labels:  parsing, parser-combinators
Expressive
Expressive is a cross-platform expression parsing and evaluation framework. The cross-platform nature is achieved through compiling for .NET Standard so it will run on practically any platform.
Stars: ✭ 113 (+391.3%)
Mutual labels:  parsing, netstandard
Pest
The Elegant Parser
Stars: ✭ 2,783 (+12000%)
Mutual labels:  parsing, peg
Parjs
JavaScript parser-combinator library
Stars: ✭ 145 (+530.43%)
Mutual labels:  parsing, parser-combinators
Ohm
A library and language for building parsers, interpreters, compilers, etc.
Stars: ✭ 3,938 (+17021.74%)
Mutual labels:  parsing, peg
Swiftparsec
A parser combinator library written in the Swift programming language.
Stars: ✭ 192 (+734.78%)
Mutual labels:  functional, parser-combinators
fefe
Validate, sanitize and transform values with proper TypeScript types and zero dependencies.
Stars: ✭ 34 (+47.83%)
Mutual labels:  functional, parsing
autumn
A Java parser combinator library written with an unmatched feature set.
Stars: ✭ 112 (+386.96%)
Mutual labels:  parsing, parser-combinators
Parser Combinators From Scratch
Code that accompanies the series
Stars: ✭ 56 (+143.48%)
Mutual labels:  parsing, parser-combinators
3bmd
markdown processor in CL using esrap parser
Stars: ✭ 58 (+152.17%)
Mutual labels:  parsing, peg
Pyparsing
Python library for creating PEG parsers
Stars: ✭ 1,052 (+4473.91%)
Mutual labels:  parsing, parser-combinators
Combine
A parser combinator library for Elixir projects
Stars: ✭ 174 (+656.52%)
Mutual labels:  parsing, parser-combinators
parson
Yet another PEG parser combinator library and DSL
Stars: ✭ 52 (+126.09%)
Mutual labels:  parsing, peg
Rust Peg
Parsing Expression Grammar (PEG) parser generator for Rust
Stars: ✭ 836 (+3534.78%)
Mutual labels:  parsing, peg
Comby
A tool for structural code search and replace that supports ~every language.
Stars: ✭ 912 (+3865.22%)
Mutual labels:  parsing, parser-combinators
Funcparserlib
Recursive descent parsing library for Python based on functional combinators
Stars: ✭ 250 (+986.96%)
Mutual labels:  parsing, parser-combinators

ParsecSharp

Nuget

The faster monadic parser combinator library for C#

What's this

This library provides most useful Text Parsers, Stream Parsers, and Parser Combinators. All APIs are pure, immutable, can combine any others. Designed to utilize JIT Compilers optimization, realizes completely immutable, and can parse infinitely recursive data structures.

This project is affected by parsec, monadic parser library for Haskell.

Concept

  • Easy construction APIs with monad on C#
  • Pure/Immutable/Functional framework on C#
  • Replace regular expressions on your code (applicable from smallest to largest)
  • Most readable APIs source code

Overview

  • Strictly typed parsers/combinators that support natural type inference
  • A lot of reasonable built-in parsers/combinators
  • Supports parsing infinitely recursive data structures
  • Supports full backtracking: Parsing Expression Grammar (PEG) style parsing strategy
  • Supports parsing streams with any token type (e.g. string, char stream, byte array, binary stream)
  • Supports tokenization
  • Supports partial parsing
  • Supports nullable reference types (with C# 8.0 or later)
  • No additional dependencies
  • Faster running
  • Just enough error messages
  • No left-recursion support
  • No packrat parsing support (because it increases parsing time in most cases)

How to install

from NuGet

dotnet-cli:

$ dotnet add package ParsecSharp

NuGet Package Manager Console:

> Install-Package ParsecSharp

PackageReference:

<ItemGroup>
  <PackageReference Include="ParsecSharp" Version="*" />
</ItemGroup>

Download manually:

NuGet gallery

Supported platform

  • netstandard2.0 (compatible with net461 or later, uap, xamarin and more)
  • netstandard2.1 (compatible with netcoreapp, net5.0 or later, some performance improvements and additional APIs that depend on new runtime features)

Requires C# 7.3 or later for generic overloading resolution.

Get started

  1. Add package reference to your project.
  2. Add using directive: using static ParsecSharp.Parser; and using static ParsecSharp.Text; to your code.
  3. Parse your all.

How to use

Implementation examples:

Documents are included in UnitTest code (jp).

If you want more information, read APIs source code, all is there.

Questions?

Feel free to create an Issue!

License

This software is released under the MIT License, see LICENSE.

Using

  • Fody (MIT): Only for internal use, does NOT propagate license acceptance to users.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].