Newer
Older
if (p_false) {
op.reset(new Conditional<Position>(test, p_true, p_false));
}
else {
op.reset(new Conditional<Position>(test, p_true));
}
}
| Q_MARK
p_true = position_operator [scope]
Q_MARK
test = bool_operator [scope] {
op.reset(new Conditional<Position>(test, p_true));
}
// ----------------------------------------------------------------------------
// Taking position of a first token in a match
// first(Match)
position_first_token [ParsingScope& scope]
returns [boost::shared_ptr<Function<Position> > ret]
{
boost::shared_ptr<Function<Match> > m;
}
: "first" LPAREN m = match_operator [scope] RPAREN {
ret.reset(new FirstToken(m));
}
;
// ----------------------------------------------------------------------------
// Taking position of a first token in a match
// last(Match)
position_last_token [ParsingScope& scope]
returns [boost::shared_ptr<Function<Position> > ret]
{
boost::shared_ptr<Function<Match> > m;
}
: "last" LPAREN m = match_operator [scope] RPAREN {
ret.reset(new LastToken(m));
}
;
///////////////////////////////////////////////////////////////////////////////
// Returns boost::shared_ptr<Function<StrSet> >
///////////////////////////////////////////////////////////////////////////////
strset_operator [ParsingScope& scope]
returns [boost::shared_ptr<Function<StrSet> > ret]
: ret = strset_orth [scope]
| ret = strset_base [scope]
| ret = strset_prop [scope]
| ret = strset_lower [scope]
| ret = strset_upper [scope]
| ret = strset_affix [scope]
| ret = strset_var_val [scope]
| ret = strset_condition [scope]
| ret = strset_union [scope]
| ret = strset_intersection [scope]
Adam Radziszewski
committed
| ret = strset_anninter [scope]
//
| LPAREN ret = strset_operator [scope] RPAREN
;
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
// ----------------------------------------------------------------------------
// comma-separated strset operators
strset_operator_comma_sep
[ParsingScope& scope]
returns
[boost::shared_ptr< std::vector<boost::shared_ptr<Function<StrSet> > > > ret_v]
{
boost::shared_ptr<Function<StrSet> > pred;
ret_v.reset(
new std::vector<boost::shared_ptr<Function<StrSet> > >
);
}
: pred = strset_operator [scope] {
ret_v->push_back(pred);
}
(
COMMA pred = strset_operator [scope] {
ret_v->push_back(pred);
}
)*
;
// ----------------------------------------------------------------------------
// Wrapper from Function<StrSet> to Operator<StrSet>
functional_operator_strset
[ParsingScope& scope]
returns [boost::shared_ptr<Operator<StrSet> > op]
{
boost::shared_ptr<Function<StrSet> > body;
}
: body = strset_operator [scope] {
op.reset(new Operator<StrSet>(body, scope.variables()));
}
;
// ----------------------------------------------------------------------------
// Orth operator.
strset_orth
returns [boost::shared_ptr<Function<StrSet> > ret]
boost::shared_ptr<Function<Position> > pos;
: "orth" LBRACKET pos = position_operator [scope] RBRACKET {
ret.reset(new GetOrth(pos));
// ----------------------------------------------------------------------------
// Base operator.
strset_base
returns [boost::shared_ptr<Function<StrSet> > ret]
boost::shared_ptr<Function<Position> > pos;
: "base" LBRACKET pos = position_operator [scope] RBRACKET {
// ----------------------------------------------------------------------------
// Token-level property value operator.
strset_prop
[ParsingScope& scope]
returns [boost::shared_ptr<Function<StrSet> > ret]
{
boost::shared_ptr<Function<Position> > pos;
boost::shared_ptr<Function<StrSet> > keys;
}
: "prop" LPAREN
pos = position_operator [scope] COMMA
keys = strset_operator [scope]
RPAREN {
ret.reset(new PropVal(pos, keys));
}
;
// ----------------------------------------------------------------------------
// Lower operator.
strset_lower
returns [boost::shared_ptr<Function<StrSet> > ret]
boost::shared_ptr<Function<StrSet> > o_ret;
: "lower" LPAREN o_ret = strset_operator [scope] RPAREN {
ret.reset(new ToLower(o_ret));
// ----------------------------------------------------------------------------
// Upper operator.
strset_upper
returns [boost::shared_ptr<Function<StrSet> > ret]
boost::shared_ptr<Function<StrSet> > o_ret;
: "upper" LPAREN o_ret = strset_operator [scope] RPAREN {
ret.reset(new ToUpper(o_ret));
// ----------------------------------------------------------------------------
// Affix operator.
strset_affix
returns [boost::shared_ptr<Function<StrSet> > ret]
boost::shared_ptr<Function<StrSet> > o_ret;
: "affix" LPAREN
o_ret = strset_operator [scope] COMMA offset = number
RPAREN {
ret.reset(new Affix(o_ret, offset));
}
// ----------------------------------------------------------------------------
// A wrapper for strset value and strset variable
strset_var_val
returns [boost::shared_ptr<Function<StrSet> > op]
: op = strset_value
| op = strset_variable [scope.variables()]
// ----------------------------------------------------------------------------
// Condition of the strset value
// if (Bool, StrSet, StrSet)
// ? StrSet ? Bool : []
strset_condition
returns [boost::shared_ptr<Function<StrSet> > op]
boost::shared_ptr<Function<Bool> > test;
boost::shared_ptr<Function<StrSet> > p_true, p_false;
: "if" LPAREN test = bool_operator [scope] COMMA
p_true = strset_operator [scope]
(COMMA p_false = strset_operator [scope])?
RPAREN {
Paweł Kędzia
committed
if (p_false) {
op.reset(new Conditional<StrSet>(test, p_true, p_false));
Paweł Kędzia
committed
}
else {
op.reset(new Conditional<StrSet>(test, p_true));
Paweł Kędzia
committed
}
Paweł Kędzia
committed
| Q_MARK
p_true = strset_operator [scope]
Paweł Kędzia
committed
Q_MARK
test = bool_operator [scope] {
op.reset(new Conditional<StrSet>(test, p_true));
Paweł Kędzia
committed
}
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
// ----------------------------------------------------------------------------
// Union operator, strset
strset_union
[ParsingScope& scope]
returns [boost::shared_ptr<Function<StrSet> > ret]
{
boost::shared_ptr<std::vector<boost::shared_ptr<Function<StrSet> > > > sets;
}
: "union" LPAREN
sets = strset_operator_comma_sep [scope]
RPAREN {
ret.reset(new SetUnion<StrSet>(sets));
}
;
// ----------------------------------------------------------------------------
// Intersection operator, strset
strset_intersection
[ParsingScope& scope]
returns [boost::shared_ptr<Function<StrSet> > ret]
{
boost::shared_ptr<std::vector<boost::shared_ptr<Function<StrSet> > > > sets;
}
: "intersection" LPAREN
sets = strset_operator_comma_sep [scope]
RPAREN {
ret.reset(new SetIntersection<StrSet>(sets));
}
;
Adam Radziszewski
committed
strset_anninter
[ParsingScope& scope]
returns [boost::shared_ptr<Function<StrSet> > op]
{
boost::shared_ptr<Function<Position> > pos;
boost::shared_ptr<Function<StrSet> > in_strs;
}
: "anninter"
LPAREN
pos = position_operator [scope]
COMMA
in_strs = strset_operator [scope]
RPAREN
{
op.reset(new AnnInter(pos, in_strs));
}
;
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());
}
;
///////////////////////////////////////////////////////////////////////////////
// Returns boost::shared_ptr<Function<Bool> >
///////////////////////////////////////////////////////////////////////////////
bool_operator
returns [boost::shared_ptr<Function<Bool> > ret]
: ret = bool_and [scope]
| ret = bool_or [scope]
| ret = bool_nor [scope]
| ret = bool_var_val [scope]
| ret = bool_regex [scope]
| ret = bool_inout [scope]
| ret = bool_condition [scope]
// setvar:
| ret = setvar_operator [scope]
// empty
| ret = empty_operator [scope]
// equal/in/inter:
| ret = equal_operator [scope]
| ret = in_operator [scope]
| ret = inter_operator [scope]
| ret = bool_iteration [scope]
// agreement
| ret = bool_agreement [scope]
//
| ret = bool_ann [scope]
| ret = bool_annsub [scope]
// singular/amb
| ret = bool_ambiguous [scope]
| ret = bool_singular [scope]
ilor
committed
// debug operators
| ret = debug_print_operator [scope]
| LPAREN ret = bool_operator [scope] RPAREN
// ----------------------------------------------------------------------------
// wrapper from Function<Bool> to Operator<Bool>
functional_operator_bool
[ParsingScope& scope]
returns [boost::shared_ptr<Operator<Bool> > op]
{
boost::shared_ptr<Function<Bool> > body;
}
: body = bool_operator [scope] {
op.reset(new Operator<Bool>(body, scope.variables()));
}
;
// ----------------------------------------------------------------------------
// comma-separated predicates (bool operators)
bool_operator_comma_sep
returns
[boost::shared_ptr<std::vector<boost::shared_ptr<Function<Bool> > > > ret_v]
boost::shared_ptr<Function<Bool> > pred;
new std::vector<boost::shared_ptr<Function<Bool> > >
: pred = bool_operator [scope] {
ret_v->push_back(pred);
}
(
COMMA pred = bool_operator [scope] {
ret_v->push_back(pred);
}
)*
// ----------------------------------------------------------------------------
// And operator.
bool_and
returns [boost::shared_ptr<Function<Bool> > op]
boost::shared_ptr<std::vector<boost::shared_ptr<Function<Bool> > > > ret_v;
: "and" LPAREN ret_v = bool_operator_comma_sep [scope] RPAREN {
op.reset(new And(ret_v));
// ----------------------------------------------------------------------------
// Or operator
bool_or
returns [boost::shared_ptr<Function<Bool> > op]
boost::shared_ptr<std::vector<boost::shared_ptr<Function<Bool> > > > ret_v;
: "or" LPAREN ret_v = bool_operator_comma_sep [scope] RPAREN {
op.reset(new Or(ret_v));
// ----------------------------------------------------------------------------
// Nor/Not operator
bool_nor
returns [boost::shared_ptr<Function<Bool> > op]
boost::shared_ptr<std::vector<boost::shared_ptr<Function<Bool> > > > ret_v;
: "not" LPAREN ret_v = bool_operator_comma_sep [scope] RPAREN {
op.reset(new Nor(ret_v));
// ----------------------------------------------------------------------------
// Wrapper for bool value and bool variable
bool_var_val
returns [boost::shared_ptr<Function<Bool> > op]
: op = bool_value
| op = bool_variable [scope.variables()]
// ----------------------------------------------------------------------------
// Regex operator
bool_regex
returns [boost::shared_ptr<Function<Bool> > op]
{
boost::shared_ptr<Function<StrSet> > expr;
}
: "regex"
LPAREN
expr = strset_operator [scope] COMMA reg: STRING
RPAREN {
op.reset(new Regex(expr, token_ref_to_ustring(reg)));
}
;
// ----------------------------------------------------------------------------
// Input/output operator
bool_inout
returns [boost::shared_ptr<Function<Bool> > op]
{
boost::shared_ptr<Function<Position> > ret_pos;
}
: "inside" LPAREN ret_pos = position_operator [scope] RPAREN {
op.reset(new IsInside(ret_pos));
}
| "outside" LPAREN ret_pos = position_operator [scope] RPAREN {
op.reset(new IsOutside(ret_pos));
}
;
// ----------------------------------------------------------------------------
// if (Bool, Bool, Bool)
// ? Bool ? Bool : False
bool_condition
returns [boost::shared_ptr<Function<Bool> > op]
{
boost::shared_ptr<Function<Bool> > test, p_true, p_false;
}
: "if" LPAREN test = bool_operator [scope] COMMA
p_true = bool_operator [scope]
(COMMA p_false = bool_operator [scope])?
RPAREN {
if (p_false) {
op.reset(new Conditional<Bool>(test, p_true, p_false));
}
else {
op.reset(new Conditional<Bool>(test, p_true));
}
}
| Q_MARK
p_true = bool_operator [scope]
Q_MARK
test = bool_operator [scope] {
op.reset(new Conditional<Bool>(test, p_true));
}
;
// ----------------------------------------------------------------------------
// Equal operator
equal_operator
returns [boost::shared_ptr<Function<Bool> > op]
boost::shared_ptr<Function<TSet> > t1, t2;
boost::shared_ptr<Function<Bool> > b1, b2;
boost::shared_ptr<Function<StrSet> > s1, s2;
boost::shared_ptr<Function<Position> > p1, p2;
: "equal" LPAREN
(position_operator [scope]) =>
p1 = position_operator [scope] COMMA
p2 = position_operator [scope] {
op.reset(new Equals<Position>(p1, p2));
(symset_operator [scope]) =>
t1 = symset_operator [scope] COMMA
t2 = symset_operator [scope] {
op.reset(new Equals<TSet>(t1, t2));
}
)
|
(strset_operator [scope]) =>
s1 = strset_operator [scope] COMMA
s2 = strset_operator [scope] {
op.reset(new Equals<StrSet>(s1, s2));
}
)
|
(
b1 = bool_operator [scope] COMMA
b2 = bool_operator [scope] {
op.reset(new Equals<Bool>(b1, b2));
// ----------------------------------------------------------------------------
// In operator
in_operator
returns [boost::shared_ptr<Function<Bool> > op]
boost::shared_ptr<Function<TSet> > t1, t2;
boost::shared_ptr<Function<StrSet> > s1, s2;
Paweł Kędzia
committed
}
:
"in" LPAREN
(symset_operator [scope]) =>
t1 = symset_operator [scope] COMMA
t2 = symset_operator [scope] {
op.reset(new IsSubsetOf<TSet>(t1, t2));
s1 = strset_operator [scope] COMMA
s2 = strset_operator [scope] {
op.reset(new IsSubsetOf<StrSet>(s1, s2));
;
// ----------------------------------------------------------------------------
// Inter operator
inter_operator
returns [boost::shared_ptr<Function<Bool> > op]
boost::shared_ptr<Function<TSet> > t1, t2;
boost::shared_ptr<Function<StrSet> > s1, s2;
:
"inter" LPAREN
(symset_operator [scope]) =>
t1 = symset_operator [scope] COMMA
t2 = symset_operator [scope] {
op.reset(new Intersects<TSet>(t1, t2));
s1 = strset_operator [scope] COMMA
s2 = strset_operator [scope] {
op.reset(new Intersects<StrSet>(s1, s2));
// ----------------------------------------------------------------------------
// Annotation operator.
bool_ann
returns [boost::shared_ptr<Function<Bool> > op]
{
boost::shared_ptr< Function<Match> > match_from;
boost::shared_ptr< Function<Match> > match_to;
}
: "ann" LPAREN
match_from = match_operator [scope] COMMA
(match_to = match_operator [scope] COMMA)?
ilor
committed
channel : STRING
ilor
committed
op.reset(new Ann(match_from, match_to, token_ref_to_std_string(channel)));
ilor
committed
op.reset(new Ann(match_from, token_ref_to_std_string(channel)));
// ----------------------------------------------------------------------------
// Annotation-sub operator.
bool_annsub
returns [boost::shared_ptr<Function<Bool> > op]
{
boost::shared_ptr< Function<Match> > match_from;
boost::shared_ptr< Function<Match> > match_to;
}
: "annsub" LPAREN
match_from = match_operator [scope] COMMA
(match_to = match_operator [scope] COMMA)?
ilor
committed
channel : STRING
ilor
committed
op.reset(new AnnSub(match_from, match_to, token_ref_to_std_string(channel)));
ilor
committed
op.reset(new AnnSub(match_from, token_ref_to_std_string(channel)));
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
// ----------------------------------------------------------------------------
// Ambiguity checking operator
bool_ambiguous
[ParsingScope& scope]
returns [boost::shared_ptr<Function<Bool> > ret]
{
boost::shared_ptr<Function<TSet> > tf;
boost::shared_ptr<Function<StrSet> > sf;
boost::shared_ptr<Function<Position> > pf;
}
: "ambiguous" LPAREN
(
(position_operator [scope]) =>
(
pf = position_operator [scope] {
ret.reset(new IsAmbiguous<Position>(pf));
}
)
|
(symset_operator [scope]) =>
(
tf = symset_operator [scope] {
ret.reset(new IsAmbiguous<TSet>(tf));
}
)
|
(strset_operator [scope]) =>
(
sf = strset_operator [scope] {
ret.reset(new IsAmbiguous<StrSet>(sf));
}
)
)
RPAREN
;
// ----------------------------------------------------------------------------
// Tag singularity checking operator
bool_singular
[ParsingScope& scope]
returns [boost::shared_ptr<Function<Bool> > ret]
{
boost::shared_ptr< Function<TSet> > v;
}
: "singular" LPAREN
v = symset_operator [scope]
RPAREN
{
ret.reset(new IsSingular(v, scope.tagset()));
}
;
ilor
committed
// ----------------------------------------------------------------------------
// Debug printing:
debug_print_operator
ilor
committed
returns [boost::shared_ptr<Function<Bool> > ret]
{
boost::shared_ptr<FunctionBase> v;
}
: "debug" LPAREN
(
(position_operator [scope]) =>
ilor
committed
(
v = position_operator [scope] {
ilor
committed
ret.reset(new DebugPrint(v));
}
)
|
(symset_operator [scope]) =>
ilor
committed
(
v = symset_operator [scope] {
ilor
committed
ret.reset(new DebugPrint(v));
}
)
|
(strset_operator [scope]) =>
ilor
committed
(
v = strset_operator [scope] {
ilor
committed
ret.reset(new DebugPrint(v));
}
)
|
ilor
committed
(
ilor
committed
ret.reset(new DebugPrint(v));
}
)
v = match_operator [scope] {
ret.reset(new DebugPrint(v));
}
)
ilor
committed
)
RPAREN
;
// ----------------------------------------------------------------------------
// Iterations:
bool_iteration
returns [boost::shared_ptr<Function<Bool> > ret]
{
int min_match = 0;
boost::shared_ptr<Function<Bool> > expr;
boost::shared_ptr<Function<Position> > lpos, rpos;
boost::shared_ptr<VariableAccessor<Position> > pacc;
}
: "only" LPAREN
lpos = position_operator [scope] COMMA
rpos = position_operator [scope] COMMA
pacc = position_variable_acc [scope.variables()] COMMA
expr = bool_operator [scope]
RPAREN {
ret.reset(new Only(lpos, rpos, *pacc, expr));
}
| "atleast" LPAREN
lpos = position_operator [scope] COMMA
rpos = position_operator [scope] COMMA
pacc = position_variable_acc [scope.variables()] COMMA
expr = bool_operator [scope] COMMA
min_match = number
RPAREN {
ret.reset(new AtLeast(lpos, rpos, *pacc, expr, min_match));
}
| "llook" LPAREN //note inverted rpos/lpos order
rpos = position_operator [scope] COMMA
lpos = position_operator [scope] COMMA
pacc = position_variable_acc [scope.variables()] COMMA
expr = bool_operator [scope]
RPAREN {
ret.reset(new LeftLook(lpos, rpos, *pacc, expr));
}
| "rlook" LPAREN
lpos = position_operator [scope] COMMA
rpos = position_operator [scope] COMMA
pacc = position_variable_acc [scope.variables()] COMMA
expr = bool_operator [scope]
RPAREN {
ret.reset(new RightLook(lpos, rpos, *pacc, expr));
}
| "skip" LPAREN
lpos = position_operator [scope] COMMA
pacc = position_variable_acc [scope.variables()] COMMA
expr = bool_operator [scope] COMMA
offset = number
RPAREN {
ret.reset(new Skip(lpos, *pacc, expr, offset));
}
// ----------------------------------------------------------------------------
// Agreement operator: agr, agrpp, wagr
bool_agreement
returns [boost::shared_ptr<Function<Bool> > ret]
{
boost::shared_ptr<Function<TSet> > expr;
boost::shared_ptr<Function<Position> > lpos, rpos;
}
: "agr" LPAREN
lpos = position_operator [scope] COMMA
rpos = position_operator [scope] COMMA
expr = symset_operator [scope]
ret.reset(new StrongAgreement(lpos, rpos, expr, scope.tagset()));
}
| "agrpp" LPAREN
lpos = position_operator [scope] COMMA
rpos = position_operator [scope] COMMA
expr = symset_operator [scope]
ret.reset(new PointAgreement(lpos, rpos, expr, scope.tagset()));
}
| "wagr" LPAREN
lpos = position_operator [scope] COMMA
rpos = position_operator [scope] COMMA
expr = symset_operator [scope]
ret.reset(new WeakAgreement(lpos, rpos, expr, scope.tagset()));
}
;
// ----------------------------------------------------------------------------
// Parse operator on L1 level
bool_phrase
: ret = bool_phrase_annotation [scope]
| ret = bool_phrase_iteration [scope]
;
// ----------------------------------------------------------------------------
// Annotation operator: phrase, phrase_beg, phrase_end, phrase_whole, phrase_pp
bool_phrase_annotation
returns [boost::shared_ptr<Function<Bool> > ret]
{
boost::shared_ptr<Function<Position> > lpos, rpos;
}
lpos = position_operator [scope] COMMA n1: STRING
Adam Radziszewski
committed
ret.reset(new AnnToken(lpos, token_ref_to_std_string(n1), AnnToken::O_ANY));
lpos = position_operator [scope] COMMA n2: STRING
Adam Radziszewski
committed
ret.reset(new AnnToken(lpos, token_ref_to_std_string(n2), AnnToken::O_FIRST));
lpos = position_operator [scope] COMMA n3: STRING
Adam Radziszewski
committed
ret.reset(new AnnToken(lpos, token_ref_to_std_string(n3), AnnToken::O_LAST));
| "isannhead" LPAREN
lpos = position_operator [scope] COMMA n4: STRING
Adam Radziszewski
committed
ret.reset(new AnnToken(lpos, token_ref_to_std_string(n4), AnnToken::O_HEAD));
lpos = position_operator [scope] COMMA
rpos = position_operator [scope] COMMA n5: STRING
| "isannpp" LPAREN
lpos = position_operator [scope] COMMA
rpos = position_operator [scope] COMMA n6: STRING
RPAREN {
// TODO
}
;
// ----------------------------------------------------------------------------
// Phrase iteration operator: lphrase, rphrase
bool_phrase_iteration
returns [boost::shared_ptr<Function<Bool> > ret]
{
boost::shared_ptr<Function<Position> > position;
boost::shared_ptr<VarGetter<Position> > var_position;
}
position = position_operator [scope] COMMA
var_position = position_variable [scope.variables()] COMMA
position = position_operator [scope] COMMA
var_position = position_variable [scope.variables()] COMMA
n2: STRING
RPAREN {
// TODO
}
;
// ----------------------------------------------------------------------------
// Setvar operator
// Returns boost::shared_ptr<Function<Bool> >
// ----------------------------------------------------------------------------
setvar_operator
returns [boost::shared_ptr<Function<Bool> > ret]
: "setvar" LPAREN
(
ret = position_setvar [scope]
| ret = bool_setvar [scope]
| ret = strset_setvar [scope]
| ret = symset_setvar [scope]
)
RPAREN
;
// ----------------------------------------------------------------------------
// Setvar for position
position_setvar
returns [boost::shared_ptr<Function<Bool> > op]
boost::shared_ptr<Function<Position> > ret_op;
boost::shared_ptr<VariableAccessor<Position> > ret_acc;
: ret_acc = position_variable_acc [scope.variables()]
COMMA
ret_op = position_operator [scope] {
op.reset(new VarSetter<Position>(*ret_acc, ret_op));
// ----------------------------------------------------------------------------
// Setvar for bool
bool_setvar
returns [boost::shared_ptr<Function<Bool> > op]
boost::shared_ptr<Function<Bool> > ret_op;
boost::shared_ptr<VariableAccessor<Bool> > ret_acc;
: ret_acc = bool_variable_acc [scope.variables()]
COMMA
ret_op = bool_operator [scope] {
op.reset(new VarSetter<Bool>(*ret_acc, ret_op));
// ----------------------------------------------------------------------------
// Setvar for strset
strset_setvar
returns [boost::shared_ptr<Function<Bool> > op]
boost::shared_ptr<Function<StrSet> > ret_op;
boost::shared_ptr<VariableAccessor<StrSet> > ret_acc;
: ret_acc = strset_variable_acc [scope.variables()]
COMMA
ret_op = strset_operator [scope] {
op.reset(new VarSetter<StrSet>(*ret_acc, ret_op));
Paweł Kędzia
committed
}
// ----------------------------------------------------------------------------
// Setvar for symset
symset_setvar
returns [boost::shared_ptr<Function<Bool> > op]
boost::shared_ptr<Function<TSet> > ret_op;
boost::shared_ptr<VariableAccessor<TSet> > ret_acc;
: ret_acc = symset_variable_acc [scope.variables()]
COMMA
ret_op = symset_operator [scope] {
op.reset(new VarSetter<TSet>(*ret_acc, ret_op));
}
;
// ----------------------------------------------------------------------------
// empty() operator
// Returns boost::shared_ptr<Function<Bool> >
//----------------------------------------------------------------------------
empty_operator
returns [boost::shared_ptr<Function<Bool> > op]
: "empty" LPAREN
(
)
RPAREN
;
/*
empty_operator
returns [boost::shared_ptr<Function<Bool> > op]
: "empty" LPAREN
(
op = match_empty [scope]
| op = symset_empty [scope]
| op = strset_empty [scope]
)
RPAREN
;