2014-03-09 22:05:17 -07:00
|
|
|
#ifndef COMPILER_RULES_PATTERN_H_
|
|
|
|
|
#define COMPILER_RULES_PATTERN_H_
|
2013-11-10 14:24:25 -08:00
|
|
|
|
2014-03-09 21:37:21 -07:00
|
|
|
#include "compiler/rules/rule.h"
|
2013-11-10 14:24:25 -08:00
|
|
|
|
|
|
|
|
namespace tree_sitter {
|
|
|
|
|
namespace rules {
|
|
|
|
|
class Pattern : public Rule {
|
2013-12-18 20:58:05 -08:00
|
|
|
const std::string value;
|
2013-11-10 14:24:25 -08:00
|
|
|
public:
|
|
|
|
|
Pattern(const std::string &string);
|
2013-12-30 23:52:38 -08:00
|
|
|
|
2013-11-10 14:24:25 -08:00
|
|
|
bool operator==(const Rule& other) const;
|
2013-12-30 23:52:38 -08:00
|
|
|
size_t hash_code() const;
|
2014-01-02 13:04:41 -08:00
|
|
|
rule_ptr copy() const;
|
2013-11-10 14:24:25 -08:00
|
|
|
std::string to_string() const;
|
2013-12-19 23:16:13 -08:00
|
|
|
void accept(Visitor &visitor) const;
|
2014-03-09 19:49:35 -07:00
|
|
|
|
2013-11-14 21:25:58 -08:00
|
|
|
rule_ptr to_rule_tree() const;
|
2013-11-10 14:24:25 -08:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-09 22:05:17 -07:00
|
|
|
#endif // COMPILER_RULES_PATTERN_H_
|
2013-11-10 14:24:25 -08:00
|
|
|
|