Remove unused parameters to ParseConflictManager

This commit is contained in:
Max Brunsfeld 2015-12-17 15:18:18 -08:00
parent da115d81a4
commit 351b4f4aaa
4 changed files with 27 additions and 46 deletions

View file

@ -43,8 +43,7 @@ class ParseTableBuilder {
ParseTableBuilder(const SyntaxGrammar &grammar,
const LexicalGrammar &lex_grammar)
: grammar(grammar),
lexical_grammar(lex_grammar),
conflict_manager(grammar) {}
lexical_grammar(lex_grammar) {}
pair<ParseTable, const GrammarError *> build() {
Symbol start_symbol = Symbol(0, grammar.variables.empty());
@ -247,8 +246,7 @@ class ParseTableBuilder {
return &parse_table.set_action(state_id, lookahead, new_action);
const ParseAction old_action = current_entry->second[0];
auto resolution =
conflict_manager.resolve(new_action, old_action, lookahead);
auto resolution = conflict_manager.resolve(new_action, old_action);
switch (resolution.second) {
case ConflictTypeNone:

View file

@ -9,14 +9,10 @@ namespace build_tables {
using std::pair;
using std::vector;
ParseConflictManager::ParseConflictManager(const SyntaxGrammar &syntax_grammar)
: syntax_grammar(syntax_grammar) {}
pair<bool, ConflictType> ParseConflictManager::resolve(
const ParseAction &new_action, const ParseAction &old_action,
const rules::Symbol &symbol) const {
const ParseAction &new_action, const ParseAction &old_action) const {
if (new_action.type < old_action.type) {
auto opposite = resolve(old_action, new_action, symbol);
auto opposite = resolve(old_action, new_action);
return { !opposite.first, opposite.second };
}

View file

@ -22,12 +22,8 @@ enum ConflictType {
};
class ParseConflictManager {
const SyntaxGrammar syntax_grammar;
public:
explicit ParseConflictManager(const SyntaxGrammar &);
std::pair<bool, ConflictType> resolve(const ParseAction &, const ParseAction &,
const rules::Symbol &) const;
std::pair<bool, ConflictType> resolve(const ParseAction &, const ParseAction &) const;
};
} // namespace build_tables