There is much to be said for the idea that if a system is given a formal definition, its implementation should follow that definition as closely as possible. The formal definition then becomes a roadmap to the implementation that, at the very least, improves the implementation’s maintainability. However, formal definitions are constructed primarily for economy of expression, not for ease or efficiency of direct implementation, and the result is usually a compromise in which the implementor deforms the roadmap into a distantly related schematic.
In this paper, one aspect of the powerful two-level grammar definition of ALGOL 68, as it appears in [1], is demonstrated to be directly and, with some well-defined transformations, efficiently implementable. Predicates, which are used to enforce the non-context-free aspects of the language definition (such as type agreement), but do not perform a generative function in the grammar (they reduce to the null string if true, and if false to an irreducible non-terminal string that blocks the completion of a sentence), become semantic procedures in a parser implementation. The presentation is thorough and relatively easy to follow.