diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-03-31 20:46:33 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-03-31 20:46:33 +0200 |
commit | 342f927aace815c2b6e7903def14d4aca9bc2233 (patch) | |
tree | d000c11855d00dd9c9d11ab2a609aeefbb2b0004 /src/generator.hpp | |
parent | 03b5a87eeb87fb059c9d51696912bfa9c39c5929 (diff) | |
download | solar-342f927aace815c2b6e7903def14d4aca9bc2233.tar solar-342f927aace815c2b6e7903def14d4aca9bc2233.zip |
generator: generate transitions
Diffstat (limited to 'src/generator.hpp')
-rw-r--r-- | src/generator.hpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/generator.hpp b/src/generator.hpp index 880323b..b901785 100644 --- a/src/generator.hpp +++ b/src/generator.hpp @@ -39,17 +39,18 @@ private: std::multimap<std::string, item_t> rules; std::multimap<symbol_t, item_t> items; std::map<std::set<item_t>, unsigned> itemsets; + std::map<std::pair<unsigned, symbol_t>, unsigned> transitions; void close_set(std::set<item_t> *set); std::set<item_t> get_set(const std::string &nonterm); - std::pair<bool, unsigned> add_set(const std::set<item_t> &set) { - auto ret = itemsets.emplace(set, itemsets.size()); - return std::make_pair(ret.second, ret.first->second); + std::pair<std::map<std::set<item_t>, unsigned>::iterator, bool> add_set(const std::set<item_t> &set) { + return itemsets.emplace(set, itemsets.size()); } void generate_itemsets(); + static void print_symbol(const symbol_t &sym); static void print_item(const item_t &item); static void print_set(const std::set<item_t> &set); |