Skip to content
Snippets Groups Projects
Commit 2d156086 authored by Adam Wardynski's avatar Adam Wardynski
Browse files

Add lex() operator to parser grammar.

parent 0a3f5bb2
No related branches found
No related tags found
No related merge requests found
...@@ -50,6 +50,7 @@ header { ...@@ -50,6 +50,7 @@ header {
#include <libwccl/ops/functions/strset/toupper.h> #include <libwccl/ops/functions/strset/toupper.h>
#include <libwccl/ops/functions/strset/tolower.h> #include <libwccl/ops/functions/strset/tolower.h>
#include <libwccl/ops/functions/strset/getlemmas.h> #include <libwccl/ops/functions/strset/getlemmas.h>
#include <libwccl/ops/functions/strset/lextranslator.h>
#include <libwccl/ops/functions/tset/agrfilter.h> #include <libwccl/ops/functions/tset/agrfilter.h>
#include <libwccl/ops/functions/tset/catfilter.h> #include <libwccl/ops/functions/tset/catfilter.h>
...@@ -975,6 +976,7 @@ strset_operator [ParsingScope& scope] ...@@ -975,6 +976,7 @@ strset_operator [ParsingScope& scope]
| ret = strset_affix [scope] | ret = strset_affix [scope]
| ret = strset_var_val [scope] | ret = strset_var_val [scope]
| ret = strset_condition [scope] | ret = strset_condition [scope]
| ret = strset_lex [scope]
// //
| LPAREN ret = strset_operator [scope] RPAREN | LPAREN ret = strset_operator [scope] RPAREN
; ;
...@@ -1086,6 +1088,22 @@ strset_condition ...@@ -1086,6 +1088,22 @@ strset_condition
} }
; ;
strset_lex
[ParsingScope& scope]
returns [boost::shared_ptr<Function<StrSet> > op]
{
boost::shared_ptr<Function<StrSet> > s;
}
: "lex" LPAREN s = strset_operator [scope] COMMA name : STRING RPAREN
{
op.reset(new LexTranslator(
s,
scope.lexicons().get_ptr(token_ref_to_std_string(name))));
}
exception catch [WcclError ex] {
throw ParserException(ex.what());
}
;
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Bool operator // Bool operator
// Returns boost::shared_ptr<Function<Bool> > // Returns boost::shared_ptr<Function<Bool> >
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment