diff --git a/libwccl/parser/grammar.g b/libwccl/parser/grammar.g index ec2154cf4dde23067a2d6fdd89583965cfada27a..53df7907d181bd8c6c1fd95fecf4ea4e47a28e24 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 ;