![]() |
|
Navigation |
Synopsis Extend an IDE with interactive, language-specific, features (Eclipse only).
Usage
import util::IDE;
Details clearLanguage clearLanguages clearNonRascalContribution clearNonRascalContributions Contribution createConsole DocumentationHover ErrorMarking Folding Hyperlinking label loc Menus Outline Plugin registerAnnotator registerContributions registerLanguage registerNonRascalContributions registerOutliner
Description The IDE Meta-tooling Platform, IMP
![]() 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:
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); okAfter 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
![]() |