<commit_before># griddle
GDL validation and Eclipse GDL editor plugin.

Griddle is an Eclipse plugin offering a lightweight editor for the Game Description Language (GDL) used in General Game Playing. It uses its own 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

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
- One-step reformatting or indentation correction for the entire file
- Build system improvements (see "Building from source" below)

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

- Improved support for the validation library as a stand-alone library
- CLI for validation and error detection
- Customization of syntax highlighting colors

Installation
------------

The plugin can be applied to an existing Eclipse installation using the following steps (older versions of Eclipse may need a different approach):

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.

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 two separate projects: the "net.alloyggp.griddle" project, which is an Eclipse plugin project (developed using Eclipse PDE), and the validation project, which is an ordinary Java project.

The net.alloyggp.griddle project contains Eclipse project files, and can be imported into Eclipse as an existing project. It 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.

Eclipse project files for the validation project can be generated by running "./gradlew eclipse" or, on Windows, ".\gradlew.bat eclipse".

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

This is a process that needs to be improved and automated eventually. For now:

1. Build the validation project using "./gradlew build" (on Windows, ".\gradlew.bat build").
2. Copy the validation-<version>.jar file from validation/build/libs to the net.alloyggp.griddle directory.
3. Refresh the net.alloyggp.griddle project folder in Eclipse.
4. Export the project in Eclipse with the "Plug-in Development/Deployable plug-ins and fragments" wizard.

Authorship
----------

Griddle is written and maintained by <NAME>. Email may be directed to <EMAIL>, but consider first if the "Issues" section of the Github repository is more applicable.
<commit_msg>Fix README info on single-file reformatting<commit_after># griddle
GDL validation and Eclipse GDL editor plugin.

Griddle is an Eclipse plugin offering a lightweight editor for the Game Description Language (GDL) used in General Game Playing. It uses its own 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
- Build system improvements (see "Building from source" below)

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

- Improved support for the validation library as a stand-alone library
- CLI for validation and error detection
- Customization of syntax highlighting colors

Installation
------------

The plugin can be applied to an existing Eclipse installation using the following steps (older versions of Eclipse may need a different approach):

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.

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 two separate projects: the "net.alloyggp.griddle" project, which is an Eclipse plugin project (developed using Eclipse PDE), and the validation project, which is an ordinary Java project.

The net.alloyggp.griddle project contains Eclipse project files, and can be imported into Eclipse as an existing project. It 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.

Eclipse project files for the validation project can be generated by running "./gradlew eclipse" or, on Windows, ".\gradlew.bat eclipse".

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

This is a process that needs to be improved and automated eventually. For now:

1. Build the validation project using "./gradlew build" (on Windows, ".\gradlew.bat build").
2. Copy the validation-<version>.jar file from validation/build/libs to the net.alloyggp.griddle directory.
3. Refresh the net.alloyggp.griddle project folder in Eclipse.
4. Export the project in Eclipse with the "Plug-in Development/Deployable plug-ins and fragments" wizard.

Authorship
----------

Griddle is written and maintained by <NAME>. Email may be directed to <EMAIL>, but consider first if the "Issues" section of the Github repository is more applicable.

{'fraction_non_alphanumeric': 0.05668533254740151, 'fraction_numerical': 0.00412614205717654, 'mean_word_length': 4.31038080333855, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6016831', 'n_tokens_mistral': 2408, 'n_tokens_neox': 2264, 'n_words': 1451}