From 37faf56d2c8c74abcb207e8ddc0052b81b89b586 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20K=C4=99dzia?= <Pawel.Kedzia@pwr.wroc.pl>
Date: Tue, 19 Apr 2011 14:50:16 +0200
Subject: [PATCH] Added Constant<Match> rule

---
 libwccl/parser/grammar.g | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/libwccl/parser/grammar.g b/libwccl/parser/grammar.g
index ec2154c..53df790 100644
--- a/libwccl/parser/grammar.g
+++ b/libwccl/parser/grammar.g
@@ -78,6 +78,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/actions/markmatch.h>
 
 	// Unicode String
 	#include <unicode/uniset.h>
@@ -417,6 +418,18 @@ match_value
 	}
 ;
 
+// Constant match value
+// Returns boost::shared_ptr<Constant<Match> >
+match_value_const
+	returns [boost::shared_ptr<Constant<Match> > val]
+{
+	boost::shared_ptr<Match> m;
+}
+	: m = match_value {
+		val.reset(new Constant<Match>(*m));
+	}
+;
+
 // ----------------------------------------------------------------------------
 // Value used into match operator such as TOK[position] and ANN[position, name]
 // Returns boost::shared_ptr<MatchData>
@@ -434,7 +447,7 @@ token_match_value
 {
 	boost::shared_ptr<Position> p;
 }
-	: "TOK"LBRACKET p = position_literal RBRACKET {
+	: "TOK" LBRACKET p = position_literal RBRACKET {
 		val.reset(new TokenMatch(*p));
 	}
 ;
@@ -1927,10 +1940,10 @@ match_action
 ;
 
 // Match mark action
-// Returns ???
+// Returns 
 match_mark_action
 	[const Corpus2::Tagset& tagset, Variables& vars]
-	returns [boost::shared_ptr<MatchAction> m_act]
+	returns [boost::shared_ptr<MarkMatch> m_act]
 	: "mark" LPAREN /* TODO */ RPAREN
 ;
 
-- 
GitLab