Abstract
Reference attribute grammars (RAGs) provide a practical declarative means to implement programming language compilers and other tools. RAGs have previously been extended to support both circular attributes and context-dependent declarative rewrites of the abstract syntax tree. In this previous work, dependencies between circular attributes and rewrites are not considered. In this paper, we investigate how these extensions can interact, and still be well defined. We introduce a generalized evaluation algorithm that can handle grammars where circular attributes and rewrites are interdependent. To this end, we introduce circular higher-order attributes, and show how RAG rewrites are a special form of such attributes.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Apel, S., Kolesnikov, S., Liebig, J., et al.: Access control in feature-oriented programming. Sci. Comp. Prog. 77(3), 174–187 (2012)
Appeltauer, M., Hirschfeld, R., Masuhara, H., Haupt, M., Kawauchi, K.: Event-specific software composition in context-oriented programming. In: Baudry, B., Wohlstadter, E. (eds.) SC 2010. LNCS, vol. 6144, pp. 50–65. Springer, Heidelberg (2010)
Avgustinov, P., Ekman, T., Tibble, J.: Modularity first: a case for mixing AOP and attribute grammars. In: AOSD, pp. 25–35. ACM (2008)
Blackburn, S.M., McKinley, K.S., Garner, R., et al.: Wake up and smell the coffee: evaluation methodology for the 21st century. CACM 51(8), 83–89 (2008)
Tang Boyland, J.: Remote attribute grammars. J. ACM 52(4), 627–687 (2005)
Cordy, J.R.: The TXL source transformation language. Sci. Comp. Prog. 61(3), 190–210 (2006)
Demers, A.J., Reps, T.W., Teitelbaum, T.: Incremental evaluation for attribute grammars with application to syntax-directed editors. In: White, J., Lipton, R.J., Goldberg, P.C. (eds.) POPL, pp. 105–116. ACM Press (1981)
Söderberg, E.: Paper examples (2013), http://fileadmin.cs.lth.se/sde/publications/papers/2013-Soderberg-SLE-CircularNTA
Ekman, T., Hedin, G.: Rewritable reference attributed grammars. In: Odersky, M. (ed.) ECOOP 2004. LNCS, vol. 3086, pp. 147–171. Springer, Heidelberg (2004)
Ekman, T., Hedin, G.: Modular name analysis for Java using JastAdd. In: Lämmel, R., Saraiva, J., Visser, J. (eds.) GTTSE 2005. LNCS, vol. 4143, pp. 422–436. Springer, Heidelberg (2006)
Ekman, T., Hedin, G.: The Jastadd Extensible Java Compiler. In: OOPSLA, pp. 1–18. ACM (2007)
Ekman, T., Hedin, G.: The JastAdd system - modular extensible compiler construction. Sci. Comp. Prog. 69(1-3), 14–26 (2007)
Farrow, R.: Automatic generation of fixed-point-finding evaluators for circular, but well-defined, attribute grammars. In: SIGPLAN 1986: Proceedings of the 1986 SIGPLAN Symposium on Compiler Construction, pp. 85–98. ACM, New York (1986)
Hedin, G.: Reference Attributed Grammars. Informatica (Slovenia) 24(3), 301–317 (2000)
Jones, L.G.: Efficient evaluation of circular attribute grammars. ACM TOPLAS 12(3), 429–462 (1990)
Jones, L.G., Simon, J.: Hierarchical vlsi design systems based on attribute grammars. In: POPL, pp. 58–69. ACM (1986)
Jourdan, M.: An optimal-time recursive evaluator for attribute grammars. In: Paul, M., Robinet, B. (eds.) Programming 1984. LNCS, vol. 167, pp. 167–178. Springer, Heidelberg (1984)
Knuth, D.E.: Semantics of Context-free Languages. Mathematical Systems Theory 2(2), 127–145 (1968); Correction: Mathematical Systems Theory 5(1), 95–96 (1971)
Krishnan, L., Van Wyk, E.: Termination analysis for higher-order attribute grammars. In: Czarnecki, K., Hedin, G. (eds.) SLE 2012. LNCS, vol. 7745, pp. 44–63. Springer, Heidelberg (2013)
Magnusson, E., Hedin, G.: Circular reference attributed grammars - their evaluation and applications. Sci. Comp. Program. 68(1), 21–37 (2007)
Martins, P., Fernandes, J.P., Saraiva, J.: Zipper-based attribute grammars and their extensions. In: Du Bois, A. (ed.) SBLP 2013. LNCS, vol. 8129, pp. 135–149. Springer, Heidelberg (2013)
Reps, T.W.: Optimal-time incremental semantic analysis for syntax-directed editors. In: DeMillo, R.A. (ed.) POPL, pp. 169–176. ACM Press (1982)
Söderberg, E., Hedin, G.: Incremental Evaluation of Reference Attribute Grammars using Dynamic Dependency Tracking. Technical Report 98, Lund University, LU-CS-TR:2012-249, ISSN 1404-1200 (April 2012)
den van Brand, M.G.J., et al.: The ASF+SDF meta-environment: A component-based language development environment. In: Wilhelm, R. (ed.) CC 2001. LNCS, vol. 2027, pp. 365–370. Springer, Heidelberg (2001)
Visser, E.: Stratego: A language for program transformation based on rewriting strategies system description of stratego 0.5. In: Middeldorp, A. (ed.) RTA 2001. LNCS, vol. 2051, pp. 357–361. Springer, Heidelberg (2001)
Vogt, H., Swierstra, S.D., Kuiper, M.F.: Higher order attribute grammars. In: PLDI, pp. 131–145 (1989)
Van Wyk, E., de Moor, O., Backhouse, K., Kwiatkowski, P.: Forwarding in attribute grammars for modular language design. In: Nigel Horspool, R. (ed.) CC 2002. LNCS, vol. 2304, pp. 128–142. Springer, Heidelberg (2002)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2013 Springer International Publishing Switzerland
About this paper
Cite this paper
Söderberg, E., Hedin, G. (2013). Circular Higher-Order Reference Attribute Grammars. In: Erwig, M., Paige, R.F., Van Wyk, E. (eds) Software Language Engineering. SLE 2013. Lecture Notes in Computer Science, vol 8225. Springer, Cham. https://doi.org/10.1007/978-3-319-02654-1_17
Download citation
DOI: https://doi.org/10.1007/978-3-319-02654-1_17
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-02653-4
Online ISBN: 978-3-319-02654-1
eBook Packages: Computer ScienceComputer Science (R0)