Skip to main content
Log in

Testing attribute grammars for circularity

  • Published:
Acta Informatica Aims and scope Submit manuscript

Summary

The problem of deciding whether a given attribute grammar is noncircular is known to require exponential time for infinitely many grammars. Here the time requirement of a simple circularity test is analyzed. It is shown that the reason for the exponential time requirement is the number of graphs in a collection formed for every nonterminal. By practical experiments it is argued that for real grammars the number is very small. Therefore it is feasible to actually perform the circularity test in practice. Different techniques to improve the implementation of the circularity test are discussed, too.

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., Ullman, J.D.: The Theory of parsing, translation, and compiling, Vol.2. Compiling. Englewood Cliffs, N.J.: Prentice-Hall 1973

    Google Scholar 

  2. Bruno, J., Burkhard, W.A.: A circularity test for interpreted grammars. Computer Science Laboratory, Department of Electrical Engineering, Princeton University, Technical Report 88, 1970

  3. Engelfriet, J., Filè, G.: Passes and paths of attribute grammars. Information and Control 49, 125–169 (1981)

    Google Scholar 

  4. Jazayeri, M., Ogden, W.F., Rounds, W.C.: The intrinsically exponential complexity of the circularity problem for attribute grammars. Comm. ACM 18, 697–706 (1975)

    Google Scholar 

  5. Jones, N.D.: Circularity testing for attribute grammars requires exponential time: A simpler proof. Computer Science Department, Aarhus University, Report DAIMI PB-107, 1980

  6. Karttunen, M.: On circularity tests for semantic attributes (in Finnish). Department of Computer Science, University of Helsinki, Report C-1977–87, 1977

  7. Kennedy, K., Warren, S.K.: Automatic generation of efficient evaluators for attribute grammars. In: Conf. Record of the Third ACM Symposium on Principles of Programming Languages, pp. 32–49 (1976)

  8. Knuth, D.E.: Semantics of context-free languages. Math. Systems Theory 2, 127–145 (1968)

    Google Scholar 

  9. Knuth, D.E.: Semantics of context-free languages: Correction. Math. Systems Theory 5, 95–96 (1971)

    Google Scholar 

  10. Koskimies, K., Juutinen, L.: An attribute grammar for the compile-time semantics of a subset of the programming language Euclid. Department of Computer Science, University of Helsinki, Report C-1979-130, 1979

  11. Lorho, B., Pair, C.: Algorithms for checking consistency of attribute grammars. In: Proving and Improving Programs (G. Huet, G. Kahn, eds.), pp. 23–54. Le Chesnay: Colloques IRIA 1975

    Google Scholar 

  12. Räihä, K.-J.: Experiences with the compiler writing system HLP. In: Semantics-Directed Compiler Generation (N.D. Jones, ed.), pp. 350–362. Berlin-Heidelberg-New York: Springer 1980

    Google Scholar 

  13. Räihä, K.-J., Saarinen, M., Soisalon-Soininen, E., Tienari, M.: The compiler writing system HLP (Helsinki Language Processor). Department of Computer Science, University of Helsinki, Report A-1978-2, 1978

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Räihä, K.J., Saarinen, M. Testing attribute grammars for circularity. Acta Informatica 17, 185–192 (1982). https://doi.org/10.1007/BF00288969

Download citation

  • Received:

  • Issue Date:

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

Keywords

Navigation