Parse a MAP clause for a union or global aggregate expression.
| 3822 | |
| 3823 | // Parse a MAP clause for a union or global aggregate expression. |
| 3824 | static MapNode* parseMap(thread_db* tdbb, CompilerScratch* csb, StreamType stream, |
| 3825 | bool parseHeader) |
| 3826 | { |
| 3827 | SET_TDBB(tdbb); |
| 3828 | |
| 3829 | if (parseHeader) |
| 3830 | { |
| 3831 | if (csb->csb_blr_reader.getByte() != blr_map) |
| 3832 | PAR_syntax_error(csb, "blr_map"); |
| 3833 | } |
| 3834 | |
| 3835 | unsigned int count = csb->csb_blr_reader.getWord(); |
| 3836 | MapNode* node = FB_NEW_POOL(csb->csb_pool) MapNode(csb->csb_pool); |
| 3837 | |
| 3838 | while (count-- > 0) |
| 3839 | { |
| 3840 | node->targetList.add(PAR_gen_field(tdbb, stream, csb->csb_blr_reader.getWord())); |
| 3841 | node->sourceList.add(PAR_parse_value(tdbb, csb)); |
| 3842 | } |
| 3843 | |
| 3844 | return node; |
| 3845 | } |
| 3846 | |
| 3847 | // Process a single record source stream from an RseNode. |
| 3848 | // Obviously, if the source is a view, there is more work to do. |
no test coverage detected