tree-sitter/src/compiler/rules/symbol.h

32 lines
No EOL
741 B
C++

#ifndef __tree_sitter__sym__
#define __tree_sitter__sym__
#include "rule.h"
namespace tree_sitter {
namespace rules {
class Symbol : public Rule {
public:
Symbol(const std::string &name);
bool operator==(const Rule& other) const;
size_t hash_code() const;
rule_ptr copy() const;
std::string to_string() const;
void accept(Visitor &visitor) const;
bool operator<(const Symbol &other) const;
const std::string name;
};
typedef std::shared_ptr<const Symbol> sym_ptr;
}
}
namespace std {
template<>
struct hash<tree_sitter::rules::Symbol> : hash<tree_sitter::rules::Rule> {};
}
#endif