skip to main content
article

Remote attribute grammars

Published:01 July 2005Publication History
Skip Abstract Section

Abstract

Describing the static semantics of programming languages with attribute grammars is eased when the formalism allows direct dependencies to be induced between rules for nodes arbitrarily far away in the tree. Such direct non-local dependencies cannot be analyzed using classical methods, which enable efficient evaluation.This article defines an attribute grammar extension (“remote attribute grammars”) to permit references to objects with fields to be passed through the attribute system. Fields may be read and written through these references. The extension has a declarative semantics in the spirit of classical attribute grammars. It is shown that determining circularity of remote attribute grammars is undecidable.The article then describes a family of conservative tests of noncircularity and shows how they can be used to “schedule” a remote attribute grammar using standard techniques. The article discusses practical batch and incremental evaluation of remote attribute grammars.

References

  1. Aiken, A. 1996. Cool: A portable project for teaching compiler construction. ACM SIGPLAN Notices 31, 7 (July), 19--26. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Alblas, H. 1991. Attribute evaluation methods. In Attribute Grammars, Applications and Systems. International Summer School SAGA Proceedings (Prague, Czechoslovakia, June 4--13), H. Alblas and B. Melichar, Eds. Lecture Notes in Computer Science, vol. 545. Springer-Verlag, Berlin, 48--113. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Augusteijn, L. 1990. The Elegant compiler generator system. In Attribute Grammars and their Applications. International Conference WAGA Proceedings (Paris, France, Sept. 19--21), P. Deransart and M. Jourdan, Eds. Lecture Notes in Computer Science, vol. 461. Springer-Verlag, Berlin, 238--254. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Bochmann, G. V. 1976. Semantic evaluation from left to right. Comm. ACM 19, 2 (Feb.), 55--62. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Borras, P., Clément, D., Despeyroux, T., Incerpi, J., Kahn, G., Lang, B., and Pascual, V. 1988. CENTAUR: The system. In Proceedings of the Third ACM SIGSOFT/SIGPLAN Software Engineering Symposium on Practical Software Development Environments. ACM Press, New York, 14--24. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Boyland, J. 2002. Incremental evaluators for remote attribute grammars. Electronic Notes in Theoretical Computer Science 63, 3 (June).Google ScholarGoogle Scholar
  7. Boyland, J., and Graham, S. L. 1994. Composing tree attributions. In Conference Record of the Twenty-first Annual ACM SIGACT/SIGPLAN Symposium on Principles of Programming Languages (Portland, Oregon, USA). ACM Press, New York, 375--388. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Boyland, J. T. 1996a. Conditional attribute grammars. ACM Trans. Prog. Lang. Syst. 18, 1 (Jan.), 73--108. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Boyland, J. T. 1996b. Descriptional composition of compiler components. Ph.D. thesis, University of California, Berkeley. Available as technical report UCB//CSD-96-916. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Boyland, J. T. 1998. Analyzing direct non-local dependencies in attribute grammars. In Compiler Construction: 7th International Conference, CC '98 (Lisbon, Portugal, Mar. 28--Apr. 4), K. Koskimies, Ed. Lecture Notes in Computer Science, vol. 1383. Springer, Berlin, Heidelberg, New York, 31--49. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Courcelle, B., and Franchi-Zannettacci, P. 1982. Attribute grammars and recursive program schemes. Theore. Comput. Sci. 17, 2--3 (Feb.--Mar.), 163--191, 235--257.Google ScholarGoogle Scholar
  12. Farrow, R. 1986. Automatic generation of fixed-point-finding evaluators for circular, but well-defined, attribute grammars. In Proceedings of the ACM SIGPLAN '86 Symposium on Compiler Construction (Palo Alto, California, USA). ACM SIGPLAN Notices 21, 7 (July), 85--98. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Farrow, R. 1989. The Linguist translator-writing system. Tech. Rep., Declarative Systems Inc. June.Google ScholarGoogle Scholar
  14. Farrow, R., Marlowe, T. J., and Yellin, D. M. 1992. Composable attribute grammars: Support for modularity in translator design and implementation. In Conference Record of the Nineteenth Annual ACM SIGACT/SIGPLAN Symposium on Principles of Programming Languages. 223--234. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Farrow, R., and Stanculescu, A. G. 1989. A VHDL compiler based on attribute grammar methodology. In Proceedings of the ACM SIGPLAN '89 Conference on Programming Language Design and Implementation (Portland, Oregon, USA). ACM SIGPLAN Notices 24, 7 (July), 120--130. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Gray, R. W., Heuring, V. P., Levi, S. P., Sloane, A. M., and Waite, W. M. 1992. Eli: A complete flexible compiler construction system. Comm. ACM 35, 2 (Feb.), 121--131. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Grosch, J. 1990. Object-oriented attribute grammars. In Proceedings of the Fifth International Symposium on Computer and Information Sciences (ISCIS V) (Eds. A. E. Harmanci, E. Gelenbe) (Cappadocia, Nevsehir, Turkey). 807--816.Google ScholarGoogle Scholar
  18. Hedin, G. 1994. An overview of door attribute grammars. In Proceedings of Compiler Construction, 5th International Conference, CC '94 (Edinburgh, U.K.), P. A. Fritzson, Ed. Lecture Notes in Computer Science, vol. 786. Springer-Verlag, Berlin, 31--51. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Hedin, G. 2000. Reference attributed grammars. Informatica 24, 3, 301--317.Google ScholarGoogle Scholar
  20. Hopcroft, J. E., and Ullman, J. D. 1979. Introduction to Automata Theory, Languages and Computation. Addison-Wesley, Reading, Massachussetts, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Jazayeri, M., Ogden, W., and Rounds, W. 1975. The intrinsically exponential complexity of the circularity problem for attribute grammars. Comm. ACM 18, 12 (Dec.), 697--706. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Johnson, G. F. 1983. An approach to incremental semantics. Ph.D. thesis, University of Wisconsin--Madison. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Johnson, G. F., and Fischer, C. N. 1985. A meta-language and system for nonlocal incremental attribute evaluation in language-based editors. In Conference Record of the Twelfth ACM Symposium on Principles of Programming Languages (New Orleans, Louisiana, USA). ACM Press, New York, 141--151. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Jourdan, M., Bellec, C. L., and Parigot, D. 1990. The OLGA attribute grammar description language: Design, implementation and evaluation. In Attribute Grammars and their Applications. International Conference WAGA Proceedings (Paris, France, Sept. 19--21), P. Deransart and M. Jourdan, Eds. Lecture Notes in Computer Science, vol. 461. Springer-Verlag, Berlin, 222--237. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Jourdan, M., and Parigot, D. 1991. Internals and externals of the FNC-2 attribute grammar system. In Attribute Grammars, Applications and Systems. International Summer School SAGA Proceedings (Prague, Czechoslovakia, June 4--13), H. Alblas and B. Melichar, Eds. Lecture Notes in Computer Science, vol. 545. Springer-Verlag, Berlin, 485--504. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Kastens, U. 1980. Ordered attributed grammars. Acta Informatica 13, 3 (Mar.), 229--256.Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Kastens, U. 1991. Attribute grammars in a compiler construction environment. In Attribute Grammars, Applications and Systems. International Summer School SAGA Proceedings (Prague, Czechoslovakia, June 4--13), H. Alblas and B. Melichar, Eds. Lecture Notes in Computer Science, vol. 545. Springer-Verlag, Berlin, 380--400. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Kastens, U., and Waite, W. M. 1994. Modularity and reusability in attribute grammars. Acta Informatica 31, 601--627. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Knuth, D. E. 1968. Semantics of context free languages. Mathematical Systems Theory 2, 2 (June), 127--145. Corrections appear in Mathematical Systems Theory 5, 1 (1971), 95--96.Google ScholarGoogle ScholarCross RefCross Ref
  30. Maddox, W. 1997. Incremental static semantic analysis. Ph.D. thesis, University of California, Berkeley. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Magnusson, E., and Hedin, G. 2003. Circular reference attributed grammars---their evaluation and applications. In Proceedings of the Third Workshop on Language Descriptions, Tools and Applications (LDTA 2003). Satellite event of ETAPS 2003 (Warsaw, Poland, Apr. 6). http://www.di.uminho.pt/~jas/LDTA_PROCEEDINGS.tgz.Google ScholarGoogle Scholar
  32. Parigot, D., Roussel, G., Jourdan, M., and Duris, E. 1996. Dynamic attribute grammars. In International Symposium on Programming Languages, Implementations, Logics and Programs (PLILP '96), H. Kuchen and S. D. Swierstra, Eds. Lecture Notes in Computer Science, vol. 1140. Springer-Verlag, Berlin, 122--136. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Poetzsch-Heffter, A. 1997. Prototyping realistic programming languages based on formal specifications. Acta Informatica 34, 737--772.Google ScholarGoogle ScholarCross RefCross Ref
  34. Reps, T. 1998. Program analysis via graph reachability. Tech. Rep. CS-TR-1998-1386, University of Wisconsin, Madison.Google ScholarGoogle Scholar
  35. Reps, T. 2000. Undecidability of context-sensitive data-dependence analysis. ACM Trans. Prog. Lang. Syst. 22, 1 (Jan.), 162--186. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Reps, T. W., and Teitelbaum, T. 1989. The Synthesizer Generator: A system for constructing language-based editors. Springer-Verlag, Berlin. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Rodeh, M., and Sagiv, M. 1999. Finding circular attributes in attribute grammars. J. ACM 46, 4 (July), 556--575. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Saraiva, J. 1999. Purely functional implementation of attribute grammars. Ph.D. thesis, Department of Computer Science, Utrecht University, The Netherlands. ftp://ftp.cs.uu.nl/pub/RUU/CS/phdtheses/Saraiva/.Google ScholarGoogle Scholar
  39. Sasaki, A., and Sassa, M. 2003. Circular attribute grammars with remote attribute references and their evaluators. New Generation Computing 22.Google ScholarGoogle Scholar
  40. Swierstra, D., and Vogt, H. 1991. Higher order attribute grammars. In Attribute Grammars, Applications and Systems. International Summer School SAGA Proceedings, H. Alblas and B. Melichar, Eds. Lecture Notes in Computer Science, vol. 545. Springer-Verlag, Berlin, 256--296. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Uhl, J., Drossopoulou, S., Persch, G., Goos, G., Dausmann, M., Winterstein, G., and Kirchgässner, W. 1982. An Attribute Grammar for the Semantic Analysis of Ada. Lecture Notes in Computer Science, vol. 139. Springer-Verlag, Berlin. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Vogt, H. H., Swierstra, S. D., and Kuiper, M. F. 1989. Higher order attribute grammars. In Proceedings of the ACM SIGPLAN '89 Conference on Programming Language Design and Implementation (Portland, Oregon, USA). ACM SIGPLAN Notices 24, 7 (July), 131--145. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Vorthmann, S. A. 1990. Coordinated incremental attribute evaluation on a DR-threaded tree. In Attribute Grammars and their Applications. International Conference WAGA Proceedings (Paris, France, Sept. 19--21), P. Deransart and M. Jourdan, Eds. Lecture Notes in Computer Science, vol. 461. Springer-Verlag, Berlin, 207--221. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Remote attribute grammars

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image Journal of the ACM
      Journal of the ACM  Volume 52, Issue 4
      July 2005
      199 pages
      ISSN:0004-5411
      EISSN:1557-735X
      DOI:10.1145/1082036
      Issue’s Table of Contents

      Copyright © 2005 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 1 July 2005
      Published in jacm Volume 52, Issue 4

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader