Conditional Productions

In this section we introduce the notion of conditional production. The syntax proposed here, reminiscent of guards, is very simple; we will later discuss its restrictions and possible extensions. These new productions allow the specification of different sets of semantic rules on a single production. The set of rules to be applied to a specific instance of a production is chosen dynamically. Essentially, we add predicates over attribute values to supplement the patterns used to select which attribute computations to apply.

In this next example, there are two different sets of semantic rules on the fork operator. The value of the $min attribute governs the choice between the two sets. This specification has the same semantics as the first bird specification for the computation of the $min attribute. We require that there always be a default rule, indicated by the label [], which is applied if none of the other conditional productions can be applied.

tex2html_wrap572

Other examples will appear later in the paper. The main use of conditional productions is in combination with scheme productions, but note here that they have the interest to decouple the dependence schemes associated with the various alternatives and possibly make them simpler.



Web page maintained by Didier Parigot
Fri Feb 27 10:05:31 MET 1998