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
The plugin requires Eclipse Luna or a later version. (Eclipse versions are ordered alphabetically.)
Using this method, Eclipse will be able to automatically detect future available updates for the Griddle plugin.
- If you have previously installed Griddle via the dropins folder method (below), remove the Griddle jar from the dropins folder and restart Eclipse.
- In the Eclipse menus, select Help -> Install New Software...
- Enter http://alexlandau.github.io/griddle/eclipse/ as the site location at the top of the dialog.
- Select the "Griddle GDL Editor" feature that appears.
- Continue through the installation process as prompted.
Alternatively, Griddle can be added to an existing Eclipse installation using the following steps:
- Download the .jar file containing the plugin from the Github repository's Releases section: https://github.com/AlexLandau/griddle/releases
- Locate the directory containing your Eclipse installation; this should include files like eclipse.ini and folders like features, plugins, and dropins.
- Add a folder named plugins to the dropins folder (or use an existing one if it's already there).
- Put the .jar file into the dropins folder.
- Restart Eclipse.
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:
- Right-click on the project containing the GDL files.
- 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.
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.
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).
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.
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.