Guides · 4 min read

AI-Assisted Parsing for Legacy Code Modernization

Why parsing is the bottleneck in legacy modernization projects, and how AST-based tools built for COBOL, JCL, PL/I, and other mainframe-era languages change the economics.

AI-Assisted Parsing for Legacy Code Modernization

The Real Bottleneck in Legacy Modernization

Every legacy modernization project starts the same way: someone has to actually read the code. Not skim it — understand it. COBOL programs written in the 1980s, JCL job control scripts nobody has touched since, PL/I business logic with no documentation, VB6 forms wired to Access databases. Before a single line gets rewritten, someone has to figure out what the existing system actually does.

That’s parsing. And it’s usually the slowest, most error-prone part of the whole project — done manually, by consultants billing by the hour, working through code that predates most of their careers.

Why General-Purpose Tools Fall Short

Modern static analysis tools are built for modern languages. Point them at a COBOL copybook, a CICS transaction, or REXX exec, and they either choke or ignore the file entirely. Mainframe-era languages have their own grammars, their own encoding quirks, and their own execution models — batch jobs, screen-based transactions, fixed-column layouts — that don’t map cleanly onto anything a JavaScript or Python linter understands.

That gap is why we built Legacy Dragon, a parser purpose-built for the languages that actually run the world’s legacy estate: COBOL, JCL, PL/I, VB6, VB.NET, PowerBuilder, Assembly, SQL/DB2, CICS, and REXX — ten languages in one tool.

Speed Changes What’s Possible

A 1,200-line COBOL program parses in about 6 milliseconds. That’s not a marginal improvement over manual review — it’s a different category of work entirely. When parsing is near-instant, you can:

  • Parse an entire codebase — thousands of programs — in a single pass instead of sampling a handful
  • Regenerate dependency graphs every time the source changes, instead of once at project kickoff
  • Let engineers explore “what calls this paragraph?” interactively instead of grepping through printouts

Seeing the Structure, Not Just the Text

Raw source code is hard to reason about at scale. A single COBOL program can have dozens of PERFORM targets, nested conditionals, and copybook includes that only make sense once expanded. Legacy Dragon builds an interactive AST graph for each parsed program, so you can visually trace control flow and data dependencies instead of holding the whole call graph in your head.

This matters most in modernization projects where the goal isn’t just “translate this to Java” — it’s “understand what this actually does so we don’t reimplement a 40-year-old bug.”

Encoding Is Not an Afterthought

Anyone who has worked with mainframe systems outside North America knows encoding bugs eat entire sprints. Japanese shops in particular deal with Shift-JIS and DBCS (double-byte character sets) mixed into fixed-width COBOL records, alongside EBCDIC’s own quirks for numeric and packed-decimal fields. Getting this wrong doesn’t throw an error — it silently corrupts data. Legacy Dragon handles Shift-JIS, EBCDIC, and DBCS encodings natively, because a parser that can’t read the actual bytes on disk isn’t useful in production.

Deployment Has to Match the Environment

Legacy modernization work often happens on locked-down infrastructure — air-gapped networks, restricted mainframe-adjacent servers, environments where installing a runtime is its own multi-week approval process. That’s why Legacy Dragon ships as a single binary: no dependency tree, no runtime to provision, no package manager to negotiate with security review.

What This Enables

None of this replaces the judgment of engineers who understand the business logic. What it does is remove the grunt work — the weeks spent manually mapping which programs call which, which fields get read where, which encoding a given file actually uses — so that judgment gets applied to decisions that matter, not to parsing fixed-column COBOL by hand.

If you’re staring down a legacy estate that needs to be understood before it can be modernized, that’s exactly the problem Legacy Dragon is built to shrink.


Legacy Dragon is part of the AityTech portfolio. See it in action at dragon.aitytech.com, or reach out at [email protected] to talk through a specific codebase.

See Our Work

From MinuteAI to AgentKits — explore the products and projects we've shipped.

View Portfolio

Related Articles