An Architecture for Context-Sensitive Formatting

Mark G. J. van den Brand, Taeke Kooiker, Jurgen J. Vinju, Niels P. Veerman. An Architecture for Context-Sensitive Formatting. In 21st IEEE International Conference on Software Maintenance (ICSM 2005), 25-30 September 2005, Budapest, Hungary. pages 631-634, IEEE Computer Society, 2005. [doi]

Abstract

We have taken a fixed set of formatting requirements for a Cobol system as spelled out in a standardization document, and applied generic formatting technology to implement them. It appeared that corporate conventions can dictate alignment that crosscuts the logical structure of a program, and can even dictate indentation that is dynamically computed from context information. We have developed and implemented a formatting architecture that allows arbitrary computational power for mapping language constructs to the Box language. The enabling feature is a hybrid format that merges Box expressions with parse trees. Much of the boilerplate part of formatting can still be automated by a default mapping to Box. Absolute tab stops, an important feature which is not found in many Box back-ends, is used extensively in our case study.