summaryrefslogtreecommitdiffstats
path: root/src/generator_lr0.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/generator_lr0.hpp')
-rw-r--r--src/generator_lr0.hpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/generator_lr0.hpp b/src/generator_lr0.hpp
index c434ed6..063a518 100644
--- a/src/generator_lr0.hpp
+++ b/src/generator_lr0.hpp
@@ -32,8 +32,21 @@
namespace solar {
class generator_lr0_t : public generator_t {
+private:
+ std::map<size_t, size_t> reductions;
+
+protected:
+ virtual bool has_reduce_conflict(size_t from, const symbol_t &sym);
+ virtual void add_reduction(size_t from, size_t to);
+
public:
- generator_lr0_t(const grammar_t &grammar) : generator_t(grammar) {}
+ const std::map<size_t, size_t> & get_reductions() const {
+ return reductions;
+ }
+
+ generator_lr0_t(const grammar_t &grammar) : generator_t(grammar) {
+ generate();
+ }
};
}