Abstract

With attribute coupled grammars, descriptions of subsequent compilation phases can be composed to a single phase on the description level. This creates the opportunity for independent compiler modularization on the description versus the implementation level. The composition introduces a nontrivial reshaping of attribute dependencies, and hence affects the overall strategy for attribute evaluation. For a hierarchy of evaluation classes reaching from S-attributed to noncircular attribute couplings (ACs), we investigate whether they are closed under composition. Where closure does not hold, we identify subclasses which have the closure property. We show that closure of 1-ordered and simpler classes can only be achieved when there is only a single syntactic attribute allowed, while in the case of absolutely noncircular attribute couplings, an arbitrary number of synthesized syntactic attributes can be used. We show how (suboptimal) evaluators for the composed description are obtained directly from the evaluators of the separate phases. We also investigate the complementary problem of reducing the attribute evaluation complexity of a given, monolithic phase specification by finding an appropriate decomposition into subphases which all belong to simpler evaluation classes. In particular, we find that the closed subclass of sweep-evaluable ACs is generated by a proper subclass ofL-attributed ACs, while a similar characterization of 1-ordered ACs is proved to be impossible. Finally, we relate our observations to known results about descriptive power of attribute grammars and tree transducers.

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call