* EXEC ... END-EXEC blocks are opaque single nodes. Mine the text for the * statically-resolvable shapes: CICS LINK/XCTL to a program (cross-program * call), CICS RETURN/START TRANSID (the pseudo-conversational hop — emitted * as a `cics-transid:XXXX` reference the CICS framework resolver maps to
( node: SyntaxNode, ctx: ExtractorContext, fromNodeId: string | undefined )
| 142 | * the owning program), and SQL INCLUDE (a copybook import). |
| 143 | */ |
| 144 | function handleExec( |
| 145 | node: SyntaxNode, |
| 146 | ctx: ExtractorContext, |
| 147 | fromNodeId: string | undefined |
| 148 | ): void { |
| 149 | const text = getNodeText(node, ctx.source); |
| 150 | const cics = EXEC_CICS_PROGRAM_RE.exec(text); |
| 151 | if (cics) { |
| 152 | const program = cics[1] ?? (cics[2] ? derefSameFileValue(cics[2], ctx) : undefined); |
| 153 | if (program) addRef(ctx, fromNodeId, program, 'calls', node); |
| 154 | } |
| 155 | const transid = EXEC_CICS_TRANSID_RE.exec(text); |
| 156 | if (transid) { |
| 157 | const tx = transid[1] ?? (transid[2] ? derefSameFileValue(transid[2], ctx) : undefined); |
| 158 | if (tx && /^[A-Za-z0-9$#@]{1,4}$/.test(tx)) { |
| 159 | addRef(ctx, fromNodeId, `cics-transid:${tx.toUpperCase()}`, 'calls', node); |
| 160 | } |
| 161 | } |
| 162 | const include = EXEC_SQL_INCLUDE_RE.exec(text); |
| 163 | if (include?.[1]) { |
| 164 | ctx.createNode('import', include[1], node, { |
| 165 | signature: collapse(text), |
| 166 | }); |
| 167 | addRef(ctx, fromNodeId ?? currentScope(ctx), include[1], 'imports', node); |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | /** |
| 172 | * Walk a run of DATA DIVISION entries (working-storage section children or a |
no test coverage detected