MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / AST_GetClauses

Function AST_GetClauses

src/ast/ast.c:339–354  ·  view source on GitHub ↗

collect references to all clauses of the specified type in the query since clauses cannot be nested we only need to check the immediate children of the query node

Source from the content-addressed store, hash-verified

337// since clauses cannot be nested we only need to check
338// the immediate children of the query node
339const cypher_astnode_t **AST_GetClauses
340(
341 const AST *ast,
342 cypher_astnode_type_t type
343) {
344 const cypher_astnode_t **clauses = array_new(const cypher_astnode_t *, 0);
345 uint clause_count = cypher_ast_query_nclauses(ast->root);
346
347 for(uint i = 0; i < clause_count; i ++) {
348 const cypher_astnode_t *child = cypher_ast_query_get_clause(ast->root, i);
349 if(cypher_astnode_type(child) != type) continue;
350 array_append(clauses, child);
351 }
352
353 return clauses;
354}
355
356static void _AST_GetTypedNodes
357(

Callers 3

AST_BuildFilterTreeFunction · 0.85

Calls

no outgoing calls

Tested by 1