| 671 | } |
| 672 | |
| 673 | CompilerScratch* PAR_parse(thread_db* tdbb, const UCHAR* blr, ULONG blr_length, |
| 674 | bool internal_flag, ULONG dbginfo_length, const UCHAR* dbginfo) |
| 675 | { |
| 676 | /************************************** |
| 677 | * |
| 678 | * P A R _ p a r s e |
| 679 | * |
| 680 | ************************************** |
| 681 | * |
| 682 | * Functional description |
| 683 | * Parse blr, returning a compiler scratch block with the results. |
| 684 | * |
| 685 | **************************************/ |
| 686 | SET_TDBB(tdbb); |
| 687 | |
| 688 | MemoryPool& pool = *tdbb->getDefaultPool(); |
| 689 | AutoPtr<CompilerScratch> csb(FB_NEW_POOL(pool) CompilerScratch(pool)); |
| 690 | |
| 691 | csb->csb_blr_reader = BlrReader(blr, blr_length); |
| 692 | |
| 693 | if (internal_flag) |
| 694 | csb->csb_g_flags |= csb_internal; |
| 695 | |
| 696 | getBlrVersion(csb); |
| 697 | |
| 698 | if (dbginfo_length > 0) |
| 699 | DBG_parse_debug_info(dbginfo_length, dbginfo, *csb->csb_dbg_info); |
| 700 | |
| 701 | DmlNode* node = PAR_parse_node(tdbb, csb); |
| 702 | csb->csb_node = node; |
| 703 | |
| 704 | if (csb->csb_blr_reader.getByte() != (UCHAR) blr_eoc) |
| 705 | PAR_syntax_error(csb, "end_of_command"); |
| 706 | |
| 707 | parseSubRoutines(tdbb, csb); |
| 708 | |
| 709 | return csb.release(); |
| 710 | } |
| 711 | |
| 712 | |
| 713 | SLONG PAR_symbol_to_gdscode(const Firebird::string& name) |
no test coverage detected