Figure 4 shows the structure obtained by merging Figure 2 and Figure 3. The tree computations that check the requirement of unique names and carry out the translation are attached to the nodes of this structure.
First consider the computation to check that set names are unique over the text and set elements are unique over their set. This is a standard compiler task involving nested scopes, and a solution is available in Eli's library. All that a user need do to make use of this solution is to instantiate the appropriate libraries and specify that their computations be inherited by the proper symbols in Figure 4.
The translation task is the essence of each compilation problem, and hence no complete standard solution can be provided. Standard solutions are, however, available for translating common data objects like strings and integers into PTGNodes that can be passed to the output tree construction functions. The remainder of this section gives the details of these computations.