Sunday, February 19, 2017

About Microsoft Visual Basic 6.0 language mapping

About Microsoft Visual Basic 6.0 language mapping

The following language constructs are supported for Visual Basic reverse engineering.

Classes, modules, and forms

Include class type, member variables, constants, and functions and subroutines.

Class type (standard module, class module, MS form, resource file, VB form, VB MDI form, property page, user control, document object, related document, or Microsoft ActiveX designer). Class type is set through a tagged value (ClassType). Standard modules are created with the utility stereotype.

Functions and subroutines

Include visibility (public, private, or protected), return type (functions only), and parameters.

Note: Visual Basic does not have the concept of a protected class member. In reverse engineered Visual Basic code, protected is used to designate a friend property, subroutine, or function.

Parameters

Include type, kind (in, inout, return), and default value.

Version 1.2 of the UML specification does not support multiplicity for parameters. Array dimensions are appended to the parameter name. For example:

Sub func(arr() as Integer)

would be reverse engineered as:

arr(): Integer

The default value is only set if the parameter is optional.

Constants

Include visibility (public or private), type, and initial value.

Constants are added to the model as attributes with the changeable field set to frozen.

For example, the VB line:

Const str As String = "some text"

will be given an initial value of

"some text"

while

Const x As Integer = 1

will be given an initial value of 1.

Member variables

Include visibility (public or private) and type.

Array dimensions are appended to the variable name. For example:

x(1 to 5, 1 to 10) as Integer

would be reverse engineered as:

x(1 to 5, 1 to 10): Integer

Properties

Include visibility (public, private, or protected), return type (get only), and parameters.

VB properties are added to the model as methods with a stereotype of accessor. Each property accessor may have a distinct visibility.

get_, set_, or let_ is prepended to the name depending on the accessor type.

Note: Visual Basic does not have the concept of a protected class member. When reverse engineering Visual Basic code, protected is used to designate a friend property, subroutine, or function.

Events

Include visibility (public only) and parameters.

Events are added to the model as methods with the stereotype event.

User defined types

Created as classes.

User defined types are added to the model as classes. Member attributes of the type are not created.

No comments:

Post a Comment