gmplRefactorStatement
Table of Contents
Refactor Statement Summary
Refactor is a nonterminal, refactoring statement that occurs in command scripts, in reference scripts called RefactorLibraries, and in the GlobalSettings file within RefactorFile statements. The term "refactoring" generally refers to changing the implementation of user code when porting it to a new platform; while, the term "migration" refers to reformulating references to and replacing external libraries whose source code is not part of the source code being ported. Within actual portation projects, however, this distinction becomes blurred. Both terms are used throughout this discussion.<Registry type="RefactorFile" source="Pathname of file to be refactored" > <Refactor> refactor statements </Refactor> </Registry>
<Registry type="RefactorFile" source="\code\vb6\CommonFunctions.cls" > <Refactor> <FixType identifier="SortCollection.aObject" type="Interfaces.Icbn_Compare" /> </Refactor> </Registry>
<Compile project="\code\vb6\VariousCommonFunctions.vbp" > <Refactor fileFilter="[\code\vb6\CommonFunctions.cls]"> <FixType identifier="SortCollection.aObject" type="Interfaces.Icbn_Compare" /> </Refactor> </Compile>
Attribute | Description |
DllName | This attribute specifies the name of a dll file that should be loaded when the refactor statement is processed and should remain loaded for the remainder of the current gmBasic execution. Up to 64 Dlls may be loaded at the same time. |
Event | This attribute is used to trigger a set of generic user migration code events within the analyser. These events are triggered first during the initialization phase and second during the code review phase for each code block in the current scope of the analyzer by references in the code to subcomponents that have a UserCode status flag set. The start of the string stored in the comment field of the component must match this attribute value to trigger the code events in the dll file. |
Id | This attribute is the hostid. It is the identifier of the library or project being refactored. Libraries are identified via their local filename enclosed in square brackets like [mso.dll] or [msword9.olb] or [mscomctl.ocx] or [msado20.tlb]. In this context fully qualified names, whose identifiers are separated by periods can also be used. The brackets are used to avoid confusion. |
ErrorStatus | This attribute controls the consequences of an error. If it is Ignore, then no message is displayed and the tool simply continues. If it is Warning, then a message is displayed and the and then to tool continues. If it is Error, then a message is displayed, and an abnormal exit to the operating system is taken. The default setting for this attribute is Error. |
FileFilter | This attribute is the fully qualified identifier of the user code file whose components are being refactored. It specifies the filefilter for the following refactoring statements. |
The declarations within the Class statement are as follows:
Substatement | Description |
Fixtype | This filefiler oriented statement changes the binary type of a component or group of components |
CallByName | This filefilter oriented statement changes symbol-related code events that yield CallByName late binding calls into direct boxed calls. |
Implements | This filefilter oriented statement specifies that a VB6 class implements another class or interface. |
Remove | This filefilter oriented statement prevents a component from being authored. |
Migrate | This hostid oriented statement specifies migration of a specific symbol within an external library. |
Rename | This filefilter oriented statement changes the authored name of components. |
Reauthor | This filefilter oriented statement replaces the content of a subprogram with a completely rewritten block of code |
Extend | This hostid oriented statement extends the content of a class by adding new components. |
Replace | This hostid oriented statement replaces either members of an external class or the patterns of opcodes via replacement declarations. |
Migclass | This hostid oriented statement defines a collection of related refactoring information used primarily to describe the components on the .NET side of the migration. |
Gmsl | This command statement enters a gmSL subprogram that is needed in the authoring of the refactored code. |
Reference | This command statement loads a reference script defining and external library whose components are being referenced within the refactoring block. |
The script errors associated with the Refactor statement are as follows:
Error | Description |
1102 | Encountered illegal REFACTOR directive %1d |
Table of Contents