diff --git a/libwccl/parser/grammar.g b/libwccl/parser/grammar.g index 03542d3f35a051173bca2b898a721e20afd06b34..2756b82a8b5f203380daa0a444e9dcbf1f3c3249 100644 --- a/libwccl/parser/grammar.g +++ b/libwccl/parser/grammar.g @@ -79,6 +79,7 @@ header { #include <libwccl/ops/match/conditions/optionalmatch.h> #include <libwccl/ops/match/conditions/repeatedmatch.h> #include <libwccl/ops/match/conditions/conjconditions.h> + #include <libwccl/ops/match/conditions/tokencondition.h> #include <libwccl/ops/match/actions/markmatch.h> #include <libwccl/ops/match/actions/unmarkmatch.h> @@ -1904,8 +1905,23 @@ match_cond_all returns [boost::shared_ptr<const MatchCondition> ret] : ret = match_cond_optional [tagset, vars] | ret = match_cond_repeate [tagset, vars] + | ret = match_cond_token [tagset, vars] ; +// Match condition - token (wraps a L0 predicate) +// Returns boost::shared_ptr<const MatchCondition> +match_cond_token + [const Corpus2::Tagset& tagset, Variables& vars] + returns [boost::shared_ptr<const TokenCondition> ret] +{ + boost::shared_ptr<Function<Bool> > bool_op; +} + : bool_op = bool_operator [tagset, vars] { + ret = boost::make_shared<TokenCondition>(bool_op); + } +; + + // Match condition - optional // Returns boost::shared_ptr<OptionalMatch> match_cond_optional