An optimal-time recursive evaluator for attribute grammars

  • Martin Jourdan
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 167)


We present a new evaluation method applicable to any attribute grammars. From each description of attribute grammar we produce an evaluator which is composed by a set of mutually recursive functions, one for each attribute, synthesised or inherited. It detects circularities at run-time and implements an optimal dynamic "evaluation by need".


Dependency Graph Recursive Function Parse Tree Source Text Derivation Tree 
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.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

6. References

  1. [Boc76]
    G. Bochmann, "Semantic Evaluation from Left to Right", CACM, 19, 2 (1976), pp 55–62.Google Scholar
  2. [CH79]
    R. Cohen and E. Harry, "Automatic Generation of Near-optimal Linear-time Translators for Non-circular Attribute Grammars", 6th ACM Symp. on Principles of Programming Lnaguages (1979), pp 121–134.Google Scholar
  3. [CF82]
    B. Courcelle and P. Franchi-Zannettacci, "Attribute Grammars and Recursive Program Schemes", Theoretical Computer Science, 17 (1982), pp 163–191 and 235–257.Google Scholar
  4. [DJL83]
    P. Deransart, M. Jourdan and B. Lorho, "Speeding up Circularity Tests for Attribute Grammars", Report RR-211, INRIA, Rocquencourt (1983). To be published in Acta Informatica.Google Scholar
  5. [EF81a]
    J. Engelfriet and G. Filé, "The Formal Power of One-visit Attribute grammars", Acta Informatica, 16 (1981), pp 275–302.Google Scholar
  6. [EF81b]
    J. Engelfriet and G. Filé, "Passes and Paths of Attribute Grammars", Information and Control, 49 (1981), pp 125–169.Google Scholar
  7. [Fan72]
    I. Fang, "FOLDS, a Declarative Formal Language Definition System", Report STAN-CS-72-329, Computer Science Dept., Stanford University (1972).Google Scholar
  8. [JG83]
    F. Jalili and J. H. Gallier, "A General Incremental Evaluator for Attribute Grammars", draft, University of Pennsylvannia, Philadelphia (1983).Google Scholar
  9. [Jaz81]
    M. Jazayeri, "A Simpler Construction for Showing the Intrinsically Exponential Complexity of the Circularity Problem for Attribute Grammars", JACM, 28 (1981), pp 715–720.Google Scholar
  10. [Jou83]
    M. Jourdan, "An Efficient Evaluator for Strongly Non-circular Attribute Grammars", Report RR-235, INRIA, Rocquencourt (1983).Google Scholar
  11. [Jou84]
    M. Jourdan, "Recursive Evaluation of Attribute Grammars: an Implementation", to appear in "Methods and Tools for Compiler Construction", B. Lorho ed., Cambridge University Press, Cambridge (1984).Google Scholar
  12. [Kas80]
    U. Kastens, "Ordered Attribute Grammars", Acta Informatica, 13 (1980), pp 229–256.Google Scholar
  13. [Kat80]
    T. Katamaya, "Transformation of Attribute Grammars into Procedures", Report CS-K-8001, Department of Computer Science, Tokyo Institute of Technology (1980)/Google Scholar
  14. [KR79]
    K. Kennedy and J. Ramanathan, "A Deterministic Attribute Grammar Evaluator Based on Dynamic Sequencing", ACM TOPLAS, 1, 1 (1979), pp 142–160.Google Scholar
  15. [KW76]
    K. Kennedy and S. Warren, "Automatic Generation of Efficient Evaluators for Attribute Grammars", 3rd ACM Symp. on Principles of Programming Languages, Atlanta (1976), pp 32–49.Google Scholar
  16. [Knu68]
    D. Knuth, "Semantics of Context-free Languages", Mathematical Systems Theory, 2 (1968), pp 127–145.Google Scholar
  17. [LRS74]
    P. Lewis, D. Rosenkrantz and R. Stearns, "Attributed Translations", JCSS, 9, 3 (1974), pp 279–307.Google Scholar
  18. [Lor77]
    B. Lorho, "Semantic Attributes Processing in the System DELTA", in "Methods of Algorithm Language Implementation", Ershov and Koster eds., LNCS 47, Springer-Verlag (1977), pp 21–40.Google Scholar
  19. [Mad80]
    O. Madsen, "On Defining Semantics by Means of Extended Attribute Grammars", in "Semantics-Directed Compiler Generation", Jones ed., LNCS 94, Springer-Verlag (1980), pp 259–299.Google Scholar
  20. [MN82]
    H. Meijer and A. Nijholt, "Translator Writing Tools since 1970: a Selective Bibliography", ACM SIGPLAN Notices, 17, 10 (1982), pp 62–72.Google Scholar
  21. [Räi80]
    K.J. Räihä, "Bibliography on Attribute Grammars", ACM SIGPLAN Notices, 15, 3 (1980), pp 35–44.Google Scholar
  22. [RU81]
    K.J. Räihä and E. Ukkonen, "Minimizing the Number of Evaluation Passes for Attribute Grammars", SIAM Journal on Computing, 10, 4 (1981), pp 772–786.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1984

Authors and Affiliations

  • Martin Jourdan
    • 1
  1. 1.INRIA Domaine de Voluceau — RocquencourtChesnay CedexFrance

Personalised recommendations