This is a proof-of-concept implementation of a compiler plugin automating the concepts from my Master's thesis.
These are the steps to build and run the plugin:
-
Check that your environment variable
SCALA_HOME
points to your Scala installation's root directory. Alternatively, adapt propertyscala.home
frombuild.xml
(line 3). -
Compile and package the plugin with
ant
. -
Compile (one of) the examples with
scalac -Xplugin:dist/dpplugin.jar -classpath dist/dpplugin.jar src/de/unikl/reitzig/paralleldynprog/automation/examples/[example].scala &> out
As an alternative to
-Xplugin
you can also specify use-Xpluginsdir
. -
Investigate the output which has been written into file
out
.
In order to use the plugin in your own context, you will need to point your IDE
to dpuser.jar
so you can use our annotation and markers. You compile as above.
The compiled code needs dpruntime.jar
(or dpplugin.jar
, but that is overkill)
in the classpath to run.
Hints:
- You need Scala 2.9 and ant 1.6
- You can use
ant clean
to remove all files byant
. - If you want to investigate the AST, add option
-Ybrowse:parser
to see it before our plugin, and-Ybrowse:dynprog
after. - If you prefer a text dump similar to the original source code, add
-Xprint:dynprog -Ycompact-trees
. - In order to see how the plugin nestles into the compiler run, add
-Xshow-phases