README.textile
1h1. Neotoma
2
3!https://travis-ci.org/seancribbs/neotoma.svg?branch=master!:https://travis-ci.org/seancribbs/neotoma
4
5h2. About
6
7Neotoma is a packrat parser-generator for Erlang for Parsing Expression Grammars (PEGs).
8It consists of a parsing-combinator library with memoization routines, a parser for PEGs,
9and a utility to generate parsers from PEGs. It is inspired by treetop, a Ruby library with
10similar aims, and parsec, the parser-combinator library for Haskell.
11
12Neotoma is licensed under the MIT License (see LICENSE).
13
14h2. Features
15
16# Simple, declarative parsers generated from even simpler grammars.
17# Fully integrated, single-pass lexical and syntactic analysis (a feature of PEGs).
18# Packrat-style memoization, boasting parse-time bound linearly to the input size (at the expense of memory usage).
19# In-place semantic analysis/transformation, supporting single-pass end-to-end in some applications.
20# Erlang code-generation for the lexical/syntactic analysis piece, with the option of semantic analysis/transformation inline, or in a separate module.
21# Line/column number tracking for easy resolution of parsing errors.
22
23h2. Installation
24
25# Clone the repository from github: <notextile><pre><code>$ git clone git://github.com/seancribbs/neotoma.git</code></pre></notextile>
26# Symlink or copy the cloned repository to somewhere in your Erlang code path. $ERLANG_HOME/lib is best.
27# Build the source: <notextile><pre><code>$ make</code></pre></notextile>
28
29h2. Usage
30
31# After making sure the library is in your code path, fire up an Erlang shell.
32# To generate a parser from a PEG, use @neotoma:file/1,2@ (more detailed documentation pending). For PEG examples, see the @extra/@ directory in the repository.
33
34 <notextile><pre><code>1> neotoma:file("extra/arithmetic.peg").</code></pre></notextile>
35
36 This will place @arithmetic.erl@ in the same directory as the @.peg@ file by default.
37
38h2. Contributing
39
40Please send pull-requests to 'seancribbs' on github. When submitting a patch, eunit tests are strongly encouraged.
41