Project The goal of the project is to perform a software development task from design through implementation. The task is to write a translator from a language L1 to a language L2. The language L1 consists of all of Java plus a traversal language T. The output language consists of a small subset of AspectJ. The purpose of the translation is to translate high-level traversal specifications to Java traversal methods, similar to the ones you wrote in homework 2. Example input: Java: class Basket { Fruit f; Pencil p; } class Fruit { Weight w;} class Orange implements Fruit { Color c; } class Pencil {} class Color { String s; } class Weight{ int i; } class Main { public static void main() {} } T: aspect Traversals { declare traversal t1 = Basket to *; declare traversal t2 = Basket to Weight; } output: aspect TraveralsImplementation { void Basket.t1(){ if (f != null) t1_f(); if (p != null) t1_p();} void Basket.t1_f(){if f.t1();} void Basket.t1_p(){if p.t1();} void Fruit.t1(){t1_w();} void Fruit.t1_w(){w.t1();} void Orange.t1(){t1_c(); super.t1();} void Orange.t1(){c.t1();} void Pencil.t1(){}; void Color.t1(){}; void Weight.t1(){}; void Basket.t2(){t2_f();} void Basket.t2_f(){f.t2();} void Fruit.t2(){t2_w();} void Fruit.t2_w(){w.t2();} void Orange.t2(){super.t2();} void Weight.t2(){}; } To test your output, you should compile it with the AspectJ compiler ajc. See URL. aspect TraversalsTest { pointcut mainCall() : call(public static void main()); before mainCall() { // create Basket b b.t1(); b.t2(); } pointcut nodeTraversals(Object o): call(void t1()) && target(o); pointcut edgeTraversals(Source s, Target t): within(*.t1_*()) && call(void t1()) && this(s) && target(t); before nodeTraversals(o) { System.out.println("traversing node " + o); } before edgeTraversals((Source s, Target t) { System.out.println( "traversing edge: source= " + o + " target= " + t); System.out.println(thisJoinPoint); } // same but replace t1 by t2 } The project consists of the following steps: 1. Produce the class graph cg from the Java program. 2. For cg and a fixed traversal strategy produce the traversal graph. 3. Generate the traversal code from a fixed traversal graph using the interface of the AP Library available in DJ. 4. Test the generated traversal code manually. 5. Automate 2./3./4.: Read in traversal graphs from file Traversals.java and translate them into a file that, when compiled by AspectJ and executed, will produce the file TraversalsImplementation.java (containing the traversal code) and TraversalsTest.java (containing the test code). We will develop the project in phases: Traversal specifications: 1. from A to * 2. from A to B 3. from A bypassing B to C Class graphs: 1. Only construction classes and edges. 2. Add alternation classes and edges. 3. Add collections.