A parser library for Pony.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples/calc remove extraneous files Oct 2, 2018
kiuatan
.gitignore
CONTRIBUTING.md
LICENSE update license year Aug 8, 2017
Makefile
README.md documentation updates Oct 2, 2018
STYLE_GUIDE.md
VERSION
bundle.json remove dependency on temporary champ map Oct 15, 2018
make.bat Rewrite the Kiuatan parser library to use actor-model functionality. Aug 4, 2018

README.md

Kiuatan

Kiuatan ("horse" or "pony" in Chinook Jargon) is a library for building and running parsers in the Pony programming language.

  • Kiuatan uses Parsing Expression Grammar semantics, which means:
  • Choices are ordered, i.e. the parser will always try to parse alternatives in the order they are declared.
    • Sequences are greedy, i.e. the parser will not backtrack from the end of a sequence.
    • You can use positive and negative lookahead that does not advance the match position to constrain greedy sequences.
    • Parsers do not backtrack from successful choices.
  • Kiuatan parsers are "packrat" parsers; they memoize intermediate results, resulting in linear-time parsing.
  • Parsers use Mederios et al's algorithm to handle unlimited left-recursion.

Obtaining Kiuatan

Pony-Stable

The easiest way to incorporate Kiuatan into your Pony project is to use Pony-Stable. Once you have it installed, cd to your project's directory and type:

stable add github kulibali/kiuatan --tag=0.2.0

This will clone the kiuatan repository and add it under the .deps directory in your project. To build your project, Pony-Stable will take care of setting the correct PONYPATH environment variable for you, e.g.:

stable env ponyc .

Git

You can clone and build Kiuatan directly from GitHub:

git clone https://github.com/kulibali/kiuatan.git
cd kiuatan
make && make test

To use Kiuatan in a project you will need to add kiuatan/kiuatan to your PONYPATH environment variable.

Documentation

Documentation is here.

Example

See the calc example for a sample of how to define and use a grammar for Kiuatan.