A few examples:
- minimal.mgen - a minimal example of
mgen
's formal specification demonstrating how to use fields alongside their unit information, enumerated arrays and field-indexed arrays. - common.mgen - a "real-world" example demonstrating the most common features. The generated output code can be found in common.py and common.m. A Jupyter notebook with additional details on the Python code generation is also available. Accompanying input (textual) data for testing is stored in common.in.
- heterogenous.mgen - a small example showing how to use field-indexed arrays with different units for each entry.
- nesting.mgen - an example of demonstrating nesting of structures and addressing nested fields.