summaryrefslogtreecommitdiffstats
path: root/src/grammar.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/grammar.hpp')
-rw-r--r--src/grammar.hpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/grammar.hpp b/src/grammar.hpp
index 6e766c7..41c6316 100644
--- a/src/grammar.hpp
+++ b/src/grammar.hpp
@@ -48,14 +48,14 @@ struct grammar_t {
std::vector<std::pair<std::string, std::string>> extra_args;
- void add_rule(const rule_t &rule) {
+ void add_rule(const item_t &item, const std::vector<std::pair<std::string, bool>> &variables, const std::string &action) {
if (rules.empty()) {
item_t init("");
- init.get_rhs().push_back(symbol_t::make_nonterm(rule.item.get_lhs()));
- rules.emplace_back(solar::rule_t {std::move(init), std::vector<std::pair<std::string, bool>>(), std::string()});
+ init.get_rhs().push_back(symbol_t::make_nonterm(item.get_lhs()));
+ rules.push_back({std::move(init), std::vector<std::pair<std::string, bool>>(), std::string()});
}
- rules.push_back(rule);
+ rules.push_back({item, variables, action});
}
const std::string & get_nonterm_type(const std::string &sym) const {