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
| 337 | // since clauses cannot be nested we only need to check |
| 338 | // the immediate children of the query node |
| 339 | const 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 | |
| 356 | static void _AST_GetTypedNodes |
| 357 | ( |
no outgoing calls