Giter VIP home page Giter VIP logo

neotoma's Introduction

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

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

Installation

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

Usage

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

neotoma's People

Contributors

seancribbs avatar isakb avatar metajack avatar abhay avatar lehoff avatar vagabond avatar auser avatar caioariede avatar doubleyou avatar klajo avatar manuel-rubio avatar superbobry avatar

Watchers

James Cloos avatar  avatar Guillermo Rodriguez  avatar Daniel Herrero avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.