I am currently developing a simple programming language for easily creating C++ projects. It lets you type in some short C++-like code and generates .h and .cpp files automatically.
I need some way to map a type, e.g. from the standard library, to its corresponding header file. That makes it possible to just use a type in my language and automatically infer which headers to include in the generated code.
Here is an example of the language as it is right now:
class Car {
std::string print()
members:
int i, j
std::array<Wheel, 4> wheels
}
When processing this code I find the types std::string
and std::array
which need to be mapped to their header files. How can I achieve this mapping?
Is there maybe a data base publicly available? I do not want to parse all the headers myself of course (which I assume is how IDEs do it).
On top of only supporting the standard library it would of course be useful to be able to support other libraries as well, but that is only a secondary goal.