We use the Spoofax language workbench in the lab to develop a MiniJava editor.
The Spoofax Language Workbench supports the definition of all aspects of textual languages, such as syntax, static analysis, and compilation, using high-level, declarative meta-languages. From a language definition using these meta-languages, Spoofax generates full-featured Eclipse and IntelliJ editor plugins, as well as a command-line interface. The generated editors include syntax highlighting, syntax checking, parse error recovery, error markers for syntactic and semantic errors, and custom operations, such as invoking an interpreter or compiler.
In this lab, we will be using the Spoofax Eclipse plugin. You can download an Eclipse installation with the Spoofax Eclipse plugin preinstalled from our build farm:
These are specifically tagged versions of Spoofax, suited for the lab assignments. Please use these versions of Spoofax, instead of the ones found on the Spoofax website.
To install and run Spoofax, read the Installing Spoofax instructions, starting from the Unpack section.
On Windows, do not unpack the Eclipse installation into Program Files, because no write access is granted there, breaking Spoofax.
To update the Spoofax plugin in Eclipse, perform the following steps:
- go to Help -> Install New Software…
- in the Work with field, enter
- press enter and wait for the update site to load
- press Select All
- press Next and wait for Eclipse to calculate what to install and update
- press Finish to download and install updates
- when a security warning pops up, press OK to dismiss the warning
- when Eclipse has installed all updates, it will ask for a restart, press Yes to restart Eclipse
If installation fails with errors indicating that “updates are not permitted”, it means that your Eclipse installation is in a location that requires admin rights to write files. This is the case on Windows if you’ve copied Eclipse to Program Files. Move it to a directory where you have write access, such as the desktop, to solve the problem.
We host documentation for Spoofax and its meta-languages at spoofax.org: