This guide contains instructions on how to get the most out of the SPARK
plugin for Eclipse. Please make sure that you have followed the installation instructions first and have
successfully installed the plugin before continuing.
This User Guide covers:
- Editing SPARK-L files in Eclipse
- Running SPARK within Eclipse
- Debugging your SPARK process models
The Spark Plugin is still under active development, and features described
in this document are likely to change.
Expert tip: You can switch perspectives quickly within Eclipse by typing Ctrl+F8
Eclipse has a notion of "Perspectives" and "Views."
A Perspective is a preset layout of various windows, which are called Views.
You can think of a Perspective as being a driver's seat preset that saves the position
of the seat, steering wheel, mirrors, etc... If you are editing .spark files,
you will want to have a large editing window for your files, if you are debugging
your files you will want to see windows/views that show you what different variables
are bound to, and if you are checking files out of CVS you will want to see a window/view
listing various CVS repositories. Perspectives allow you to make these switches between
what windows are being show very quickly, in a task-oriented manner.
Perspectives in Eclipse are opened using the Window->Open Perspective menu. The
initial menu shows the more common perspectives that are available. There are
several more perspectives that are available if you select "Other..." Views in
Eclipse are opened using the Window->Show View menu. Depending on which perspective
you are currently in, this menu will change, but you can access any of the views
by selecting Window->Show View->Other...
For editing your .spark files, there is a specialized perspective, predicatably
referred to as the
SPARK perspective.
You can open the
SPARK perspective
using the Window->Open Perspective menu. If you do not see the
SPARK perspective
immediately listed, click on "Other", and you should see the
SPARK perspective
listed there.
After you have opened the
SPARK perspective, you should
see the
icon on the left-hand side of your Eclipse Window (or
on the top right if you are using Eclipse 3.0). In the future, you can switch into the
SPARK perspective
by clicking on this icon, without having to use the Window->Open Perspective menu.
There are several views specially defined for use with SPARK and SPARK-related tools:
- SPARK Intentions: displays a list of the current intention structure in the
SPARK interpreter.
- SPARK Execute: maintains a "quick list" of commands to send to SPARK
(e.g. "[do: (print "Hello" [])]"). You can execute them by double
clicking on them.
- SPARK Evaluate/Test: monitor values in the SPARK agent knowledge base using predicate expressions.
These views are accessible using the Window->Show View menu. If these are not
immediately listed, select "Other..." and then select the folder labelled "Debug". Most
of these views are automatically set to open once you open the appropriate perspective.
The following is a list of non-SPARK-specific Views that you are likely to encounter while using Eclipse. If the listed view is not visible, you can click on Window->Show View. If you do not see the desired view listed, click on "Other..." and then select find the view you want in the appropriate folder (e.g. Basic Views->Console).
- Console: Displays the output of the currently running program. (Basic Views->Console)
- Problems: Displays compilation issues, such as syntax errors. Clicking on an SPARK-L problem will navigate you to the line with the error. (Basic Views->Problems)
- Tasks: A list of TODO items, compilation errors, pending CVS changes, warnings,
and other checklist-like items. The TODO items are currently only available to Java
developers, but support for them in SPARK will be coming soon. (Basic Views-> Tasks)
- Search: Displays the most recent search results and allows you to directly
navigate to the the lines that match your query. (Basic Views->Search)
- Synchronize: Eclipse's CVS interface. It includes a diff program that
is fairly nice. (Team->Synchronize)
- Outline: Displays a structural outline of the currently open file. (Basic->Outline)
- Navigator: A generic file browser. (Basic Views->Navigator)
- Package Explorer: A modified file navigator that makes it easier to file
Java resources. (Java->Package Explorer)
Expert tip 1: Eclipse has several keyboard shortcuts for navigating between editors. Ctrl+E pulls up a list of all open editors. Ctrl+PageDown and Ctrl+PageUp navigates between editor tabs. Alt+Left and Alt+Right navigate backwards and forwards like a Web browser.
Expert tip 2: You can leave yourself 'TODO' notes by typing #TODO: your todo note at the beginning of a line. A summary of all your TODO notes is available in the "Tasks" view, and there will also be a blue marker next to your scrollbar that you can quickly navigate to.
Expert tip 3: You can quickly navigate to syntax errors and TODO markers in a file using Ctrl+. and Ctrl+, (or you can use the
or
buttons on the toolbar, or use the Navigate menu).
- Switch into the
SPARK perspective (Windows->Open Perspective->SPARK Perspective)
if you haven't already, and also make sure that the
Navigator
view is open (Window->Show View->Navigator).
- Find a file you wish to edit in the
Navigator you want to edit
and double-click on it. (NOTE: all .spark files should have an
icon next to them).
The SPARK-L editor provides several basic editing features:
- Syntax coloring: customize with Windows->Preferences->SPARK>SPARK-L Editor
- Outline: summarizes content and allows for quicker navigation
- Auto-completion: whenever you type a '[', '(', or '{', the editor will provide you with a list of possible keywords or symbols to type. The auto-complete mechanism can be invoked manually by typing Ctrl+Space (still under active development)
There are multiple ways to
terminate a SPARK debug process:
- Select "Run->Terminate" on your menu bar. If this option is
not highlighted, try the other two options listed here.
- If you are in the
Debug Perspective, you should see a view
labelled
debug. You can right click (Mac: control click) on an existing SPARK
process listed there to terminate it, or you can also click
in the empty space of this view and select "Terminate All".
- In the "Console" View, you can right click (Mac: control click) inside of the view
and select "Terminate"
You can monitor the value of predicate expressions in the SPARK agent knowledge base by using the
Evaluate/Test View, which is part of the
Debug Perspective (If you do not see this view, select Window->Show View->Evaluate/Test).
- Adding a predicate: Click on the
button and then type in a predicate expression to monitor, e.g. (Doc $symbol $string).
- Deleting a predicate: Click on the predicate expression a press Del
- Reordering the list of predicates: Click on a predicate expression and use the up/down arrows to move the predicate.
The list of predicate expressions you enter is saved between sessions so that you do not have to re-enter them. If a predicate on the list is not applicable to your current SPARK interpreter session, no results for it will be shown.
You can override some of the default settings (e.g. SPARK home, Jython home) that the SPARK Plugin chooses when you run a SPARK module:
- Global settings: In the Windows->Preferences->SPARK menu, you can specify default global values for the SPARK Interpreter location, Jython location, and OAA home.
- Projects settings: If you right click on a project and select 'Properties', you will see a menu for project-level settings. If you click on 'Spark', you will be able to specify a default project-level value for the SPARK Interpreter location. This will override global preferences.
Step filters are a very useful feature when stepping through SPARK process models. A simple process model can require hundreds of steps to complete, and you may only wish to monitor a very small handful of these. Step filters allow you to specify events and keywords to either monitor or ignore. For example, you can tell SPARK to report 'SUCCEEDED' and 'FAILED' events, but ignore 'EXECUTING' events. Similarly, you can tell it to ignore events with the text 'print' in them or only report events with the text 'foobar.'
You can access the step filter configuration in one of three different ways:
- Under the 'Run' menu: 'Configure SPARK Step Filters'
- On your toolbar:

- On the right-click menu in the 'Debug' view: 'Configure SPARK Step Filters'