Abstract
We have demonstrated how an attribute grammar, augmented with operational constraints, can be used to specify the static semantics of an object-oriented language. The operational constraints have side-effects which make it possible to incrementally update attributes. This makes it possible to represent symbol tables in a natural and efficient way. A tracing technique is used to efficiently locate all affected identifier use sites after changes to symbol tables. The technique is general enough to handle the various combinations of scope rules which appear in object-oriented languages.
A mechanism for demand attributes is used, which together with the operational constraints allows the total space consumption for attributes to be kept very low. This is extremely important in order to be able to represent large programs. An object-oriented notation has been introduced which allows default definition of constraints. This gives a high degree of flexibility in the grammar specification, and is particularly useful in combination with demand attributes.
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
Beshers G., Campbell R.: Maintained and Constructor Attributes. In Proceedings of the ACM SIGPLAN 85 Symposium on Language Issues in Programming Environments. Seattle, June 1985.
Dahle, H.P., Löfgren, M., Madsen, O.L., Magnusson, B., The MJØLNER Project, Proceeding of the Conference held at Software Tools, Online Publications, London, 1987.
Demers A., Rogers A., Zadeck F.K.: Attribute Propagation by Message Passing. In Proceedings of the ACM SIGPLAN 85 Symposium on Language Issues in Programming Environments. Seattle, June 1985.
Goldberg A., Robson D.: Smalltalk 80. The language and its implementation. Addison-Wesley 1983.
Hoover R.: Dynamically bypassing copy rule chains in attribute grammars. In Conference Record of the 13th Symposium on Principles of Programming Languages, St. Petersburg, Fla. Januray 1986.
Hoover R., Teitelbaum T.: Efficient Incremental Evaluation of Aggregate Values in Attribute Grammars. Proceedings of the SIGPLAN '86 Symposium on Compiler Construction, Palo Alto, June 1986.
Hoover R.: Incremental Graph Evaluation. PhD Thesis. Cornell University, Dept. of Computer Science, May 1987.
Horwitz S., Teitelbaum T.: Generating Editing Environments Based on Relations and Attributes. ACM TOPLAS, Vol 8, No 4, October 1986. Pages 577–608.
Johnson G. F., Fischer C. N.: Non-syntactic attribute flow in language based editors. In Conference Record of the 9th ACM Symposium on Principles of Programming Languages, Albuquerque, N.M., January 1982, 185–195.
Johnson G. F., Fischer C. N.: A meta-language and system for nonlocal incremental attribute evaluation in language-based editors. In Conference Record of the 12th ACM Symposium on Principles of Programming Languages, New Orleans, La. January 1985. 141–151.
Knuth D. E.: Semantics of context-free languages. Math. Syst. Theory 2:2, June 1968, 127–145.
Kristensen B. B., Madsen O.L., Møller-Pedersen B., Nygaard K.: The BETA Programming Language. In Shriver B., Wegner P. (eds.) Research Directions in Object-Oriented Programming. The MIT Press, 1987.
Lewis P.M., Rosenkrantz D.J., Stearns R.E.: Attributed translations. J. Computer and Systems Sciences 9:3, 279–307.
Meyer B.: Eiffel: Programming for Reusability and Extendibility. SIGPLAN Notices, Vol. 22, No. 2, Feb 1987.
Naur P.: Revised report on the algorithmic language ALGOL 60. Comm. ACM 6:1, 1–17.
PLANC Reference Manual. Norsk Data A.S. Oslo, Norway, 1979.
Reps T.: Generating Language-Based Environments. The MIT Press, 1984.
Reps T., Teitelbaum T.: The Synthesizer Generator. Reference Manual. Cornell University, Dept. of Computer Science. 1985 (revised 1987).
Reps T., Marceau C., Teitelbaum T.: Remote attribute updating for language-based editors. In Conference Record of the Thirteenth ACM Symposium on Principles of Programming Languages, St. Petersburg, Florida, January 1986. pp 1–13.
Schaffert C., Cooper T., Bullis B., Kilian M., Wilpolt C.: An Introduction to Trellis/Owl. In Proceedings of OOPSLA '86. The 1986 Conference on Object-Oriented Programming Systems, Languages and Applications. SIGPLAN Notices. Vol 21 No 11, Nov 1986.
Data Processing — Programming Languages — SIMULA. Swedish Standard SS 63 61 14. SIS. Stockholm, Sweden, June 1987.
Dahl, O.-J., Nygaard, K.: SIMULA 67 Common Base Language. Norwegian Computing Center, Oslo, 1968. Revised 1970, 1972, and 1984.
Stroustrup B.: The C++ Programming Language. Addison-Wesley, 1986.
Wirth N.: From Modula to Oberon. Tech. Rep. ETH, Zurich, 1988.
Yeh D.: On Incremental Evaluation of Ordered Attribute Grammars. BIT 23:3, 1983.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1989 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Hedin, G. (1989). Incremental attribute evaluation with side-effects. In: Hammer, D. (eds) Compiler Compilers and High Speed Compilation. CCHSC 1988. Lecture Notes in Computer Science, vol 371. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-51364-7_14
Download citation
DOI: https://doi.org/10.1007/3-540-51364-7_14
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-51364-3
Online ISBN: 978-3-540-46200-2
eBook Packages: Springer Book Archive