Compiling program source modules (fglcomp, fgllink)

Genero Business Development Language (BDL) provides a source code compiler named fglcomp, which generates hardware-independent pseudo-machine code (p-code). This code is not directly executable by the operating system: it is interpreted by the Genero BDL runtime system (a program named fglrun, and called "runner").

The compiled p-code modules are binary. The files are not printable or editable as text.

The fglcomp tool - Module compiler

This tool compiles a program source module into a p-code version. The compiled module has an extension of .42m.

If a compilation error occurs, the text file filename.err flagging the errors is created. You can display directly the compilation errors by using the -M option.

Example:
fglcomp -M cust_main.4gl
Running the program:
fglrun cust_main.42m

The fgllink tool - Library and program linker

If your program consists of more than one module, the modules can be linked together prior to execution, by the fgllink tool.

If possible, prefer the IMPORT FGL solution to define module dependencies, instead of linking programs.

The fgllink tool assembles multiple p-code modules compiled with fglcomp into a single .42r program or a .42x library.

Example linking several 42m modules into a 42r program:
fgllink -o cust_main.42r cust_data.42m cust_report.42m common_lib.42x
Running the program:
fglrun custmain.42r
Example to create a library that can be linked into other programs:
fgllink -o common_lib.42x sql_utils.42m input_utils.42m report_utils.42m