diff --git a/libwccl/parser/grammar.g b/libwccl/parser/grammar.g index 94ccdacff412da93b04f41600e90b43e0f3efbbf..67f50a108bc3e8dbc203f1f406202ecdec048c56 100644 --- a/libwccl/parser/grammar.g +++ b/libwccl/parser/grammar.g @@ -81,6 +81,7 @@ header { #include <libwccl/ops/match/applyoperator.h> #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/conjconditions.h> #include <libwccl/ops/match/conditions/tokencondition.h> #include <libwccl/ops/match/actions/markmatch.h> @@ -1998,6 +1999,7 @@ match_cond_all : ret = match_cond_optional [tagset, vars] | ret = match_cond_repeate [tagset, vars] | ret = match_cond_token [tagset, vars] + | ret = match_cond_is ; // Match condition - token (wraps a L0 predicate) @@ -2040,6 +2042,15 @@ match_cond_repeate } ; +// Match condition - is(ann_name) +// Returns boost::shared_ptr<IsAnnotatedAs> +match_cond_is + returns [boost::shared_ptr<IsAnnotatedAs> mtch] + : "is" LPAREN annotation_name: STRING RPAREN { + mtch.reset(new IsAnnotatedAs(token_ref_to_std_string(annotation_name))); + } +; + // ---------------------------------------------------------------------------- // Match actions. Match action can be mark or unmark