Class FunctionShadower
- java.lang.Object
-
- com.yahoo.searchlib.rankingexpression.transform.ExpressionTransformer<RankProfileTransformContext>
-
- com.yahoo.searchdefinition.expressiontransforms.FunctionShadower
-
public class FunctionShadower extends com.yahoo.searchlib.rankingexpression.transform.ExpressionTransformer<RankProfileTransformContext>
Transforms function nodes to reference nodes if a rank profile function shadows a built-in function. This has the effect of allowing rank profile functions to redefine built-in functions. Another effect is that we can add built-in functions over time without fear of breaking existing users' functions with the same name. However, there is a (largish) caveat. If a user has a function with a certain number of arguments, and we add in a built-in function with a different arity, this will cause parse errors as the Java parser gives precedence to built-in functions.- Author:
- lesters
-
-
Constructor Summary
Constructors Constructor Description FunctionShadower()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.yahoo.searchlib.rankingexpression.RankingExpression
transform(com.yahoo.searchlib.rankingexpression.RankingExpression expression, RankProfileTransformContext context)
com.yahoo.searchlib.rankingexpression.rule.ExpressionNode
transform(com.yahoo.searchlib.rankingexpression.rule.ExpressionNode node, RankProfileTransformContext context)
-
-
-
Method Detail
-
transform
public com.yahoo.searchlib.rankingexpression.RankingExpression transform(com.yahoo.searchlib.rankingexpression.RankingExpression expression, RankProfileTransformContext context)
- Overrides:
transform
in classcom.yahoo.searchlib.rankingexpression.transform.ExpressionTransformer<RankProfileTransformContext>
-
transform
public com.yahoo.searchlib.rankingexpression.rule.ExpressionNode transform(com.yahoo.searchlib.rankingexpression.rule.ExpressionNode node, RankProfileTransformContext context)
- Specified by:
transform
in classcom.yahoo.searchlib.rankingexpression.transform.ExpressionTransformer<RankProfileTransformContext>
-
-