Now, instead of adding states to the lex table as they are needed by the parse states, we iterate over the parse states after the fact and set up their corresponding lex states. This has the nice side effect that the lex states are in a more readable order.
18 lines
501 B
C++
18 lines
501 B
C++
#ifndef COMPILER_BUILD_TABLES_BUILD_PARSE_TABLE_H_
|
|
#define COMPILER_BUILD_TABLES_BUILD_PARSE_TABLE_H_
|
|
|
|
#include <utility>
|
|
#include <vector>
|
|
#include "tree_sitter/compiler.h"
|
|
#include "compiler/parse_table.h"
|
|
|
|
namespace tree_sitter {
|
|
class PreparedGrammar;
|
|
|
|
namespace build_tables {
|
|
std::pair<ParseTable, std::vector<Conflict>>
|
|
build_parse_table(const PreparedGrammar &grammar, const PreparedGrammar &lex_grammar);
|
|
}
|
|
}
|
|
|
|
#endif // COMPILER_BUILD_TABLES_BUILD_PARSE_TABLE_H_
|