I was trying compiler design with flex and bison. This is my first attempt in that sense.
For my compiler, I wanted to build a symbol table which would help in building a proper compile-time type-system. When I sat to implement it, I noticed, it actually requires two symbol tables for a code file. One for compile time, which may be implemented using hash-tables/linked-lists. But apart from that, another symbol table is required, which is to store the exposed symbols of that file, for later use when it is imported in some other file.
How to do this second table? First I thought of using SQLite like database engines. But when a code file imports multiple other files, opening all databases corresponding to all those imported files may not be resource friendly. So, I thought there may be a better way of doing this! Could I use JSONs for this? Or there exist a much better way for implementing those symbol tables?