S-Expr Plug-in
This plugin provides a first example of a tool extension of Pda.. The S-Expr Plug-in generates s-expressions from protocols in an Pda diagram and writes them to a file. In the current version, the individual programs of the protocol agents is captured in the generated s-expressions; it is assumed that the connections between the local states of an agents are complete; otherwise the s-expression is not generated correctly.
The S-Expression grammar
Here is the current version of the s-expression grammar that describes the structure of the s-expressions generated by Pda.
Usage
- Specifying the output file:
- The output file that will be used for writing the s-expression is
specified in the Preference page for the plugin. It is accessible from
the main menu at Window
->
Preferences->
Pda Preferences->
S-Expr Generation - Usage:
- In a Pda diagram, select a protocol node and right-click to get its context menu. The s-expression representing the protocol will be generated into the specified file.
Inspecting the source code
In order to inspect the source code of this Pda tool extension, you have to import the S-Expression plugin as a binary project into your workspace. This allows you to browse the source code in order to get an idea how to write customized Pda tool interfaces.
In more detail, the following steps need to be performed:
- In the running Pda/Eclipse tool change to the Java perspective and deselect any working sets
- Run
"Import"
from the"File"
menu - Select
"Existing Plug-ins and Fragment"
and click"Next"
- Don’t change anything on the following screen, click
"Next"
- Select
"edu.kestrel.pda.SExprPdaPlugin"
on the next screen and click"Add"
, then"Finish"
- A project named
"edu.kestrel.pda.SExprPdaPlugin"
should have been created in your workspace; the source code can be found in the"src"
folder of that project.