BoiseState-AdaptLab / IEGenLib

Inspector/Executor Generation Library for manipulating sets and relations with uninterpreted function symbols.
BSD 2-Clause "Simplified" License
2 stars 4 forks source link

Generate type declarations #110

Open Aaron3154518 opened 3 years ago

Aaron3154518 commented 3 years ago

Once we store type information, we need to generate type declarations in codeGen(). Every statement writes to exactly 1 dataspace so every statement needs exactly 1 type declaration.

Aaron3154518 commented 3 years ago

In Codegen, we iterate through each statement. We need to get the first write of that statement and look up its type.

Aaron3154518 commented 3 years ago

Here's an example of iterating through dataSpaces (type is std::vector<std::pair<std::string, std::string>>):

for (auto& pair : dataSpaces) { pair.first; //Name pair.second; // Type }

Documentation for the pair object: https://www.cplusplus.com/reference/utility/pair/