From 4e9943232e8351bc9d7d4eccf2161755d0681fe0 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:16:13 +0200 Subject: [PATCH] Added ann() operator to the grammar --- libwccl/parser/grammar.g | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/libwccl/parser/grammar.g b/libwccl/parser/grammar.g index 976ab8d..5ccfb11 100644 --- a/libwccl/parser/grammar.g +++ b/libwccl/parser/grammar.g @@ -1061,7 +1061,8 @@ bool_operator | ret = bool_agreement [tagset, vars] // | ret = bool_phrase [tagset, vars] - // + // annotation + | ret = bool_ann [tagset, vars] | ret = bool_annsub [tagset, vars] // debug operators | ret = debug_print_operator [tagset, vars] @@ -1305,6 +1306,32 @@ inter_operator RPAREN ; +// ---------------------------------------------------------------------------- +// Annotation operator. +bool_ann + [const Corpus2::Tagset& tagset, Variables& vars] + returns [boost::shared_ptr<Function<Bool> > op] +{ + boost::shared_ptr< Function<Match> > match_from; + boost::shared_ptr< Function<Match> > match_to; + std::string chan_name; +} + : "ann" LPAREN + match_from = match_fit [tagset, vars] COMMA + (match_to = match_fit [tagset, vars] COMMA)? + name : STRING + RPAREN { + if (match_to) { + // TODO + // op.reset(new Ann(match_from, match_to, chan_name)); + } else { + // TODO + // op.reset(new Ann(match_from, chan_name)); + } + } +; + + // ---------------------------------------------------------------------------- // Annotation-sub operator. bool_annsub -- GitLab