The GF Eclipse Plugin

The research leading to these results has received funding from the European Union’s Seventh Framework Programme (FP7/2007-2013) under grant agreement n° FP7-ICT-247914.

Introduction

The aim behind developing a desktop IDE for GF is to provide more powerful tools than may be possible and/or practical in a web-based environment (the GF Web IDE). In particular, the ability to resolve identifier cross-references and browse external libraries quickly during development time is one of the primary motivations for the project.

The choice was made to develop this desktop IDE as a plugin for the Eclipse Platform as it emerged as the most popular choice among the GF developer community. Support for the platform is vast and many tools for adapting Eclipse to domain-specific languages already exist. Unlike the zero-click Web IDE approach, using the GF Eclipse plugin (GFEP) will require some manual installation and configuration on the development machine. Thus the GFEP is aimed more at seasoned developers rather than the curious GF newbie.

The starting point for the GFEP is using the Xtext DSL Framework for Eclipse. By converting the GF grammar into the appropriate Extended-BNF form required by the LL(*) ANTLR parser, the framework provides a good starting point for future plugin development, already including a variery of syntax checking tools and some cross-reference resolution support. The specific requirements of the GF language, particularly in the way of its special module hierarchy, mean that significant customisations to this generated base plugin are needed.

Who

The GFEP is being developed as part of Work Package 2 of the MOLTO Project.

Primary developer is John J. Camilleri, who should be contacted for all queries and feedback related to the plugin on john.j.camilleri at domain chalmers.se.

Links

Update history

16/11/11
Third BETA released, using new tag-based scoping for better performance.
11/10/11
Second BETA released, with improved support for qualified names, local variable bindings, selective inheritance, module outlining, and launch configurations. Also new GF Project type.
01/10/11
Initial BETA released.
20/09/11
Refactoring of grammar to provide neater syntax trees, and handle cross-referencing contraints. Major work on name resolution across modules, implementing custom Scoping, Naming, ResourceDescription implementations.
08/09/11
Successfully converted GF language grammar into ANTLR-compaticble format. Refactoring to avoid left-recursion took up the majority of this time so far.
Late August 2011
Started investigation the use of Xtext as a basis for building the Eclipse plugin. Xtext requires a EBNF-style language grammar in order to generate development tools as a plugin for the Eclipse IDE.

Features

Implemented (or partially implemented)

Near-term

Long-term goals

Known issues

  1. The in-editor validation often needs to be triggered by a keystroke.

Other remarks

  1. Interface decisions such as icons were made reltively hastily and may not be entirely suitable or intuitive. This will get better as the plugin gets used by more users (and provide feedback).
  2. A wiki or bug tracker may be set up if there is enough usage feedback to justify it.

Installation & updating

System requirements

  1. The plugin was developed using Eclipse 3.7, and has not been tested with older versions of Eclipse.
  2. GFEP makes use of the newest GF features, and requires that the latest developer version of GF is already installed on your system. Paths to GF must be set within the Eclipse plugin (meaning you don’t necessarily need to have GF in your PATH environment variable).

Installing the plugin for the first time

  1. Inside Eclipse, go to Help → Install New Software.
  2. Add new software site using the URL: http://www.grammaticalframework.org/eclipse/release/
  3. Select the GF Eclipse Plugin, click Next, accept the license agreement and install.
  4. Accept the prompt warning that the software is unsigned.
  5. Restart Eclipse when prompted.

Settings

  1. Add the GF perspective by clicking Open Perspective → Other and choosing GF.
  2. Set your paths to the GF executable and libraries by going to Window → Preferences → Grammatical Framework.
    The runtime path is assumed to be ~/.cabal/bin/gf, which may be wrong depending on your system and how you installed GF.
    The library path should get automatically set from your environment’s GF_LIB_PATH variable.

Updating the plugin

  1. In Eclipse, go to Help → Check for updates.
  2. Any available updates will appear in the dialog. Select them and follow the usual steps.

Getting started

Some steps you can follow to get a feel of of the plugin’s features.

New project wizard New project wizard

New module wizard

If asked whether you want to add the Xtext nature to your project, you can safely say No (this prompt has been removed in newer versions).

The editor and outline view

Warnings and errors in the editor

Before auto-formatting After auto-formatting

Launch configuration dialog

Output from the GF compiler


Feedback

As part of the evaluation of the GF Eclipse Plugin, feedback (both negative and positive) on the following would be appreciated:

  1. Issues encountered with installation
  2. Incorrect support of GF syntactic constructs, module hierarchy system
  3. Performance issues (speed, resources footprint)
  4. General intuitiveness of the UI
  5. Feature wish-list
  6. Compatibilities / conflicts with other Eclipse plugins