spoofax_helloworld/README.md

2.2 KiB

spoofax_helloworld Language Specification

This repository begins with exactly the helloworld language example from the Spoofax user guide http://www.metaborg.org/en/latest/source/langdev/start.html, except under the name "spoofax_helloworld."

The plan is to develop this example just to the point of defining a translation of this language into python, and setting things up so that it is possible to (independently from Eclipse) "compile" a helloworld "program" into a python program.

Then I will freeze this project and start again with the calc language, grafting into that the syntax changes I'm actually interested in.

In the meantime, in case it's of use to me later or to anyone else, I will document here in this readme the full set of steps I go through in order to get the helloworld program into the goal state.

  1. In my previously existing working installation of Eclipse IDE for Java (2020-09, i.e. v. 4.17, for completeness sake), I went to Help > Install new software, clicked on the button to add a new site, put in the site name of Spoofax and got the the URL for the site from http://www.metaborg.org/en/latest/source/release/stable.html#update-site - it's the very long url labeled as "Eclipse update site:" that spans several lines.
  2. Then I checked the box next to "Spoofax Eclipse" and then followed the prompts (I think I had to click on "Next>" or maybe "Finished"). Eventually Eclipse asked me if I wanted it to restart, which I agreed to.
  3. And indeed, once it restarted, the "Spoofax" and "Spoofax (meta)" menus showed up.
  4. At this point I followed the tutorial linked at the top of this readme...
  5. ... until I got to the point of building the project. Then I encountered a "Plugin execution not covered by lifecycle configuration error." See the YellowGrass issue https://yellowgrass.org/issue/Spoofax/236 for the workarounds I used for this and the subsequent JRE version issues I encountered.
  6. With those workarounds, I was able to enter the test.hel program and get into parse or produce syntax errors when incorrect, as described in the getting started guide.
  7. The guide ends there, but we want to be able to "compile" helloworld language programs into Python Hello World programs, so...