Preliminary Transformation

 

The aim of the preliminary transformation, presented in Figure 4, is to draw the general shape of the future attribute grammar. It introduces the attribute grammar profile with its semantic rules, and a unique semantic rule per each constructor pattern.

   figure385
Figure 4: Preliminary transformation

The attribute result is defined as a synthesized attribute of the attribute grammar profile and contains the result of the function (rule Let'). For function with case statement the result is computed through attributes on the pattern-matched variable (rule Let). Other arguments are translated into semantic rules defining inherited attributes attached to the pattern-matched variable (rule Let). Each function call tex2html_wrap_inline1561 is translated into a dotted notation tex2html_wrap_inline1563 (rule App). This rule distinguishes between function and type constructor callsgif. Each expression appearing in a pattern is transformed into a semantic rule that defines the synthesized attribute computing the result (rule App). This induces some renaming (rule Pattern).

The application of the preliminary transformation to the flat function leads to:

displaymath1565



Web page maintained by Didier Parigot
Fri Feb 27 17:28:38 MET 1998