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

change match_value to match_literal etc. for consistency with literals of other types.

parent 86028bba
Branches
No related merge requests found
......@@ -408,12 +408,12 @@ position_value
// ----------------------------------------------------------------------------
// Value used into match operator such as TOK[position] and ANN[position, name]
// Returns boost::shared_ptr<Match>
match_value
match_literal
returns [boost::shared_ptr<Match> val]
{
boost::shared_ptr<MatchData> m;
}
: m = match_data_value {
: m = match_data_literal {
val.reset(new Match(m));
}
;
......@@ -425,7 +425,7 @@ match_value_const
{
boost::shared_ptr<Match> m;
}
: m = match_value {
: m = match_literal {
val.reset(new Constant<Match>(*m));
}
;
......@@ -433,16 +433,16 @@ match_value_const
// ----------------------------------------------------------------------------
// Value used into match operator such as TOK[position] and ANN[position, name]
// Returns boost::shared_ptr<MatchData>
match_data_value
match_data_literal
returns [boost::shared_ptr<MatchData> val]
: val = token_match_value
| val = ann_match_value
| val = match_vector_value
: val = token_match_literal
| val = ann_match_literal
| val = match_vector_literal
;
// token match value
// token match literal - TOK[position]
// Returns boost::shared_ptr<TokenMatch>
token_match_value
token_match_literal
returns [boost::shared_ptr<TokenMatch> val]
{
boost::shared_ptr<Position> p;
......@@ -452,9 +452,9 @@ token_match_value
}
;
// annotation match value
// annotation match literal - ANN[position, name]
// Returns boost::shared_ptr<AnnotationMatch>
ann_match_value
ann_match_literal
returns [boost::shared_ptr<AnnotationMatch> val]
{
boost::shared_ptr<Position> p;
......@@ -464,28 +464,28 @@ ann_match_value
}
;
// annotation match vector: MATCH() or MATCH(token, ann, MATCH())
// annotation match vector literal: MATCH() or MATCH(token, ann, MATCH())
// Returns boost::shared_ptr<MatchVector>
match_vector_value
match_vector_literal
returns [boost::shared_ptr<MatchVector> val]
{
val.reset(new MatchVector());
}
: "MATCH" LPAREN (match_vector_value_item[val])? RPAREN
: "MATCH" LPAREN (match_vector_literal_item[val])? RPAREN
;
// Body of the MATCH value. It only adds vector items to the MatchVector
// Item may be single or multiple
match_vector_value_item [boost::shared_ptr<MatchVector>& mvector]
match_vector_literal_item [boost::shared_ptr<MatchVector>& mvector]
{
boost::shared_ptr<Match> m_val;
}
: m_val = match_value {
: m_val = match_literal {
mvector->append(m_val);
}
(
COMMA
m_val = match_value {
m_val = match_literal {
mvector->append(m_val);
}
)*
......@@ -1998,6 +1998,7 @@ match_action_comma_sep
)*
;
// Function<Match> is wrapper for Constant<Match> and Function<Match>
// Returns boost::shared_ptr<Function<Match> >
match_fit
......
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