ridencww / goldengine

Java implementation of Devin Cook's GOLD Parser engine
Other
35 stars 14 forks source link

goldengine for Java

A Java implementation of Devin Cook's GOLD Parser engine. The goldengine for Java is compatible with version 5.0 of the GOLD parsing engine and a code generation template for the engine is included in GOLD Builder.

The GOLD parsing system is a tool that can be used to develop programming and scripting languages, compilers, and interpreters. GOLD can be used with numerous programming languages and on multiple platforms.

Features

Requirements

This project uses Java 1.8+ and requires no additional libraries other than the ones provided by the JDK/JRE.

Installation

From source

Clone the repository from Github:

git://github.com/ridencww/goldengine.git

Build the project and create the JAR:

Using Maven
mvn clean install

The is a Maven multi-module project. The goldengine.jar can be found in the engine/target folder and simple2.jar and simple3.jar in their respective target folders.

Maven

If you're using Maven, add the following to your project's pom.xml:

<dependency>
  <groupId>com.creativewidgetworks</groupId>
  <artifactId>goldengine</artifactId>
  <version>5.0.6</version>
</dependency>

The goldengine engine jar is available for download at the Maven Central repository.

Using the samples

The engine jar contains the parser and supporting classes only. The simple2.jar and simple3.jar files are "fat" jars that contain the goldengine, rule handlers for the language, a shell to execute programs written in that language, and a few example programs.

The shell will attempt to execute the source file specified on the command line. If the file cannot be located, the shell also looks in the /examples folder in the jar so the supplied demo programs can be executed.

Examples (assumes the current directory is where simple2.jar or simple3.jar is located):

java -jar simple2.jar myprogram.txt (execute program outside of jar)

java -jar simple2.jar examples/Hello.txt (execute program included in jar)

java -jar simple3.jar examples/Functions.txt -tree

Version History

License

goldengine for Java is licensed under the Modified BSD license. Permission is granted to anyone to use this software for any purpose, including commercial applications.

Enjoy.