Getting help when working with Rascal
You can use Rascal in two ways:
-
At the command line — the Command Line Interface (CLI) or if you prefer the Read-Eval-Print-Loop (REPL).
-
In an Integrated Development Environment (IDE) like Eclipse.
Both provide help facilities that we discuss in more detail:
-
Help at the command line: Get help when using Rascal at the command line (CLI, REPL).
-
Help in the Integrated Development Environment (IDE): Get help when using Rascal in the IDE.
-
Browsing Documentation: Browsing the Rascal documentation.
-
Further Reading: How to continue reading the Rascal documentation.
1. Help at the command line
Get help when using Rascal at the command line (CLI, REPL)
While using the command line interface you have two commands at your proposal:
-
help:-
Without arguments,
helpgives some introductory information about the help facilities. -
With arguments, the arguments are interpreted as search terms and search results are shown in a separate browser window.
-
-
apropos: likehelpbut all (abbreviated) results are only shown as text in the command line interface.
First, type help and get some introductory help:
rascal>help
HelpManager: using port 8750
Help for the compiler-based RascalShell.
RascalShell commands:
quit or EOF Quit this RascalShell
help <topic> Open a browser with help about topic
apropos <topic> Textual summary of help about topic
declarations List all declarations and imports
undeclare <name> Remove declaration of <name>
unimport <name> Remove import of module <name>
set <option> <bool> Set RascalShell <option> to true or false
Option: profile, trace, coverage
set List all current option values
test Run all tests in currently imported modules
test <modules> Run all test in given <modules>
edit <module> Edit <module>
clean Clean bin directory
Debugging commands:
break List current break points
break <name> Breakpoint at start of function <name>
break <name> <lino> Breakpoint in function <name> at line <lino>
cl(ear) <bpno> Clear breakpoint with index <bpno>
Keyboard essentials:
<UP> Previous command in history
<DOWN> Next command in history
<CTRL>r Backward search in history
<CTRL>s Forward search in history
<TAB> Complete previous word
<CTRL>a Move cursor to begin of line
<CTRL>e Move cursor to end of line
<CTRL>k Kill remainder of line after cursor
<CTRL>l Clear screen
Next, type help followed by some search terms will open a browser window
with a list of relevant pages in the Rascal documentation.
From there-on you can further browse through and search in
Rascal’s extensive documentation.
Typing apropos followed by search terms shows the search results directly
in the command shell and does not open a separate browser. Here is a way to search for
help related to if.
rascal>apropos if
Test/If:
Conditional statement.
2. Help in the Integrated Development Environment (IDE)
Get help when using Rascal in the IDE
|
Description
To be written
|
3. Browsing Documentation
Browsing the Rascal documentation
All Rascal documentation has been indexed and cross-referenced and can be accessed via a single browser interface.
Suppose we want to learn about while statement in Rascal and
the type help while at the command line. This will show the following
results (actual results may differ):
In the right pane you find the search results,
most relevant first (this happpens to be the
description of the while statement).
Each result consists of a clickable link and
a synopsis of the information to be found there.
In the top left corner, you find a search box
for new searches and the RascalTutor logo
that
will bring you back to the Tutor home page.
All Rascal documentation is organized
in courses, each course consist of
a hierarchy of concepts.
The documentation for while is found in the
course named Rascal
and the complete name is Rascal/Statements/While.
4. Further Reading
How to continue reading the Rascal documentation
The Tutor home page is always reachable via the RascalTutor logo
in the top left corner of each Tutor page and is the best starting point for further reading.
Here is a recent overview of the available courses:
| Beginner | Moderate | Advanced | General |
|---|---|---|---|