Giter Club home page Giter Club logo

parse.js's Introduction

parse.js - Combinatorial Parser Javascript Library

About

parse.js is a library for creating combinatorial parsers in Javascript. It is based on Nate Young's Parsatron which in turn is based on Parsec.

Combinatorial parsers allow complex parsers to be created from a set of simple building blocks. Compared to other parsing techniques, combinatorial parsers can be written more quickly and integrate better with the host language.

Examples

  • parse-ecma - Combinatory parsers for lexing and parsing ECMAScript 5.

To clone

git clone https://github.com/mattbierner/parse.js parse
cd parse
git submodule update --init --recursive

Using parse.js

Dependencies

parse.js depends on Nu internally and also uses Nu objects in the API.

With AMD

Include any AMD style module loader and load parse:

<!DOCTYPE html>
<html>
<head></head>
<body>
    <script type="application/javascript" src="require.js"></script>
    <script type="application/javascript">
        requirejs.config({
            paths: {
                'parse': './lib',
                'nu': './dependencies/nu/lib'
            }
        });
        require(['parse/parse'], function(parse) {
            ...
        });
    </script>
</body>

Modules

All files live in the top level 'parse' module.

lib/parse - 'parse/parse'

Core functionality. Defines core parsers and data structures for creating and running parsers.

lib/parse_string - 'parse/parse_string'

Parsers for working specifically with strings.

lib/parse_eager - 'parse/parse_eager'

Redefines iterative core parsers to return regular Javascript arrays instead of streams.

Code

parse.js is written in Javascript / Khepri. Khepri is a ECMAScript subset that, among other things, adds a shorted lambda function syntax. It is also implemented using parse.js. Besides lambda functions, Khepri files (*.kep) are pretty much plain old Javascript.

For now, both the .js and .kep versions of source code will be kept in 'lib/', but only Khepri sources will be developed and Javascript files will be generated from it.

parse.js's People

Contributors

mattbierner avatar

Watchers

chaosim avatar James Cloos 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.