this function returns the actual root of the query as cypher_parse_result_t can have multiple roots such as comments only a root with type CYPHER_AST_STATEMENT is considered as the actual root comment roots are ignored
| 68 | // only a root with type CYPHER_AST_STATEMENT is considered as the actual root |
| 69 | // comment roots are ignored |
| 70 | static const cypher_astnode_t *_AST_parse_result_root |
| 71 | ( |
| 72 | const cypher_parse_result_t *parse_result |
| 73 | ) { |
| 74 | uint nroots = cypher_parse_result_nroots(parse_result); |
| 75 | for(uint i = 0; i < nroots; i++) { |
| 76 | const cypher_astnode_t *root = cypher_parse_result_get_root(parse_result, i); |
| 77 | cypher_astnode_type_t root_type = cypher_astnode_type(root); |
| 78 | if(root_type != CYPHER_AST_STATEMENT) { |
| 79 | continue; |
| 80 | } else { |
| 81 | return root; |
| 82 | } |
| 83 | } |
| 84 | ASSERT("_AST_parse_result_root: Parse result should have a valid root" && false); |
| 85 | return NULL; |
| 86 | } |
| 87 | |
| 88 | // this method extracts the query's parameters values, convert them into |
| 89 | // constant SIValues and store them in a map of <name, value> |
no outgoing calls
no test coverage detected