diff --git a/libwccl/parser/grammar.g b/libwccl/parser/grammar.g index 67f50a108bc3e8dbc203f1f406202ecdec048c56..ffebe4ef1cd0994e5f241c1137eee3f5d76d1156 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