bild
School of
Computer Science
and Communication
KTH / CSC / TCS / People / Pedro / STaVe

Downloading and building STaVe

The source code is available at GitHub. You may use git to download it:

git clone https://github.com/pcgomes/stave.git
You download the dependencies and build the source code with Apache Maven. If you already have Maven installed, just type the to download the dependencies, compile and create a JAR file:
mvn package
Notice that STaVe was developed to compile and run with OpenJDK version 1.8.0_121. Other versions might work as well, though there is no guarantee.

Running STaVe

The following commands are examples executed from the top-level local repository directory, and assume that STaVe was successfully built and described above.
List the command syntax and options:

java -cp target/lib/\*:target/stave-1.0-SNAPSHOT.jar stave.Main --help
Alternatively:
export CLASSPATH="target/lib/\*:target/stave-1.0-SNAPSHOT.jar";
java stave.Main --help
Process an annotated Java program as input, and output a SyncTask program:
java -cp target/lib/\*:target/stave-1.0-SNAPSHOT.jar stave.Main -os Example.st -ij Example.java
Process a SyncTask program, and output a Coloured Petri net:
java -cp target/lib/\*:target/stave-1.0-SNAPSHOT.jar stave.Main -oc Example.cpn -is Example.st

STaVe parts provided as independent libraries

javaparser2jctree: a Java library that converts a Java Parser abstract syntax tree (AST) into an OpenJDK Javac (JCTree) AST. The Javac parser discards "non-annotation" comments, but the JavaParser does not. On the other hand, JavaParser provides only a lexer and a parser; no type-checking, optimization, code generation. Therefore, javaparser2jctree is useful for applications that need to preserve the per-node comments, at the same time that can still take advantage of Javac's features. This version is compatible with OpenJDK1.8.x.

libcpntools: a library to generate coloured Petri Net files in the CPN Tools's XML-based ".cpn" format. The library provides two main functionalities: generation of the XML's DOM structure and layout setting.

Last Modified: April 30 2017.