We describe JastAdd, a Java-based system for specifying and implementing the parts of compiler front ends that follow parsing. The system is built on top of a traditional Java parser generator which is used for parsing and tree building. JastAdd adds facilities for specifying and generating object-oriented abstract syntax trees with both declarative behavior (using Reference Attributed Grammars (RAGs)) and imperative behavior (using ordinary Java code). The behavior can be modularized into different aspects, e.g. name analysis, type checking, code generation, etc., that are woven together into classes. The class weaving technique has many advantages over the often used Visitor pattern in that it provides a safe and much simpler interface fo...