"Fossies" - the Fresh Open Source Software Archive

Member "flatbuffers-23.1.21/docs/source/IntermediateRepresentation.md" (21 Jan 2023, 1548 Bytes) of package /linux/misc/flatbuffers-23.1.21.tar.gz:

As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

Flatbuffers Intermediate Representation {#intermediate_representation}

We use reflection.fbs as our intermediate representation. flatc parses .fbs files, checks them for errors and stores the resulting data in this IR, outputting .bfbs files. Since this IR is a Flatbuffer, you can load and use it at runtime for runtime reflection purposes.

There are some quirks:


You can invoke it like so

flatc -b --schema ${your_fbs_files}

This generates .bfbs (binary flatbuffer schema) files.

Some information is not included by default. See the --bfbs-filenames and --bfbs-comments flags. These may be necessary for code-generators, so they can add documentation and maybe name generated files (depending on the generator).

TODO(cneo): Flags to output bfbs as flexbuffers or json.

TODO(cneo): Tutorial for building a flatc plugin.