tree-sitter/src/compiler/build_tables/first_set.h
Max Brunsfeld 7df35f9b8d Make separate types for syntax and lexical grammars
This way, the separator characters can be added as a field to
lexical grammars only
2014-06-25 13:27:16 -07:00

23 lines
618 B
C++

#ifndef COMPILER_BUILD_TABLES_FIRST_SET_H_
#define COMPILER_BUILD_TABLES_FIRST_SET_H_
#include <set>
#include "compiler/build_tables/parse_item.h"
#include "compiler/rules/symbol.h"
namespace tree_sitter {
class SyntaxGrammar;
namespace build_tables {
/*
* Returns the set of terminal symbols that can appear at
* the beginning of a string derivable from a given rule,
* in a given grammar.
*/
std::set<rules::Symbol>
first_set(const rules::rule_ptr &rule, const SyntaxGrammar &grammar);
}
}
#endif // COMPILER_BUILD_TABLES_FIRST_SET_H_