Demeter/Java Project Page

Reflection Project

Implenting Propagation Patterns in Demeter/Java

Team members:

Mike Theroux, Mike Ruelle and James Pappas


Our goal is to implement Propagation Patterns in Demeter/Java. Propagation Patterns exist currently in Demeter/C++, and they allow arguments and a return value to be transported and modified by any objects encountered during the traversal. Our program should convert the propagation pattern into a traversal and visitor pattern by using a two pass method.

The first pass should read in the new propagation pattern from the command line. The program should then use a general information visitor with several subvisitors to find and store the arguments, return type, class wrappers, edge wrappers, and Java code needed to translate the propagation pattern into a traversal-visitor pattern. The three visitors each should contain vectors which track datatypes and instance names to be put into the new traversal-visitor pattern. The information should be gathered by four main traversals which insert the needed datatypes and instance name into the vectors. After this information gathering takes place, we should call a printing visitor to print out the resulting behavior file and to print the visitors onto the end of the class dictionary.


This project was implemented in three phases:

Phase1 included the foundation of the translator. This was the biggest phase which protyped many of the features of the full-blown translator. The goal of Phase1 was:

1) To perform a simple translation of an input propagation pattern.
2) To identify problems that may ocurr in future.
3) To clearly define the goals of future phases.

Phase2's goal was to allow the translator to perform a simple translation that compiled and functioned correctly for a subset of the propagation pattern syntax. By the end of Phase2, we would also be able to accept input and output from files, rather than (stdin) and (stdout). Phase2 did not allow for:

1) Multiple propagtion files.
2) A nice interface.
3) Bypass and through directives.
4) The "initialize" command.

Phase3's goal was to complete the translator. The following features were added:

1) A nice command line interface, accessible through a script called "pptrans".
2) All syntax, including through, bypassing, and intialize.
3) Correct initialization of ALL transportation variables.
4) Allow for the translation of multiple propagation files at once.

We are proud to say that all goals for this project were met on time. A full translator has been coded and functions correctly.