From e23085e34d98bdc5bde4166213dbedccb3d294c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20K=C4=99dzia?= <pawel.kedzia@pwr.wroc.pl>
Date: Thu, 21 Apr 2011 22:31:41 +0200
Subject: [PATCH] Added text() operator to the grammar

---
 libwccl/parser/grammar.g | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/libwccl/parser/grammar.g b/libwccl/parser/grammar.g
index 67f50a1..ffebe4e 100644
--- a/libwccl/parser/grammar.g
+++ b/libwccl/parser/grammar.g
@@ -82,6 +82,7 @@ header {
 	#include <libwccl/ops/match/conditions/optionalmatch.h>
 	#include <libwccl/ops/match/conditions/repeatedmatch.h>
 	#include <libwccl/ops/match/conditions/isannotatedas.h>
+	#include <libwccl/ops/match/conditions/matchtext.h>
 	#include <libwccl/ops/match/conditions/conjconditions.h>
 	#include <libwccl/ops/match/conditions/tokencondition.h>
 	#include <libwccl/ops/match/actions/markmatch.h>
@@ -2000,6 +2001,7 @@ match_cond_all
 	| ret = match_cond_repeate  [tagset, vars]
 	| ret = match_cond_token    [tagset, vars]
 	| ret = match_cond_is
+	| ret = match_cond_text
 ;
 
 // Match condition - token (wraps a L0 predicate)
@@ -2051,6 +2053,15 @@ match_cond_is
 	}
 ;
 
+// Match condition - text(text)
+// Returns boost::shared_ptr<MatchText>
+match_cond_text
+	returns [boost::shared_ptr<MatchText> mtch]
+	: "text" LPAREN txt: STRING RPAREN {
+		mtch.reset(new MatchText(token_ref_to_ustring(txt)));
+	}
+;
+
 // ----------------------------------------------------------------------------
 
 // Match actions. Match action can be mark or unmark
-- 
GitLab