From 5f7bbb419fcdf328aa7f81f5b4f17db739d26790 Mon Sep 17 00:00:00 2001 From: ilor <kailoran@gmail.com> Date: Thu, 21 Apr 2011 14:40:33 +0200 Subject: [PATCH] token condition match (L0 predicate wrappers) in grammar --- libwccl/parser/grammar.g | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libwccl/parser/grammar.g b/libwccl/parser/grammar.g index 03542d3..2756b82 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 -- GitLab