#ifndef LIBWCCL_VALUES_VALUE_H #define LIBWCCL_VALUES_VALUE_H #include <libcorpus2/tagset.h> #define WCCL_VALUE_PREAMBLE \ static const char* type_name; \ const char* get_type_name() const { return type_name; } \ static std::string var_repr(const std::string &var_name); namespace Wccl { /** * Abstract base class for WCCL value types */ class Value { public: static const char* type_name; virtual const char* get_type_name() const { return type_name; } virtual ~Value() {} /** * String representation function, in general, a tagset is required, * but some classes might not need that, so by default just forward * to to_raw_string(); */ virtual std::string to_string(const Corpus2::Tagset& /*tagset*/) const { return to_raw_string(); } /** * String representation of the Value that does not require a tagset, * might be incomplete and/or contain internal info. * * Prefer to_string(tagset). */ virtual std::string to_raw_string() const = 0; protected: Value() {} }; } /* end ns Wccl */ #endif // LIBWCCL_VALUE_H