2013-12-18 20:58:05 -08:00
|
|
|
#include "rules.h"
|
2013-11-07 18:30:00 -08:00
|
|
|
#include "transition_map.h"
|
|
|
|
|
|
2013-12-19 23:05:54 -08:00
|
|
|
using std::string;
|
|
|
|
|
|
2013-11-07 18:30:00 -08:00
|
|
|
namespace tree_sitter {
|
|
|
|
|
namespace rules {
|
2013-12-19 23:05:54 -08:00
|
|
|
String::String(string value) : value(value) {};
|
2013-11-07 18:30:00 -08:00
|
|
|
|
|
|
|
|
bool String::operator==(const Rule &rule) const {
|
|
|
|
|
const String *other = dynamic_cast<const String *>(&rule);
|
|
|
|
|
return (other != NULL) && (other->value == value);
|
|
|
|
|
}
|
2013-11-14 12:55:02 -08:00
|
|
|
|
2013-12-19 23:05:54 -08:00
|
|
|
string String::to_string() const {
|
|
|
|
|
return string("(string '") + value + "')";
|
2013-11-07 18:30:00 -08:00
|
|
|
}
|
2013-12-18 20:58:05 -08:00
|
|
|
|
2013-12-19 23:16:13 -08:00
|
|
|
void String::accept(Visitor &visitor) const {
|
2013-12-18 20:58:05 -08:00
|
|
|
visitor.visit(this);
|
|
|
|
|
}
|
2013-11-07 18:30:00 -08:00
|
|
|
}
|
|
|
|
|
}
|