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 extending the lambda calculus with let-bindings, conditionals, and SQL-style query expressions. We then give a formal description of the underlying parsing, transformation, and substitution rules. Finally, we sketch how these rules are exploited in the implementation of a generic, extensible parser package.
The second author was supported by the European Commission, ESPRIT, EC/US-FIDE Collaborative Activity, 006:9829.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
A.V. Aho, R. Sethi, and J.D. Ullmann. Compilers: Principles, Techniques and Tools. Addison-Wesley, 1987.
A. Bove and L. Arbilla. A Confluent Calculus of Macro Expansion and Evaluation. In ACM Conference on Lisp and Functional Programming, pages 278–287, 1992.
V. Breazu-Tannen, P. Buneman, and S. Naqvi. Structural Recursion as a Query Language. In Proceedings of the Third International Workshop on Database Programming Languages,Nafplion, Greece, 1991. Morgan Kaufmann Publishers.
L. Cardelli. An Implementation of F. Report 97, Digital Equipment Corporation, Systems Research Center, 1993.
T. Griffin. Notational definition — A formal account. In Proceedings Symposium on Logic in Computer Science, pages 372–383, 1988.
E. Kohlbecker, D.P. Friedman, M. Felleisen, and B. Duba. Hygienic macro expansion. In ACM Conference on Lisp and Functional Programming, 1992.
G.N.C. Kirby. Persistent Programming with Strongly Typed Linguistic Reflection. FIDE Technical Report Series FIDE/92/40, FIDE Project Coordinator, Department of Computing Sciences, University of Glasgow, 1992.
E.E. Kohlbecker. Syntactic extensions in the programming language LISP. PhD thesis, Indiana University, 1986.
B.W. Kernighan and D.M. Ritchie. The C Programming Language. Prentice Hall, Englewood Cliffs, NJ, 1977.
F. Matthes. Persistente Objektsysteme: Integrierte Datenbankentwicklung and Programmerstellung. Springer-
M. Manny and D. Rauglaudre. Parsers in ML. In ACM Conference on Lisp and Functional Programming, 1992.
F. Matthes and J.W. Schmidt. Bulk Types: Built-In or Add-On? In Proceedings of the Third International Workshop on Database Programming Languages,Nafplion, Greece, 1991. Morgan Kaufmann Publishers.
S.A. Naqvi. Stratification as a Design Principle in Logical Query Languages. In Proceedings of the Second International Workshop on Database Programming Languages, Salishan, Oregon, 1989.
A. Ohori, P. Buneman, and V. Breazu-Tannen. Database Programming in Machiavelli — a Polymorphic Language with Static Type Inference. In Proceedings of the ACM-SIGMOD International Conference on Management of Data, Portland, Oregon, pages 46–57, 1989.
B. Pierce and D. Turner. Object-Oriented Programming without Recursive Types. In Proceedings of the 20th ACM Symposium on Principles of Programming Languages, pages 299–312, 1993.
J.M. Smith, S. Fox, and T. Landers. ADAPLEX: Rationale and Reference Manual ( 2nd ed. ). Technical report, Computer Corporation of America, Cambridge, Mass., 1983.
D. Stemple, R. Morrison, and Atkinson M. Type-safe Linguistic Reflection. In Database Programming Languages: Bulk Types and Persistent Data,pages 357–362, Nafplion, Greece, 1991. Morgan Kaufmann Publishers.
ISO. Standard ISO 9075, Information processing systems–Database language SQL,1987.
D. Stemple and T. Sheard. A Recursive Base for Database Programming Primitives. In Proceedings of the Kiev East/West Workshop on Next Generation Database Technology, volume 504 of Lecture Notes in Computer Science, 1991.
D. Stemple, T. Sheard, and L. Fegaras. Linguistic Reflection: A Bridge from Programming to Database Languages. In Proc.
D. Stemple, A. Socorro, and T. Sheard. Formalizing Objects for Databases using ADABTPL. In Advances in Object-Oriented Database Systems, pages 110–172, 1988.
D. Stemple, R.B. Stanton, T. Sheard, P. Philbrow, R. Morrison, G.N.C. Kirby, L. Fegaras, R.L. Cooper, R.C.H. Connor, M.P. Atkinson, and S. Alagic. Type-Safe Linguistic Reflection: A Generator Technology. Research Report CS/92/6, Univ. of St. Andrews, Dept. of Comp. Science, 1992.
P. Trinder. Comprehensions, a Query Notation for DBPLs. In Proceedings of the Third International Workshop on Database Programming Languages,Nafplion, Greece, 1991. Morgan Kaufmann Publishers.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1994 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Cardelli, L., Matthes, F., Abadi, M. (1994). Extensible Grammars for Language Specialization. In: Beeri, C., Ohori, A., Shasha, D.E. (eds) Database Programming Languages (DBPL-4). Workshops in Computing. Springer, London. https://doi.org/10.1007/978-1-4471-3564-7_2
Download citation
DOI: https://doi.org/10.1007/978-1-4471-3564-7_2
Publisher Name: Springer, London
Print ISBN: 978-3-540-19853-6
Online ISBN: 978-1-4471-3564-7
eBook Packages: Springer Book Archive