Nunavut is a source-to-source compiler (transpiler) that automatically converts OpenCyphal DSDL definitions
into source code in a specified target programming language.
It is constructed as a template engine that exposes a PyDSDL abstract
syntax tree to Jinja2 templates allowing authors to generate code, schemas, metadata,
documentation, etc.
Nunavut DSDL transcompilation pipeline.
Nunavut ships with built-in support for some programming languages,
and it can be used to generate code for other languages if custom templates (and some glue logic) are provided.
Currently, the following languages are supported out of the box:
The examples do not replace the documentation, please do endeavor to read it.
Generate C headers using the command-line tool
This example assumes that the public regulated namespace directories reg and uavcan reside under
public_regulated_data_types/.
Nunavut is invoked to generate code for the former.
Generate HTML documentation pages using the command-line tool
See above assumptions. The below commands generate documentation
for the reg namespace.
Note that we have to generate documentation for the uavcan namespace
as well, because there are types in reg that will link to uavcan
documentation sections.
Generate Python packages using the command-line tool
This example assumes that the public regulated namespace directories reg and uavcan reside under
public_regulated_data_types/.
Nunavut is invoked to generate code for the former.