3 #include <boost/variant/static_visitor.hpp>
5 #include "mstch/mstch.hpp"
6 #include "has_token.hpp"
10 class get_token: public boost::static_visitor<const mstch::node&> {
12 get_token(const std::string& token, const mstch::node& node):
13 m_token(token), m_node(node)
18 const mstch::node& operator()(const T&) const {
22 const mstch::node& operator()(const map& map) const {
23 return map.at(m_token);
26 const mstch::node& operator()(const std::shared_ptr<object>& object) const {
27 return object->at(m_token);
31 const std::string& m_token;
32 const mstch::node& m_node;