1.2.4. Filters

Aus Hugo Doku

Wechseln zu: Navigation, Suche

Filters filter the .model files to feed the frameprocessor in a controled way. This enables you to set up a powerful generating process with several .model files.

If you only use one .model file, you don't have to care about the filter concept. Just copy a given filter directory, e.g. that of simple_class in your project.

Caution Caution

HuGo needs at least one filter! So be sure, that you have a filter dictory with at least one .filter file in it.

1.2.4.1. The filter concept

When the model-builder is called, it takes two lists:

*The list of all .model files, determined by the programms parameters.
*A list of filters, which filter the .model file list.

The following figure illustrates the effect of filters:

Filter filters the .model file list

As the figure shows, the filters determine which .model files out of the .model file list are taken.

There are cases, where the order of generation is important, e.g. when the generated source code files depend on each other. Because of this reason, HuGo runs through fixed stages. Each stage has in turn several fixed sections. Each filter is assigned to a stage and section, thus you can determine the order, when which filter is called and therfore which .model files are taken.

The following figure illustrates that:

Filter filters the .model file list

Note Note

After each section the model-builder saves all generated target code definitivly to disk. Thus generated files can be used for the next section.

1.2.4.2. How to write filters

Filters are specified in XML files with the extension .filter in the filters directory.

Note Note

Filter source files must have the extension .filter, while model files need not, they can have any extension, e.g. .dsl or what ever. Because which model files are taken, is determined by the filter files.

The frame-builder transforms the .filter files to a frame_factory.class, which is then used by the model-builder. Thus the complete developing correlation between domain and application engineering using HuGo looks like shown in the following figure. The elements concerning the filters are coloured blue. The directories, where HuGo looks for the files are set by the programm parameters. The corresponding parameters are shown in the figure by labeled, dotted rectangles in the background.

Tasks for domain and application engineer using HuGo

As the figures show, the .filter files are only needed at time of domain engineering. On point of view of the model-builder (which is used at application engineering) only the .model files and the repository directory, which contains the compiled files, are needed.

The .filter files are written in XML.

All possible tags of the filter file are listet in Chapter 5. As you will see there the filter is responsible for calling the jxgp frameprocessor and can call further other steps bevor.


Next: 1.2.5. Using HuGo as Eclipse plugin
Persönliche Werkzeuge