Extensible Grammars for Language Specialization

Luca Cardelli, Florian Matthes, Martín Abadi. Extensible Grammars for Language Specialization. In Catriel Beeri, Atsushi Ohori, Dennis Shasha, editors, Database Programming Languages (DBPL-4), Proceedings of the Fourth International Workshop on Database Programming Languages - Object Models and Languages, Manhattan, New York City, USA, 30 August - 1 September 1993. Workshops in Computing, pages 11-31, Springer, 1993. [doi]

Abstract

A frequent dilemma in the design of a database programming language is the choice between a language with a rich set of tailored notations for schema definitions, query expressions, etc., and a small, simple core language. We address this dilemma by proposing extensible grammars, a syntax-definition formalism for incremental language extensions and restrictions based on an initial core language. The translation of programs written in rich object languages into a small core language is defined via syntax-directed patterns. In contrast to macro-expansion and program-rewriting tools, our extensible grammars respect scoping rules. Therefore, we can introduce binding constructs while avoiding problems with unwanted name clashes. We develop extensible grammars and illustrate their use by extend- ing the lambda calculus with let-bindings, conditionals, and SQL-style query expressions. We then give a formal description of the underlying parsing, transformat,ion, and substitution rules. Finally, we sketch how these rules are exploit,ed in the implementation of a generic, extensible parser package.