Journal of the ACM (JACM)
Semantic evaluation from left to right
Communications of the ACM
The intrinsically exponential complexity of the circularity problem for attribute grammars
Communications of the ACM
On the complexity of LR(k) testing
Communications of the ACM
Correctness-preserving program transformations
POPL '75 Proceedings of the 2nd ACM SIGACT-SIGPLAN symposium on Principles of programming languages
Compiler Design Theory
The theory of parsing, translation, and compiling
The theory of parsing, translation, and compiling
Removal of invariant statements from nested-loops in a single effective compiler pass
Proceedings of the conference on Programming languages and compilers for parallel and vector machines
Automatic generation of efficient evaluators for attribute grammars
POPL '76 Proceedings of the 3rd ACM SIGACT-SIGPLAN symposium on Principles on programming languages
On attribute grammars and the semantic specification of programming languages.
On attribute grammars and the semantic specification of programming languages.
The coroutine model of attribute grammar evaluation.
The coroutine model of attribute grammar evaluation.
Incremental evaluation for attribute grammars with application to syntax-directed editors
POPL '81 Proceedings of the 8th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Experience with an attribute grammar-based compiler
POPL '82 Proceedings of the 9th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Optimal-time incremental semantic analysis for syntax-directed editors
POPL '82 Proceedings of the 9th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Non-syntactic attribute flow in language based editors
POPL '82 Proceedings of the 9th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
The global storage needs of a subcomputation
POPL '84 Proceedings of the 11th ACM SIGACT-SIGPLAN symposium on Principles of programming languages
Dynamic allocation of space for attribute instances in multi-pass evaluators of attribute grammars
SIGPLAN '79 Proceedings of the 1979 SIGPLAN symposium on Compiler construction
A truly generative semantics-directed compiler generator
SIGPLAN '82 Proceedings of the 1982 SIGPLAN symposium on Compiler construction
A general linear-time evaluator for attribute grammars
ACM SIGPLAN Notices
Hi-index | 0.00 |
Attribute grammars are an extension of context-free grammars devised by Knuth as a formalism for specifying the semantics of a context-free language along with the syntax of the language. The syntactic phase of the translation process has been extensively studied and many techniques are available for automatically generating efficient parsers for context-free grammars. Attribute grammars offer the prospect of similarly automating the implementation of the semantic phase. In this paper we present a general method of constructing, for any non-circular attribute grammar, a deterministic translator which will perform the semantic evaluation of each syntax tree of the grammar in time linear with the size of the tree. Each tree is traversed in a manner particularly suited to the shape of the tree, yielding a near optimal evaluation order for that tree. Basically, the translator consists of a finite set of "Local Control Automata", one for each production; these are ordinary finite-state acyclic automata augmented with some special features, which are used to regulate the evaluation process of each syntax tree. With each node in the tree there will be associated the Local Control Automaton of the production applying at the node. At any given time during the translation process all Local Control Automata are inactive, except for the one associated with the currently processed node, which is responsible for directing the next steps taken by the translator until control is finally passed to a neighbour node, reactivating its Local Control Automaton. The Local Control Automata of neighbour nodes communicate with each other.The construction of the translator is custom tailored to each individual attribute grammar. The dependencies among the attributes occurring in the semantic rules are analysed to produce a near-optimal evaluation strategy for that grammar. This strategy ensures that during the evaluation process, each time the translator enters some subtree of the syntax tree, at least one new attribute evaluation will occur at each node visited. It is this property which distinguishes the method presented here from previously known methods of generating translators for unrestricted attribute grammars, and which causes the translators to be near-optimal.