This branch had diverged considerably, so merging it required changing a lot of code. Conflicts: project.gyp spec/compiler/build_tables/action_takes_precedence_spec.cc spec/compiler/build_tables/build_conflict_spec.cc spec/compiler/build_tables/build_parse_table_spec.cc spec/compiler/build_tables/first_symbols_spec.cc spec/compiler/build_tables/item_set_closure_spec.cc spec/compiler/build_tables/item_set_transitions_spec.cc spec/compiler/build_tables/rule_can_be_blank_spec.cc spec/compiler/helpers/containers.h spec/compiler/prepare_grammar/expand_repeats_spec.cc spec/compiler/prepare_grammar/extract_tokens_spec.cc src/compiler/build_tables/action_takes_precedence.h src/compiler/build_tables/build_parse_table.cc src/compiler/build_tables/first_symbols.cc src/compiler/build_tables/first_symbols.h src/compiler/build_tables/item_set_closure.cc src/compiler/build_tables/item_set_transitions.cc src/compiler/build_tables/parse_item.cc src/compiler/build_tables/parse_item.h src/compiler/build_tables/rule_can_be_blank.cc src/compiler/build_tables/rule_can_be_blank.h src/compiler/prepare_grammar/expand_repeats.cc src/compiler/prepare_grammar/extract_tokens.cc src/compiler/prepare_grammar/extract_tokens.h src/compiler/prepare_grammar/prepare_grammar.cc src/compiler/rules/built_in_symbols.cc src/compiler/rules/built_in_symbols.h src/compiler/syntax_grammar.cc src/compiler/syntax_grammar.h
36 lines
854 B
C++
36 lines
854 B
C++
#ifndef COMPILER_BUILD_TABLES_PARSE_CONFLICT_MANAGER_H_
|
|
#define COMPILER_BUILD_TABLES_PARSE_CONFLICT_MANAGER_H_
|
|
|
|
#include <utility>
|
|
#include "tree_sitter/compiler.h"
|
|
#include "compiler/syntax_grammar.h"
|
|
#include "compiler/build_tables/parse_item.h"
|
|
|
|
namespace tree_sitter {
|
|
|
|
class ParseAction;
|
|
namespace rules {
|
|
class Symbol;
|
|
}
|
|
|
|
namespace build_tables {
|
|
|
|
enum ConflictType {
|
|
ConflictTypeNone,
|
|
ConflictTypeResolved,
|
|
ConflictTypeUnresolved
|
|
};
|
|
|
|
class ParseConflictManager {
|
|
const SyntaxGrammar syntax_grammar;
|
|
|
|
public:
|
|
explicit ParseConflictManager(const SyntaxGrammar &);
|
|
std::pair<bool, ConflictType> resolve(const ParseAction &, const ParseAction &,
|
|
const rules::Symbol &) const;
|
|
};
|
|
|
|
} // namespace build_tables
|
|
} // namespace tree_sitter
|
|
|
|
#endif // COMPILER_BUILD_TABLES_PARSE_CONFLICT_MANAGER_H_
|