Source code generation

A code generator is a computer program for software development. It translates models that were created in UML, XML, structure charts, decision tables or other formal language in the programming language (C, C , Assembler, ... ) of the selected target platform. He quickly and accurately generates source code ( code generation ), which is then connected to other parts of the program to a program.

The product of a code generator is (albeit rarely) called generat.

The compiler is the code generator of the part of a compiler that generates when compiling machine code.

The control of a code generator is performed either manually, ie directly by the programmer, or automatically with a special formal language, which greatly simplifies the formulation of the problem as compared to the target language.

Automated code generators

Simple versions operate on the basis of the source files and replace so-called macro calls with predefined text strings. The preprocessor is an example. Other variants generate completely new source files by meta information they process. Meta-information describing the process of code generation as well as properties of program code to be created at a higher level ( see also Model Driven Architecture ) and are located either in separate files ( such as the parser ) or in the form of annotations (also: attributes, annotations) within the existing code prior. The generated code, unlike the case of manually controlled code generators, before or during the compiling process automatically. The programming languages ​​C # and Java have their own language constructs for it to (so-called annotations).

Manual -driven code generators

Manual -driven code generators are part of an integrated development environment ( IDE) or a CASE tool. Often they can be operated via a graphic user interface (GUI). The programmer can program its code interactively, either by exclusively using the code generator or supplemented by manual programming, put together. In addition to pure code generation some code generators offer ie round-trip engineering capabilities reading and a summarized graphical representation of the manually created and the generated program codes.

Tools

  • Actifsource
  • ASCET -SE (based on the automotive ASCET tool family for algorithm development and software engineering )
  • Eclipse Modeling Framework
  • OpenArchitectureWare
  • Simulink HDL Coder (generated VHDL / Verilog from based on MATLAB / Simulink / Stateflow )
  • SinelaboreRT To generate C code from UML state diagrams
  • TargetLink ( based on MATLAB / Simulink )
  • ScriptCase, PHP / MySQL -based code generator
  • Innovator
195589
de