Coder Social home page Coder Social logo

grappa's Introduction

Read me first

The license of this project is Apache 2.0.

Requires Java 7 or later.

The latest versions are:

  • development: 2.1.0-beta.3; requires Java 8 (this is 2016, after all);
  • stable: 2.0.4. requires Java 7.

What this is

This package allows you to write grammars entirely in Java. Unlike, for instance, ANTLR and JavaCC, parsers written with this package do not require a pre-processing phase. Yes, this means you generate your parsers at runtime. And there is no DSL. Pure Java!

See also the debugger package.

And, uh, the name?

Well, you write grammars and can then generate parsers for them. (I also happen to like the drink of the same name)

Versions

There are three major versions.

2.1.x

This version is currently in development. See here for a list of changes from 2.0.x.

2.0.x

The latest 2.0.x version is 2.0.4. Using gradle:

dependencies {
    compile(group: "com.github.fge", name: "grappa", version: "2.0.4");
}

Projects using grappa

Parse tree generator

Grappa in itself does not generate a parse tree. While you can do it yourself, a module exists which allows you to do exactly that with little effort:

https://github.com/ChrisBrenton/grappa-parsetree

A visualizer (using Graphviz) also exists for such parse trees: https://github.com/fge/grappa-parsetree-visual

More advanced usage...

A project, currently in development, will allow you to generate a grappa parser from a formal grammar (BNF, EBNF, WSN, others) at runtime. See here:

https://github.com/ChrisBrenton/grappa-formal

Other usages

The following projects, all on GitHub, use grappa:

Examples

Unfortunately, I still haven't documented the project properly.

Here is a link to a tutorial by Joseph Ottinger explaining a possible use of grappa:

http://enigmastation.com/2016/03/07/simple-grappa-tutorial/

The code for this tutorial is available on GitHub.

I have also put up a project with some sample grammars; in particular, a grammar which is able to fully parse any JSON:

https://github.com/fge/grappa-examples

Getting help

This project has an IRC channel (#grappa on Freenode; server: irc.freenode.net) and two dedicated Google groups: grappa-users and grappa-devel. They are also available to post by email.

grappa's People

Contributors

fge avatar guipsp avatar

Watchers

 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.