All Projects → OvermindDL1 → ex_spirit

OvermindDL1 / ex_spirit

Licence: other
No description or website provided.

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to ex spirit

metal
A Java library for parsing binary data formats, using declarative descriptions.
Stars: ✭ 13 (-50%)
Mutual labels:  parser-combinators, parser-library
Cppcmb
A generic C++17 parser-combinator library with a natural grammar notation.
Stars: ✭ 108 (+315.38%)
Mutual labels:  parser-combinators, parser-library
leftry
Leftry - A left-recursion enabled recursive-descent parser combinator library for Lua.
Stars: ✭ 32 (+23.08%)
Mutual labels:  parser-combinators, parser-library
autumn
A Java parser combinator library written with an unmatched feature set.
Stars: ✭ 112 (+330.77%)
Mutual labels:  parser-combinators, parser-library
microparsec
⭐ A performant Nim parsing library built for humans.
Stars: ✭ 26 (+0%)
Mutual labels:  parser-combinators, parser-library
vim-ide-elixir
Highly opininated setup of vim plugins for Elixir development
Stars: ✭ 28 (+7.69%)
Mutual labels:  elixir-programming-language, elixir-library
ParsecSharp
The faster monadic parser combinator library for C#
Stars: ✭ 23 (-11.54%)
Mutual labels:  parser-combinators
FLexer
Simple Lexer and Parser in F#
Stars: ✭ 22 (-15.38%)
Mutual labels:  parser-combinators
mix systemd
Library of mix tasks to generate a systemd unit file for an Elixir project
Stars: ✭ 48 (+84.62%)
Mutual labels:  elixir-library
emojix
Simple emoji library for Elixir 💩
Stars: ✭ 21 (-19.23%)
Mutual labels:  elixir-library
parse it
A python library for parsing multiple types of config files, envvars & command line arguments that takes the headache out of setting app configurations.
Stars: ✭ 86 (+230.77%)
Mutual labels:  parser-library
antk
Redkato, - Indonesian anime scraper
Stars: ✭ 14 (-46.15%)
Mutual labels:  parser-library
sockerl
Sockerl is an advanced Erlang/Elixir socket framework for TCP protocols and provides fast, useful and easy-to-use API for implementing servers, clients and client connection pools.
Stars: ✭ 26 (+0%)
Mutual labels:  elixir-library
Ramble
A R parser based on combinatory parsers.
Stars: ✭ 19 (-26.92%)
Mutual labels:  parser-combinators
parserz
A purely-functional library for creating both parsers, pretty-printers, and grammar definitions from a single, type-safe specification of a grammar
Stars: ✭ 68 (+161.54%)
Mutual labels:  parser-combinators
Parsey
Swift Parser Combinators
Stars: ✭ 56 (+115.38%)
Mutual labels:  parser-combinators
SuperCombinators
[Deprecated] A Swift parser combinator framework
Stars: ✭ 19 (-26.92%)
Mutual labels:  parser-combinators
parsekt
Parser Combinator library for Kotlin
Stars: ✭ 27 (+3.85%)
Mutual labels:  parser-combinators
gab-cmdline
A GABStudios Java library to help with command line parsing.
Stars: ✭ 12 (-53.85%)
Mutual labels:  parser-library
CombinedParsers.jl
Compiled parser combinators and regular expressions in pure julia
Stars: ✭ 76 (+192.31%)
Mutual labels:  parser-combinators

ExSpirit

Spirit-style PEG-like parsing library for Elixir.

Please see ExSpirit.Parser for details about the parser.

Installation

Available in hex.pm.

Add to dependencies with:

def deps do
  [{:ex_spirit, "~> 0.1"}]
end

Full docs can be found at: https://hexdocs.pm/ex_spirit

Examples

See the examples directory for examples and run them with mix run examples/<filename>.

Current examples are:

number_adder.exs

Takes a list of simple integers of base 10, separated by commas, with optional spaces between them, adds them together, and returns them (all within the parser), requires at least one number.

Example Run:

$ mix run examples/number_adder.exs
Input simple number separated by comma's and optionally spaces and press enter:

<unknown>:1:1: Parse error: Parsing uint with radix of 10 had 0 digits but 1 minimum digits were required
        RuleStack: [added_number]
        Input:

$ mix run examples/number_adder.exs
d
Input simple number separated by comma's and optionally spaces and press enter:
<unknown>:1:1: Parse error: Parsing uint with radix of 10 had 0 digits but 1 minimum digits were required
        RuleStack: [added_number]
        Input: d

$ mix run examples/number_adder.exs
Input simple number separated by comma's and optionally spaces and press enter:
42
Result: 42

$ mix run examples/number_adder.exs
Input simple number separated by comma's and optionally spaces and press enter:
1,2,3 , 4,   5    ,6 , 7
Result: 28

$ mix run examples/number_adder.exs
Input simple number separated by comma's and optionally spaces and press enter:
1 ,
Result: 1
Leftover: " ,\n"

roman_numerals.exs

Takes a typed in roman numeral from stdin and an enter, parses out the number up to the thousands position and reports back any errors and remaining leftovers.

Example Run:

$ mix run examples/roman_numerals.exs
Input Roman Numerals and press enter:
MDMXXIV
Result: 1924

$ mix run examples/roman_numerals.exs
Input Roman Numerals and press enter:
zzzz
Result: 0
Leftover: "zzzz\n"

$ mix run examples/roman_numerals.exs
Input Roman Numerals and press enter:
XVIzzz
Result: 16
Leftover: "zzz\n"

simple_xml.exs

A simple xml parser, no attributes, just nodes and text.

Example Run:

$ mix run examples/simple_xml.exs
Input a single line of xml-like syntax:
<test1>Some text<test2>Hi</test2> and more</test1>
Result: {"test1", ["Some text", {"test2", ["Hi"]}, " and more"]}

$ mix run examples/simple_xml.exs
Input a single line of xml-like syntax:
<a-tag>How about an improperly terminated tag</b-tag>
<unknown>:1:48: Expectation Failure: literal `a-tag` did not match the input
        RuleStack: [tag, node_]
        Input: b-tag>

$ mix run examples/simple_xml.exs
Input a single line of xml-like syntax:
<
<unknown>:1:1: Parse error: Repeating over a parser failed due to not reaching the minimum amount of 1 with only a repeat count of 0
        RuleStack: [text, node_]
        Input: <
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].