Dynamic Syntax Specification Using Grammar Forms

A conceptually simple scheme is exhibited for specifying syntactically correct programs of declarative, block-structured programming languages. The method is then demonstrated on a selected subset of PL/1. The scheme itself is based on grammar forms, a concept recently introduced to provide a unified treatment of structurally related grammars. The form grammar provides the BNF equivalent for the syntax. The interpretations of the grammar form are constructed dynamically during the scanning of the input program and map the form grammar into a context-free grammar satisfying the constraints of the given programming language.