neotomex
neotomex copied to clipboard
A PEG parser/transformer with a pleasant Elixir DSL.
`Neotomex.Grammar.ParseError` and `Neotomex.Grammar.ValidationError` cause warnings as below. ``` iex(1)> try do ...(1)> raise Neotomex.Grammar.ParseError, message: "parse error" ...(1)> rescue ...(1)> e in Neotomex.Grammar.ParseError -> e.description ...(1)> end warning: the following...
`mix test` generates the warnings below: ``` $ mix test Compiling 4 files (.ex) warning: variable "definitions" is unused (if the variable is not meant to be used, prefix it...
``` defmodule Unparsable do use Neotomex.ExGrammar @root true define :root, "[^a]*" end Unparsable.parse("pɪˈkɑːn") ``` This code raises the following error: ``` ** (MatchError) no match of right hand side value:...
At the moment it can be a pain to debug a match because it's hard to tell how it's recurring through the parse tree. To help with this I'll define...
It's nice to have reports on how performant your grammar is. This should be added as a mix task where you can specify an input file, allow stdin, or perhaps...
As described [here](http://bford.info/pub/lang/packrat-icfp02.pdf). Not much more to say, except that the implementation will be similar to the paper's description, and avoid using a separate process or ets table to keep...
At the moment, the Elixir interface specified in `ExGrammar` is nice for specifying transforms, but not expressions: in `define(id, expr, body)`, `id` is an atom naming the expression, and `expr`...
[neotoma](https://github.com/seancribbs/neotoma) has a neat facility for labelling matches: `string