diff options
Diffstat (limited to 'src/parser_state.cpp')
-rw-r--r-- | src/parser_state.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/parser_state.cpp b/src/parser_state.cpp index 5ec8d08..f0e9bdd 100644 --- a/src/parser_state.cpp +++ b/src/parser_state.cpp @@ -30,7 +30,7 @@ namespace solar { void parser_state_t::new_rule(const char *nonterm) { - if (rules.empty()) { + if (grammar.rules.empty()) { // start rule add_rule_nonterminal(nonterm); add_rule(); @@ -56,7 +56,7 @@ void parser_state_t::add_rule_terminal(unsigned char term) { } void parser_state_t::add_rule(const std::string &action) { - rules.emplace_back(std::move(current), std::move(current_vars), action); + grammar.rules.emplace_back(rule_t{std::move(current), std::move(current_vars), action}); } void parser_state_t::add_rule_var(const char *var) { @@ -72,7 +72,7 @@ void parser_state_t::add_type_terminal(const char *term) { } void parser_state_t::set_type_nonterminal(const char *type) { - nonterm_types.insert(std::make_pair(current_var, type)); + grammar.nonterm_types.insert(std::make_pair(current_var, type)); } void parser_state_t::set_type_terminal(const char *type) { @@ -80,7 +80,7 @@ void parser_state_t::set_type_terminal(const char *type) { } void parser_state_t::set_type_terminal_name(const char *name) { - term_types.insert(std::make_pair(symbol_t::make_term(current_var.c_str()), std::make_pair(current_type, name))); + grammar.term_types.insert(std::make_pair(symbol_t::make_term(current_var.c_str()), std::make_pair(current_type, name))); } } |