use of org.vertexium.cypher.functions.CypherFunction in project vertexium by visallo.
the class CypherCstToAstVisitor method visitFunctionInvocation.
@Override
public CypherAstBase visitFunctionInvocation(CypherParser.FunctionInvocationContext ctx) {
String functionName = visitFunctionName(ctx.functionName()).getValue();
CypherFunction fn = compilerContext.getFunction(functionName);
if (fn == null) {
throw new VertexiumCypherSyntaxErrorException("UnknownFunction: Could not find function with name \"" + functionName + "\"");
}
boolean distinct = ctx.DISTINCT() != null;
CypherListLiteral<CypherAstBase> argumentsList = visitExpressions(ctx.expression());
CypherAstBase[] arguments = argumentsList.toArray(new CypherAstBase[argumentsList.size()]);
fn.compile(compilerContext, arguments);
return new CypherFunctionInvocation(functionName, distinct, arguments);
}
Aggregations