Skip to content

Instantly share code, notes, and snippets.

@morgangallant
Last active August 19, 2019 20:43
Show Gist options
  • Save morgangallant/53c93bb03943692bd39f9962e0eb423a to your computer and use it in GitHub Desktop.
Save morgangallant/53c93bb03943692bd39f9962e0eb423a to your computer and use it in GitHub Desktop.
#include <unordered_map>
// Checks if this node has been flattened yet.
bool is_flattened() const { return offset_ == -1; }
// New private member variables for Node class.
// Stores the module offset for flattening.
int offset_ = -1;
// Maps each trigger word to a set of integer IDs.
std::unordered_map<std::string, std::vector<int>> ids_;
// Maps each integer ID to an associated function to execute.
std::unordered_map<int, std::function<void()>> execs_;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment