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

Added longest() operator to the grammar

parent 5cb9c82a
Branches
No related merge requests found
......@@ -86,6 +86,7 @@ header {
#include <libwccl/ops/match/conditions/conjconditions.h>
#include <libwccl/ops/match/conditions/tokencondition.h>
#include <libwccl/ops/match/conditions/oneof.h>
#include <libwccl/ops/match/conditions/longest.h>
#include <libwccl/ops/match/actions/markmatch.h>
#include <libwccl/ops/match/actions/unmarkmatch.h>
#include <libwccl/ops/functions/match/submatch.h>
......@@ -2023,6 +2024,8 @@ match_cond_all
: ret = match_cond_optional [tagset, vars]
| ret = match_cond_repeate [tagset, vars]
| ret = match_cond_token [tagset, vars]
| ret = match_cond_oneof [tagset, vars]
| ret = match_cond_longest [tagset, vars]
| ret = match_cond_is
| ret = match_cond_text
;
......@@ -2098,6 +2101,19 @@ match_cond_oneof
}
;
// Match condition - longest(variant1(v1), variant(v2), ...)
// Returns boost::shared_ptr<Longest>
match_cond_longest
[const Corpus2::Tagset& tagset, Variables& vars]
returns [boost::shared_ptr<Longest> lng]
{
boost::shared_ptr<std::vector<ConjConditions> > variants;
}
: "longest" LPAREN variants = match_variants [tagset, vars] RPAREN {
lng.reset(new Longest(variants));
}
;
// ----------------------------------------------------------------------------
// Match actions. Match action can be mark or unmark
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment