Closes #7 (closed) , #4 (closed)
This MR brings a significant refactoring and several extensions to the modelling of source file structure and contents in the SFG IR, as well as to the way these are constructed by the composer internally.
Replace ir.source_components
by ir.entities
and ir.syntax
ir.entities
defines C++ code entities independently from their place in the output file syntax. It defines namespaces (including kernel namespaces and the global namespace), functions, kernels, classes and their members (methods, constructors). It also places these entities in parent-child-relationsships.ir.syntax
defines the class SfgSourceFile
to represent source files. It also contains the representation of the above entities as syntactic objects: namespace blocks (one namespace can have multiple blocks), entity declaration and definition nodes, class body and visibility block nodes.sfg.namespace
can now be called multiple times and be used as a context manager to enter and exit nested namespacessfg.define_once
since it can no longer reliably check definitions for uniquenessSourceFileGenerator
to prepare the file objects for the context and correctly invoke the printer#include
s via the SfgConfig
- if one is specified, clang-format
header sorting will be automatically disabled