Clone wiki

inf225public / Installing Rascal

  1. First, download Eclipse Juno for RCP and RAP Developers for your platform. (Version 3.8.1 should also work (perhaps even better), the newest version (Kepler) probably won't work; it may be possible to install the plugins below on the lab computer's Eclipse installation – if so, you don't need to install Eclipse yourself.)

  2. The Eclipse download will give you a tar.gz file (at least on Linux). Extract it to your home directory (or an appropriate subdirectory of it, such as 'inf225'). E.g., on Linux, run the following command:

    tar xzvf /tmp/eclipse-rcp-juno-SR2-linux-gtk-x86_64.tar.gz

    This will give you an 'eclipse' subdirectory, and you can start Eclipse by running eclipse/eclipse.

  3. Install Rascal according to the installation instructions. Make sure you also edit the eclipse/eclipse.ini file according to these instructions.

  4. The bundled version of the Git plugin seems to be broken, so you should update EGit as well. Do Help → Install New Software, and enter the following update site:

    Select the features that have the little update symbol next to them:

    EGit update screenshot

  5. To test, try importing the INF225 repository from Bitbucket:

    1. Do File → Import....

    2. Select Projects from Git.

    3. Select URI.

    4. Enter the repository URI ( in the URI field.

    5. Press next a few times.

    6. When you get a list of projects, make sure inf225ex1 is checked.

    7. Press Finish.

  6. You should find a small grammar in the file src/Simple.rsc. Double-click on it, and examine it in the editor.

  7. Right-click in the editor, and select Start Console (unless you're already in the Rascal perspective, and you can see a console at the bottom of the Eclipse window with a rascal> prompt in it).

  8. Right-click in the editor again, and select Import Current Module in the Console.

  9. Click in the console, and write `x` (note the back-quotes). This should give you output like the following:

ID: `x`
Tree: appl(prod(lex("ID"),[conditional(iter(\char-class([range(65,90),range(95,95),range(97,122)])),{\not-precede(\char-class([range(65,90),range(95,95),range(97,122)])),\not-follow(\char-class([range(65,90),range(95,95),range(97,122)]))})],{}),[appl(regular(iter(\char-class([range(65,90),range(95,95),range(97,122)]))),[char(120)])[@loc=|stdin:///|(1,1,<1,1>,<1,2>)]])[@loc=|stdin:///|(1,1,<1,1>,<1,2>)]

The first line of the result is the type (ID), the second line is the parse tree.