Abstract
Describing the static semantics of programming languages with attribute grammars is eased when the formalism allows direct dependencies to be induced between rules for nodes arbitrarily far away in the tree. Such direct non-local dependencies cannot be analyzed using classical methods, which enable efficient evaluation.This article defines an attribute grammar extension (“remote attribute grammars”) to permit references to objects with fields to be passed through the attribute system. Fields may be read and written through these references. The extension has a declarative semantics in the spirit of classical attribute grammars. It is shown that determining circularity of remote attribute grammars is undecidable.The article then describes a family of conservative tests of noncircularity and shows how they can be used to “schedule” a remote attribute grammar using standard techniques. The article discusses practical batch and incremental evaluation of remote attribute grammars.
- Aiken, A. 1996. Cool: A portable project for teaching compiler construction. ACM SIGPLAN Notices 31, 7 (July), 19--26. Google ScholarDigital Library
- Alblas, H. 1991. Attribute evaluation methods. In Attribute Grammars, Applications and Systems. International Summer School SAGA Proceedings (Prague, Czechoslovakia, June 4--13), H. Alblas and B. Melichar, Eds. Lecture Notes in Computer Science, vol. 545. Springer-Verlag, Berlin, 48--113. Google ScholarDigital Library
- Augusteijn, L. 1990. The Elegant compiler generator system. In Attribute Grammars and their Applications. International Conference WAGA Proceedings (Paris, France, Sept. 19--21), P. Deransart and M. Jourdan, Eds. Lecture Notes in Computer Science, vol. 461. Springer-Verlag, Berlin, 238--254. Google ScholarDigital Library
- Bochmann, G. V. 1976. Semantic evaluation from left to right. Comm. ACM 19, 2 (Feb.), 55--62. Google ScholarDigital Library
- Borras, P., Clément, D., Despeyroux, T., Incerpi, J., Kahn, G., Lang, B., and Pascual, V. 1988. CENTAUR: The system. In Proceedings of the Third ACM SIGSOFT/SIGPLAN Software Engineering Symposium on Practical Software Development Environments. ACM Press, New York, 14--24. Google ScholarDigital Library
- Boyland, J. 2002. Incremental evaluators for remote attribute grammars. Electronic Notes in Theoretical Computer Science 63, 3 (June).Google Scholar
- Boyland, J., and Graham, S. L. 1994. Composing tree attributions. In Conference Record of the Twenty-first Annual ACM SIGACT/SIGPLAN Symposium on Principles of Programming Languages (Portland, Oregon, USA). ACM Press, New York, 375--388. Google ScholarDigital Library
- Boyland, J. T. 1996a. Conditional attribute grammars. ACM Trans. Prog. Lang. Syst. 18, 1 (Jan.), 73--108. Google ScholarDigital Library
- Boyland, J. T. 1996b. Descriptional composition of compiler components. Ph.D. thesis, University of California, Berkeley. Available as technical report UCB//CSD-96-916. Google ScholarDigital Library
- Boyland, J. T. 1998. Analyzing direct non-local dependencies in attribute grammars. In Compiler Construction: 7th International Conference, CC '98 (Lisbon, Portugal, Mar. 28--Apr. 4), K. Koskimies, Ed. Lecture Notes in Computer Science, vol. 1383. Springer, Berlin, Heidelberg, New York, 31--49. Google ScholarDigital Library
- Courcelle, B., and Franchi-Zannettacci, P. 1982. Attribute grammars and recursive program schemes. Theore. Comput. Sci. 17, 2--3 (Feb.--Mar.), 163--191, 235--257.Google Scholar
- Farrow, R. 1986. Automatic generation of fixed-point-finding evaluators for circular, but well-defined, attribute grammars. In Proceedings of the ACM SIGPLAN '86 Symposium on Compiler Construction (Palo Alto, California, USA). ACM SIGPLAN Notices 21, 7 (July), 85--98. Google ScholarDigital Library
- Farrow, R. 1989. The Linguist translator-writing system. Tech. Rep., Declarative Systems Inc. June.Google Scholar
- Farrow, R., Marlowe, T. J., and Yellin, D. M. 1992. Composable attribute grammars: Support for modularity in translator design and implementation. In Conference Record of the Nineteenth Annual ACM SIGACT/SIGPLAN Symposium on Principles of Programming Languages. 223--234. Google ScholarDigital Library
- Farrow, R., and Stanculescu, A. G. 1989. A VHDL compiler based on attribute grammar methodology. In Proceedings of the ACM SIGPLAN '89 Conference on Programming Language Design and Implementation (Portland, Oregon, USA). ACM SIGPLAN Notices 24, 7 (July), 120--130. Google ScholarDigital Library
- Gray, R. W., Heuring, V. P., Levi, S. P., Sloane, A. M., and Waite, W. M. 1992. Eli: A complete flexible compiler construction system. Comm. ACM 35, 2 (Feb.), 121--131. Google ScholarDigital Library
- Grosch, J. 1990. Object-oriented attribute grammars. In Proceedings of the Fifth International Symposium on Computer and Information Sciences (ISCIS V) (Eds. A. E. Harmanci, E. Gelenbe) (Cappadocia, Nevsehir, Turkey). 807--816.Google Scholar
- Hedin, G. 1994. An overview of door attribute grammars. In Proceedings of Compiler Construction, 5th International Conference, CC '94 (Edinburgh, U.K.), P. A. Fritzson, Ed. Lecture Notes in Computer Science, vol. 786. Springer-Verlag, Berlin, 31--51. Google ScholarDigital Library
- Hedin, G. 2000. Reference attributed grammars. Informatica 24, 3, 301--317.Google Scholar
- Hopcroft, J. E., and Ullman, J. D. 1979. Introduction to Automata Theory, Languages and Computation. Addison-Wesley, Reading, Massachussetts, USA. Google ScholarDigital Library
- Jazayeri, M., Ogden, W., and Rounds, W. 1975. The intrinsically exponential complexity of the circularity problem for attribute grammars. Comm. ACM 18, 12 (Dec.), 697--706. Google ScholarDigital Library
- Johnson, G. F. 1983. An approach to incremental semantics. Ph.D. thesis, University of Wisconsin--Madison. Google ScholarDigital Library
- Johnson, G. F., and Fischer, C. N. 1985. A meta-language and system for nonlocal incremental attribute evaluation in language-based editors. In Conference Record of the Twelfth ACM Symposium on Principles of Programming Languages (New Orleans, Louisiana, USA). ACM Press, New York, 141--151. Google ScholarDigital Library
- Jourdan, M., Bellec, C. L., and Parigot, D. 1990. The OLGA attribute grammar description language: Design, implementation and evaluation. In Attribute Grammars and their Applications. International Conference WAGA Proceedings (Paris, France, Sept. 19--21), P. Deransart and M. Jourdan, Eds. Lecture Notes in Computer Science, vol. 461. Springer-Verlag, Berlin, 222--237. Google ScholarDigital Library
- Jourdan, M., and Parigot, D. 1991. Internals and externals of the FNC-2 attribute grammar system. In Attribute Grammars, Applications and Systems. International Summer School SAGA Proceedings (Prague, Czechoslovakia, June 4--13), H. Alblas and B. Melichar, Eds. Lecture Notes in Computer Science, vol. 545. Springer-Verlag, Berlin, 485--504. Google ScholarDigital Library
- Kastens, U. 1980. Ordered attributed grammars. Acta Informatica 13, 3 (Mar.), 229--256.Google ScholarDigital Library
- Kastens, U. 1991. Attribute grammars in a compiler construction environment. In Attribute Grammars, Applications and Systems. International Summer School SAGA Proceedings (Prague, Czechoslovakia, June 4--13), H. Alblas and B. Melichar, Eds. Lecture Notes in Computer Science, vol. 545. Springer-Verlag, Berlin, 380--400. Google ScholarDigital Library
- Kastens, U., and Waite, W. M. 1994. Modularity and reusability in attribute grammars. Acta Informatica 31, 601--627. Google ScholarDigital Library
- Knuth, D. E. 1968. Semantics of context free languages. Mathematical Systems Theory 2, 2 (June), 127--145. Corrections appear in Mathematical Systems Theory 5, 1 (1971), 95--96.Google ScholarCross Ref
- Maddox, W. 1997. Incremental static semantic analysis. Ph.D. thesis, University of California, Berkeley. Google ScholarDigital Library
- Magnusson, E., and Hedin, G. 2003. Circular reference attributed grammars---their evaluation and applications. In Proceedings of the Third Workshop on Language Descriptions, Tools and Applications (LDTA 2003). Satellite event of ETAPS 2003 (Warsaw, Poland, Apr. 6). http://www.di.uminho.pt/~jas/LDTA_PROCEEDINGS.tgz.Google Scholar
- Parigot, D., Roussel, G., Jourdan, M., and Duris, E. 1996. Dynamic attribute grammars. In International Symposium on Programming Languages, Implementations, Logics and Programs (PLILP '96), H. Kuchen and S. D. Swierstra, Eds. Lecture Notes in Computer Science, vol. 1140. Springer-Verlag, Berlin, 122--136. Google ScholarDigital Library
- Poetzsch-Heffter, A. 1997. Prototyping realistic programming languages based on formal specifications. Acta Informatica 34, 737--772.Google ScholarCross Ref
- Reps, T. 1998. Program analysis via graph reachability. Tech. Rep. CS-TR-1998-1386, University of Wisconsin, Madison.Google Scholar
- Reps, T. 2000. Undecidability of context-sensitive data-dependence analysis. ACM Trans. Prog. Lang. Syst. 22, 1 (Jan.), 162--186. Google ScholarDigital Library
- Reps, T. W., and Teitelbaum, T. 1989. The Synthesizer Generator: A system for constructing language-based editors. Springer-Verlag, Berlin. Google ScholarDigital Library
- Rodeh, M., and Sagiv, M. 1999. Finding circular attributes in attribute grammars. J. ACM 46, 4 (July), 556--575. Google ScholarDigital Library
- Saraiva, J. 1999. Purely functional implementation of attribute grammars. Ph.D. thesis, Department of Computer Science, Utrecht University, The Netherlands. ftp://ftp.cs.uu.nl/pub/RUU/CS/phdtheses/Saraiva/.Google Scholar
- Sasaki, A., and Sassa, M. 2003. Circular attribute grammars with remote attribute references and their evaluators. New Generation Computing 22.Google Scholar
- Swierstra, D., and Vogt, H. 1991. Higher order attribute grammars. In Attribute Grammars, Applications and Systems. International Summer School SAGA Proceedings, H. Alblas and B. Melichar, Eds. Lecture Notes in Computer Science, vol. 545. Springer-Verlag, Berlin, 256--296. Google ScholarDigital Library
- Uhl, J., Drossopoulou, S., Persch, G., Goos, G., Dausmann, M., Winterstein, G., and Kirchgässner, W. 1982. An Attribute Grammar for the Semantic Analysis of Ada. Lecture Notes in Computer Science, vol. 139. Springer-Verlag, Berlin. Google ScholarDigital Library
- Vogt, H. H., Swierstra, S. D., and Kuiper, M. F. 1989. Higher order attribute grammars. In Proceedings of the ACM SIGPLAN '89 Conference on Programming Language Design and Implementation (Portland, Oregon, USA). ACM SIGPLAN Notices 24, 7 (July), 131--145. Google ScholarDigital Library
- Vorthmann, S. A. 1990. Coordinated incremental attribute evaluation on a DR-threaded tree. In Attribute Grammars and their Applications. International Conference WAGA Proceedings (Paris, France, Sept. 19--21), P. Deransart and M. Jourdan, Eds. Lecture Notes in Computer Science, vol. 461. Springer-Verlag, Berlin, 207--221. Google ScholarDigital Library
Index Terms
- Remote attribute grammars
Recommendations
Conditional attribute grammars
Attribute grammars are a useful formalism for the specification of computations on structured terms. The classical definition of attribute grammars, however, has no way of treating conditionals nonstrictly. Consequently, the natural way of expressing ...
The formal power of one-visit attribute grammars
An attribute grammar is one-visit if the attributes can be evaluated by walking through the derivation tree in such a way that each subtree is visited at most once. One-visit (1V) attribute grammars are compared with one-pass left-to-right (L) attribute ...
Comments