Giter VIP home page Giter VIP logo

kiuatan's Introduction

Kiuatan

CI

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.

Further documentation is here.

Obtaining Kiuatan

Corral

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

corral add github chalcolith/kiuatan

This will add the library to your project. You can then build your project with something like:

corral fetch
corral run -- ponyc .

Git

You can clone and build Kiuatan directly from GitHub:

git clone https://github.com/chalcolith/kiuatan.git
cd kiuatan
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.

kiuatan's People

Contributors

chalcolith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

kiuatan's Issues

Parallelize disjunctions

It would be cool to parallelize disjunctions. There is some code for an initial implementation of this in Parser and Disj, but it is currently unused because it doesn't work for sufficiently complicated left-recursive rules. I have yet to add a minimal test case, though.

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.