Summary
Storage optimization is considered for evaluators of simple multivisit, or (ℓ-)ordered, attribute grammars. A necessary and sufficient condition is formulated which has to be satisfied by such an evaluator to enable it to store the instances of a given attribute on a global stack. A simple algorithm is given that decides this condition in polynomial time. A similar algorithm can be used to decide whether the instances of the attribute can be stored in a global variable. These algorithms are static, i.e., they are used at evaluator construction time.
References
Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques, and Tools, Sect. 5.9. Reading, Mass.: Addison-Wesley 1986
Bochmann, G.V.: Semantic evaluation from left to right. Commun. ACM 19, 55–62 (1976)
Deransart, P., Jourdan, M., Lorho, B.: Attribute Grammars. Lect. Notes Comput. Sci., vol. 323. Berlin Heidelberg New York: Springer 1988
Engelfriet, J.: Attribute grammars: attribute evaluation methods. In: [17], pp. 103–138
Engelfriet, J., Filé, G.: Simple multi-visit attribute grammars. J. Comput. Syst. Sci. 24, 283–314 (1982)
Engelfriet, J., Filé, G.: Passes, sweeps, and visits in attribute grammars. J. ACM 36, 841–869 (1989)
Farrow, R., Yellin, D.: A comparison of storage optimizations in automatically-generated attribute evaluators. Acta Inf. 23, 393–427 (1986)
Ganzinger, H.: On storage optimizations for automatically generated compilers. In: 4th GI Conf. on Theoretical Computer Science. Lect. Notes Comput. Sci. vol. 67, pp. 132–141. Berlin Heidelberg New York: Springer 1979
Immermann, N.: Nondeterministic space is closed under complement. SIAM J. Comput. 17, 935–938 (1988)
Jazayeri, M., Pozefsky, D.: Space-efficient storage management in an attribute evaluator. ACM TOPLAS 3, 388–404 (1981)
Jourdan, M., Parigot, D.: The FNC-2 system: advances in attribute grammars technology. Rapport RR 834, INRIA Rocquencourt 1988
Kastens, U.: Ordered attribute grammars. Acta Inf. 13, 229–256 (1980)
Kastens, U.: The GAG-system — a tool for compiler construction. In: [17], pp. 165–182
Kastens, U.: Lifetime analysis for attributes. Acta Inf. 24, 633–652 (1987)
Kastens, U., Hutt, B., Zimmermann, E.: GAG: a practical compiler generator. Lect. Notes Comput. Sci, vol. 141. Berlin Heidelberg New York: Springer 1982
Knuth, D.E.: Semantics of context-free languages. Math. Syst. Theory 2, 127–145 (1968). Correction: Math. Syst. Theory 5, 95–96 (1971)
Lorho, B.: Methods and tools for compiler construction. Cambridge: Cambridge University Press 1984
Räihä, K.-J.: A space management technique for multi-pass attribute evaluators. PhD thesis, report A-1981-4, DCS, University of Helsinki 1981
Reps, T., Demers, A.: Sublinear-space evaluation algorithms for attribute grammars. ACM TOPLAS 9, 408–440 (1987)
Saarinen, M.: On constructing efficient evaluators for attribute grammars. In: “5th ICALP”. Lect. Notes Comput. Sci., vol. 62, pp. 382–397. Berlin Heidelberg New York: Springer 1978
Sonnenschein, M.: Global storage cells for attributes in an attribute grammar. Acta Inf. 22, 397–420 (1985)
Szelepcsényi, R.: The method of forced enumeration for nondeterministic automata. Acta Inf. 26, 279–284 (1988)
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Engelfriet, J., de Jong, W. Attribute storage optimization by stacks. Acta Informatica 27, 567–581 (1990). https://doi.org/10.1007/BF00277390
Received:
Issue Date:
DOI: https://doi.org/10.1007/BF00277390