Abstract
Forwarding is a technique for providing default attribute definitions in attribute grammars that is helpful in the modular implementation of programming languages. It complements existing techniques such as default copy rules. This paper introduces forwarding, and shows how it is but a small extension of standard higher-order attribute grammars. The usual tools for manipulating higher-order attribute grammars, including the circularity check (which tests for cyclic dependencies between attribute values), carry over without modification. The closure test (which checks that each attribute has a defining equation) needs modification, however, because the resulting higher-order attribute grammars may contain spurious attributes that are never evaluated, and indeed that need not be defined.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
S. Adams. Modular Attribute Grammars for Programming Language Prototyping. Ph.D. thesis, University of Southampton, 1991.
K. S. Backhouse. A functional semantics of attribute grammars. In International Conference on Tools and Algorithms for Construction and Analysis of Systems, Lecture Notes in Computer Science. Springer-Verlag, 2002.
A. Carle. Hierarchical attribute grammars: Dialects, applications and evaluation algorithms. Technical Report TR93-270, Department of Computer Science, Rice University, 1993.
L. Correnson, E. Duris, D. Parigot, and G. Roussel. Declarative program transformation: a deforestation case-study. In G. Nadathur, editor, Principles and Practice of Declarative Programming, volume 1702, pages 353–369. Lecture Notes in Computer Science, 1999.
O. Danvy and L. R. Nielsen. Defunctionalization at work. In Third International Conference on Principles and Practice of Declarative Programming (PPDP 01). ACM Press, 2001.
O. de Moor, K. Backhouse, and S. D. Swierstra. First-class attribute grammars. Informatica, 24(3), 2000.
O. de Moor, S. Peyton-Jones, and E. Van Wyk. Aspect-oriented compilers. In First International Symposium on Generative and Component-based Software Engineering, Lecture Notes in Computer Science. Springer-Verlag, 1999.
G. D. P. Dueck and G. V. Cormack. Modular attribute grammars. Computing Journal, 33:164–172, 1990.
Dawson R. Engler, Wilson C. Hsieh, and M. Frans Kaashoek. ‘c: A language for high-level, efficient, and machine-independent dynamic code generation’. In Symposium on Principles of Programming Languages, pages 131–144, 1996.
R. Farrow, T. J. Marlowe, and D. M. Yellin. Composable attribute grammars: Support for modularity in translator design and implementation. In Proceedings of the ACM Symposium on Principles of Programming Languages, pages 223–234. ACM Press, 1992.
H. Ganzinger and R. Giegerich. Attribute coupled grammars. SIGPLAN Notices, 19:157–170, 1984.
J. A. Goguen. Higher-order functions considered unnecessary for higher-order programming. In D. A. Turner, editor, Research Topics in Functional Programming, pages 309–351. Addison-Welsey, Reading, MA, 1990.
G. Hedin. An object-oriented notation for attribute grammars. In Proceedings of the European Conference on Object-Oriented Programming, ECOOP’89. Cambridge University Press, 1989.
Gorel Hedin. Reference Attributed Grammars. In D. Parigot and M. Mernik, editors, Second Workshop on Attribute Grammars and their Applications, WAGA’99, pages 153–172, Amsterdam, The Netherlands, 1999. INRIA rocquencourt.
T. Johnsson. Attribute grammars as a functional programming paradigm. In G. Kahn, editor, Functional Programming Languages and Computer Architecture, volume 274 of Lecture Notes in Computer Science, pages 154–173. Springer-Verlag, 1987.
S. Jones and J. Hughes. Haskell98: A non-strict purely functional language.
U. Kastens and W. M. Waite. Modularity and reusability in attribute grammars. Acta Informatica, 31:601–627, 1994.
D. E. Knuth. Semantics of context-free languages. Mathematical Systems Theory, 2(2):127–146, 1968. Corrections in 5(2):95-96, 1971.
C. Le Bellec, M. Jourdan, D. Parigot, and G. Roussel. Specification and implementation of grammar coupling using attribute grammars. In M. Bruynooghe and J. Penjam, editors, Programming Language Implementation and Logic Programming (PLILP’ 93), volume 714 of Lecture Notes in Computer Science, pages 123–136. Springer-Verlag, 1993.
W Maddox. Semantically-sensitive macroprocessing. Master’s thesis, The University of California at Berkeley, Computer Science Division (EECS), Berkeley, CA 94720, December 1989.
M. Mernik, M. Lenic, E. Avdicausevic, and V. Zumer. Multiple attribute grammar inheritance. Informatica, 24(3):319–328, 2000.
D. Parigot, E. Duris, G. Roussel, and M. Jourdan. Attribute grammars: a declarative functional language. Rapport de Recherche 2662, INRIA, 1995.
T. W. Reps and T. Teitelbaum. The Synthesizer Generator: A system for constructing language-based editors. Texts and Monographs in Computer Science. Springer-Verlag, 1989.
J. C. Reynolds. Definitional interpreters for higher-order programming languages. Higher-order and symbolic computation, 11(4):363–397, 1998. Reprinted from the proceedings of the 25th ACM National Conference (1972).
Joao Saraiva and Doaitse Swierstra. Generic Attribute Grammars. In D. Parigot and M. Mernik, editors, Second Workshop on Attribute Grammars and their Applications, WAGA’99, pages 185–204, Amsterdam, The Netherlands, 1999. INRIA rocquencourt.
Tim Sheard. Using metaml: A staged programming language. In Advanced Functional Programming, pages 207–239, 1998.
C. Simonyi. Intentional programming: Innovation in the legacy age. Presented at IFIP Working group 2.1. Available from URL http://www.research.microsoft.com/research/ip/, 1996.
S. D. Swierstra. Simple, functional attribute grammars. http://www.cs.uu.nl/groups/ST/Software/UU_AG/, 1999.
T. Teitelbaum and R. Chapman. Higher-order attribute grammars and editing environments. In ACM Sigplan’ 90 Conference on Programming Languages Design and Implementation, pages 197–208, 1990.
E. Van Wyk, O. de Moor, G. Sittampalam, I. Sanabria-Piretti, K. Backhouse, and P. Kwiatkowski. Intentional programming: a host of language features. Technical Report PRG-RR-01-15, Computing Laboratory, University of Oxford, 2001.
H. Vogt. Higher order attribute grammars. PhD thesis, Department of Computer Science, Utrecht University, The Netherlands, 1989.
H. Vogt, S. D. Swierstra, and M. F. Kuiper. Higher-order attribute grammars. In Conference on Programming Languages Design and Implementation, pages 131–145, 1990. Published as ACM SIGPLAN Notices, 24(7).
Daniel Weise and Roger F. Crew. Programmable syntax macros. ACM SIGPLAN Notices, 28(6):156–165, 1993.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2002 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Van Wyk, E., de Moor, O., Backhouse, K., Kwiatkowski, P. (2002). Forwarding in Attribute Grammars for Modular Language Design. In: Horspool, R.N. (eds) Compiler Construction. CC 2002. Lecture Notes in Computer Science, vol 2304. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45937-5_11
Download citation
DOI: https://doi.org/10.1007/3-540-45937-5_11
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-43369-9
Online ISBN: 978-3-540-45937-8
eBook Packages: Springer Book Archive