{
  "solution_id": "024",
  "slug": "reverse-engineer-legacy-code-ast",
  "standalone_host": "reverse-engineer-legacy-code-ast.web.app",
  "category_code": "ORACLE_DATA_AI_ACCEL",
  "category_name": "Oracle Data, AI & Industry Accelerators",
  "subcategory": "Automated AST & AI Reverse-Engineering Blueprints",
  "source_stack": "Undocumented Legacy Codebases (PL/SQL, PowerBuilder, Forms, Pro*C, T-SQL, RPG/COBOL)",
  "target_stack": "AST Dependency Graphs, Business-Rule Catalogs, OpenAPI Specs & Target Code",
  "title": "Reverse-Engineer Undocumented PL/SQL, PowerBuilder & Oracle Forms Codebases into Specs",
  "short_title": "Reverse-Engineer Legacy PL/SQL, Forms & PowerBuilder (AST)",
  "seo_title": "Reverse-Engineer Legacy PL/SQL, PowerBuilder & Oracle Forms | AST Analysis",
  "meta_description": "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.",
  "hero_eyebrow": "Search Intent: Extract Business Rules from Undocumented Legacy Code \u00b7 AST + AI",
  "hero_headline": "Reverse-Engineer Undocumented PL/SQL, PowerBuilder & Forms Code into Exact Specs.",
  "hero_lead": "The #1 reason legacy modernization projects fail is that nobody alive knows what the existing 20-year-old application actually does. Before you write a single line of replacement code, our Legacy Code X-Ray engine combines deterministic Abstract Syntax Tree (AST) parsers with domain-tuned LLMs to generate a 100% cited functional specification, entity-relationship lineage map, and dead-code inventory in 2 weeks.",
  "brief_title": "Technical Solution Brief: De-Risking Legacy Modernization with Deterministic AST Parsing and AI Business-Rule Extraction",
  "brief_code": "VNA-SB-024",
  "metrics": [
    {
      "label": "Discovery Timeline",
      "value": "2-3 Weeks (vs. 6 Months)"
    },
    {
      "label": "Dead Code Identified",
      "value": "30-45% Avg Eliminated"
    },
    {
      "label": "Rule Traceability",
      "value": "100% Line-Number Cited"
    },
    {
      "label": "Supported Source Languages",
      "value": "PB / Forms / PLSQL / T-SQL"
    }
  ],
  "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."
  ],
  "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)."
  ],
  "conversion_matrix": [
    {
      "legacy_artifact": "Undocumented 5,000-Line PL/SQL or T-SQL Packages",
      "oracle_target": "Line-Cited Functional Specification + Modular Package Design",
      "method": "AST Control-Flow Graph + LLM Summarization"
    },
    {
      "legacy_artifact": "Spaghetti UI Triggers (PowerBuilder / Oracle Forms)",
      "oracle_target": "Extracted Business-Rule Catalog + State Transition Matrix",
      "method": "UI-vs-Domain Logic Separation Classifier"
    },
    {
      "legacy_artifact": "Orphaned Tables, Views & Uncalled Procedures",
      "oracle_target": "Verified Dead-Code Decommission Manifest",
      "method": "Static Call-Graph + `DBA_HIST_SQLSTAT` Join"
    },
    {
      "legacy_artifact": "Implicit Foreign Keys (Enforced Only in App Code)",
      "oracle_target": "Explicit DDL Constraints & Interactive ERD Lineage Diagram",
      "method": "AST Join-Predicate Mining"
    },
    {
      "legacy_artifact": "Cloned Reports / Queries Differing Only by WHERE Clause or Group-By (Query Fan-Out)",
      "oracle_target": "Canonical Core SQL View + APEX 24.2 Runtime / AI Inference Filters",
      "method": "AST Join-Graph Clustering (75-90% Report Count Reduction)"
    }
  ],
  "ancillary_tools": [
    "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"
  ],
  "anonymized_case_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.",
  "faqs": [
    {
      "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."
    }
  ],
  "legacy_aliases": [
    "legacy-code-xray"
  ],
  "search_keywords": [
    "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"
  ],
  "theme_flavor": "sage-canyon",
  "theme_flavor_label": "Sage Canyon",
  "calculator": {
    "calc_title": "Legacy PL/SQL, Forms & PowerBuilder AST Code X-Ray & Query Fan-Out Sizer",
    "slider_1": {
      "label": "Lines of Undocumented Legacy Code (Thousands)",
      "min": 50,
      "max": 5000,
      "step": 50,
      "default": 450,
      "unit": "K LOC"
    },
    "slider_2": {
      "label": "Legacy Reports, Forms & Database Packages",
      "min": 50,
      "max": 4000,
      "step": 50,
      "default": 600,
      "unit": "objects"
    },
    "slider_3": {
      "label": "Query Fan-Out Rationalization (Cluster Cloned Queries -> Canonical Core SQL + Runtime Filters)",
      "min": 50,
      "max": 92,
      "step": 2,
      "default": 80,
      "unit": "% fan-out reduction"
    },
    "complexity_options": [
      {
        "label": "PL/SQL & T-SQL Stored Procedures (1.0x)",
        "mult": 1.0
      },
      {
        "label": "Oracle Forms (.fmb) + PL/SQL Libraries (1.2x)",
        "mult": 1.2
      },
      {
        "label": "Mixed PowerBuilder (.pbl), Forms & Pro*C (1.4x)",
        "mult": 1.4
      }
    ],
    "formula_type": "ast_reverse",
    "auto_pct": 96,
    "savings_per_unit": 180,
    "base_savings": 45000,
    "out_1_label": "Canonical Core SQL Views (After Fan-Out Collapse)",
    "out_2_label": "Senior Architect Discovery Hours Saved",
    "out_3_label": "Automated AST & Spec Generation Turnaround",
    "out_4_label": "Discovery & De-Duplication Cost Savings"
  },
  "buyer_personas": {
    "cluster_code": "CLUSTER_B_LEGACY_APP_STACK",
    "cluster_name": "Cluster B: Legacy App Stack + Query Fan-Out to APEX",
    "practitioner_titles": [
      "Principal Enterprise Architect",
      "Legacy Modernization Program Lead",
      "Database & Application Discovery Lead"
    ],
    "practitioner_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.",
    "validator_titles": [
      "VP of Application Development",
      "CTO / Chief Architect",
      "VP of PMO & Digital Transformation"
    ],
    "validator_hook": "100% line-number-cited Functional Requirements Documents (BRDs) grounded in compiler ASTs and `DBA_HIST_SQLSTAT` runtime telemetry\u2014zero AI hallucination.",
    "economic_titles": [
      "CIO / CFO",
      "VP of Enterprise Engineering"
    ],
    "economic_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."
  }
}
