summaryrefslogtreecommitdiffstats
path: root/src/generator.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/generator.hpp')
-rw-r--r--src/generator.hpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/generator.hpp b/src/generator.hpp
index 715dd98..5396d3e 100644
--- a/src/generator.hpp
+++ b/src/generator.hpp
@@ -45,9 +45,9 @@ private:
std::multimap<symbol_t, item_t> items;
std::map<std::set<item_t>, size_t> itemsets;
- std::map<std::pair<unsigned, symbol_t>, unsigned> shifts;
- std::map<unsigned, unsigned> reductions;
- std::map<std::pair<unsigned, symbol_t>, unsigned> gotos;
+ std::map<std::pair<size_t, symbol_t>, size_t> shifts;
+ std::map<size_t, size_t> reductions;
+ std::map<std::pair<size_t, symbol_t>, size_t> gotos;
void close_set(std::set<item_t> *set);
std::set<item_t> get_set(const std::string &nonterm);
@@ -58,11 +58,15 @@ private:
void generate_itemsets();
- static void print_symbol(const symbol_t &sym);
- static void print_item(const item_t &item, bool point);
- static void print_set(const std::set<item_t> &set);
-
public:
+ const std::set<symbol_t> & get_terminals() const {
+ return terminals;
+ }
+
+ size_t get_state_count() const {
+ return itemsets.size();
+ }
+
generator_t(const std::vector<item_t> &rules0);
};