Skip to content
Snippets Groups Projects
Commit 7a8c9289 authored by Paweł Kędzia's avatar Paweł Kędzia
Browse files

Added is() operator to the grammar

parent 23467661
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment