Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WCCL
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Analysers
WCCL
Commits
bcbd29c4
Commit
bcbd29c4
authored
13 years ago
by
Adam Wardynski
Browse files
Options
Downloads
Patches
Plain Diff
Removing $_ variable - you can simply use "0".
parent
e52a1d93
Branches
Branches containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libwccl/ops/match/applyoperator.cpp
+3
-5
3 additions, 5 deletions
libwccl/ops/match/applyoperator.cpp
libwccl/ops/match/applyoperator.h
+0
-3
0 additions, 3 deletions
libwccl/ops/match/applyoperator.h
with
3 additions
and
8 deletions
libwccl/ops/match/applyoperator.cpp
+
3
−
5
View file @
bcbd29c4
...
...
@@ -5,13 +5,11 @@
namespace
Wccl
{
ApplyOperator
::
ApplyOperator
(
const
VariableAccessor
<
Position
>&
cur_iter_pos
,
const
VariableAccessor
<
Match
>&
matches
,
const
boost
::
shared_ptr
<
const
MatchOperator
>&
match_op
,
const
boost
::
shared_ptr
<
const
std
::
vector
<
boost
::
shared_ptr
<
MatchAction
>
>
>&
actions
,
const
boost
::
shared_ptr
<
const
std
::
vector
<
boost
::
shared_ptr
<
Function
<
Bool
>
>
>
>&
conditions
)
:
_cur_iter_pos
(
cur_iter_pos
),
_matches
(
matches
),
:
_matches
(
matches
),
_match_op
(
match_op
),
_actions
(
actions
),
_conditions
(
conditions
)
...
...
@@ -22,9 +20,9 @@ ApplyOperator::ApplyOperator(
void
ApplyOperator
::
execute
(
const
ActionExecContext
&
context
)
const
{
boost
::
shared_ptr
<
Position
>
iter_pos
=
context
.
variables
()
->
get_fast
(
_cur_iter_pos
);
boost
::
shared_ptr
<
Position
>
iter_pos
(
new
Position
(
0
)
);
boost
::
shared_ptr
<
MatchVector
>
matches
=
boost
::
dynamic_pointer_cast
<
MatchVector
>
(
context
.
variables
()
->
get_fast
(
_matches
));
boost
::
dynamic_pointer_cast
<
MatchVector
>
(
context
.
variables
()
->
get_fast
(
_matches
));
while
(
context
.
sentence_context
().
is_current_inside
())
{
// Set initial values of $_ and $m:_M variables for this iteration and launch the match:
iter_pos
->
set_value
(
0
);
...
...
This diff is collapsed.
Click to expand it.
libwccl/ops/match/applyoperator.h
+
0
−
3
View file @
bcbd29c4
...
...
@@ -17,14 +17,12 @@ class ApplyOperator : public Expression
public:
typedef
LogicalPredicate
::
BoolFunctionPtrVector
BoolFunctionPtrVector
;
/**
* @param cur_iter_pos Accessor to the "$_" variable
* @param matches Accessor to the "$m:_M" variable
* @param match_op "match" operator for apply
* @param actions "actions" section of apply, should not be empty
* @param conditions "cond" section of apply, empty by default
*/
ApplyOperator
(
const
VariableAccessor
<
Position
>&
cur_iter_pos
,
const
VariableAccessor
<
Match
>&
matches
,
const
boost
::
shared_ptr
<
const
MatchOperator
>&
match_op
,
const
boost
::
shared_ptr
<
const
std
::
vector
<
boost
::
shared_ptr
<
MatchAction
>
>
>&
actions
,
...
...
@@ -60,7 +58,6 @@ protected:
virtual
void
execute
(
const
ActionExecContext
&
context
)
const
;
private
:
const
VariableAccessor
<
Position
>
_cur_iter_pos
;
const
VariableAccessor
<
Match
>
_matches
;
const
boost
::
shared_ptr
<
const
MatchOperator
>
_match_op
;
const
boost
::
shared_ptr
<
const
std
::
vector
<
boost
::
shared_ptr
<
MatchAction
>
>
>
_actions
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment