gmslAPI
0.1
gmslAPI: An API for Developing Upgrade Solutions using Great Migrations Technology
|
The class Opcode works with the intermediate language streams. Its methods actively manage and reference the opcodes of the intermediate language. Their description and use assume a knowledge of that language and of its internal structure as applied by the toolset. More...
Static Public Member Functions | |
static int | CommentOut (int iStart, int cmtType) |
The method CommentOut comments out a block of intermediate operations so that they will either not appear in the target translation at all or at least will be commented out in the target translation. More... | |
static void | Delete (int iStart, int nDelete) |
The method Delete deletes one or more operations stored in the global code block. From the standpoint of the gmSL this along with Replace are the preferred methods for removing and inserting operations into the global code block. More... | |
static int | DeleteCode (int iStart, int nCode, int nDelete) |
The method DeleteCode deletes a sequence of byte codes from the global code vector used to contain the compiled code associated with the various components. More... | |
static void | DumpCode (int iStart, int iEnd) |
The method DumpCode gives a code dump display from the global code vector used to contain the compiled code associated with the various components. More... | |
static int | ExpandCode (int iStart, int nCode, int nExpand) |
The method ExpandCode expands a sequence of byte codes from the global code vector used to contain the compiled code associated with the various components. More... | |
static int | FindArgumentEnd (tCodeBlock userCode, int iStart, int iEnd) |
The method FindArgumentEnd finds the end of the code associated with a given argument within a larger code block. Note that argument code always begins with a LEV operation which specifies the nesting level of the argument code, and ends with an ARG operation which specifies the type of the parameter that is to receive the argument. More... | |
static int | GetArgumentType (int subRoot, int icode, int lcode) |
The method GetArgumentType evaluates the binary type of a code subsegment within the global code vector used to contain the compiled code associated with the various components. More... | |
static int | GetCallArgs (int subRoot, int lastNew, int funcCode, int[] qeAddr, int[] qeType, int nArg) |
The GetCallArgs method gets the byte code offset and binary type of the actual calling arguments to a method. The method optionally also gets the context and migration status flags of the arguments. More... | |
static tCodeBlock | GetCode (int iStart) |
The method GetCode returns a tCodeBlock instance for the global vector used to contain the compiled code associated with the various components. More... | |
static tCodeBlock | GetCode () |
static int | GetLength () |
The method GetLength gets the overall length of intermediate code stored in the global code storage area. This value is needed by other methods that access this code storage area to ensure that they do not exceed its bounds. More... | |
static int | GetMember (int opcValue, int subValue) |
The GetMember method gets the library member associated with an operation. Those opcodes that have the role CLSREF(class reference) can have a full library component associated with them in language storage. This library component is used to contain additional migration information about the underlying class component. This method retrieves the root address of this component in the subcode information storage area. A zero root address means that there is no class member associated with the opcode-subcode pair. More... | |
static int | GetNext (tCodeBlock codptr, int icode, int nCode) |
The method GetNext returns the offset of the start of the next operation code in the specified code storage area following the operation code offset specified. This method uses the operation type codes specified in the OPCODES section of the meta language description file to move through the code. More... | |
static int | GetOperation (tCodeBlock codptr, int icode, ref int subcode) |
The GetOperation method gets the value of the current operation in a code block. More... | |
static int | GetOperation (tCodeBlock codptr, int icode) |
static int | GetOperation (int icode) |
static int | GetOperation (int icode, ref int subcode) |
static int | GetPrevious (tCodeBlock codptr, int opAdr, int codeEnd) |
The GetPrevious method moves to a previous operation in a code block. This method returns the offset of the start of the operation code that is directly before an operation code offset specified. Since the operation codes are variable-length and are stored sequentially, this operation requires that the code be scanned from the front starting with a known operation offset. More... | |
static string | GetString (int icode, int lcode) |
The GetString method computes the string value represented by a sequence of operations in the global code block. The computation itself is performed by the same engine that executes the gmSL procedures. More... | |
static string | GetSubcodeLabel (int opcValue, int sbcValue) |
The GetSubcodeLabel method gets the label for a subcode of an opcode. This is the label entered in the language description under the subcodes specification for the opcode. More... | |
static bool | IntegerValue (int iStart, int iEnd, ref int iValue) |
static int | MoveCode (int iDest, int iStart, int nCode, int nMove) |
The MoveCode method moves byte code from one location in the global code block to a different location in that block. This is a move operation so the byte code is removed from its original location. More... | |
static int | QuantityInfo (int icode, int[] qeType, int[] qeAddr, int subRoot) |
The QuantityType method gets information about the quantity represented by a specified position in the global code block. This quantity information is dependent on the preceeding content, so this method must be called each time the code position is incremented. More... | |
static void | Replace (int icode, int opcode, int subcode, int nReplace) |
The Replace method replaces zero or more operations stored in the global code block with a new operation. More... | |
static void | SetCode (tCodeBlock codptr) |
The SetCode method sets the global code block to the tCodeBlock block specified. More... | |
static void | SetLength (int nCode) |
The method SetLength sets the overall length of intermediate code stored in the global code storage area. This value is needed by other methods that access this code storage area to ensure that they do not exceed its bounds. More... | |
static void | SetOperation (tCodeBlock codptr, int icode, int opcode, int subcode) |
The SetOperation method stores an operation at a particular location in a code block. It is a low level method and assumes that space has been allocated for the storage. This method has been deprecated. Use the Replace method to insert operations. More... | |
static void | SetOperation (int icode, int opcode, int subcode) |
static int | Sizeof (int opValue) |
The Sizeof method returns the length in bytes of a specified operation code. The opcTypes enumeration specifies what the lengths for the various types of operation codes. More... | |
The class Opcode works with the intermediate language streams. Its methods actively manage and reference the opcodes of the intermediate language. Their description and use assume a knowledge of that language and of its internal structure as applied by the toolset.
|
static |
The method CommentOut comments out a block of intermediate operations so that they will either not appear in the target translation at all or at least will be commented out in the target translation.
iStart | The parameter iStart is the offset in the global code block of the component whose presence is causing the need to comment out the statement, and |
cmpType | The parameter cmtType specifies how the commented out code is to appear, or not appear, in the output. It should be one of the following CMT operation subcodes: CMT.Delete, CMT.CommentOut, CMT.Deprecated, CMT.NotImplemented, or CMT.MustCorrect. |
|
static |
The method Delete deletes one or more operations stored in the global code block. From the standpoint of the gmSL this along with Replace are the preferred methods for removing and inserting operations into the global code block.
iStart | specifies the offset in the global code block where the deletion is to begin. |
nDelete | specifies the number of existing operations to be deleted. |
|
static |
The method DeleteCode deletes a sequence of byte codes from the global code vector used to contain the compiled code associated with the various components.
iStart | is the starting offset of the code to be deleted. |
nCode | is the overall length of the stored code. |
nDelete | is the number of bytes to be deleted. |
|
static |
The method DumpCode gives a code dump display from the global code vector used to contain the compiled code associated with the various components.
iStart | contains the starting offset of the code to be displayed. |
iEnd | contains the ending offset. The method checks that the value of iEnd does not exceed the current length of the code storage area. Therefore, if that length has been changed it is important to call the method SetLength beforecalling this method. |
|
static |
The method ExpandCode expands a sequence of byte codes from the global code vector used to contain the compiled code associated with the various components.
iStart | is the starting offset of the code to be expanded. |
nCode | is the overall length of the stored code. |
nExpand | is the number of bytes to be expanded by. |
|
static |
The method FindArgumentEnd finds the end of the code associated with a given argument within a larger code block. Note that argument code always begins with a LEV operation which specifies the nesting level of the argument code, and ends with an ARG operation which specifies the type of the parameter that is to receive the argument.
userCode | is the code block that contains the argument code. |
iStart | is the offset of the start of the argument code, |
iEnd | is the offset of the end of the search region. This is normally simply set to the overall length of the code block. The end of the argument code is the offset of the first code following the ARG operation. |
|
static |
The method GetArgumentType evaluates the binary type of a code subsegment within the global code vector used to contain the compiled code associated with the various components.
subRoot | is the root offset of the component to which the code belongs. |
icode | is the offset of the start of the code subsegment whose binary type is needed. This may or may not be an actual argument description. |
lcode | defines the end of the subsegment. If it is nonzero, then it simply specifies the length of the subsegment. If it is zero, and the opcode at the start is LEV, then the entire argument code is evaluated. This is the typical use of this method. If it is zero and the starting opcode is not LEV, then only that one opcode is evaluated. |
|
static |
The GetCallArgs method gets the byte code offset and binary type of the actual calling arguments to a method. The method optionally also gets the context and migration status flags of the arguments.
subRoot | specifies the root offset of the method performing the call. |
lastNew | specifies the byte code offset of the start of the code for the actual statement performing the call. |
funcCode | specifies the offset of the operation that is doing the call. |
qeAddr | receives the starting offset of the code for each argument. |
qeType | receives the quantity type code for each argument. |
nArg | specifies the number of parameters associated with the method. At this level, all methods have a fixed number of parameters that is determined when they are defined and that must be known when this method is called. |
|
static |
The method GetCode returns a tCodeBlock instance for the global vector used to contain the compiled code associated with the various components.
iStart | The optional parameter iStart specifies a starting offset into the global code vector for the start of this tCodeBlock instance. If not specified, a value of zero is used. |
|
static |
The method GetLength gets the overall length of intermediate code stored in the global code storage area. This value is needed by other methods that access this code storage area to ensure that they do not exceed its bounds.
|
static |
The GetMember method gets the library member associated with an operation. Those opcodes that have the role CLSREF(class reference) can have a full library component associated with them in language storage. This library component is used to contain additional migration information about the underlying class component. This method retrieves the root address of this component in the subcode information storage area. A zero root address means that there is no class member associated with the opcode-subcode pair.
opcValue | specifies the index of the opcode controlling the operation. This must be a constant defined in the OPC class. |
subValue | specifies the sequence number of the desired subcode associated the operation. This must be a constant from the operation code class that has the same identifier as the opcValue. |
|
static |
The method GetNext returns the offset of the start of the next operation code in the specified code storage area following the operation code offset specified. This method uses the operation type codes specified in the OPCODES section of the meta language description file to move through the code.
codptr | specifies the byte storage area that contains the intermediate code being traversed. It is typically obtained via the method GetCode. |
icode | contains offset in the byte storage area of the current operation. |
nCode | contains the length of the code being traversed. |
|
static |
The GetOperation method gets the value of the current operation in a code block.
codptr | contains the code block whose operations are being examined. If omitted the global code block is used. |
icode | specifies the offset in the code block of the desired operation. |
subcode | returns the subcode information associated with the operation. The opcTypes enumeration specifies what the subcode values are for the various types of operation codes. It may be omitted. |
|
static |
The GetPrevious method moves to a previous operation in a code block. This method returns the offset of the start of the operation code that is directly before an operation code offset specified. Since the operation codes are variable-length and are stored sequentially, this operation requires that the code be scanned from the front starting with a known operation offset.
codptr | contains the code block being traversed. |
opAdr | specifies the offset of an operation in the code block that is known to precede the current one. |
codeEnd | specifies the offset in the code block of the current operation. |
|
static |
The GetString method computes the string value represented by a sequence of operations in the global code block. The computation itself is performed by the same engine that executes the gmSL procedures.
icode | specifies the offset of the first operation defining the value. |
lcode | specifies the offset immediately beyond the last operation for the value. |
|
static |
The GetSubcodeLabel method gets the label for a subcode of an opcode. This is the label entered in the language description under the subcodes specification for the opcode.
opcValue | specifies the index of the opcode controlling the operation. This must be a constant defined in the OPC class. |
sbcValue | specifies the sequence number of the desired subcode associated the operation. This must be a constant from the operation code class that has the same identifier as the opcValue. |
|
static |
The MoveCode method moves byte code from one location in the global code block to a different location in that block. This is a move operation so the byte code is removed from its original location.
iDest | specifies the offset in the global code block of the destination of the move. |
iStart | specifies the offset of the source of the move. |
nCode | specifies the overall length of the byte code. |
nMove | specifies the number of byte codes to move. |
|
static |
The QuantityType method gets information about the quantity represented by a specified position in the global code block. This quantity information is dependent on the preceeding content, so this method must be called each time the code position is incremented.
icode | specifies the offset of the current operation for which information is needed. |
qeType | receives the quantity type code at each logical level. |
qeAddr | receives the starting offset of the code at each logical level. |
subRoot | specifies the root offset of the method performing the call. |
|
static |
The Replace method replaces zero or more operations stored in the global code block with a new operation.
icode | specifies the offset in the global code block where the relacement is to begin. |
opcode | specifies the index of the opcode of the operation to be inserted. |
subcode | contains the value of the desired subcode associated the operation. |
nReplace | specifies the number of existing operations to be relaced. A value of zero indicates that the new operation should simply be inserted. |
|
static |
The SetCode method sets the global code block to the tCodeBlock block specified.
codptr | specifies a new value for the global code block. |
|
static |
The method SetLength sets the overall length of intermediate code stored in the global code storage area. This value is needed by other methods that access this code storage area to ensure that they do not exceed its bounds.
nCode | specifies the length in bytes. |
|
static |
The SetOperation method stores an operation at a particular location in a code block. It is a low level method and assumes that space has been allocated for the storage. This method has been deprecated. Use the Replace method to insert operations.
codptr | contains the code block to receive the operation. |
icode | specifies the offset in the code block where the operation is to be stored. |
opcode | specifies the index of the opcode of the operation to be inserted. |
subcode | specifies the value of the desired subcode associated the operation. |
|
static |
The Sizeof method returns the length in bytes of a specified operation code. The opcTypes enumeration specifies what the lengths for the various types of operation codes.
opValue | specifies the index of the opcode whose size is desired. This must be a constant defined in the OPC class. |