Skip to content

AlexLandau/griddle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 

Repository files navigation

griddle

Eclipse GDL editor and static validation plugin.

Griddle is an Eclipse plugin offering a lightweight editor for the Game Description Language (GDL) used in General Game Playing. It uses the gdl-validation library for parsing and validating GDL to keep its dependencies (and memory footprint) minimal.

The Griddle editor offers the following features:

  • Syntax highlighting
  • Errors and warnings for syntax mistakes and other potential problems
  • Indentation assistance
  • One-step whitespace reformatting for the entire file

Additional features that may be included in the future:

  • Configuration of errors and warnings, including support for GDL-II and other proposed changes to GDL

Other possible features that won't happen unless there's evidence of demand:

  • Build system improvements (see "Building from source" below)
  • Customization of syntax highlighting colors

Installation

The plugin requires Eclipse Luna or a later version. (Eclipse versions are ordered alphabetically.)

Using the Eclipse install site (recommended)

Using this method, Eclipse will be able to automatically detect future available updates for the Griddle plugin.

  1. If you have previously installed Griddle via the dropins folder method (below), remove the Griddle jar from the dropins folder and restart Eclipse.
  2. In the Eclipse menus, select Help -> Install New Software...
  3. Enter http://alexlandau.github.io/griddle/eclipse/ as the site location at the top of the dialog.
  4. Select the "Griddle GDL Editor" feature that appears.
  5. Continue through the installation process as prompted.

Older installation method

Alternatively, Griddle can be added to an existing Eclipse installation using the following steps:

  1. Download the .jar file containing the plugin from the Github repository's Releases section: https://github.com/AlexLandau/griddle/releases
  2. Locate the directory containing your Eclipse installation; this should include files like eclipse.ini and folders like features, plugins, and dropins.
  3. Add a folder named plugins to the dropins folder (or use an existing one if it's already there).
  4. Put the .jar file into the dropins folder.
  5. Restart Eclipse.

Post-installation

If the installation was successful, .kif and .gdl files will be displayed with a black chess knight icon and can be opened in a "GDL Editor" that includes syntax highlighting. However, errors and warnings will not work until enabled:

  1. Right-click on the project containing the GDL files.
  2. In the "Configure" submenu, click "Add GDL Validation".

If "Build Automatically" is checked in the "Project" menu, errors and warnings will be recomputed each time the file is saved.

Feature notes

Errors and warnings are based on the 2008 version of the original Game Description Language specification, as well as my own experiences with writing games and general game players. Direct contradictions of the specification and problems that will reliably cause players to break are generally errors, while gray areas and issues that less commonly cause problems are left as warnings.

Note that several requirements for well-formed games, such as termination and having well-formed goal values, cannot be checked by examination of the game description alone. Files with no errors or warnings in Griddle may still be invalid games or contain bugs. The Validator application in the GGP-Base library can check for these errors, though by their nature these types of errors can escape detection.

For first-time guidance on writing and testing game descriptions, I recommend my blog post on the subject: http://alloyggp.blogspot.com/2013/01/writing-game-with-gdl-sim.html

Griddle supports the indentation method of four spaces per level of parenthetical nesting. This has the nice property of having arguments for the <= and "or" operators aligned, and, unlike tabs, does this consistently across platforms.

Working on the source files

There are multiple projects for the different required aspects of the Eclipse plugin. They contain Eclipse project files, and can be imported into Eclipse as existing projects. They may not function correctly or may appear to be missing referenced classes until additional Eclipse components have been installed, such as the Eclipse Plug-in Development Environment and Eclipse Platform SDK.

The GdlScanner and GdlParser classes are generated by the JFlex and CUP libraries, respectively. Modifications to these classes should be made by modifying the appropriate file in the schemas directory and then running the runCup or runFlex script file (in the main project directory).

Building from source

Currently this requires a lot of manual steps in Eclipse, too many to be worth documenting here.

If you are interested in using the GDL parsing and validation logic exposed by Griddle, that is available by itself in the gdl-validation project, which can easily be consumed as a library.

Authorship

Griddle is written and maintained by Alex Landau. Email may be directed to [email protected], but consider first if the "Issues" section of the Github repository is more applicable.

About

GDL validation and Eclipse GDL editor plugin.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages