ACM Home Page
Please provide us with feedback. Feedback
Semantic evaluation from left to right
Full text PdfPdf (790 KB)
Source
Communications of the ACM archive
Volume 19 ,  Issue 2  (February 1976) table of contents
Pages: 55 - 62  
Year of Publication: 1976
ISSN:0001-0782
Author
Gregor V. Bochmann  Univ. of Montreal, Quebec, Canada
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 8,   Downloads (12 Months): 40,   Citation Count: 49
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/359997.359999
What is a DOI?

ABSTRACT

This paper describes attribute grammars and their use for the definition of programming languages and compilers; a formal definition of attribute grammars and a discussion of some of its important aspects are included. The paper concentrates on the evaluation of semantic attributes in a few passes from left to right over the derivation tree of a program. A condition for an attribute grammar is given which assures that the semantics of any program can be evaluated in a single pass over the derivation tree, and an algorithm is discussed which decides how many passes from left to right are in general necessary, given the attribute grammar. These notions are explained in terms of an example grammar which describes the scope rules of Algol 60. Practical questions, such as the relative efficiency of different evaluation schemes, and the ease of adapting the attribute grammar of a given programming language to the left-to-right evaluation scheme are discussed.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
1
Knuth, D.E. Semantics of context-free languages. Math Systems Th. 2 (1968), 127-145. Correction appears in Math. Systems Th. 5 (1971),95.
 
2
Knuth, D.E. Examples of formal semantics, In Lecture Notes in Mathemetics No. 188, Springer-Verlag, Berlin 1971.
 
3
Bochmann, G.V. Semantic equivalence of syntactically related attribute grammars. Publ. No. 148, D6partement d'Informatique, U. de Montreal, Nov. 1973.
 
4
Wilner, W.T. Declarative semantic definition. Rep. STAN-CS- 233-71, Computer Science Dep., Stanford U., 1971. Also Wilner, W.T. Formal semantic definition using synthesized and inherited attributes. In Formal Semantics of Programming Languages, R. Rustin (Ed.), Prentice-Hall, Englewood Cliffs, N.J., 1972.
 
5
Stearns, R.E., and Lewis, P.M. Property grammars and table machines, beform, and Cootrol 14 (1969), 524-549.
 
6
Culik, K. II, Attributed grammars and languages. Publication No. 3, D6partement d'Informatique, U. de Montreal, May 1969.
7
8
 
9
Fang, I. FOLDS, a declarative formal language definition system. Rep. STAN-CS-72-329, Computer Science Dep., Stanford U., 1972.
 
10
Lecarme, O., and Bochmann, G.V. A (truly) usable and portable compiler writing system. In Proc. IFIP Congress 74, North- Holland Pub. Co., Amsterdam, 1974, pp. 218-221.
 
11
Bouckaert, M., Pirotte, A., and Snelling, M. SOFT: a tool for writing software. Report R212, Laboratoire de Recherche, M.B.L.E., Brussels, Jan. 1973.
 
12
Bosch, R., Grune, D., and Meertens, L. ALEPH, a language encouraging program hierarchy. In Proc. International Computing Symp. 1973, North-Holland Pub. Co., Amsterdam, 1974, p. 73.
 
13
Lewis, P.M., Rosenkrantz, D.J., and Stearns, R.E. Attributed translations. To be published in J. Computer and Systems Sci.
 
14
Van Wijngaarden, A., et al. Revised report on the algorithmic language Algol 68. IFIP, 1973.
 
15
Naur, P. The design of the GIER ALGOL compiler. BIT, 3 (1963), 124-140 and 145-166, and Amnlal Review 4 (1965), 49-85.
 
16
 
17
Wirth, N. The design of a PASCAL compiler. Software- Practice and Experience 1 (1971), 309-333.
18
19

CITED BY  49