/
gmplRefactoringStatements
gmplRefactoringStatements
Mark Juras
Owned by Mark Juras
Last updated: Jan 19, 2023
gmPL Refactoring Statements
Within gmBasic many of the changes made to the code as it moves from its VB6/ASP source code form into its ultimate .NET target code form can most easily be formulated as refactoring operations. These include:- Renaming symbols either to avoid clashes or to make them easier to maintain.
- Reauthoring a subprogram because its original approach is inappropriate or unworkable in the .NET environment
- Changing the type of a symbol which was either undefined or too weakly specified.
- Changing the status of a symbol to change its scope or behavior
- Changing the structure of a symbol to clarify its size and dimensionality.
- Removing a symbol because it is not needed or wanted.
- Changing logic flow and/or program operations to conform to new requirements.
- Replacing references to external libraries with references to native libraries
Statement | Description of use |
---|---|
Refactor | Introduces a set of refactoring statements |
CallByName | Changes symbol-related code events that yield CallByName late binding calls into direct boxed calls. |
Extend | Extends the content of a class by adding new components. |
FixType | Changes the binary type of a component or group of components |
Generic | Specifies that individual subprogram parameters be implemented as being generic to accept a list of different types. |
Implements | Specifies that a VB6 class implements another class or interface. |
MigClass | Introduces a new class that contains related refactoring information used for complex migration operations, especially as related to designer code. |
Migrate | Specifies migration of a specific symbol introduced via an external library description. |
OverGeneric | Specifies that individual subprogram parameters be implemented as being generic in an overloaded method to accept a list of different types. |
Overload | Specifies that individual subprogram arguments be overloaded to accept a list of different types. |
Reauthor | Replaces the content of a subprogram with a completely rewritten block of code |
Remove | Prevents a component from being authored |
Rename | Changes the authored name of components |
Replace | Replaces either the members of an external class or the patterns of opcodes via replacement declarations. |
Within gmBasic the portation process proceeds in 8 steps:
- Loading the VB6/ASP source code.
- Fixing the VB6/ASP source code.
- Building the symbol table from the source code
- Compiling the source code into intermediate code
- Analysing the symbol table and intermediate code
- Authoring the target code from the intermediate code and symbol table
- Fixing the target code
- Deploying the target code
Refactoring Property Specifications
Many of the refactoring statements are used to deal with the transformation of the VB6 property specifications into .NET designer code. Much of the code within VB6 forms deals with controls. These controls all have complex sets of properties that must be initialized within the VB6 code. This initialization code contains nested sets of "name=value" pairs organized into nested blocks started off by BEGIN or BEGINPROPERTY statements and ending with END or ENDPROPERTY statements. Here is a simple example of such a specification.Begin VB.Form VB0001Form Caption = "VB0001" ClientHeight = 5115 ClientLeft = 60 ClientTop = 345 ClientWidth = 5280 LinkTopic = "Form1" ScaleHeight = 5115 ScaleWidth = 5280 StartUpPosition = 3 'Windows Default Begin VB.CommandButton Command1 Caption = "Run VB0001 Test" Height = 375 Left = 1440 TabIndex = 0 Top = 1320 Width = 1935 End End
Begin VB.Label lblFirst Alignment = 2 'Center BorderStyle = 1 'Fixed Single Caption = "VB is fun" BeginProperty Font Name = "MS Sans Serif" Size = 24 Charset = 0 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = 2040 TabIndex = 0 Top = 480 Width = 2655 End
Table of Contents
, multiple selections available,
Related content
gmSLIntroduction
gmSLIntroduction
More like this
gmplMigrateStatement
gmplMigrateStatement
More like this
gmStudio Extensions
gmStudio Extensions
More like this
gmniCodeStyle
gmniCodeStyle
More like this
Support Statement: Building gmStudio Extensions using gmAPI and .NET
Support Statement: Building gmStudio Extensions using gmAPI and .NET
More like this
gmStudio Release News: Tuesday, 17-Sept-2024
gmStudio Release News: Tuesday, 17-Sept-2024
More like this