A New Approach to Compiling Adaptive Programs

An adaptive program can be understood as an object-oriented program where the class graph is a parameter, and hence the class graph may be changed without changing the program. The problem of compiling an adaptive program and a class graph into an object-oriented program was studied by Palsberg, Xiao, and Lieberherr in 1995. Their compiler is efficient but works only in special cases. In this paper we present and prove the correctness of a compiler that handles the general case. The compiler first computes a finite-state automaton and then uses it to generate efficient code.