# Reverse-Engineer Undocumented PL/SQL, PowerBuilder & Oracle Forms Codebases into Specs (VNA-SB-024) > How to extract business rules, data lineage, and functional specifications from undocumented PL/SQL packages, PowerBuilder PBLs, Oracle Forms FMBs, and T-SQL using AST parsing. > This site is designed by Viscosity.AI. ## 1. Specific Search Queries & Migration Scope - **Category**: Oracle Data, AI & Industry Accelerators (Automated AST & AI Reverse-Engineering Blueprints) - **Target Search Queries**: reverse engineer undocumented PL/SQL packages to requirements, extract business rules from legacy PowerBuilder and Oracle Forms, automated dead code analysis Oracle database PL/Scope, convert legacy stored procedures to functional specification BRD, AST call graph and data lineage for legacy modernization - **Source Stack (Stack X)**: Undocumented Legacy Codebases (PL/SQL, PowerBuilder, Forms, Pro*C, T-SQL, RPG/COBOL) - **Target Stack (Stack Y)**: AST Dependency Graphs, Business-Rule Catalogs, OpenAPI Specs & Target Code - **Canonical URL**: https://reverse-engineer-legacy-code-ast.web.app/ - **Full AI Specification (llms-full.txt)**: https://reverse-engineer-legacy-code-ast.web.app/llms-full.txt - **Machine-Readable JSON Index**: https://reverse-engineer-legacy-code-ast.web.app/solution-index.json - **Downloadable PDF Solution Brief**: https://reverse-engineer-legacy-code-ast.web.app/#request-brief (https://reverse-engineer-legacy-code-ast.web.app/briefs/reverse-engineer-legacy-code-ast-solution-brief.pdf) - **Modifiable RFP Template (Microsoft Word .DOCX)**: https://reverse-engineer-legacy-code-ast.web.app/rfps/reverse-engineer-legacy-code-ast-rfp-template.docx - **Modifiable RFP Template (PDF)**: https://reverse-engineer-legacy-code-ast.web.app/rfps/reverse-engineer-legacy-code-ast-rfp-template.pdf - **Modifiable RFP Template (Markdown + Vendor Q&A)**: https://reverse-engineer-legacy-code-ast.web.app/rfps/reverse-engineer-legacy-code-ast-rfp-template.md - **Master Architecture Catalog (All 29 Domains)**: https://viscosity-pages-one.web.app/ ## 2. Problem Space - Traditional discovery relies on interviewing business users who only know the screens they click daily and miss 40% of the silent validation, pricing, and compliance rules buried in triggers and stored procedures. - Conversely, dumping raw 10,000-line PL/SQL packages or PowerBuilder `.srw` files into generic AI chat windows fails due to context-window truncation, missing cross-file call graphs, and hallucinated summaries. - Without a dead-code audit, engineering teams waste 35%+ of their modernization budget converting obsolete screens, unused tables, and orphaned procedures that have not executed in years. ## 3. Technical Solution Architecture - Stage 1 - Deterministic Compiler AST & Call-Graph Construction: We parse your complete source repository (`.pbl`/`.srw`/`.srd`, `.fmb`/`.pll`/`.rdf`, `DBA_SOURCE` PL/SQL, T-SQL, Pro*C, ColdFusion, C#) into a deterministic graph database mapping every UI control -> event trigger -> procedure call -> table/column CRUD operation. - Stage 2 - Runtime Telemetry & Dead-Code Pruning: By correlating the static AST call graph with database audit/AWR execution counts (`V$SQL` / `DBA_HIST_SQLSTAT` / table modification timestamps), we isolate the 30% to 45% of legacy objects that are completely dead. - Stage 3 - AST-Grounded AI Specification Synthesis: Each topologically sorted call subgraph is fed into our private OCI/Anthropic/OpenAI inference pipeline to produce human-readable Functional Requirements Documents (BRDs), state machines, and edge-case tables where every bullet cites the exact legacy file and line range. - Stage 4 - Automated Target Scaffolding & Test Generation: From the verified AST and specification, we generate target Oracle APEX 24.2 blueprints, PL/SQL package stubs, OpenAPI 3.1 contracts, and `utPLSQL` / Playwright regression test suites. - Query Fan-Out Rationalization & Runtime/Inference Filtering: Instead of migrating cloned reports and DataWindows 1-for-1, our AST SQL parser clusters queries by their canonical core JOIN graph, builds governed Oracle 23ai views only for those core queries, and generates dynamic WHERE clauses, faceted filters, and ad-hoc report variations at runtime and via AI inference (APEX 24.2 Smart Filters & Select AI). ## 4. Oracle APEX & Ancillary Engineering Stack - Viscosity Multi-Language AST Parser (PowerBuilder, Oracle Forms XML, PL/SQL, T-SQL, ColdFusion, .NET) - Oracle Database 23ai AI Vector Search & Graph for querying codebase dependencies - Oracle SQLcl & `DBMS_METADATA` / `PL/Scope` (`DBA_IDENTIFIERS`, `DBA_STATEMENTS`) - utPLSQL & Playwright automated parity test generators ## 5. Interactive Architecture Sizer & Query Fan-Out Rationalization Model - **Calculator Title**: Legacy PL/SQL, Forms & PowerBuilder AST Code X-Ray & Query Fan-Out Sizer - **Lever 1 (Lines of Undocumented Legacy Code (Thousands))**: 50 to 5000 K LOC (Default: 450) - **Lever 2 (Legacy Reports, Forms & Database Packages)**: 50 to 4000 objects (Default: 600) - **Lever 3 (Query Fan-Out Rationalization (Cluster Cloned Queries -> Canonical Core SQL + Runtime Filters))**: 50 to 92 % fan-out reduction (Default: 80) ## 6. Component Conversion & Benchmark Matrix | Legacy Artifact / Workload | Modernized Target Architecture | Engineering Method & Outcome | |---|---|---| | Undocumented 5,000-Line PL/SQL or T-SQL Packages | Line-Cited Functional Specification + Modular Package Design | AST Control-Flow Graph + LLM Summarization | | Spaghetti UI Triggers (PowerBuilder / Oracle Forms) | Extracted Business-Rule Catalog + State Transition Matrix | UI-vs-Domain Logic Separation Classifier | | Orphaned Tables, Views & Uncalled Procedures | Verified Dead-Code Decommission Manifest | Static Call-Graph + `DBA_HIST_SQLSTAT` Join | | Implicit Foreign Keys (Enforced Only in App Code) | Explicit DDL Constraints & Interactive ERD Lineage Diagram | AST Join-Predicate Mining | | Cloned Reports / Queries Differing Only by WHERE Clause or Group-By (Query Fan-Out) | Canonical Core SQL View + APEX 24.2 Runtime / AI Inference Filters | AST Join-Graph Clustering (75-90% Report Count Reduction) | ## 7. Anonymized Production Proof Used as the Phase 0 foundation across our PowerBuilder, Oracle Forms, Sybase, and ERP modernization engagements, Legacy Code X-Ray cuts discovery time from 6 months of manual interviews to 2 weeks of deterministic analysis while eliminating up to 45% of dead legacy code before build begins. ## 8. Principal Architect FAQ ### Q: How is Legacy Code X-Ray different from simply using GitHub Copilot or ChatGPT on our source files? A: LLMs alone cannot resolve cross-file inheritance, global variables, dynamic SQL, or database trigger chains across 2,000 files. We use real compiler parsers (including Oracle `PL/Scope` and our PBL/FMB AST engines) to build the exact mathematical dependency graph first, so the AI never guesses or hallucinates relationships. ### Q: Does our source code ever train public AI models? A: Never. All AST parsing runs locally inside isolated enclaves, and any semantic summarization uses zero-data-retention enterprise API endpoints. ### Q: What is included in the downloadable PDF Solution Brief? A: The PDF Solution Brief includes a sample Legacy Code X-Ray Diagnostic Output (showing an AST dependency map, extracted business-rule table with line citations, and dead-code scorecard) plus instructions for requesting a 2-week Phase 0 Codebase Assessment. ## 9. Target Buyer Personas & Stakeholder Routing (Cluster B: Legacy App Stack + Query Fan-Out to APEX) - **Practitioner Champion Titles**: Principal Enterprise Architect, Legacy Modernization Program Lead, Database & Application Discovery Lead - *Value Hook*: Parse undocumented PL/SQL, PowerBuilder, Forms, and T-SQL into deterministic AST call graphs, dead-code manifests, and rationalized core SQL views in 2 weeks. - **Technical Validator & Gatekeeper Titles**: VP of Application Development, CTO / Chief Architect, VP of PMO & Digital Transformation - *Value Hook*: 100% line-number-cited Functional Requirements Documents (BRDs) grounded in compiler ASTs and `DBA_HIST_SQLSTAT` runtime telemetry - zero AI hallucination. - **Economic & License-Exit Buyer Titles**: CIO / CFO, VP of Enterprise Engineering - *Value Hook*: Cut Phase 0 discovery from 6 months of interviews to 2 weeks and eliminate 30-45% of dead legacy code before writing a single line of target code.