Dryad implements a conversion from the class file format to ATerm and vice versa.
class2aterm
is a disassembler for Java bytecode. It produces an ATerm representation of
a Java .class
file. class2aterm
can be used to obtain just the types of the members of a class, or
it can be used to decompile the full .class file (i.e. including code). Pass the -c
option to disassemble code.
aterm2class
is an assembler for Java bytecode. It accepts an ATerm representation of a .class
file and constructs a real .class
file from that.
The format of the bytecode representation in ATerms is defined in a tree grammar: ClassTree.rtg.
dryad-front
is a composition of some compiler components in the front-end of the Dryad compiler. Currently, its main component is the qualification and reclassification of names. This is an essential component for any tool that needs to analyse or transform Java code.
After parsing a Java source files, the tree contains many ambiguous constructs. For example, the parser on its own cannot determine whether the identifier System
in System.out.println("Hello world!")
refers to a package, class, field or local variable. Similarly, out
might be a package, a class, an inner classes of the System
, a field of the class System
and so on. Dryad-front resolves these ambiguities by analyzing the sources and reading the bytecode of the classes that are used. It returns a fully disambiguated abstract syntax tree.
dryad-front
also provides a type checker for Java, which annotates all expressions with their type. This type checker is still under development, but you can already use it by passing --tc on
to dryad-front
.
Dryad also provides a large library of functions useful for developing Java transformation systems in Stratego. All of the components of Dryad are based on this library. The main feature of the library is a unified representation of Java bytecode and source code classes in the Dryad Model. Classes can be loaded from the Dryad Repository and a java.lang.reflect
like API provides access to members, types, superclasses, etc.
Distributions are build continuously:
We advice to use Nix for installing Dryad. Nix provides one-click installation of Dryad and all its dependencies. Nix will make it very easy to stay up-to-date with the latest developments without any installation and configuration problems.
Installation from a source tarball requires the following packages:
The configure
script does not require any explicit configuration. Dryad will try to find the JDK by searching the path for javac
. Stratego/XT and Java-front will be found by pkg-config
.
If you build Dryad from Subversion, then there are some additional dependencies:
--with-bcel
)
--with-regexp
)
--with-aterm-java
)
--with-jjtraveler
)
--with-shared-objects
)
We use JIRA to keep track of issues. Please report any issues that you encounter!
Please send questions to the stratego@cs.uu.nl mailing list. Also, the Dryad developers are usually available on IRC at irc.freenode.net/stratego. Feel free to drop by!
The sources of Dryad are available from Subversion.
Committers:
Committers emeritus:
Feedback and bug reports:
Sponsors:
Dryad is LGPL (GNU Lesser General Public License) software. This means that you can use the Dryad Library (and tools) without being required to distribute your software under the GPL.