diff --git a/libwccl/ops/parsedexpression.h b/libwccl/ops/parsedexpression.h index bf496b872aacf6f6f60489e22a32abbc92f73119..1982c8bb97b9c9ba07153f7a2f36f8dcde5b1cea 100644 --- a/libwccl/ops/parsedexpression.h +++ b/libwccl/ops/parsedexpression.h @@ -139,6 +139,11 @@ public: */ boost::shared_ptr<ParsedExpression> clone_clean_ptr() const; + /** + * @returns vector of strings corresponfing to valid variable names + * in this operator. + */ + std::vector<std::string> valid_variable_names() const; /** * @returns String with representation of all held variables, @@ -232,6 +237,17 @@ boost::shared_ptr<ParsedExpression> ParsedExpression::clone_clean_ptr() const { return copy; } +inline +std::vector<std::string> ParsedExpression::valid_variable_names() const { + std::vector<std::string> valid; + typedef std::pair<std::string, boost::shared_ptr<Wccl::Value> > v_t; + // ja chcÄ™ c++1x i auto/decltype + foreach (const v_t& v, variables_->get_all<Wccl::Value>()) { + valid.push_back(v.first); + } + return valid; +} + inline std::ostream& ParsedExpression::dump_variables( std::ostream &ostream,