Preprocessors are components of a software development environment that can increase productivity by providing semantic capabilities for expressing certain source language statement s concisely and directly which would otherwise be expressed indirectly and verbosely. Moreover, it is frequently necessary to reflect a single programming decision in several places in the source text; a preprocessor can propagate a single specification of such a decision to the points it affects thereby reducing effort and removing the possibility a consistency error. In traditional environments, the language of preprocessor statements differs from the underlying programming language, e.g., CPP differs from C itself. If such deviations were allowed in an Ada environment, they would impair portability and detract from the effort to provide widespread, uniform language training in pure Ada. This paper demonstrates, however, that Ada is, by itself, a viable preprocessor language provided two conventions are adopted. First, the compilation sequence of preprocessing must be used; fortunately, an Ada compiler can serve in a preprocessor step without affecting its validation under the ACVC. Second, normal and preprocessor statements are not intermixed; Ada package structure must be employed to separate contexts that would be differentiated by syntax in traditional preprocessing. The distinctive compilation sequence of Ada preprocessing is a multiple pass compilation where compilation steps are connected via Ada text, not Ada library units. The results of one compilation pass are converted to text via an execution step and then provided as text input to the next step. As an example, the paper describes a preprocessor that constructs subsystem interfaces.
Read full abstract