Giter VIP home page Giter VIP logo

parsecsharp's Introduction

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.

parsecsharp's People

Contributors

acple avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.