Navigation
Synopsis Extend an IDE with interactive, language-specific, features (Eclipse only).
Usage import util::IDE;
Description The IDE Meta-tooling Platform, IMP for short, is a collection of API and tools to support constructing IDEs for programming languages and domain specific languages. Using the IDE library, you can instantiate the services that IMP provides for any language implemented in Rascal.

Rascal is also a part of the collection of IMP tools and (will be) hosted shortly on eclipse.org.

To instantiate an IDE for a language implemented using Rascal, use the following steps:
  • Define the grammar for the language.
  • Define a parse function for the language.
  • Register the language.
Now you can step-by-step extend the IDE for your language with additional features: To be able to reuse your IDE between runs of Eclipse, read about Plugins. To add annotations to trees, just after parsing, you should register an annotator function.
Examples
rascal>import util::IDE;
ok
rascal>start syntax ABC = [a-z]+;
ok
rascal>layout Whitespace = [\ \t\n]*;
ok
rascal>start[ABC] abc(str x, loc l) { 
>>>>>>>  return parse(#start[ABC], x, l); 
>>>>>>>}
start(sort("ABC")) (str, loc): start(sort("ABC")) abc(str, loc);
rascal>registerLanguage("The ABC language", "abc", abc);
ok
After this, your current Eclipse instance will start editors for all files ending in .abc and parse them using the abc function. The editor will provide some default highlighting features.

To add annotations to trees, just after parsing, you should register an 'annotator' function:
rascal>registerAnnotator("abc", Tree (Tree t) { return t[@doc="Hello!"]; });
ok
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.