Code Monkey home page Code Monkey logo

griddle's Introduction

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.

griddle's People

Contributors

alexlandau avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

griddle's Issues

Misplaced warning message in text editor

Observed in version 0.1.0

I have an example of a file with this problem saved locally. It does not appear to be common.

In some cases (possibly related to a massive number of comments in the file?) a warning message is showing up in the wrong place in the editor and the ruler on the left-hand side. The line number in the Problems pane is correct.

Reduce number of severe parsing errors

Sometimes parsing will fail, and the result will be an error without a location in the file indicating where the problem is. This should be made more rare by improving the parser to handle error cases correctly. (Currently this can happen when Datalog keywords like distinct/or/not/<= are used in place of constants.)

Package into Eclipse update site

A suggestion - could you release this in such a way that it can be installed via "Install New Software" from Eclipse? Should make installation easier and upgrades trivial.

Odd hover text "shadowing" behavior

When two markers exist for the same text, the hover text may show text from only a warning message, even if an error message also exists. This can be misleading (the warning can look like an error, while the error is hidden).

Use of keywords as constants: Consider downgrading to warning

Use of a keyword as a function name may indicate some errors in understanding GDL (e.g. "(true (does ...))", but its use as a base constant (as seen in the cubicup games) is relatively benign. This should be separately configurable and a warning by default.

Hover text: weird message over parentheses

Observed in version 0.1.0

The message "N changed lines" appears when hovering over a parenthesis, where N is the total number of lines in the document (regardless of whether anything's changed or not).

Add action to reformat entire file

Ctrl-I doesn't work with the current indentation correction approach (and may not be a conveniently pluggable point). Instead, consider writing a "format GDL" action that could be applied through the right-click context menu to improve the formatting of an existing GDL file (as concerns indentation and use of newlines) while maintaining comments and such.

Griddle installation fails

  • Environment
    • Windows 7 Professional 64-bit
    • Eclipse Kepler SR2
  • Process
    • Following installation instructions
    • Added net.alloyggp.griddle_0.2.0.201507062126.jar to C:\Program Files\eclipse.kepler\dropins\plugins\
    • Restarted Eclipse

Installation apparently unsuccessful. No knight icon when opening .kif files. Nothing new in the Open with... submenu. No Add GDL Validation option in the project's Configure submenu.

What diagnostics might be useful?

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.