aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/javacc/SDParser.jj
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-10-25 10:34:45 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2021-10-25 10:34:45 +0200
commit85c88300cdab6541fea85cb69a7b4f844bb91250 (patch)
treeaac7700c98b6a62efe2b104c54bac529d6ebf486 /config-model/src/main/javacc/SDParser.jj
parent832108f7de2bd4065d79198f23fd477c83c12939 (diff)
Update execute -> mutate with '+=', '-=' and '='
Diffstat (limited to 'config-model/src/main/javacc/SDParser.jj')
-rw-r--r--config-model/src/main/javacc/SDParser.jj28
1 files changed, 14 insertions, 14 deletions
diff --git a/config-model/src/main/javacc/SDParser.jj b/config-model/src/main/javacc/SDParser.jj
index 0f60db40069..3f4b6ab8206 100644
--- a/config-model/src/main/javacc/SDParser.jj
+++ b/config-model/src/main/javacc/SDParser.jj
@@ -207,7 +207,6 @@ TOKEN :
| < LOOSE: "loose" >
| < STRICT: "strict" >
| < DOCUMENT: "document" >
-| < EXECUTE: "execute" >
| < OPERATION: "operation" >
| < ON_MATCH: "on-match" >
| < ON_RERANK: "on-rerank" >
@@ -239,6 +238,7 @@ TOKEN :
| < CONSTANT: "constant">
| < ONNXMODEL: "onnx-model">
| < MODEL: "model" >
+| < MUTATE: "mutate" >
| < RANKPROFILE: "rank-profile" >
| < RANKDEGRADATIONFREQ: "rank-degradation-frequency" >
| < RANKDEGRADATION: "rank-degradation" >
@@ -2066,7 +2066,7 @@ Object rankProfileItem(RankProfile profile) : { }
| firstPhase(profile)
| matchPhase(profile)
| function(profile)
- | execute(profile)
+ | mutate(profile)
| ignoreRankFeatures(profile)
| numThreadsPerSearch(profile)
| minHitsPerThread(profile)
@@ -2096,39 +2096,39 @@ void inheritsRankProfile(RankProfile profile) :
}
/**
- * This rule consumes an execute statement of a rank-profile.
+ * This rule consumes an mutate statement of a rank-profile.
*
* @param profile The profile to modify.
*/
-void execute(RankProfile profile) :
+void mutate(RankProfile profile) :
{
}
{
- <EXECUTE> lbrace() (execute_operation(profile) <NL>)+ <RBRACE>
+ <MUTATE> lbrace() (mutate_operation(profile) <NL>)+ <RBRACE>
{ }
}
-void execute_operation(RankProfile profile) :
+void mutate_operation(RankProfile profile) :
{
String attribute, operation;
- RankProfile.ExecuteOperation.Phase phase;
+ RankProfile.MutateOperation.Phase phase;
}
{
- ( <ON_MATCH> { phase = RankProfile.ExecuteOperation.Phase.onmatch; }
- | <ON_RERANK> { phase = RankProfile.ExecuteOperation.Phase.onrerank; }
- | <ON_SUMMARY> { phase = RankProfile.ExecuteOperation.Phase.onsummary; }
+ ( <ON_MATCH> { phase = RankProfile.MutateOperation.Phase.onmatch; }
+ | <ON_RERANK> { phase = RankProfile.MutateOperation.Phase.onrerank; }
+ | <ON_SUMMARY> { phase = RankProfile.MutateOperation.Phase.onsummary; }
)
- lbrace() attribute = identifier() operation = execute_expr() (<NL>)* <RBRACE>
- { profile.addExecuteOperation(phase, attribute, operation); }
+ lbrace() attribute = identifier() operation = mutate_expr() (<NL>)* <RBRACE>
+ { profile.addMutateOperation(phase, attribute, operation); }
}
-String execute_expr() :
+String mutate_expr() :
{
String op;
Number constant = null;
}
{
- (("++" | "--") { op = token.image; } | ("+=" | "-=" | "*=" | "/=" | "%=" | "=") { op = token.image; } constant = consumeNumber())
+ (("+=" | "-=" | "=") { op = token.image; } constant = consumeNumber())
{ return constant != null ? (op + constant) : op; }
}