This section describes how gmStudio performs translations and also introduces the concepts involved with "tuning the translation" configuration to produce .NET codes that conform to your specific technical requirements.  

The Translation Process

The translation process is automatic and runs by default every time you click the [Upgrade] button. The discussion here is to help you understand a little about what happens behind the scenes so you will be comfortable customizing and improving the translation process.

In gmStudio, the translation of each migration task proceeds in 3 steps:

  1. Using data from the migration project, the current task, and the template translation script produce an actual translation script
  2. Start the gmBasic translation engine as a new  process in the working folder, passing in the actual translation script on the command line
  3. Monitor the gmBasic output, capture it in a log file and display it in the session panel
  4. Inspect the gmBasic outputs (i.e. the log file and the code bundle) for record status and results on the migration task record.

Inside the gmBasic process, the transformation of a source codebase to a target codebase proceeds in 8 steps as directed  by the actual translation script and all files that specify the migration configuration:

  1. Loading the source code from disk into memory
  2. Pre-processing the source code (e.g. compile/fix commands if specified) 
  3. Building a detailed symbol table from the identifiers declared in the source code and in the external libraries referenced by the source code 
  4. Building a low-level semantic model from the logic in the source code 
  5. Analyzing the symbol table and semantic model and transforming it to fit the target requirements 
  6. Authoring the target code for the semantic model and symbol table. 
  7. Post-Processing the target code (optional) 
  8. Publish the target code (write to disk as text bundle file)

Every step in the transformation process can be directed in various ways by modifying the translator configuration. The primary means of modifying the translator configuration is through Translation Scripts. 

Tuning the Translation

A crucial feature of gmStudio is flexibility: the details of the translation process can be controlled by the user.  Taking advantage of this flexibility allows migration teams to reduce and eliminate manual effort that would otherwise be needed to finish the work of a large migration.  The process of improving the translation process is referred to as "Translation Tuning" and it is done in an iterative fashion by making incremental changes to the translation rules and settings and then comparing the results of each successive generation of the .NET code.  During translation tuning, the features of gmStudio you will use the most are translating, snapshotting/comparing, and searching the codes and configuration to incrementally analyze migration problems and implement their solutions.  

Running a Translation

The translation process is started when you select [Run Translation] from the migration Task Context Menu.

The actual translation script, the translation log, and the target code are all saved in the workspace\log folder which is also the working directory for gmBasic.  gmBasic also creates a semantic model (.VBI) file that contains detailed information about the symbols and operations performed by the source code.  All of these files remain in the working directory for future review and analysis.