Thumbnail
Access Restriction
Subscribed

Author Bochmann, Gregor V.
Source ACM Digital Library
Content type Text
Publisher Association for Computing Machinery (ACM)
File Format PDF
Language English
Subject Keyword Semantic attributes ♦ Attribute grammars ♦ Semantics of programming languages ♦ Semantic conditions ♦ Multipass compilers ♦ Left-to-right parsing ♦ Semantic evaluation
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.
Description Affiliation: Univ. of Montreal, Quebec, Canada (Bochmann, Gregor V.)
Age Range 18 to 22 years ♦ above 22 year
Educational Use Research
Education Level UG and PG
Learning Resource Type Article
Publisher Date 2005-08-01
Publisher Place New York
Journal Communications of the ACM (CACM)
Volume Number 19
Issue Number 2
Page Count 8
Starting Page 55
Ending Page 62


Open content in new tab

   Open content in new tab
Source: ACM Digital Library