There are over forty functions in the toolkit. There is one generator toolkit used for the scanner generators. A set of toolkit variables are exposed to the other generator modules. The modules can set these variables to control the toolkit behavior. If C is the chosen target language, a function is called which returns a pointer to the appropriate object.
Consistent style is imposed and maintained by the toolkit code.
An effective template mechanism is one that allows values to be expressed in the template that can be computed at generation time. If there are no embedded perl statements or embedded comments, the text is written to the output with no modification. If there is an embedded comment, convert the comment text to the proper format for the target language and output the comment. If there is embedded perl code, evaluate it and replace the input text with the results of the evaluation for output. Sample template code is shown in Listing 4.