How Automatic Code Modernization For Legacy Delphi Systems Works?

The DELPHI PARSER is A Software Utility Robot & Development Full Kit Solution Specializing in Automatic Code Refactoring. It is designed & aimed to Modernize Database Oriented Software Legacy Systems build with Borland Delphi or C++ Builder in the mid 1990’s using ClientServer architecture.

Embarcadero recommends the use of the DELPHI PARSER for Upgrading Legacy Software Systems from any Delphi or C++ Builder version using BDE (or any other Data-Aware component) to latest RAD Studio 12 Berlin using FireDAC.

  • Quickly Scans Millions of Lines of Code
  • Automatically Replaces Existing Code with New Code
  • Maps & Links Objects, Code & Database
  • Reads Delphi & C++ Builder & SQL Syntax
  • Fully Customizable with Rule Base Engine
  • 100% Pure Delphi
  • Open Source Wizard
  • Extended Full Stack Developers Kit Library
  • Crawls Deep into Code
  • Leaves No Blind Spots
  • No Man Made Bug
  • Maintain Same Business Logic & UI


The DELPHI PARSER is a Unique Innovative Technology Built for Quickly & Easily Scanning Millions of Lines of Code, identify the objects and various code sections and rewrites them to support new technologies. It does this quickly and easily and without human intervention. The DELPHI PARSER Robot reads Delphi & C++ Builder Code Syntax & SQL Queries.  The Delphi Parser Robot does the job like no team of experts can do. The Robot runs on a predefined & fully customizable set of rules for optimal use. The Robot scans & map the code, locate all the various occurrences of the code, identify & analyze what is needed to be changed, drill down to the specific line of code & and makes the required exchange within the code base – on a separate copy. The robot knows how to insert new rows or entire sections, change a word or a character inside the line of code, delete unnecessary code (or mark it as a comment), and finally document the changes.

Key Features

 What Makes Automatic Software Modernization Easy Using the DELPHI PARSER?

  •  Downsizing the Modernization Project
  • Minimize the Risk
  • Ultra-Fast Solution
  • Easy to Plan
  • Reduces up to 80% of Project Modernization Costs.
  • Reduces up to 95% of the Manual Workload.
  • Reduces up to 99% of Errors & Bugs
  • No Interference with On Going Development
  • Maximize Flexibility for Changes on the Way
  • Bridge Between Old and New Technology

The Delphi Parser Empowers Your Developers by giving them super-powers & a magic wand to refactor millions of lines of code in a click!

The DELPHI PARSER is Fully Customizable with a Rule Based Code Refactoring Solution. It is suited for legacy version of Delphi & Borland C++ Builder with BDE code, wishing to upgrade its code base to the newest version of RAD Studio 10.1 Berlin & use FireDAC instead of the BDE. The Delphi Parser also support all kind of conversions & it can be easily customized for all type of code & components, VCLs, data-scheme & any other given technology. Based on all the data the Parser collects from scanning the project & analyzing it, it makes the changes wisely, based on set of rules and instructions. It doesn’t make any blind copies nor using half-baked data, voodoo programing, wild guesses or intuitions.

The Ultimate Solution for Upgrading Your Legacy Code Base to the Latest Embarcadero’s RAD STUDIO 12 using the DELPHI PARSER. With the newest Windows 10 systems, 64Bit Operating Systems, Clouds, Web Services, Unicode, Mobile Apps & the Internet of Things, there is a growing market demand for new services supporting the latest technology & modernizing legacy applications. Modernizing legacy systems, from the ’90s, and those still working on ’70s technology to the Future is Inevitable.

The AGILE Solution

The DELPHI PARSER Works in an AGILE Style Solution. The Automatic Refactoring process includes short cycles of planning, scanning, refactoring, compiling and testing in an AGILE development style. The conversion of million lines of code usually takes few hours. The resulting product is a new copy of the code, where you can easily review the differences between before & after using a standard text comparison tool. The conversion works in a separated environment without any interference to the ongoing development, using an undisturbed development process. Changes and corrections are easily obtained. With each and every new round, you can use the most current code, with no need to merge or branch project’s code with maximum flexibility for changes & additional requirements as the development process may have along the way.

The Architecture

The DELPHI PARSER Technology is built on an Open Architecture Framework. It is constructed in the form of open layers, allows any programmer an access to all its functions & an option to make any adjustments at will, giving that the source code is 100% Pure Delphi. The 1st layer deals with the Language Syntax. The 2nd layer deals with Core Base functionality of the Delphi Parser. The 3rd Layer deals with Database Component, which handles simple replacement requests. The 4th layer is the rule base engine, contains the rule based engine & migration process functionality over a single file & across the entire libraries. The 5th layer is the open scripting language, enables the control of the migration process outside of the source code, without having to recompile the Delphi Parser’s code. This is the wizard layer, which enables building a 1-click scripting tools for similar requests across many projects. The upper level is the application level, where you can write your own customized migration process wizards.

The Core Foundation of the DELPHI PARSER is based on understanding that there is compatibility between the millions of lines of code that exist within the organization, and there is common interface & basic compatibility between different projects in a written code. The similarity between the code bases across different customers is the core foundation on which the Delphi Parser is built on.

The DELPHI PARSER is fully Customizable & Adaptable to any given forms of writing, whether in the same project and whether for different customers. After analysis and mapping patterns of development and use of components of any project, you can build a custom upgrade process, and tailor a solution for each & every project & optimize it to fit requirement to carry out its automatic substitution.

Project Planning

Although, it may seem like the Delphi Parser’s Robot takes care of the whole project, when you look at the project scope is there is a lot more to do, than just running the parser…

Process Initiation

