[ ] Remove old implementation of the source code processing, use CxxT IR instead
[ ] Tree-sitter based implementation
[x] Figure out how to use boost wave in general, make a POC implementation for preprocessor wrapper
[x] Wrap boost wave in a shared library that provides a simple C callback-based API, in order to be able to use it from nim on all backends. Boost wave is heavily templated, so it would be very inconvenient to interface with it anyway (from nim). Partially done, see src/boost_wave
[x] Implement tree-sitter based C/C++ converter that uses selectively preprocessed C code from previous step. Partially done, see src/hc_tsreader
[ ] C and C++ code translation. Partially done, right now mostly works with plain C code. See src/hc_tsconvert
[ ] General
[x] Finalize implementation of the source-agnostic (from tree-sitter or libclang) intermediate representation, base all further transformations on it. Partially done, see src/hc_save
[x] Reimplement type graph construction and convenience override generation using CxxT IR
[ ] #10
[ ] Convert ‘out’ arguments for C functions to nim tuple[] returns :: Need to know which parameters are in, which are out. Sometimes this is mentioned in documentation, but in general this is a "dark knowledge", not formally noted down anywhere.
[ ] Wrap ‘raw’ C procedures that return exit codes to raising ones :: Specify list of allowed values, and relations between regular int return and some enum definition.
[ ] Convert ‘macro enum groups’ into full nim enums (#define PAPI_OK 0, #define PAPI_EINVAL -1) :: It is possible to infer macro enum boundaries to some degree (if they follow certain naming pattern), but grouping based on "enum begin" and "enum end" seems less error-prone.
[ ] CLI tool for generating wrappers
[ ] Helper macros :: Sometimes it is easier to write a small file with couple classes/procs rather than installing and running external wrapper generator. This is also needed for interfacing with C++ classes - I need to generate a C++ class and then .importcpp. it back. Not reusing main codegen implementation would be a waste.
CxxT
IR instead[ ] General
[x] Finalize implementation of the source-agnostic (from tree-sitter or libclang) intermediate representation, base all further transformations on it. Partially done, see src/hc_save
[x] Reimplement type graph construction and convenience override generation using
CxxT
IR[ ] #10
[ ] Convert ‘out’ arguments for C functions to nim
tuple[]
returns :: Need to know which parameters arein
, which areout
. Sometimes this is mentioned in documentation, but in general this is a "dark knowledge", not formally noted down anywhere.[ ] Wrap ‘raw’ C procedures that return exit codes to raising ones :: Specify list of allowed values, and relations between regular
int
return and someenum
definition.[ ] Convert ‘macro enum groups’ into full nim enums (
#define PAPI_OK 0
,#define PAPI_EINVAL -1
) :: It is possible to infer macro enum boundaries to some degree (if they follow certain naming pattern), but grouping based on "enum begin" and "enum end" seems less error-prone.[ ] CLI tool for generating wrappers
.importcpp.
it back. Not reusing main codegen implementation would be a waste.