Skip to main content
Log in

Circular attribute grammars with remote attribute references and their evaluators

  • Regular Papers
  • Published:
New Generation Computing Aims and scope Submit manuscript

Abstract

Attribute grammars (AGs) are a suitable formalism for the development of language processing systems. However, for languages including unrestricted labeled jumps, such as “goto” in C, the optimizers in compilers are difficult to write in AGs. This is due to two problems that few previous researchers could deal with simultaneously, i.e., references of attribute values on distant nodes and circularity in attribute dependency. This paper proposescircular remote attribute grammars (CRAGs), an extension of AGs that allows (1) direct relations between two distant attribute instances through pointers referring to other nodes in the derivation tree, and (2) circular dependencies, under certain conditions including those that arise from remote references. This extension gives AG programmers a natural means of describing language processors and programming environments for languages that include any type of jump structure. We also show a method of constructing an efficient evaluator for CRAGs called amostly static evaluator. The performance of the proposed evaluator has been measured and compared with dynamic and static evaluators.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Similar content being viewed by others

References

  1. Aho, A. V., Sethi, R. and Ullman, J. D.,Compilers: Principles, Techniques, and Tools, Addison Wesley, 1986.

  2. Babich, W. A. and Jazayeri, M., “The Method of Attributes for Data Flow Analysis Part I,”Acta Inf., 10, 3, pp. 245–264, 1978.

    Article  MATH  MathSciNet  Google Scholar 

  3. Babich, W. A. and Jazayeri, M., “The Method of Attributes for Data Flow Analysis Part II,”Acta Inf., 10, 3, pp. 265–272, 1978.

    Article  MATH  MathSciNet  Google Scholar 

  4. Boyland, J. T., “Conditional Attribute Grammars,”ACM Trans. Prog. Lang. Syst., 18, 1, pp. 73–108, 1996.

    Article  Google Scholar 

  5. Boyland, J. T.,Descriptional Composition of Compiler Components, Ph.D. Thesis, University of California Berkeley, 1996.

    Google Scholar 

  6. Boyland, J. T., “Analyzing Direct Non-local Dependencies in Attribute Grammars,” inProc. of International Conference on Compiler Construction (CC’98) (Koskimies, K. ed.),1383, Lecture Notes in Computer Science, Springer-Verlag, pp. 31–49, 1998.

  7. Farrow, R., “Automatic Generation of Fixed-Point-Finding Evaluator for Circular, but Well-Defined, Attribute Grammars,” inACM SIGPLAN ’86 Symposium on Compiler Construction, pp. 85–98, 1986.

  8. Hedin, G., “Reference Attributed Grammars,” inProc. of Second Workshop on Attribute Grammars and their Applications (WAGA’99) (Parigot, D. and Mernik, M. eds.), INRIA rocquencourt, pp. 153–172, 1999.

  9. Johnson, G. F. and Fischer, C. N., “A Meta-Language and System for Nonlocal Incremental Attribute Evaluation in Language-Based Editors,” inConference Record of the Twelfth Annual ACM Symposium on Principles of Programming Languages, pp. 141–151, 1985.

  10. Jones, L. G., “Efficient Evaluation of Circular Attribute Grammars,”ACM Trans. Prog. Lang. Syst., 12, 3, pp. 429–462, 1990.

    Article  Google Scholar 

  11. Kastens, U., Hutt, B. and Zimmermann, E.,GAG: A Practical Compiler Generator, 141, Lecture Notes in Computer Science, Springer-Verlag, 1982.

  12. Katayama, T., “Translation of Attribute Grammars into Procedures,”ACM Trans. Prog. Lang. Syst., 6, 3, pp. 345–369, 1984.

    Article  MATH  MathSciNet  Google Scholar 

  13. Knuth, D. E., “Semantics of Context-Free Languages,”Math. Syst. Th., 2, 2, pp. 127–145, 1968. correction:5, 1, pp. 95–96, 1971.

    Article  MATH  MathSciNet  Google Scholar 

  14. Knuth, D. E., “An Empirical Study of FORTRAN Programs,”Software—Practice and Experience, 1, 2, pp. 105–133, 1971.

    Article  MATH  Google Scholar 

  15. Rodeh, M. and Sagiv, M., “Finding Circular Attributes in Attribute Grammars,”Journal of the ACM, 46, 4, pp. 556–575, 1999.

    Article  MATH  MathSciNet  Google Scholar 

  16. Sasaki, A. and Sassa, M., “Circular Attribute Grammars with Remote Attribute References,” inProc. of 3rd Workshop on Attribute Grammars and their Applications (WAGA 2000) (Parigot, D. and Mernik, M. eds.), INRIA rocquencourt, pp. 125–140, 2000.

  17. Tachikawa, S.,Implementation of Lazy Code Motion with Circular Remote Attribute Grammars, Bachelor’s thesis, Department of Information Science, Tokyo Institute of Technology (in Japanese), 2002.

  18. Vorthmann, S. A., “Coordinated Incremental Attribute Evaluation on a DR-Threaded Tree,” inAttribute Grammars and their Applications. International Conference WAGA Proceedings (Deransart, P. and Jourdan, M., eds.),461, Lecture Notes in Computer Science, Springer-Verlag, pp. 207–221, 1990.

Download references

Author information

Authors and Affiliations

Authors

Additional information

Akira Sasaki: He is a research fellow of the Advanced Clinical Research Center in the Institute of Medical Science at the University of Tokyo. He received his BSc and MSc from Tokyo Institute of Technology, Japan, in 1994 and 1996, respectively. His research interests include programming languages, programming language processors and programming environments, especially compiler compilers, attribute grammars and systematic debugging. He is a member of the Japan Society for Software Science and Technology.

Masataka Sassa, D.Sc.: He is Professor of Computer Science at Tokyo Institute of Technology. He received his BSc, MSc and DSc from the University of Tokyo, Japan, in 1970, 1972 and 1978, respectively. His research interests include programming languages, programming language processors and programming environments, currently he is focusing on compiler optimization, compiler infrastructure, attribute grammars and systematic debugging. He is a member of the ACM, IEEE Computer Society, Japan Society for Software Science and Technology, and Information Processing Society of Japan.

About this article

Cite this article

Sasaki, A., Sassa, M. Circular attribute grammars with remote attribute references and their evaluators. New Gener Comput 22, 37–60 (2004). https://doi.org/10.1007/BF03037280

Download citation

  • Received:

  • Revised:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF03037280

Keywords

Navigation