fpp to cpp - nasa/fpp GitHub Wiki
This tool parses FPP models, performs semantic checking on them, and writes out C++ files.
Options:
- 
-a: Enable unit test auto helpers.
- 
-ddir: Set the output directory to dir. If this option is not present, then the output directory is the current directory.
- 
-ifiles: Import files. The definitions in these files are part of the FPP model, but they do not cause any code to be generated.
- 
-gprefix: Specify a prefix for include guards that have no associated namespace.
- 
-nfile: Write the names of the generated files to file. This is useful for collecting build dependencies.
- 
-pfiles: Specify local prefixes to delete when generating include guards and include paths.
- 
-sstring size: Specify the default string size. If this option is present, the argument must be a decimal integer value between 1 and 1024. If this option is not present, the default string size is 80.
- 
-u: Generate unit test code.
- 
-t: Generate component implementation templates.
Input:
- 
A list fl_tr of files to translate: either the single file stdin or a list of files specified on the command line. 
- 
A list fl_i of files to import, specified as arguments to the -ioption.
Output:
- 
A set of C++ files, written to the output directory. - 
By default these are the autocoded F Prime C++ files for constants, types, ports, components, and topologies. 
- 
If option -uis present and option-tis not present, then- 
These are the autocoded base class files for unit test components. 
- 
If option -ais present, then these files include auto-generated helper code running unit tests.
 
- 
- 
If option -tis present, then- 
By default these are the template files for handwritten component implementations. 
- 
If option -uis also present, then- 
These are the template files for handwritten component unit test implementations. 
- 
If option -ais not present, then these files include auto-generated helper code running unit tests.
 
- 
 
- 
 
- 
- 
If option -nis present, then write the names of the generated C++ files to the specified file.
Procedure:
- 
Parse each of the files in fl_tr, generating a list tul_tr of translation units. When parsing, recursively resolve include specifiers. 
- 
Do the same for fl_i, generating a list tul_i. 
- 
Perform semantic checking on the concatenation of tul_fl and tul_i. 
- 
Check that no two definitions in tul_tr will generate a C++ file with the same name. If so, halt with an error message. 
- 
Generate the output for the definitions in tul_tr.