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

Change new_scope pattern to scope.reset_variables() to make gcc happy.

It didn't like passing reference to something that could be treated as a value.
parent d856f517
No related merge requests found
......@@ -1940,8 +1940,8 @@ bool_operator_sequence
seq.reset(new OpSequence<Bool>(token_ref_to_std_string(name)));
}
LPAREN
op = functional_operator_bool [scope] { seq->append(op); }
(SEMI op = functional_operator_bool [scope.new_scope()] { seq->append(op); })*
op = functional_operator_bool [scope] { seq->append(op); scope.reset_variables(); }
(SEMI op = functional_operator_bool [scope] { seq->append(op); scope.reset_variables(); })*
RPAREN
;
......@@ -1956,8 +1956,8 @@ symset_operator_sequence
seq.reset(new OpSequence<TSet>(token_ref_to_std_string(name)));
}
LPAREN
op = functional_operator_symset [scope] { seq->append(op); }
(SEMI op = functional_operator_symset [scope.new_scope()] { seq->append(op); })*
op = functional_operator_symset [scope] { seq->append(op); scope.reset_variables(); }
(SEMI op = functional_operator_symset [scope] { seq->append(op); scope.reset_variables(); })*
RPAREN
;
......@@ -1972,8 +1972,8 @@ strset_operator_sequence
seq.reset(new OpSequence<StrSet>(token_ref_to_std_string(name)));
}
LPAREN
op = functional_operator_strset [scope] { seq->append(op); }
(SEMI op = functional_operator_strset [scope.new_scope()] { seq->append(op); })*
op = functional_operator_strset [scope] { seq->append(op); scope.reset_variables(); }
(SEMI op = functional_operator_strset [scope] { seq->append(op); scope.reset_variables(); })*
RPAREN
;
......@@ -1988,8 +1988,8 @@ position_operator_sequence
seq.reset(new OpSequence<Position>(token_ref_to_std_string(name)));
}
LPAREN
op = functional_operator_position [scope] { seq->append(op); }
(SEMI op = functional_operator_position [scope.new_scope()] { seq->append(op); })*
op = functional_operator_position [scope] { seq->append(op); scope.reset_variables(); }
(SEMI op = functional_operator_position [scope] { seq->append(op); scope.reset_variables(); })*
RPAREN
;
......@@ -2004,8 +2004,8 @@ untyped_operator_sequence
seq.reset(new UntypedOpSequence(token_ref_to_std_string(name)));
}
LPAREN
op = functional_operator_any [scope] { seq->append(op); }
(SEMI op = functional_operator_any [scope.new_scope()] { seq->append(op); })*
op = functional_operator_any [scope] { seq->append(op); scope.reset_variables(); }
(SEMI op = functional_operator_any [scope] { seq->append(op); scope.reset_variables(); })*
RPAREN
;
......@@ -2020,8 +2020,8 @@ match_operator_sequence
seq.reset(new OpSequence<Match>(token_ref_to_std_string(name)));
}
LPAREN
op = functional_operator_match [scope] { seq->append(op); }
(SEMI op = functional_operator_match [scope.new_scope()] { seq->append(op); })*
op = functional_operator_match [scope] { seq->append(op); scope.reset_variables(); }
(SEMI op = functional_operator_match [scope] { seq->append(op); scope.reset_variables(); })*
RPAREN
;
......@@ -2103,17 +2103,18 @@ tag_rule
// Rule sequence
tag_rule_sequence
[const ParsingScope& scope]
[ParsingScope& scope]
returns [boost::shared_ptr<TagRuleSequence> rule_seq]
{
boost::shared_ptr<TagRule> rle;
rule_seq.reset(new TagRuleSequence());
}
: rle = tag_rule [scope.new_scope()] {
: rle = tag_rule [scope] {
rule_seq->push_back(*rle);
scope.reset_variables();
}
(
SEMI rle = tag_rule [scope.new_scope()] {
SEMI rle = tag_rule [scope] {
rule_seq->push_back(*rle);
}
)*
......@@ -2122,7 +2123,7 @@ tag_rule_sequence
// Temporary name.
// This is wrapper for tag_rule_sequence in rules section in the wccl file
tag_rules
[const ParsingScope& scope]
[ParsingScope& scope]
returns [boost::shared_ptr<TagRuleSequence> rule_seq]
: "tag_rules" LPAREN rule_seq = tag_rule_sequence [scope] RPAREN {
//
......
......@@ -24,10 +24,6 @@ public:
{
}
ParsingScope new_scope() const {
return ParsingScope(tagset_, lexicons_);
}
const Corpus2::Tagset& tagset() const {
return tagset_;
}
......@@ -44,6 +40,9 @@ public:
return lexicons_;
}
void reset_variables() {
variables_->reset_values();
}
private:
const Corpus2::Tagset& tagset_;
boost::shared_ptr<Variables> variables_;
......
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