File: README.textile

package info (click to toggle)
neotoma 1.7.3%2Bdfsg-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 256 kB
  • ctags: 278
  • sloc: erlang: 1,454; makefile: 32
file content (40 lines) | stat: -rw-r--r-- 2,035 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
h1. Neotoma

!https://travis-ci.org/seancribbs/neotoma.svg?branch=master!:https://travis-ci.org/seancribbs/neotoma

h2. About

Neotoma is a packrat parser-generator for Erlang for Parsing Expression Grammars (PEGs).
It consists of a parsing-combinator library with memoization routines, a parser for PEGs,
and a utility to generate parsers from PEGs.  It is inspired by treetop, a Ruby library with
similar aims, and parsec, the parser-combinator library for Haskell.

Neotoma is licensed under the MIT License (see LICENSE).

h2. Features

# Simple, declarative parsers generated from even simpler grammars.
# Fully integrated, single-pass lexical and syntactic analysis (a feature of PEGs).
# Packrat-style memoization, boasting parse-time bound linearly to the input size (at the expense of memory usage).
# In-place semantic analysis/transformation, supporting single-pass end-to-end in some applications.
# Erlang code-generation for the lexical/syntactic analysis piece, with the option of semantic analysis/transformation inline, or in a separate module.
# Line/column number tracking for easy resolution of parsing errors.

h2. Installation

# Clone the repository from github: <notextile><pre><code>$ git clone git://github.com/seancribbs/neotoma.git</code></pre></notextile>
# Symlink or copy the cloned repository to somewhere in your Erlang code path. $ERLANG_HOME/lib is best.
# Build the source: <notextile><pre><code>$ make</code></pre></notextile>

h2. Usage

# After making sure the library is in your code path, fire up an Erlang shell.
# 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.

  <notextile><pre><code>1&gt; neotoma:file("extra/arithmetic.peg").</code></pre></notextile>

  This will place @arithmetic.erl@ in the same directory as the @.peg@ file by default.

h2. Contributing

Please send pull-requests to 'seancribbs' on github.  When submitting a patch, eunit tests are strongly encouraged.