| 594 | |
| 595 | |
| 596 | ValueExprNode* PAR_make_field(thread_db* tdbb, CompilerScratch* csb, USHORT context, |
| 597 | const MetaName& base_field) |
| 598 | { |
| 599 | /************************************** |
| 600 | * |
| 601 | * P A R _ m a k e _ f i e l d |
| 602 | * |
| 603 | ************************************** |
| 604 | * |
| 605 | * Functional description |
| 606 | * Make up a field node in the permanent pool. This is used |
| 607 | * by MET_scan_relation to handle view fields. |
| 608 | * |
| 609 | **************************************/ |
| 610 | SET_TDBB(tdbb); |
| 611 | |
| 612 | if (context >= csb->csb_rpt.getCount() || !(csb->csb_rpt[context].csb_flags & csb_used)) |
| 613 | return NULL; |
| 614 | |
| 615 | const StreamType stream = csb->csb_rpt[context].csb_stream; |
| 616 | |
| 617 | jrd_rel* const relation = csb->csb_rpt[stream].csb_relation; |
| 618 | jrd_prc* const procedure = csb->csb_rpt[stream].csb_procedure; |
| 619 | |
| 620 | const SSHORT id = |
| 621 | relation ? MET_lookup_field(tdbb, relation, base_field) : |
| 622 | procedure ? PAR_find_proc_field(procedure, base_field) : -1; |
| 623 | |
| 624 | if (id < 0) |
| 625 | return NULL; |
| 626 | |
| 627 | if (csb->collectingDependencies()) |
| 628 | PAR_dependency(tdbb, csb, stream, id, base_field); |
| 629 | |
| 630 | return PAR_gen_field(tdbb, stream, id); |
| 631 | } |
| 632 | |
| 633 | |
| 634 | // Make a list node out of a stack. |
nothing calls this directly
no test coverage detected