This approach allowed testing the language using the example speci?¬?cations
given in the original language speci?¬?cation. Further testing of the generated result
was done using basic XML schema validation tools, as there were no actual CPL
engines available.
From the designs expressed in the models, the generator produces code that can be
parsed and then executed in the CPL server. Let??™s look next at the structure of the code
generator and then samples of the generated call processing scripts.
5.5.1 Generator Structure
The generator visits each element in the model, calling a generator module for that
element??™s type (see the visitor pattern in Chapter 11). Figure 5.9 illustrates this
generator structure by describing the generator modules and call structures between
them. The generator modules that handle the CPL concepts are emphasized with a
gray rectangle. Most of the other generator modules provide generator functionality
that was common and applied at many places during the generation.
FIGURE 5.8 Call processing service reusing the same voicemail subaction
GENERATOR FOR XML 113
Generators were de?¬?ned for three different purposes: producing the service
speci?¬?cation into a ?¬?le, producing it into an output window, and checking the service
speci?¬?cations. In the ?¬?gure, these main generators are represented on the left-hand
side.
Pages:
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233