tree-sitter/src/compiler/lexical_grammar.h
Max Brunsfeld bd77ab1ac9 Move public rule functions out of rule namespace
This way, there's only one public namespace: tree_sitter
2015-09-03 17:49:20 -07:00

24 lines
604 B
C++

#ifndef COMPILER_LEXICAL_GRAMMAR_H_
#define COMPILER_LEXICAL_GRAMMAR_H_
#include <vector>
#include <string>
#include <utility>
#include "tree_sitter/compiler.h"
#include "compiler/rules/symbol.h"
namespace tree_sitter {
class LexicalGrammar {
public:
const std::string &rule_name(const rules::Symbol &symbol) const;
const rule_ptr &rule(const rules::Symbol &symbol) const;
std::vector<std::pair<std::string, rule_ptr>> rules;
std::vector<std::pair<std::string, rule_ptr>> aux_rules;
std::vector<rule_ptr> separators;
};
} // namespace tree_sitter
#endif // COMPILER_LEXICAL_GRAMMAR_H_