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

Merge branch 'master' into win32-compat

parents 9c49566b ccb85ebf
Branches
No related merge requests found
...@@ -538,11 +538,16 @@ symset_condition ...@@ -538,11 +538,16 @@ symset_condition
position_operator position_operator
[const Corpus2::Tagset& tagset, Variables& vars] [const Corpus2::Tagset& tagset, Variables& vars]
returns [boost::shared_ptr<Function<Position> > ret] returns [boost::shared_ptr<Function<Position> > ret]
: ret = position_var_val [vars] :
| ret = position_relpos [tagset, vars] ( ret = position_var_val [vars]
| ret = position_condition [tagset, vars] | ret = position_condition [tagset, vars]
//
| LPAREN ret = position_operator [tagset, vars] RPAREN | LPAREN ret = position_operator [tagset, vars] RPAREN
)
( // if there is SIGNED_INT after the position, it is actually a relative position
i: SIGNED_INT {
ret.reset(new RelativePosition(ret, token_ref_to_int(i)));
}
)?
; ;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
...@@ -554,21 +559,6 @@ position_var_val ...@@ -554,21 +559,6 @@ position_var_val
| ret = position_variable [vars] | ret = position_variable [vars]
; ;
// ----------------------------------------------------------------------------
// Realtive position operator.
// TODO 2+2, actually relative gets position is possible only as relpos(...,...)
position_relpos
[const Corpus2::Tagset& tagset, Variables& vars]
returns [boost::shared_ptr<Function<Position> > ret]
{
int n = 0;
boost::shared_ptr<Function<Position> > pos;
}
: "relpos" LPAREN pos = position_operator [tagset, vars] COMMA n = number RPAREN {
ret.reset(new RelativePosition(pos, n));
}
;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Condition of the position value // Condition of the position value
// if (Bool, Position, Position) // if (Bool, Position, Position)
...@@ -1089,7 +1079,7 @@ SIGNED_INT ...@@ -1089,7 +1079,7 @@ SIGNED_INT
options { options {
paraphrase = "Signed integer"; paraphrase = "Signed integer";
} }
: ('-'|'+') ('0'..'9')+ : ('-'|'+') (' '!|'\t'!)* ('0'..'9')+
; ;
UNSIGNED_INT UNSIGNED_INT
......
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