|
RECODER
recoder.sourceforge.net sourceforge.net/projects/recoder Version 0.85 released April 09, 2008. |
RECODER is a Java framework for source code metaprogramming aimed to deliver a sophisticated infrastructure for many kinds of Java analysis and transformation tools.
For a quick impression of RECODER's abilities, first browse a generated HTML view of a small code example taken from Sun's tutorial, pretty printed and annotated by RECODER. Note how well the syntactic structure is preserved. You may also inspect the source of the generator application.
RECODER also allows to transform code. Another toy program illustrates this. When applied to the example program, this obfuscator produces a very interesting result. Note that the modified program compiles and behaves as before.
These were just two of the example programs. If you are interested, feel free to download a public release and run the examples on your machine - the screenshot on the right shows a graphical demo application.
The following table gives a short description of the different layers of RECODER features as well as the application perspectives that these layers offer:
Parsing and unparsing of Java sources
In addition to abstract model elements, RECODER also supports a highly detailed syntactic model - no information is lost. Comments and formatting information are retained. The pretty printer is customizable and will be able to reproduce the code (possibly improving upon it, but retaining given code structures) and to embed new code seamlessly.Possible applications: Simple preprocessors, simple code generators, source code beautification tools
Name and type analysis for Java programs
RECODER can infer types of expressions, evaluate compile-time constants, resolve all kinds of references and maintain cross reference information.
Possible applications: Software visualization tools, software metrics, Lint-like semantic problem detection tools, design problem detection tools (anti-patterns), cross-referencing tools
Transformation of Java sources
RECODER contains a library of small analyses, code snippet generators and frequently used transformations.
Possible applications: Preprocessors for language extensions, semantic macros, aspect weavers, source code obfuscation tools, compilers
Incremental analysis and transformation of Java sources
Transformations change the underlaying program model; for incremental and iterative use, this model has to be updated accordingly. Transformations have to take care of dependencies by updating their local data and setting back matching positions when necessary; however, RECODER will analyze change impacts for its model and perform updates automatically.
Possible applications: Source code optimization, refactoring tool, software migration programs (Smart Patches), design pattern, clichés and idiom synthesis, architectural connector synthesis, adaptive programming environments, invasive software composition
You can do marvellous things, but you cannot expect miracles. A complete automation of software changes is far beyond todays possibilities: In general, it is not possible to do reasonable design decisions automatically, such as the choice of a fitting name for a globally visible entity. Also, in general it is not possible to analyze the behavior of reflective programs (analyzing reflection requires value analysis which is computable in "easy" cases only). Therefore, no guarantees can be given that the observable behavior of reflective programs will be retained. Reflective programs are evil in that respect.
RECODER is already useful but it also still needs polishing. The bug tracker contains the currently known issues and the feature requests tracker collects nice-to have features.
Development of COMPOST, the COMPOsition SysTem, started in 1998 following an idea of Uwe Aßmann. The core system was developped by Andreas Ludwig as part of his PhD thesis, with a lot of help and support from Uwe Aßmann and co-author Rainer Neumann at the software engineering and compiler construction group of Prof. Dr. Goos at the University of Karlsruhe. Since then, the number of users grew rapidly, mostly in the "academic neighborhood". In 2001, the core system of COMPOST was made available separately as "RECODER" for a broader range of users.
RECODER development has recently moved to Växjö Universitet. It was initially developed at the University of Karlsruhe (Universität Karlsruhe) and FZI Forschungszentrum Informatik Karlsruhe, Germany. Post your questions, critics, suggestions, reports, comments, requests, hints, and ideas to the forums at sourceforge.net/projects/recoder or send an e-mail to the staff members.
Tobias Gutzmann [TG] (developer, admin)
Dr. Dirk Heuzeroth [DH] (admin)
Mircea Trifu [MT] (admin)
Dr. Andreas Ludwig [AL]
Dr. Rainer Neumann [RN], Prof. Dr. Uwe Aßmann [UA] from the University of Karlsruhe
Jerker Hammarberg [JH], Jens Nordberg [JN], Andreas Sjöstedt [AS], Uwe Hoffmann [UH], Aldona Majorek [AM], Volker Kuttruff [VK], Philipp Rümmer [PR], Steffen Schlager [SS], Richard Bubel [RB], Bernhard Haumacher [BH]