38 lines
767 B
C++
38 lines
767 B
C++
#ifndef VALUE_H_
|
|
#define VALUE_H_
|
|
|
|
#include <boost/variant.hpp>
|
|
#include <vector>
|
|
|
|
namespace boost {
|
|
namespace spirit {
|
|
class utree;
|
|
}
|
|
} // namespace boost
|
|
|
|
namespace bts {
|
|
namespace expression {
|
|
|
|
struct ValueType {
|
|
enum type { boolean, integer, real, string, list, anything };
|
|
};
|
|
|
|
typedef boost::make_recursive_variant<
|
|
bool,
|
|
int,
|
|
double,
|
|
std::string,
|
|
std::vector<boost::recursive_variant_>,
|
|
void *>::type Value;
|
|
|
|
bool value_to_bool(const Value &val);
|
|
std::string value_to_string(const Value &val);
|
|
Value value_from_utree(const boost::spirit::utree &node);
|
|
|
|
const std::string get_symbol(const boost::spirit::utree &node);
|
|
const std::string get_string(const boost::spirit::utree &node);
|
|
|
|
} // namespace expression
|
|
} // namespace bts
|
|
#endif
|