Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

 

Search Statement Summary

Searchis nonterminal, utility statement that occurs only in command scripts. It searches the currently open storage area for symbols and produces reports as requested within the statement.

 

The Searchstatement has no attributes.

 

The substatements within the Searchstatement are as follows:

 

SubstatementDescription
SymbolsProduces a symbol listing
DetailsProduces a detailed symbol audit
InterfaceDisplays a listing of the interface objects

 

The substatements all have the same attributes:

 

AttributeDescription
ProjectThis attribute contains the name of project. It restricts the reports to the symbols within that project.

To show what these reports contain Vb001is a very simple code with one form. This search script for it

 

   <gmBasic>
      <Storage Action="Open" Identifier="C:\fkgtest\vb6test\csh\VB001.vbi" />
      <Output filename="vb001.txt" StripTrail="on" />
      <Search >
          <Symbols project="VB0001" />
          <Details project="VB0001" />
          <Interface project="VB0001" />
      </Search>
      <Storage Action="Close" />
  </gmBasic>
only audits the symbols in the project code itself. Much of the material in the audit reports is intended for use in the gmNI when working directly with the intermediate language. They are presented here only in a general sense.

The Symbols Report for VB001

The report produced by the Symbolssubstatement is

 

Audit of Symbol tree in C:\fkgtest\vb6test\csh\VB001.vbi storage area:
Lev |  Address |   Parent | Symbol Type      | Full Symbol Identifier
--- |  ------- |   ------ | -----------      | ----------------------
  0 |     3692 |     2523 | FormFile         | VB0001.frm
  1 |    22730 |     3692 | Form             | VB0001.VB0001Form.VB0001Form
  2 |    22817 |    22730 | CommandButton    | VB0001.VB0001Form.VB0001Form.Command1
  1 |    22964 |     3692 | Subprogram       | VB0001.VB0001Form.Command1_Click
  2 |    23019 |    22964 | Variable         | VB0001.VB0001Form.Command1_Click.MyNumber
  0 |    22938 |     2523 | Vb_Name.3692     | VB0001.VB0001Form
The symbol table is hierarchical. The Lev column shows the nesting level relative to the root symbol of the symbol.

The Address column is the root address of the symbol. All symbols are assigned a unique root address in the symbol table. As will be seen later in this topic and as will be discussed fully within the gmNI topics these addresses remain constant over multiple translation runs. Since the same identifier is often used for many different components, finding specific references to components in the audit reports is often difficult. The address on the other hand are unique and are always appended to symbols in the detailed reports to make them easy to find.

The Parentcolumn specifies the root address of the parent of the symbol in the hierarchical tree.

 

The Symbol Type column specifies the symbol object type. These are described more fully in the gmNI discussion.

The Full Symbol Identifier column is the fully qualifier identifier of the symbol. These identifiers are used to specify particular components in the Refactoring statements. They are relatively easy to construct but simply copying them out of an audit report is often easier.

The Details Report for VB001

The Details report shows the detailed entries in the storage area for each symbol. The actual meaning of these entries is not in the scope of this discussion beyond knowing that they exist and generally the sort of information that they contain. The following shows the start of the information shown for the Command1_Clicksubprogram.

 

Detailed Description of Subprogram VB0001.VB0001Form.Command1_Click with root address 22964:
Property                       | Content
--------                       | -------
Migrate Status                 | SkipDecl
Migrate Flags                  | CodeAnalysed
Status Flags                   | Private
VB_Name                        | VB0001Form:22938
Binary Type                    | Void
Dimensions                     | 0
Triggering Control             | 22817:CommandButton:Command1
Triggering Event               | Click
Number of Arguments            | 0
Number Required                | 0
Address of Code                | 24517
Bytes of Code                  | 324

Actual C# Codeblock Associated with Command1_Click:
Offset |  Sl.Start |  Ql.Start | Quantity type | Opcode | Operation support information
------ |  -------- |  -------- | ------------- | ------ | -----------------------------
     0 |           |           |               | NEW    | 29 ChDir ".\"
     3 |           |           |               | LEV    | Nest0
     5 |       1.5 |       1.5 | String        | LSC    | 2:.\
    10 |       1.5 |           |               | ARG    | String
    12 |           |      1.12 | Void          | CMD    | ChDir
    14 |           |           |               | NEW    | 30 Open "VB0001.out" For Output As #2
    17 |           |           |               | LEV    | Nest0
    19 |      1.19 |      1.19 | String        | LSC    | 10:VB0001.out
    24 |      1.19 |           |               | ARG    | String
    26 |      1.19 |           |               | LEV    | Nest0
    28 |      2.28 |      1.28 | Integer       | LIC    | 2
    31 |      2.28 |           |               | ARG    | Integer
    33 |      2.28 |           |               | SPV    | PoundSign
    35 |      3.35 |      1.35 | OpenMode      | OMO    | Output
Codeblocks are the intermediate language forms of source code units. They are structured sequences of intermediate Opcodes -- operation identifiers -- that are manipulated by gmBasic and ultimately authored in the target language. This particular code is ready to be authored in C#.

The Interface Report for VB001

The Interfacereport assumes that the symbol table contains components that are controls. The properties of these controls are displayed in the report.

 

Lev | Count | Status     | Role       | Object Type    | Object Identifier
--- | ----- | ------     | ----       | -----------    | -----------------
  1 |     0 | Ok         | Control    | Form           | VB0001Form
  2 |     0 | Ok         | Control    | CommandButton  | Command1
The symbol table is hierarchical. The Lev column shows the nesting level relative to the root symbol of the symbol.

The Count column shows "0" if the control is not a control array; else it shows the number of members in the control array.

The Status column shows the migration status of the component. By default it is Ok. It might also be Delete, Deprecated, NotImplemented, or MustCorrect.

The Role column shows the role that the component serves. By default it is Control. It might also be Event, Define, Resource, Migclass, Index, Property, Collection, or Utility.

The Object Type column specifies the symbol control type. These are described more fully in the gmNI discussion.

The Object Identifier is the identifier of the component as it was originally defined in the source.
Table of Contents

  • No labels