diff --git a/libwccl/parser/grammar.g b/libwccl/parser/grammar.g index 976ab8de021e49bd8ca72b8b1bde96e18af29b23..5ccfb115e7c2ea19b8c87b2b36bf4f73ce2f7840 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