Affiliation:
1. Univ. of Montreal, Quebec, Canada
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.
Publisher
Association for Computing Machinery (ACM)
Reference18 articles.
1. Semantics of context-free languages
2. Bochmann G.V. Semantic equivalence of syntactically related attribute grammars. Publ. No. 148 D6partement d'Informatique U. de Montreal Nov. 1973. Bochmann G.V. Semantic equivalence of syntactically related attribute grammars. Publ. No. 148 D6partement d'Informatique U. de Montreal Nov. 1973.
3. Stearns R.E. and Lewis P.M. Property grammars and table machines beform and Cootrol 14 (1969) 524-549. Stearns R.E. and Lewis P.M. Property grammars and table machines beform and Cootrol 14 (1969) 524-549.
Cited by
127 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Streaming Tree Transducers;Journal of the ACM;2017-10-15
2. Hybrid Grammars for Parsing of Discontinuous Phrase Structures and Non-Projective Dependency Structures;Computational Linguistics;2017-09
3. Linearly Ordered Attribute Grammars;Proceedings of the 2015 Workshop on Partial Evaluation and Program Manipulation;2015-01-13
4. Transforming XML Streams with References;String Processing and Information Retrieval;2015
5. From object algebras to attribute grammars;ACM SIGPLAN Notices;2014-12-31