An attribute grammar is simple multi-visit if each attribute of a nonterminal has a fixed visit-number associated with it such that, during attribute evaluation, the attributes of a node which have visit-number j are computed at the jth visit to the node. An attribute grammar is l-ordered if for each nonterminal a linear order of its attributes exists such that the attributes of a node can always be evaluated in that order (cf. the work of Kastens).
An attribute grammar is simple multi-visit if and only if it is l-ordered. Every noncircular attribute grammar can be transformed into an equivalent simple multi-visit attribute grammar which uses the same semantic operations.
For a given distribution of visit-numbers over the attributes, it can be decided in polynomial time whether the attributes can be evaluated according to these visit-numbers. The problem whether an attribute grammar is simple multi-visit is NP-complete.
[1]
Hanne Riis,et al.
Subclasses of Attribute Grammars
,
1980
.
[2]
Gregor von Bochmann,et al.
Semantic evaluation from left to right
,
1976,
CACM.
[3]
Joost Engelfriet,et al.
Formal Properties of One-Visit and Multi-Pass Attribute Grammars
,
1980,
ICALP.
[4]
Ken Kennedy,et al.
Automatic generation of efficient evaluators for attribute grammars
,
1976,
POPL.
[5]
Mehdi Jazayeri,et al.
Alternating semantic evaluator
,
1975,
ACM '75.
[6]
Rainer Parchmann,et al.
IO-Macrolanguages and Attributed Translations
,
1977,
Inf. Control..
[7]
David S. Johnson,et al.
Computers and Intractability: A Guide to the Theory of NP-Completeness
,
1978
.