We characterise a computational model for processing annotated  Suppose we want to renovate Cobol programs using program transformations. Typical examples are dialect conversion, GO TO elimination, data-field expansion, migration from Cobol files to a relational database, and migration from an ASCII user interface to a GUI. To implement the corresponding transformation functionality, rewritingbased systems such as ASF+SDF [2] or TXL [6] are quite suitable. In the case of dialect conversion, for example, we would gather rewrite rules that translate patterns of the source dialect into patterns of the target dialect. Let's turn to the 'side issues': a few additional concerns regarding such renovation tooling are worth an effort. Here they are: Layout preservation. The renovated sources must preserve the original comments and white spaces. Otherwise, maintenance programmers will argue that the sources were alienated. (Layout preservation would also be a precondition for the visualisation of code changes if we wanted to use a simple tool like diff.) Pattern simplification. To hide some of Cobol's complexity, the programmer should operate on a simple core syntax for Cobol as opposed to Cobol's full syntax. To this end, Cobol programs are normalised prior to transformation. The original patterns must be restored in the output to avoid a drastic alienation of the sources. Change logging. We want to record all code changes in a precise, syntax-aware manner. Such change logging is useful for visualising affected code regions, recording changes for later reference and enabling user intervention. Remote referencing. Given a data name in a Cobol statement, we want to access directly the corresponding declaration site. Such remote referencing is convenient for encoding typical analyses and transformations. Otherwise, remote sites had to be repeatedly located by tree traversals. Post-processing directives. COPY books (i.e., include files) should be expanded during preprocessing to make their content accessible within the parse trees. The COPY statements should be re-established during post-processing on the basis of directives carried in the parse trees. Access restrictions. In the presence of expanded COPY books, it needs to be defined how to handle changes of the parse-tree regions that arose from expansion. If there is no useful way to deal with such changes, then any attempt of rewrite rules to perform such changes should be refused. Plan of attack -separation of concerns It turns out that these are crosscutting concerns in a rewriting context. (That is, a traditional implementation of such a concern will be tangled in the sense that many or all rewrite rules need to pay attention to the concern.) In this paper, we provide a rewriting-based computational model that allows for the separation of concerns like those above. This model provides designated support for processing annotated parse trees. The key insight of our approach is the following: The data for concerns like those above can be captured as annotations of the parse trees that are rewritten. The treatment of annotations can be largely decoupled from the ordinary, annotation-unaware rewrite rules.
Additionally, in REF these documentary structure issues are seen as a cross-cutting concern in the form of annotated parse trees.
Parse-tree annotations meet re-engineering concerns
Proceedings Third IEEE International Workshop on Source Code Analysis and Manipulation
Proceedings Third IEEE International Workshop on Source Code Analysis and Manipulation
Computer Science