diff options
Diffstat (limited to 'config-model/src/main/javacc/SchemaParser.jj')
-rw-r--r-- | config-model/src/main/javacc/SchemaParser.jj | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/config-model/src/main/javacc/SchemaParser.jj b/config-model/src/main/javacc/SchemaParser.jj index a9c67a0bb60..888e5ffb665 100644 --- a/config-model/src/main/javacc/SchemaParser.jj +++ b/config-model/src/main/javacc/SchemaParser.jj @@ -279,6 +279,7 @@ TOKEN : | < MAXHITS: "max-hits" > | < FIRSTPHASE: "first-phase" > | < SECONDPHASE: "second-phase" > +| < CONTAINERPHASE: "container-phase" > | < MACRO: "macro" > | < INLINE: "inline" > | < ARITY: "arity" > @@ -1706,6 +1707,7 @@ void rankProfileItem(ParsedSchema schema, ParsedRankProfile profile) : { } | rankFeatures(profile) | rankProperties(profile) | secondPhase(profile) + | containerPhase(profile) | inputs(profile) | constants(schema, profile) | matchFeatures(profile) @@ -1923,6 +1925,34 @@ void secondPhaseItem(ParsedRankProfile profile) : ) } +/** + * Consumes the container-phase block of a rank profile. + * + * @param profile The rank profile to modify. + */ +void containerPhase(ParsedRankProfile profile) : { } +{ + <CONTAINERPHASE> lbrace() (containerPhaseItem(profile) (<NL>)*)* <RBRACE> +} + +/** + * Consumes a statement for a container-phase block. + * + * @param profile The rank profile to modify. + */ +void containerPhaseItem(ParsedRankProfile profile) : +{ + String expression; + int rerankCount; +} +{ + ( expression = expression() { profile.setContainerPhaseExpression(expression); } + | (<RERANKCOUNT> <COLON> rerankCount = integer()) { profile.setContainerPhaseRerankCount(rerankCount); } + ) +} + + + /** Consumes an inputs block of a rank profile. */ void inputs(ParsedRankProfile profile) : { @@ -2519,7 +2549,7 @@ String expression() : ( <EXPRESSION_SL> { exp = token.image.substring(token.image.indexOf(":") + 1); } | <EXPRESSION_ML> { exp = token.image.substring(token.image.indexOf("{") + 1, token.image.lastIndexOf("}")); } ) - { return exp; } + { return exp.trim(); } } String identifierWithDash() : @@ -2555,6 +2585,7 @@ String identifier() : { } | <CONSTANT> | <CONSTANTS> | <CONTEXT> + | <CONTAINERPHASE> | <CREATEIFNONEXISTENT> | <DENSEPOSTINGLISTTHRESHOLD> | <DESCENDING> |