private boolean shouldGenerateFeature(ExpressionNode expr) {
        if (expr instanceof ConstantNode) return false;
        if (expr instanceof ReferenceNode) return false;
        if (expr instanceof NameNode) return false;
        if (expr instanceof FunctionNode) return false;
        if (expr instanceof NegativeNode && ((NegativeNode) expr).getValue() instanceof ConstantNode) return false;
        return true;
    }
Creates and returns an instance of this function based on the given
arguments. If function calls are nested, this call may produce
additional functions.

@param context the context used to expand this
@param argumentValues the arguments to instantiate on.
@param path the expansion path leading to this.
@return the script function instance created.
searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/ExpressionFunction.java