First you need to initiate the process by assessing your business needs, and the implications on your software & hardware systems. Most software modernization project are evolving from the need to change the operating system like

  1. Upgrading Operating System – like from Windows XP to 7 or 10
  2. Hardware incompatibility
  3. Environment Change – like from Desktop to Web Application
  4. Database Server Adaptation
  5. Interaction with other software or application services.

Get a Total Inspection & Assessment of your software system.

  • You need to get a realistic view of your software & hardware system.
  • We can help with that using our automatic analysis tools & assessments for modernization service.

Make a wish-list of your modernization needs, both software & hardware.

Estimating the modernization project

This is probably the hardest part of the whole process. We can help you getting all the answers to all the big questions, like:

  1. How long will it take?
  2. How much will it cost?
  3. How will it be managed?
  4. What are the risks?
  5. What will be the impact of the business?
  6. Will it make the customers happy?
  7. What are my alternatives?



Once you are ready to go, we can start designing the new modernized software system:

  1. Design your modernization solution, both software & hardware.
  2. Define all legacy features (software & hardware) & their modernization solution
  3. Build a work plan
  4. Setup modernization development team
  5. Design modernization development environment

Build your modernization solution

  1. Build an isolated development & test modernization Environment (software & hardware)
  2. Automatically Analyze the code
  3. Automatically Discover all function points & group them into template groups.
  4. Develop & build customized parser features based on the template groups.
  5. Customize automatic modernization process to fully fit your project needs
  6. Adjust manual fixes
  7. Run automatic modernization solution
  8. Test solution
  9. Refine solution until all features works as expected.



Compile Code – Once you have a new Modernized code, you need to do some manual development work on each application:

  • Check the result of new code
  • Compile the new code – If it fails, locate the problem. If it is a problem in the parser, make the necessary changes in the parser & run it again.

Test the Modernized Application

  • If it fails, locate the problem. If it is a problem in the parser, make the necessary changes in the parser & run it again.
  • Refine the process as needed, add or change features to the parser, regenerate the code over again, until the code compiles & works as expected.
  • Once you have a new modernized working application, you can make manual adjustments as you like & continue development as needed.


Building a new modernized solution takes time as well as Integration & tests until the new modernized code is deployed in full (months to years, depending on the code & requirements) – in the meantime the ongoing development team continues to work on their own code, produce updates & develop new features…

Don’t worry! whenever the code is update, you can insert it to the parser and run it on the most updated code, and regenerate a fresh batch of new modernized code.

This is the most significant feature, why it is best to use an automatic refactoring solution.

Flexible solution – whether you decide to make a change in the modernized solution, go back, remove, change or add feature – the process is very flexible and won’t resent you or slack off.

Fast Response – Feel free to run the parser over & over again, until you are satisfied.

Preliminary integration & tests –  Once you have a new modernized working set of applications, you can start do integration tests to see if interacts & behaves as expected in the new test environment.


Full Scale QA Tests

Once all the new applications are ready & interacts in the new test environment, you can run full scale QA tests, to make sure the new modernized code works as expected.

If the test finds an error that runs across the code, or something is forgotten & need to be changed or added, you can always go back to parser, make the necessary changes, regenerate a new code from the most update version, compile (through an already build automatic procedure), and send back for QA to test again.



Once you have all the new application tested & approved you are ready for deployment. Even though it may take a while for the organization to setup all the environment for deploying the new system, don’t worry – your parser is waiting for any new code version to process.


Maintenance & Support

Even after the whole organization is working with the new modernized software, and the development team have successfully shift to work on the code, the Delphi Parser can still be of help, maintaining millions of lines code, with a click of button.


Crunching The Numbers

Providing a full blown customized automatic migration process, that will target most of the project requirement depended on the code complexity & migration requirements.

Gartner says it will take about $5 per line of code to successfully modernize a software system. This may be true if it is done manually. For a medium business software system with about 1,000,000 lines of code it may take $5,000,000.

Sound too expensive, but the problem won’t be the money spent as for the time to delivery & the risk of getting lost in the project…

Due to the fact that the parser runs automatically, the amount of lines of code are not the main issue, rather aspects like:

  • The Complexity of the code
  • The variety of the code templates
  • The variation of the technology components
  • The code health
  • The modernization requirements
  • The development team
  • The organization behavior

Typically, what matters to the parser is the Function Points.


Function Points

Function Points are the points in the code, where the parser needs to do something – identify, copy, modify, add etc.

Statistically, in a typical legacy Delphi desktop ClientServer software system, about 10% of the total lines of code are a potential function points. Giving about 100,000 Function points in a 1M LoC project. Using the Delphi Parser Analyzer, we can scan, identify & assemble all the function points with the same behavior into a Template Groups.

Each template group will produce a customize Feature for the parser to run through the code & do something. Typically, a template group is assembled for at least 1,000 function points. A template group can be of a simple type or can split to sub-templates with minor changes for complex template types. This complexity can be automated using different Scripts commands for the same main Feature.

The cost of developing a Feature for the template group may be varied, depending on the complexity. A simple Feature is estimated for at least $1000, taking about 1 day to develop.

We estimate about 1 Feature per 1000 function points.

  • That gives us about 100 features for 1MLoC project.
  • We estimate the cost of building a migration solution for 100 X $ 1000 = $100,000, taking about 100 development days.

Meaning: A Cost of $0.1 per line of code.

Well, building the solution is just part of the effort in the project. That will take about 4 months to develop, and with a good effort from the whole organization the whole process may take about 12 months.

We estimate that for a project of 1M LoC, will require about 1000 hours for Integrations, Tests & Delivery.


Overall Total Modernization Cost

Estimating a total cost can be varied, depending on the cost of employees, the depth of QA, Integration test & Deployment process combined into the overall effort. The cost of modernization depends also on the modernization requirements, the cost of new hardware, OS & 3rd party software.