This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
commit d71257822afdb7928916a5c604cde89aab803b0d
tree 81360c6e965358c06382817cb120024b3b0d3d62
parent 86e09575b6e6abdad173ff78303718309006724b
tree 81360c6e965358c06382817cb120024b3b0d3d62
parent 86e09575b6e6abdad173ff78303718309006724b
neotoma / README.textile
Neotoma
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).
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 in a separate module.
- Line/column number tracking for easy resolution of parsing errors.
Installation
- Clone the repository from github:
$ git clone git://github.com/seancribbs/neotoma.git - Symlink or copy the cloned repository to somewhere in your Erlang code path. $ERLANG_HOME/lib is best.
- Build the source:
$ make
Usage
- After making sure the library is in your code path, fire up an Erlang shell.
- To generate a parser from a PEG, use
peg_gen:file/1,2(more detailed documentation pending). For PEG examples, see theextra/directory in the repository.
1> peg_gen:file("extra/arithmetic.peg").
This will place arithmetic.erl in the same directory as the .peg file by default.
Contributing
Please send pull-requests to ‘seancribbs’ on github. When submitting a patch, eunit tests are strongly encouraged.







