diff --git a/libwccl/ops/match/matchcondition.h b/libwccl/ops/match/matchcondition.h new file mode 100644 index 0000000000000000000000000000000000000000..6e8fddfa31587bead22629c71a109693e709d016 --- /dev/null +++ b/libwccl/ops/match/matchcondition.h @@ -0,0 +1,30 @@ +#ifndef LIBWCCL_OPS_MATCH_MATCHCONDITION_H +#define LIBWCCL_OPS_MATCH_MATCHCONDITION_H + +#include <libwccl/ops/funexeccontext.h> +#include <libwccl/ops/expression.h> +#include <libwccl/ops/match/matchresult.h> + +namespace Wccl { + +/** + * Abstract base class for conditions of MatchOperator + */ +class MatchCondition : public Expression +{ +public: + /** + * @returns Name of the condition. + */ + virtual std::string name() const = 0; + /** + * Applies the condition to the given execution context. + * If match is found, the current iter position "$_" is + * set to position right after the match. + */ + virtual MatchResult apply(boost::shared_ptr<Position> iter_pos, const FunExecContext& context) const = 0; +}; + +} /* end ns Wccl */ + +#endif // LIBWCCL_OPS_MATCH_MATCHCONDITION_H