Chava is a tool that produces a relational database describing a given Java program. It works with Java class files and optionally Java source. The database it produces is a CQL database, which can then be used by programs such as CIAO to query various aspects of the program.
Chava is a C program, so you need not have a Java compiler in order to use chava.
Chava is in the directory /home/jkorn/chava/src on raptor. Copy it from there. In order to install chava, you must have both AST and CIAO on your system (i.e., on raptor you can do /usr/local/ast/bin/use /usr/local/bin/ast then use /home/ek/work/sgi. Once you have obtained chava, it is installed as follows:
To use chava, CIAO must first be initialzied with the Java definition files. This is done by changing your directory to the install root of chava (/home/jkorn/chava on raptor). Enter the command ciao_testdb. It will ask which language; type "Java". Hit return for the other questions that will be asked.
Now, go to the directory that contains your Java class files. Make sure that the directory that contains chava is in your path. Then, type:
Chava works with Java .class files, which are similar to .o files in C. The Java class files contain symbol table information and byte code, and is sufficient to generate a fairly complete database. Most entities are referenced in the constant pool section of the class file. Method invocation and field access references are found by scanning the byte code for appropriate instuctions. Although the byte code is annotated with line number information, definitions are not. Chava will look for the source file corresponding to the specified class file and parse the source file for definitions. If you don't have the source, definitions will contain the correct file name (since that is specified in the class file), but the line numbers will be 0.
An advantage of using the Java class files is that it is easy to reverse engineer a class downloaded off the net. Since browsers download class files, chava can used on them without having to obtain anything else (including a Java compiler, since chava is written in C).