Component translation sequence, generating initialization

First, a source code is generated (only the sections as follows: interface/implementation, help, linker and maker) from a SRC file named "Main.src" that should generate (entire) main module - namely the interface and implementation part (generating into other sections is optional).

Subsequently, modules for each device are generated; these modules can add the code into the joint initialization procedure (all of them will add a code only). The initialization procedure is a part of the processor module. Further, the module as such will be generated from their SRC file (header as well as implementation) that will implement the functions requested by the user. If handlers for certain events are required by the user as well, a template (again, header and implementation) is generated for writing the code for these events by the user. The template will be generated into the shared modules (multiple drivers can share a single module - for module name, see %EventModule).

Afterwards, shared modules are generated from the SharedModules global list.

Finally, the processor module is generated. At the same time, this module represents an initialization module; an initialization and enable codes that had been successively generated by each component are added to the end of the module. This means that the resulting processor (implementation) module will be composed step by step from the following sections: %IMPLEMENTATION from the processor, %INITIALIZATION from all components, %ENABLE from the processor, %ENABLE from all components, %INITIALIZATION from the processor. In addition, termination of the initialization code must be generated by the processor driver (for example, END command), into the initialization section (%INITIALIZATION), i.e. to the end of the initialization and enable codes. Similarly, the same will go for assembler initialization, except for %ENABLE, i.e. the section sequence will be as follows %ASSEMBLER and all %INITIALIZATION asm.

Further, the processor module usually also generates initialization code for interrupt vectors.

The processor driver can terminate generating files for LINKER and MAKER, as well as the project for the target compiler.

Once drivers for each device and processor module have been generated, files containing templates for each event are completed; these modules will be created by merging codes from relevant drivers and generating the "event.src" file and adding its "interface" and "implementation" sections to the beginning and "interface end" and "implementation end" sections to the end of the generated source code from all modules.

COMPONENT.SRC
INTERFACE Header of the device module.
IMPLEMENTATION Implementation of the device module.
INTERFACE <event> Generates into the header of the events module.
IMPLEMENTATION <event> Generates into the implementation of the events module.
INITIALIZATION Generates into the implementation of the processor module.
ENABLE Generates into the implementation of the processor module.
LINKER Generates into the linker file.
MAKER Generates into the maker file.