- Prolog Plugin Features
- The next steps
- Installing and using the Prolog Plugin
In this first stage of the project, we intended to offer to Prolog users an integrated environment, in which he/she could develop his/her programs, organize them in different projects, load them into the Prolog interpreter, make tests, debug and compile them.
However, some of these features are still not being delivered in this first version. Once the Eclipse Platform is a framework, it was necessary to spend considerable time studying its architecture, as well as the plug-in development and the extension points system.
Besides, we initially planned to develop a specialized Eclipse IDE for Ciao Prolog, a specific Prolog implementation.
Nevertheless, this first plug-in version can be used in a satisfactory way as an IDE for the Prolog implementation chosen by the user.
This project will be continued as a graduate project.
For more details, see "The next steps".
- Undergraduate student:
The following features are added to the Eclipse Platform, after the
Plugin Prolog installation:
A new Editor with Prolog syntax highlighting.
The Prolog Editor is able to recognize and color Prolog built-in predicates, variables, operators, comments and strings.
After the plug-in installation, all the Prolog sources ("*.pl" and "*.pro")
will be automatically associated to the Prolog
Editor. However, the user can cancel this association using the
"Preferences -> Workbench -> File Associations" menu.
A new Preference Page.
Using the new preference page, it´s possible to choose the colors to be used in the source code sintax highlighting.
Besides, the user must inform in this page the path of the Prolog
interpreter to be executed by the plug-in.
A new menu action which starts a Prolog interpreter.
The plug-in provides a new menu ("Prolog") and a new toolbar button to the Eclipse Workbench, both of them related to an action which starts the Prolog interpreter in the Platform console window.
(The Prolog interpreter to be executed is that one whose path is informed in the plug-in preference page).
Through this action, the interpreter is executed in an independent way.
A new pop-up menu action, related to Prolog files, used to consult these files into a Prolog Interpreter.
This action is triggered by the new menu item "Consult into Prolog
Interpreter", located in the pop-up menu associated to Prolog files.
This pop-up menu is called through rigth-clicking on one or more selected Prolog files.
If the user selects Prolog files and chooses this new menu option, the Prolog interpreter will be called and all the selected files will be automatically loaded (consulted) in it. After that, the user will be able to write queries to his/her files using the interpreter window (console window).
A new Launch Configuration.
The Eclipse Platform allows plug-in developers to define<i> launch configurations </i>.
These launch configurations can be executed through the "Run" Eclipse menu.
Using a launch configuration it is possible to execute (or to launch) programs according to user parameters, within the Eclipse Platform.
The Prolog Plugin provides the "Prolog Interpreter" launch configuration.
When a new "Prolog Interpreter" launch configuration is created,
the name of the current project in the workbench, as well as the names
of all the Prolog files in this current project, are brought to the
The execution of this launch configuration will launch the interpreter and consult in it all the Prolog files listed in its window.
This new launch configuration provides a suitable way to load a
whole Project into a Prolog interpreter.
Log of the unexpected errors or exceptions.
The Eclipse Platform allows plug-in developers to log unexpected
The logged errors become available through the "Error Log" Platform view.
The Prolog Plugin tries to log all the handled exceptions that
cannot be solved by the user.
During the Prolog Plugin development, the following Eclipse extension points were extended:
To add the Prolog editor.
To add the "Prolog Preferences" preference page.
To add the "Prolog Interpreter" launch configuration.
To the definition of the "Prolog Interpreter" launch configuration image.
To the definition of the new launch configuration tab pages set.
To add the pop-up menu action which calls a Prolog interpreter and loads in it the selected Prolog files.
To add the action, represented by the "Prolog" menu item and workbench toolbar buttom, which calls a Prolog interpreter in an independent way.
The project will be continued during 2004 as a graduate project.
More information will be available here soon.
We describe here the installation of Prolog Plugin as well as some configuration steps that should be executed before its first use.
We remind you that the Prolog Plugin is compatible with any Eclipse version, since the 2.0.
1. First of all, you have to download the plug-in package.
2. Extract the plug-in zip file file into the Eclipse installation directory.
(For instance, if your Eclipse is installed in /usr/local/eclipse, extract the zip file into this directory.)
3. After step (2) is performed, the Prolog Plugin is already installed and ready to be used next time Eclipse is launched.
(Note: if your Eclipse were running during the installation process, you will have to restart it before using the new plug-in features).
Before starting to develop Prolog programs using the Eclipse IDE, the
user must follow the configuration steps bellow:
1. Set the Prolog Interpreter path.
This path has to be set in the "Prolog Preferences" preference page.
To access the "Prolog Preferences", the user must use the "Window -> Preferences" menu.
2. Enable the Prolog action set in the choosen perspective.
The Prolog action set includes the "Prolog" menu item and a new workbench toolbar buttom, both of them used to call the Prolog interpreter.
Even after the plug-in installation, this action set will not appear at the Eclipse workbench. So, the user must activate a chosen perspective (that one in which the user will edit his/her Prolog files) and do the following:
- Click on "Window -> Customize Perspective" workbench menu;
- Expand the "Others" option;
- Check the "Prolog Plugin" item.
After that, buttom and menu item that call the Prolog interpreter
will be available at the Eclipse workbench, when the user activates
the chosen perspective.
We identify here some Prolog Plugin features using screenshots.
In this first picture, we can see a Prolog source code being edited and the Prolog interpreter running in the Platform console window:
Observe the Prolog syntax highlighting in the editor and the special icon associated to Prolog files in the "Navigator" view.
The toolbar button (linked to the hint "Starts Prolog Interpreter") and the "Prolog" menu item are used to call the Prolog interpreter in the Platform console window.
In the next picture, we can see the pop-up menu associated to Prolog files, which is called through rigth-clicking on one or more selected Prolog files:
The Prolog Plugin contributes the "Consult into Prolog Interpreter" menu item to this pop-up menu. The user can load his/her Prolog files to a new Prolog interpreter console using this menu option.
This is the Prolog Plugin preference page, called through the "Window -> Preferences" menu:
Here the user can choose the colors to be used in the source code sintax highlighting and must inform the path of the Prolog interpreter to be executed by the plug-in.
This is the Prolog Plugin launch configuration, executed through the "Run" Eclipse menu:
The name of the current project in the workbench - "Prolog 2"- and the names of all the Prolog files in this current project - "mortal.pl" and "test.pl" - are automatically brought to this launch window when it is opened.
When the user clicks the "Run" button in this window,
the launch configuration will launch the Prolog interpreter
and consult in it all the Prolog files listed in its window.
The Prolog Plugin is available here:
The Prolog Plugin source code is availabe here:
See "Installing and using the Prolog Plugin", for installation instructions.