Skip to content
Snippets Groups Projects
Commit 45e923f3 authored by ilor's avatar ilor
Browse files

Add namespace Matching { to match-related operators (but not to the Match type itself)

parent 6810c379
Branches
No related tags found
No related merge requests found
Showing
with 40 additions and 0 deletions
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
namespace Wccl { namespace Wccl {
namespace Matching {
void MarkMatch::execute(const ActionExecContext& context) const void MarkMatch::execute(const ActionExecContext& context) const
{ {
...@@ -81,4 +82,5 @@ std::ostream& MarkMatch::write_to(std::ostream& os) const ...@@ -81,4 +82,5 @@ std::ostream& MarkMatch::write_to(std::ostream& os) const
return os; return os;
} }
} /* end ns Matching */
} /* end ns Wccl */ } /* end ns Wccl */
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <libwccl/ops/function.h> #include <libwccl/ops/function.h>
namespace Wccl { namespace Wccl {
namespace Matching {
class MarkMatch : public MatchAction class MarkMatch : public MatchAction
{ {
...@@ -82,6 +83,7 @@ private: ...@@ -82,6 +83,7 @@ private:
const std::string chan_name_; const std::string chan_name_;
}; };
} /* end ns Matching */
} /* end ns Wccl */ } /* end ns Wccl */
#endif // LIBWCCL_OPS_MATCH_ACTIONS_MARKMATCH_H #endif // LIBWCCL_OPS_MATCH_ACTIONS_MARKMATCH_H
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <sstream> #include <sstream>
namespace Wccl { namespace Wccl {
namespace Matching {
void UnmarkMatch::execute(const ActionExecContext& context) const void UnmarkMatch::execute(const ActionExecContext& context) const
{ {
...@@ -50,4 +51,5 @@ std::ostream& UnmarkMatch::write_to(std::ostream& os) const ...@@ -50,4 +51,5 @@ std::ostream& UnmarkMatch::write_to(std::ostream& os) const
return os << name() << "(" << *match_ << ", \"" << chan_name_ << "\")"; return os << name() << "(" << *match_ << ", \"" << chan_name_ << "\")";
} }
} /* end ns Matching */
} /* end ns Wccl */ } /* end ns Wccl */
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <libwccl/ops/function.h> #include <libwccl/ops/function.h>
namespace Wccl { namespace Wccl {
namespace Matching {
/** /**
* Action to unmark (delete) an annotation passing through a first * Action to unmark (delete) an annotation passing through a first
...@@ -53,6 +54,7 @@ private: ...@@ -53,6 +54,7 @@ private:
const std::string chan_name_; const std::string chan_name_;
}; };
} /* end ns Matching */
} /* end ns Wccl */ } /* end ns Wccl */
#endif // LIBWCCL_OPS_MATCH_ACTIONS_UNMARKMATCH_H #endif // LIBWCCL_OPS_MATCH_ACTIONS_UNMARKMATCH_H
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <libpwrutils/foreach.h> #include <libpwrutils/foreach.h>
namespace Wccl { namespace Wccl {
namespace Matching {
ApplyOperator::ApplyOperator( ApplyOperator::ApplyOperator(
const VariableAccessor<Match>& matches, const VariableAccessor<Match>& matches,
...@@ -103,4 +104,5 @@ std::ostream& ApplyOperator::write_to(std::ostream &ostream) const ...@@ -103,4 +104,5 @@ std::ostream& ApplyOperator::write_to(std::ostream &ostream) const
return ostream; return ostream;
} }
} /* end ns Matching */
} /* end ns Wccl */ } /* end ns Wccl */
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <libwccl/ops/functions/bool/predicates/logicalpredicate.h> #include <libwccl/ops/functions/bool/predicates/logicalpredicate.h>
namespace Wccl { namespace Wccl {
namespace Matching {
class ConjConditions; class ConjConditions;
class MatchAction; class MatchAction;
...@@ -62,6 +63,7 @@ private: ...@@ -62,6 +63,7 @@ private:
const boost::shared_ptr<const std::vector<boost::shared_ptr<Function<Bool> > > > apply_conditions_; const boost::shared_ptr<const std::vector<boost::shared_ptr<Function<Bool> > > > apply_conditions_;
}; };
} /* end ns Matching */
} /* end ns Wccl */ } /* end ns Wccl */
#endif // LIBWCCL_OPS_MATCH_APPLYOPERATOR_H #endif // LIBWCCL_OPS_MATCH_APPLYOPERATOR_H
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <sstream> #include <sstream>
namespace Wccl { namespace Wccl {
namespace Matching {
ConjConditions::ConjConditions(const std::vector< boost::shared_ptr<const MatchCondition> >& conditions) ConjConditions::ConjConditions(const std::vector< boost::shared_ptr<const MatchCondition> >& conditions)
: _conditions(conditions) : _conditions(conditions)
...@@ -55,4 +56,5 @@ std::ostream& ConjConditions::write_to(std::ostream &ostream) const ...@@ -55,4 +56,5 @@ std::ostream& ConjConditions::write_to(std::ostream &ostream) const
return ostream; return ostream;
} }
} /* end ns Matching */
} /* end ns Wccl */ } /* end ns Wccl */
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <libwccl/ops/match/matchcondition.h> #include <libwccl/ops/match/matchcondition.h>
namespace Wccl { namespace Wccl {
namespace Matching {
/** /**
* Class that wraps a vector of match conditions to act as * Class that wraps a vector of match conditions to act as
...@@ -44,6 +45,7 @@ private: ...@@ -44,6 +45,7 @@ private:
const std::vector<boost::shared_ptr<const MatchCondition> > _conditions; const std::vector<boost::shared_ptr<const MatchCondition> > _conditions;
}; };
} /* end ns Matching */
} /* end ns Wccl */ } /* end ns Wccl */
#endif // LIBWCCL_OPS_MATCH_CONDITIONS_CONJCONDITIONS_H #endif // LIBWCCL_OPS_MATCH_CONDITIONS_CONJCONDITIONS_H
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#include <sstream> #include <sstream>
namespace Wccl { namespace Wccl {
namespace Matching {
MatchResult IsAnnotatedAs::apply(const ActionExecContext& context) const MatchResult IsAnnotatedAs::apply(const ActionExecContext& context) const
{ {
...@@ -55,4 +56,5 @@ std::ostream& IsAnnotatedAs::write_to(std::ostream& os) const ...@@ -55,4 +56,5 @@ std::ostream& IsAnnotatedAs::write_to(std::ostream& os) const
return os << name() << "(\"" << chan_name_ << "\")"; return os << name() << "(\"" << chan_name_ << "\")";
} }
} /* end ns Matching */
} /* end ns Wccl */ } /* end ns Wccl */
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <libwccl/ops/function.h> #include <libwccl/ops/function.h>
namespace Wccl { namespace Wccl {
namespace Matching {
/** /**
* is() match condition - matches an annotation * is() match condition - matches an annotation
...@@ -46,6 +47,7 @@ private: ...@@ -46,6 +47,7 @@ private:
const std::string chan_name_; const std::string chan_name_;
}; };
} /* end ns Matching */
} /* end ns Wccl */ } /* end ns Wccl */
#endif // LIBWCCL_OPS_MATCH_CONDITIONS_ISANNOTATEDAS_H #endif // LIBWCCL_OPS_MATCH_CONDITIONS_ISANNOTATEDAS_H
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <libpwrutils/foreach.h> #include <libpwrutils/foreach.h>
namespace Wccl { namespace Wccl {
namespace Matching {
Longest::Longest(const boost::shared_ptr<std::vector<boost::shared_ptr<ConjConditions> > >& variants) Longest::Longest(const boost::shared_ptr<std::vector<boost::shared_ptr<ConjConditions> > >& variants)
: _variants(variants) : _variants(variants)
...@@ -58,4 +59,5 @@ std::ostream& Longest::write_to(std::ostream& ostream) const ...@@ -58,4 +59,5 @@ std::ostream& Longest::write_to(std::ostream& ostream) const
return ostream << ")"; return ostream << ")";
} }
} /* end ns Matching */
} /* end ns Wccl */ } /* end ns Wccl */
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <libwccl/ops/match/conditions/conjconditions.h> #include <libwccl/ops/match/conditions/conjconditions.h>
namespace Wccl { namespace Wccl {
namespace Matching {
/** /**
* Class for "longest" condition of match * Class for "longest" condition of match
...@@ -47,6 +48,7 @@ protected: ...@@ -47,6 +48,7 @@ protected:
private: private:
const boost::shared_ptr<std::vector<boost::shared_ptr<ConjConditions> > > _variants; const boost::shared_ptr<std::vector<boost::shared_ptr<ConjConditions> > > _variants;
}; };
} /* end ns Matching */
} /* end ns Wccl */ } /* end ns Wccl */
#endif // LIBWCCL_OPS_MATCH_CONDITIONS_LONGEST_H #endif // LIBWCCL_OPS_MATCH_CONDITIONS_LONGEST_H
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
namespace Wccl { namespace Wccl {
namespace Matching {
MatchResult MatchText::apply(const ActionExecContext& context) const MatchResult MatchText::apply(const ActionExecContext& context) const
{ {
...@@ -46,4 +47,5 @@ std::ostream& MatchText::write_to(std::ostream& os) const ...@@ -46,4 +47,5 @@ std::ostream& MatchText::write_to(std::ostream& os) const
return os << name() << "(\"" << PwrNlp::to_utf8(text_) << "\")"; return os << name() << "(\"" << PwrNlp::to_utf8(text_) << "\")";
} }
} /* end ns Matching */
} /* end ns Wccl */ } /* end ns Wccl */
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <unicode/unistr.h> #include <unicode/unistr.h>
namespace Wccl { namespace Wccl {
namespace Matching {
/** /**
* text() match condition - matches a text * text() match condition - matches a text
*/ */
...@@ -46,6 +47,7 @@ private: ...@@ -46,6 +47,7 @@ private:
const UnicodeString text_; const UnicodeString text_;
}; };
} /* end ns Matching */
} /* end ns Wccl */ } /* end ns Wccl */
#endif // LIBWCCL_OPS_MATCH_CONDITIONS_MATCHTEXT_H #endif // LIBWCCL_OPS_MATCH_CONDITIONS_MATCHTEXT_H
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <libpwrutils/foreach.h> #include <libpwrutils/foreach.h>
namespace Wccl { namespace Wccl {
namespace Matching {
OneOf::OneOf(const boost::shared_ptr<std::vector<boost::shared_ptr<ConjConditions> > >& variants) OneOf::OneOf(const boost::shared_ptr<std::vector<boost::shared_ptr<ConjConditions> > >& variants)
: _variants(variants) : _variants(variants)
...@@ -51,4 +52,5 @@ std::ostream& OneOf::write_to(std::ostream& ostream) const ...@@ -51,4 +52,5 @@ std::ostream& OneOf::write_to(std::ostream& ostream) const
return ostream << ")"; return ostream << ")";
} }
} /* end ns Matching */
} /* end ns Wccl */ } /* end ns Wccl */
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <libwccl/ops/match/conditions/conjconditions.h> #include <libwccl/ops/match/conditions/conjconditions.h>
namespace Wccl { namespace Wccl {
namespace Matching {
/** /**
* Class for "oneof" condition of match * Class for "oneof" condition of match
...@@ -46,6 +47,7 @@ protected: ...@@ -46,6 +47,7 @@ protected:
private: private:
const boost::shared_ptr<std::vector<boost::shared_ptr<ConjConditions> > > _variants; const boost::shared_ptr<std::vector<boost::shared_ptr<ConjConditions> > > _variants;
}; };
} /* end ns Matching */
} /* end ns Wccl */ } /* end ns Wccl */
#endif // LIBWCCL_OPS_MATCH_CONDITIONS_ONEOF_H #endif // LIBWCCL_OPS_MATCH_CONDITIONS_ONEOF_H
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <sstream> #include <sstream>
namespace Wccl { namespace Wccl {
namespace Matching {
OptionalMatch::OptionalMatch(const boost::shared_ptr<ConjConditions>& conditions) OptionalMatch::OptionalMatch(const boost::shared_ptr<ConjConditions>& conditions)
: _conditions(conditions) : _conditions(conditions)
...@@ -33,4 +34,5 @@ std::ostream& OptionalMatch::write_to(std::ostream& ostream) const ...@@ -33,4 +34,5 @@ std::ostream& OptionalMatch::write_to(std::ostream& ostream) const
return ostream << name() << *_conditions; return ostream << name() << *_conditions;
} }
} /* end ns Matching */
} /* end ns Wccl */ } /* end ns Wccl */
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <libwccl/ops/match/conditions/conjconditions.h> #include <libwccl/ops/match/conditions/conjconditions.h>
namespace Wccl { namespace Wccl {
namespace Matching {
/** /**
* Class for "optional" condition of match * Class for "optional" condition of match
...@@ -47,6 +48,7 @@ protected: ...@@ -47,6 +48,7 @@ protected:
private: private:
const boost::shared_ptr<ConjConditions> _conditions; const boost::shared_ptr<ConjConditions> _conditions;
}; };
} /* end ns Matching */
} /* end ns Wccl */ } /* end ns Wccl */
#endif // LIBWCCL_OPS_MATCH_CONDITIONS_OPTIONALMATCH_H #endif // LIBWCCL_OPS_MATCH_CONDITIONS_OPTIONALMATCH_H
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <sstream> #include <sstream>
namespace Wccl { namespace Wccl {
namespace Matching {
RepeatedMatch::RepeatedMatch(const boost::shared_ptr<ConjConditions>& conditions) RepeatedMatch::RepeatedMatch(const boost::shared_ptr<ConjConditions>& conditions)
: _conditions(conditions) : _conditions(conditions)
...@@ -40,4 +41,5 @@ std::ostream& RepeatedMatch::write_to(std::ostream& ostream) const ...@@ -40,4 +41,5 @@ std::ostream& RepeatedMatch::write_to(std::ostream& ostream) const
return ostream << name() << *_conditions; return ostream << name() << *_conditions;
} }
} /* end ns Matching */
} /* end ns Wccl */ } /* end ns Wccl */
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <libwccl/ops/match/conditions/conjconditions.h> #include <libwccl/ops/match/conditions/conjconditions.h>
namespace Wccl { namespace Wccl {
namespace Matching {
/** /**
* Class for "repeat" condition of match * Class for "repeat" condition of match
...@@ -49,6 +50,7 @@ private: ...@@ -49,6 +50,7 @@ private:
const boost::shared_ptr<ConjConditions> _conditions; const boost::shared_ptr<ConjConditions> _conditions;
}; };
} /* end ns Matching */
} /* end ns Wccl */ } /* end ns Wccl */
#endif // LIBWCCL_OPS_MATCH_CONDITIONS_REPEATEDMATCH_H #endif // LIBWCCL_OPS_MATCH_CONDITIONS_REPEATEDMATCH_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment