Giter Club home page Giter Club logo

polyglot's Introduction

The Polyglot Parser Generator

This is an SLR and LR(1) parser generator with some support for common LR(k) constructs. It can generate outputs for arbitrary target languages. It will use all cores on your build system, and is engineered for maximum practicality and performance.

Principle and Language

(TODO)

Installation

Run bootstrap.sh then upgrade.sh.

Execution

Polyglot is published on Maven Central as org.anarres.polyglot:polyglot-core:${version}.

The Gradle plugin, Maven plugin and Ant task are published as polyglot-gradle, polyglot-maven and polyglot-ant respectively. There is also a commandline version, published as org.anarres.polyglot:polyglot-cmd:${version}.

Gradle

Gradle is the Right Answer(tm).

buildscript {
	classpath 'org.anarres.polyglot:polyglot-gradle:1.0.0-SNAPSHOT'
}
apply plugin: 'org.anarres.polyglot'

See PolyglotPlugin.

Maven

If you understand Maven better than I do, please help to correct this.

<plugin>
    <groupId>org.anarres.polyglot</groupId>
    <artifactId>polyglot-maven</artifactId>
    <version>${polyglot.version}</version>
    <executions>
        <execution>
            <goals>
                <goal>polyglot</goal>
            </goals>
        </execution>
    </executions>
</plugin>

You will also need to set up a dependency on org.anarres.polyglot:polyglot-runtime:${polyglot.version}.

See PolyglotMojo.

Ant

My commiserations on still using ant. The ant task is called org.anarres.polyglot.ant.Polyglot

You will also need to set up a dependency on org.anarres.polyglot:polyglot-runtime:${polyglot.version}.

See PolyglotTask.

Implementation Details

Polyglot aims for the maximum possible performance for the practical developer. It will attempt fast strategies (SLR), and if they fail, it will attempt slower strategies (LR(1), LR(k)). It will use all CPU cores on the system, so your computer will go out to lunch during a build. However, the performance for LR(1) universes in excess of 10 million items is quite acceptable.

The polyglot core is also designed to be almost steady state in the garbage collector, although the template engine (currently Velocity) is quite inefficient and should be replaced.

Credits

Polyglot is based on the specification (but not the code) of SableCC by Etienne Gagnon, and aims for limited backwards compatibility with all SableCC grammars and applications built on the generated code.

polyglot's People

Contributors

shevek 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.