Local Constraints in Programming Languages Part I: Syntax

Abstract The method of local constraints attempts to describe context-free languages in an apparently context-sensitive form which helps to retain the intuitive insights about the grammatical structure. This form of description, while apparently context-sensitive is, in fact, context-free and allows a program derivation structure to be represented as a tree with additional constraints, thus allowing for the possibility of a correctness proof in the form of Knuthian semantics. These semantic aspects will be discussed in a sequel to this paper (Part II: Semantics). Several detailed examples are given to motivate the use of local constraints grammars including some examples from the syntax of ALGOL 60. A parsing algorithm has been described; its purpose is to show that the computation of local constraints is quite reasonable. Transformation rules for transferring a context-free grammar into a local constraints grammar have been described and some heuristic approaches for the inverse transformation have been presented.