Parse blr, returning a compiler scratch block with the results. Caller must do pool handling.
| 169 | // Parse blr, returning a compiler scratch block with the results. |
| 170 | // Caller must do pool handling. |
| 171 | DmlNode* PAR_blr(thread_db* tdbb, jrd_rel* relation, const UCHAR* blr, ULONG blr_length, |
| 172 | CompilerScratch* view_csb, CompilerScratch** csb_ptr, Statement** statementPtr, |
| 173 | const bool trigger, USHORT flags) |
| 174 | { |
| 175 | #ifdef CMP_DEBUG |
| 176 | cmp_trace("BLR code given for JRD parsing:"); |
| 177 | // CVC: Couldn't find isc_trace_printer, so changed it to gds__trace_printer. |
| 178 | fb_print_blr(blr, blr_length, gds__trace_printer, 0, 0); |
| 179 | #endif |
| 180 | |
| 181 | BlrParseWrapper csb(*tdbb->getDefaultPool(), relation, view_csb, csb_ptr, trigger, flags); |
| 182 | |
| 183 | csb->csb_blr_reader = BlrReader(blr, blr_length); |
| 184 | |
| 185 | getBlrVersion(csb); |
| 186 | |
| 187 | csb->csb_node = PAR_parse_node(tdbb, csb); |
| 188 | |
| 189 | if (csb->csb_blr_reader.getByte() != (UCHAR) blr_eoc) |
| 190 | PAR_syntax_error(csb, "end_of_command"); |
| 191 | |
| 192 | parseSubRoutines(tdbb, csb); |
| 193 | |
| 194 | if (statementPtr) |
| 195 | *statementPtr = Statement::makeStatement(tdbb, csb, false); |
| 196 | |
| 197 | return csb->csb_node; |
| 198 | } |
| 199 | |
| 200 | |
| 201 | // Finish parse of memory nodes, returning a compiler scratch block with the results. |
no test coverage detected