![]() |
![]() |
![]() |
![]() |
![]() |
The Symbol Table
The symbol table is used for storing information mainly about the static properties of the SDL system, such as the block structure, connections of channels and the valid input signal set for processes. Some dynamic properties are also placed in the symbol table; for example the list of all active process instances of a process instance set. This is part of the node representing the process instance set.
The nodes in the symbol table are structs with components initialized in the declaration. During the initialization of the application, in the yInit function in generated code, a tree is built up from these nodes.
Symbol Table Tree Structure
The symbol table is created in two steps:
- First, symbol table nodes are declared as structs with components initialized in the declaration (in generated code).
- Then, the yInit function (in generated code) updates some components in the nodes and builds a tree from the nodes. This operation is not needed in an application!
The following names can be used to refer to some of the nodes that are always present. These names are defined in scttypes.h.
xSymbolTableRootxEnvIdxSrtN_SDL_BitxSrtN_SDL_Bit_StringxSrtN_SDL_BooleanxSrtN_SDL_CharacterxSrtN_SDL_CharstringxSrtN_SDL_DurationxSrtN_SDL_IA5StringxSrtN_SDL_IntegerxSrtN_SDL_NaturalxSrtN_SDL_NullxSrtN_SDL_NumericStringxSrtN_SDL_Object_IdentifierxSrtN_SDL_OctetxSrtN_SDL_Octet_StringxSrtN_SDL_PIdxSrtN_SDL_PrintableStringxSrtN_SDL_RealxSrtN_SDL_TimexSrtN_SDL_VisibleStringxSymbolTableRoot is the root node in the symbol table tree. Below this node the system node is inserted. After the system node, there is a node representing the environment of the system (xEnvId). Then there is one node for each package referenced from the SDL system. This is true also for the package predefined containing the predefined data types. The nodes for the predefined data types, that are sons to the node for the package predefined, can be directly referenced by the names xSrtN_SDL_xxx, according to the list above.
Nodes in the symbol table are placed in the tree exactly according its place of declaration in SDL. A node that represent an item declared in a block is placed as a child to that block node, and so on. The hierarchy in the symbol table tree will directly reflect the block structure and declarations within the blocks and processes.
A small example can be found in Figure 559. The following node types will be present in the tree:
The nodes (the struct variables) will in generated code be given names according to the following table:
ySysR_SystemName(system, system type, system instance)yPacR_PackageNameyBloR_BlockName(block, block type, block instance)yBSuR_SubstructureNameyPrsR_ProcessName(process, process type, process instance)yPrdR_ProcedureName (procedure, operator)ySigR_SignalName(signal, timer, startup signal, RPC signal)yChaR_ChannelName (channel, signal route, gate)yStaR_StateNameySrtR_NewtypeName (newtype, syntype)yLitR_LiteralNameyVarR_VariableName(variable, formal parameter, signalparameter, struct component, synt.variable)yReVR_RemoteVariableyRePR_RemoteProcedureIn most cases it is of interest to refer to a symbol table node via a pointer. By taking the address of a variable according to the table above, i.e.
& yPrsR_Process1such a reference is obtained. For backward compatibility, macros according to the following example is also generated for several of the entity classes:
#define yPrsN_ProcessName (&yPrsR_ProcessName)Types Representing the Symbol Table Nodes
The following type definitions, from the file scttypes.h, are used in connection with the symbol table:
typedef enum {xRemoteVarEC,xRemotePrdEC,xSignalrouteEC,xStateEC,xTimerEC,xFormalParEC,xLiteralEC,xVariableEC,xBlocksubstEC,xPackageEC,xProcedureEC,xOperatorEC,xProcessEC,xProcessTypeEC,xGateEC,xSignalEC,xSignalParEC,xStartUpSignalEC,xRPCSignalEC,xSortEC,xSyntypeEC,xSystemEC,xSystemTypeEC,xBlockEC,xBlockTypeEC,xChannelEC,xServiceEC,xServiceTypeEC,xCompoundStmtEC,xSyntVariableECxMonitorCommandEC} xEntityClassType;typedef enum {xPredef, xUserdef, xEnum,xStruct, xArray, xGArray, xCArray,xOwn, xORef, xRef, xString,xPowerSet, xGPowerSet, xBag, xInherits, xSyntype,xUnion, xUnionC, xChoice} xTypeOfSort;typedef char *xNameType;typedef struct xIdStruct {xEntityClassType EC;#ifdef XSYMBTLINKxIdNode First;xIdNode Suc;#endifxIdNode Parent;#ifdef XIDNAMESxNameType Name;#endif} xIdRec;/*BLOCKSUBSTRUCTURE*/typedef struct xBlockSubstIdStruct {xEntityClassType EC;#ifdef XSYMBTLINKxIdNode First;xIdNode Suc;#endifxIdNode Parent;#ifdef XIDNAMESxNameType Name;#endif} xBlockSubstIdRec;/*LITERAL*/typedef struct xLiteralIdStruct {xEntityClassType EC;#ifdef XSYMBTLINKxIdNode First;xIdNode Suc;#endifxIdNode Parent;#ifdef XIDNAMESxNameType Name;#endifint LiteralValue;} xLiteralIdRec;/*PACKAGE*/typedef struct xPackageIdStruct {xEntityClassType EC;#ifdef XSYMBTLINKxIdNode First;xIdNode Suc;#endifxIdNode Parent;#ifdef XIDNAMESxNameType Name;#endif#ifdef XIDNAMESxNameType ModuleName;#endif} xPackageIdRec;/*SYSTEM*/typedef struct xSystemIdStruct {xEntityClassType EC;#ifdef XSYMBTLINKxIdNode First;xIdNode Suc;#endifxIdNode Parent;#ifdef XIDNAMESxNameType Name;#endifxIdNode *Contents;xPrdIdNode *VirtPrdList;xSystemIdNode Super;#ifdef XTRACEint Trace_Default;#endif#ifdef XGRTRACEint GRTrace;#endif#ifdef XMSCEint MSCETrace;#endif} xSystemIdRec;/*CHANNEL,SIGNALROUTE,GATE*/#ifndef XOPTCHANtypedef struct xChannelIdStruct {xEntityClassType EC;#ifdef XSYMBTLINKxIdNode First;xIdNode Suc;#endifxIdNode Parent;#ifdef XIDNAMESxNameType Name;#endifxSignalIdNode *SignalSet; /*Array*/xIdNode *ToId; /*Array*/xChannelIdNode Reverse;} xChannelIdRec; /* And xSignalRouteEC.*/#endif/*BLOCK*/typedef struct xBlockIdStruct {xEntityClassType EC;#ifdef XSYMBTLINKxIdNode First;xIdNode Suc;#endifxIdNode Parent;#ifdef XIDNAMESxNameType Name;#endifxBlockIdNode Super;xIdNode *Contents;xPrdIdNode *VirtPrdList;xViewListRec *ViewList;int NumberOfInst;#ifdef XTRACEint Trace_Default;#endif#ifdef XGRTRACEint GRTrace;#endif#ifdef XMSCEint MSCETrace;int GlobalInstanceId;#endif} xBlockIdRec;/*PROCESS*/typedef struct xPrsIdStruct {xEntityClassType EC;#ifdef XSYMBTLINKxIdNode First;xIdNode Suc;#endifxIdNode Parent;#ifdef XIDNAMESxNameType Name;#endifxStateIdNode *StateList;xSignalIdNode *SignalSet;#ifndef XNOUSEOFSERVICExIdNode *Contents;#endif#ifndef XOPTCHANxIdNode *ToId; /*Array*/#endifint MaxNoOfInst;#ifdef XNRINSTint NextNr;int NoOfStaticInst;#endifxPrsNode *ActivePrsList;xptrint VarSize;#if defined(XPRSPRIO) || defined(XSIGPRSPRIO) || \defined(XPRSSIGPRIO)int Prio;#endifxPrsNode *AvailPrsList;#ifdef XTRACEint Trace_Default;#endif#ifdef XGRTRACEint GRTrace;#endif#ifdef XBREAKBEFOREchar *(*GRrefFunc) (int, xSymbolType *);int MaxSymbolNumber;int SignalSetLength;#endif#ifdef XMSCEint MSCETrace;#endif#ifdef XCOVERAGElong int *CoverageArray;long int NoOfStartTransitions;long int MaxQueueLength;#endifvoid (*PAD_Function) (xPrsNode);void (*Free_Vars) (void *);xPrsIdNode Super;xPrdIdNode *VirtPrdList;xBlockIdNode InBlockInst;#ifdef XBREAKBEFOREchar *RefToDefinition;#endif} xPrsIdRec;#ifndef XNOUSEOFSERVICE/*SERVICE*/typedef struct xSrvIdStruct {xEntityClassType EC;#ifdef XSYMBTLINKxIdNode First;xIdNode Suc;#endifxIdNode Parent;#ifdef XIDNAMESxNameType Name;#endifxStateIdNode *StateList;xSignalIdNode *SignalSet;#ifndef XOPTCHANxIdNode *ToId;#endifxptrint VarSize;#ifdef XBREAKBEFOREchar *(*GRrefFunc) (int, xSymbolType *);int MaxSymbolNumber;int SignalSetLength;#endif#ifdef XCOVERAGElong int *CoverageArray;long int NoOfStartTransitions;#endifxSrvNode *AvailSrvList;void (*PAD_Function) (xPrsNode);void (*Free_Vars) (void *);xSrvIdNode Super;xPrdIdNode *VirtPrdList;} xSrvIdRec;#endif/*PROCEDURE*/typedef struct xPrdIdStruct {xEntityClassType EC;#ifdef XSYMBTLINKxIdNode First;xIdNode Suc;#endifxIdNode Parent;#ifdef XIDNAMESxNameType Name;#endifxStateIdNode *StateList;xSignalIdNode *SignalSet;xbool (*Assoc_Function) (xPrsNode);void (*Free_Vars) (void *);xptrint VarSize;xPrdNode *AvailPrdList;#ifdef XBREAKBEFOREchar *(*GRrefFunc) (int, xSymbolType*);int MaxSymbolNumber;int SignalSetLength;#endif#ifdef XCOVERAGElong int *CoverageArray;#endifxPrdIdNode Super;xPrdIdNode *VirtPrdList;} xPrdIdRec;typedef struct xRemotePrdIdStruct {xEntityClassType EC;#ifdef XSYMBTLINKxIdNode First;xIdNode Suc;#endifxIdNode Parent;#ifdef XIDNAMESxNameType Name;#endifxRemotePrdListNode RemoteList;} xRemotePrdIdRec;/* SIGNAL, TIMER */typedef struct xSignalIdStruct {xEntityClassType EC;#ifdef XSYMBTLINKxIdNode First;xIdNode Suc;#endifxIdNode Parent;#ifdef XIDNAMESxNameType Name;#endifxptrint VarSize;xSignalNode *AvailSignalList;xbool (*Equal_Timer) (void *, void *);#ifdef XFREESIGNALFUNCSvoid (*Free_Signal) (void *);#endif#ifdef XBREAKBEFOREchar *RefToDefinition;#endif#if defined(XSIGPRIO) || defined(XSIGPRSPRIO) || defined(XPRSSIGPRIO)int Prio;#endif} xSignalIdRec; /* and xTimerEC, xStartUpSignalEC,and xRPCSignalEC.*//*STATE*/typedef struct xStateIdStruct {xEntityClassType EC;#ifdef XSYMBTLINKxIdNode First;xIdNode Suc;#endifxIdNode Parent;#ifdef XIDNAMESxNameType Name;#endifint StateNumber;xInputAction *SignalHandlArray;int *InputRef;xInputAction (*EnablCond_Function)(XSIGTYPE, void *);void (*ContSig_Function)(void *, int *, xIdNode *, int *);int StateProperties;#ifdef XCOVERAGElong int *CoverageArray;#endifxStateIdNode Super;#ifdef XBREAKBEFOREchar *RefToDefinition;#endif} xStateIdRec;/*SORT*/typedef struct xSortIdStruct {xEntityClassType EC;#ifdef XSYMBTLINKxIdNode First;xIdNode Suc;#endifxIdNode Parent;#ifdef XIDNAMESxNameType Name;#endif#ifdef XFREEFUNCSvoid (*Free_Function) (void **);#endif#ifdef XTESTFxbool (*Test_Function) (void *);#endifxptrint SortSize;xTypeOfSort SortType;xSortIdNode CompOrFatherSort;xSortIdNode IndexSort;long int LowestValue;long int HighestValue;long int yrecIndexOffset;long int typeDataOffset;} xSortIdRec;/*VARIABLE,...*/typedef struct xVarIdStruct {xEntityClassType EC;#ifdef XSYMBTLINKxIdNode First;xIdNode Suc;#endifxIdNode Parent;#ifdef XIDNAMESxNameType Name;#endifxSortIdNode SortNode;xptrint Offset;xptrint Offset2;int IsAddress;} xVarIdRec; /* And xFormalParEC andxSignalParEC.*/typedef struct xRemoteVarIdStruct {xEntityClassType EC;#ifdef XSYMBTLINKxIdNode First;xIdNode Suc;#endifxIdNode Parent;#ifdef XIDNAMESxNameType Name;#endifxptrint SortSize;xRemoteVarListNode RemoteList;} xRemoteVarIdRec;There are also pointer types defined for each of the xECIdStruct according to the following example:
typedef XCONST struct xIdStruct *xIdNode;The type definitions above define the contents in the symbol table nodes. Each xECIdStruct, where EC should be replaced by an appropriate string, have the first five components in common. These components are used to build the symbol table tree. To access these components, a pointer to a symbol table node can be type cast to any of the xIdECNode types. The type xIdNode is used as such general type, for example when traversing the tree.
The five components present in all xIdNode are:
- EC of type xEntityClassType. This component is used to determine what sort of SDL object the node represents. xEntityClassType is an enum type containing elements for all entity classes in SDL.
- First, Suc, and Parent of type xIdNode. These components are used to build the symbol table tree. First refers to the first child of the current node. Suc refers to the next brother, while Parent refers to the father node. Only Parent is needed in an application.
- Name of type xNameType, which is defined as char *. This component is used to represent the name of the current SDL object as a character string. Not needed in an application.
Next there are components depending on what entity class that is to be represented. Below we discuss the non-common elements in the other xECIdStruct.
Package
- ModuleName of type xNameType. If the package is generated from ASN.1, this component holds the name of the ASN.1 module as a char *.
System, System Type
- Content of type xIdNode *. This component contains a list of all channels at the system level.
- VirtPrdList of type xPrdIdNode *. This is a list of all virtual procedures in this system instance.
- Super of type xSystemIdNode. This is a reference to the inherited system type. In a system this component in null. In a system instance it is a reference to the instantiated system type.
- Trace_Default of type int. This component contains the current trace value defined for the system.
- GRTrace of type int. This component contains the current GR (graphical) trace value defined for the system.
- MSCETrace of type int. This component contains the current MSCE (Message Sequence Chart Editor) trace value defined for the system.
Channel, Signal route, Gate
For channels, signal routes, and gates there are always two consecutive xChannelIdNodes in the symbol table, representing the two possible directions for a channel, signal route, or gate. The components are:
- SignalSet of type xIdNode *. This component represents the signal set of the channel in the current direction (a unidirectional channel has an empty signal set in the opposite direction).
- ToId of type xIdNode *. This is an array of xIdNodes, where each array component is a pointer to a symbol table node representing an SDL object, which this Channel/Signal route/Gate is connected to (connected to in the sense: to the SDL objects that signals are sent forward to).
- The SDL objects that may be referenced in ToId are channels, signal routes, gates, processes, and services. The last component in the array is always a NULL pointer (the value (xIdNode)0). See also Channels and Signal Routes.
- Reverse of type xChannelIdNode. This is a reference to the symbol table node that represents the other direction of the same channel, signal route, or gate.
Block, Block Type, Block Instance
- Super of type xBlockIdNode. In a block, this component is NULL. In a block type this component is a reference to the block that this block inherits from (NULL if no inheritance). In a block instance, this is a reference to the block type that is instantiated.
- Contents of type xIdNode *. In a block instance, these components contains list of:
- VirtPrdList of type xPrdIdNode *. This is a list of all virtual procedures in this block instance.
- ViewList of type xViewListRec *. This is a list of all revealed variables in the block or block instance.
- NumberOfInst of type int. This is the number of block instances in a block instance set. The component is thus only relevant for a block instance.
- Trace_Default of type int. This component contains the current value of the trace defined for the block.
- GRTrace of type int. This component contains the current value of the GR trace defined for the block.
- MSCETrace of type int. This component contains the current MSCE (Message Sequence Chart Editor) trace value defined for the block.
- GlobalInstanceId of type int. This component is used to store a unique id needed when performing MSCE trace.
Process, Process Type, Process Instance
- StateList of type xStateIdNode *. This is a list of references to the xStateIdNodes for this process or process type. Using the state value of an executing process, this list can be used to find the corresponding xStateIdNode.
- SignalSet of type xIdNode *. This represents the valid input signal set of the process or process type.
- Contents of type xIdNode *. This is an array containing references to the xSrvIdNodes of the services and service instances in this process.
- ToId of type xIdNode *. This is an array of xIdNode, where each array component is a pointer to an IdNode representing an SDL object that this process or process instance is connected to (connected to in the sense: to the SDL objects that signals are sent forward to).
- The SDL objects that may be referenced in ToId are channels, signal routes, gates, processes, and services. The last component in the array is always a NULL pointer (the value (xIdNode)0). See also section Channels and Signal Routes.
- MaxNoOfInst of type int. This represents the maximum number of concurrent processes that may exist according to the specification for the current process or process instance. An infinite number of concurrent processes is represented by -1.
- NextNo of type int. This is the instance number that will be assigned to the next instance that is created of this process instance set.
- NoOfStaticInst of type int.This component contains the number of static instance of this process instance set that should be present at start up. Used for process and process instance.
- ActivePrsList of type xPrsNode *. This is the address of a pointer to the "first" in the (single linked) list of active process instances of the current process or process instantiation.
- VarSize of type xptrint. The size, in bytes, of the data area used to represent the process (the struct: yVDef_ProcessName).
- Prio of type int. This represents the process priority.
- AvailPrsList of type xPrsNode. This is the address to the avail list pointer for process instances that have stopped. The data area can later be reused in subsequent Create actions on this process or process instantiation.
- Trace_Default of type int. This component contains the current value of the trace defined for the process.
- GRTrace of type int. This component contains the current value of the GR trace defined for the process.
- GRrefFunc, which is a pointer to a function that, given a symbol number (number assigned to a process symbol), will return a string containing the SDT reference to that symbol.
- MaxSymbolNumber of type int. This component is the number of symbols contained in the current process or process type.
- SignalSetLength of type int. This component is the number of signals contained in the signal set of the current process or process type.
- MSCETrace of type int. This component contains the current MSCE (Message Sequence Chart Editor) trace value defined for the process.
- CoverageArray of type long int *. This component is used as an array over all symbols in the process. Each time a symbol is executed the corresponding array component is increased by 1.
- NoOfStartTransitions of type long int. This component is used to count the number of times the start transition of the current process is executed. This information is presented in the coverage tables.
- MaxQueueLength of type long int. This component is used to register the maximum input port length for any instance of the current process. The information is presented in the coverage tables.
- PAD_Function, which is a pointer to a function. This pointer refers to the yPAD_ProcessName function for the current process. This function is called when a process instance of this type is to execute a transition. The PAD_Functions will of course be part of generated code, as they contain the action defined in the process graphs.
- Free_Vars, which is a pointer to a function. This pointer refers to the yFree_ProcessName function for the current process. This function is called when the process performs a stop action to deallocate memory used by the local variables in the process.
- Super of type xPrsIdNode. In a process this component is NULL. In a process type this component is a reference to the process type that this process type inherits from (NULL if no inheritance). In a process instance set, this is a reference to the process type that is instantiated.
- VirtPrdList of type xPrdIdNode *. This is a list of all virtual procedures in this process instantiation.
- InBlockInst of type xBlockIdNode. This component is a reference to the block instance set (if any) that this process or process instantiation is part of.
- RefToDefinition of type char *. This is the SDT reference to this process.
Service, Service Type, Service Instance
- StateList of type xStateIdNode *. This is a list of the references to the xStateIdNodes for this service or service type. Using the state value of an executing service, this list can be used to find the corresponding xStateIdNode.
- SignalSet of type xIdNode *. This represents the valid input signal set of the service or service type.
- ToId of type xIdNode *. This is an array of xIdNode, where each array component is a pointer to an IdNode representing an SDL object that this service or service instance is connected to (connected to in the sense: to the SDL objects that signals are sent forward to).
- The SDL objects that may be referenced in ToId are channels, signal routes, gates, processes, and service. The last component in the array is always a NULL pointer (the value (xIdNode)0). See also section Channels and Signal Routes.
- VarSize of type xptrint. The size, in bytes, of the data area used to represent the service (the struct: yVDef_ServiceName).
- GRrefFunc, which is a pointer to a function that, given a symbol number (number assigned to a service symbol), will return a string containing the SDT reference to that symbol.
- MaxSymbolNumber of type int. This component is the number of symbols contained in the current service or service type.
- SignalSetLength of type int. This component is the number of signals contained in the signal set of the current service or service type.
- CoverageArray of type long int. This component is used as an array over all symbols in the service. Each time a symbol is executed the corresponding array component is increased by 1.
- NoOfStartTransitions of type long int. This component is used to count the number of times the start transition of the current service is executed. This information is presented in the coverage tables.
- AvailSrvList of type xSrvNode. This is the address to the avail list pointer for service instances that have stopped. The data area can later be reused.
- PAD_Function, which is a pointer to a function. This pointer refers to the yPAD_ServiceName function for the current service. This function is called when a service instance of this type is to execute a transition. The PAD_Functions will of course be part of generated code, as they contain the action defined in the service graphs.
- Free_Vars, which is a pointer to a function. This pointer refers to the yFree_SeriveName function for the current service. This function is called when the service performs a stop action to deallocate memory used by the local variables in the service.
- Super of type xSrvIdNode. In a service this component is NULL. In a service type this component is a reference to the service type that this service type inherits from (NULL if no inheritance). In a service instantiation this is a reference to the service type that is instantiated.
- VirtPrdList of type xPrdIdNode *. This is a list of all virtual procedures in this service instantiation.
Procedure, Operator Diagram, Compound Statement
Note that operator diagrams and compound statements containing variable declarations are treated as procedures. However, such objects can, for example, not contain states.
- StateList of type xStateIdNode *. This is a list of references to the xStateIdNodes for this process or process type. Using the state value of an executing process, this list can be used to find the corresponding xStateIdNode.
- SignalSet of type xIdNode *. This represents the valid input signal set of the process or process type.
- Assoc_Function, which is a pointer to a function. This pointer refers to the yProcedureName function for the current procedure. This function is called when the SDL procedure is called and will execute the appropriate actions. The yProcedureName functions will, of course, be part of generated code as they contain the action defined in the procedure graphs.
- Free_Vars, which is a pointer to a function. This pointer refers to the yFree_ProcedureName function for the current procedure. This function is called when the procedure performs a return action to deallocate memory used by the local variables in the procedure.
- VarSize of type xptrint. The size, in bytes, of the data area used to represent the procedure (struct yVDef_ProcedureName).
- AvailPrdList of type xPrdNode *. This is the address of the avail list pointer for the data areas used to represent procedure instances. At a return action the data area is placed in the avail list and can later be reused in subsequent Calls of this procedure type.
- GRrefFunc, which is a pointer to a function that given a symbol number (number assigned to a procedure symbol) will return a string containing the SDT reference to that symbol.
- MaxSymbolNumber of type int. This component is the number of symbols contained in the current procedure.
- SignalSetLength of type int. This component is the number of signals contained in the signal set of the current procedure.
- CoverageArray of type long int. This component is used as an array over all symbols in the procedure. Each time a symbol is executed the corresponding array component is increased by 1.
- Super of type xPrdIdNode. This component is a reference to the procedure that this procedure inherits from (NULL if no inheritance).
- VirtPrdList of type xPrdIdNode *. This is a list of all virtual procedures in this procedure.
Remote Procedure
- RemoteList of type xRemotePrdListNode. This component is the start of a list of all processes that exports this procedure. This list is a linked list of xRemotePrdListStructs, where each node contains a reference to the exporting process.
Signal, Timer, StartUpSignal, and RPC Signals
- VarSize of type xptrint. The size, in bytes, of the data area used to represent the signal (the struct: yPDef_SignalName).
- AvailSignalList of type xSignalNode *. This is the address to the avail list pointer for signal instances of this signal type.
- Equal_Timer, which is a pointer to a function. This pointer only refers to a function when this node is used to represent a timer with parameters.
- In this case the referenced function can be used to investigate if the parameters of two timers are equal or not, which is necessary at reset actions. The Equal_Timer functions will be part of generated code. These functions are called from the functions xRemoveTimer and xRemoveTimerSignal, both defined in sctsdl.c
- Free_Signal, which is a function. This function takes a signal reference and returns any dynamic data referenced from the signal parameters to the pool of available memory.
- RefToDefinition of type char *. The SDT reference to the definition of the signal or timer.
- Prio, of type int. The priority of the signal.
State
- StateNumber of type int. The int value used to represent this state.
- SignalHandlArray of type xInputAction *. This component refers to an array of xInputAction, where xInputAction is an enum type with the possible values xDiscard, xInput, xSave, xEnablCond, xPrioInput.
- The array will have the same number of components as the SignalSet array in the node representing the process in which this state is contained. Each position in the SignalHandlArray represents the way the signal in the corresponding position in the SignalSet array in the process should be treated in this state.
- The last component in the SignalHandlArray is equal to xDiscard, which corresponds to the 0 value last in the SignalSet.
- If the SignalHandlArray contains the value xInput, xSave, or xDiscard at a given index, the way to handle the signal is obvious. If the SignalHandlArray contains the value xEnablCond, it is, however, necessary to calculate the enabling condition expression to know if the signal should cause an input or should be saved. This calculation is exactly the purpose of the EnablCond_Function described below.
- InputRef of type int *. This component is an array. If the SignalHandlArray contains xInput, xPrioInput, or xEnablCond at a certain index, this InputRef contains the symbol number for the corresponding input symbol in the graph.
- EnablCond_Function, which is a function that returns xInputAction. If the state contains any enabling conditions, this pointer will refer to a function. Otherwise it refers to 0. An EnablCond_Function takes a reference to an xSignalIdNode (referring to a signal) and a reference to a process instance and calculates the enabling condition for the input of the current signal in the current state of the given process instance.
- The function returns either of the values xInput or xSave. The EnablCond_Functions will of course be part of generated code, as they contain enabling condition expressions. These functions are called from the function xFindInputAction in the file sctsdl.c. xFindInputAction is used by the SDL_Output and SDL_Nextstate functions.
- ContSig_Function, which is a function returning int. If the state contains any continuous signals, this pointer will refer to a function. Otherwise it refers to 0.
- StateProperties of type int. In this component the three least significant bits are used to indicate:
- CoverageArray of type long int. This component is used as an array over the signalset (+1) of the process. Each time an input operation is performed, the corresponding array component is increased by 1. The last component, at index equal to the length of the signalset, is used to record the number of continuous signals "received" in the state. The information stored in this component is presented in the coverage table.
- Super of type xPrdIdNode. This component is a reference to the procedure that this procedure inherits from (NULL if no inheritance).
- RefToDefinition of type char *. The SDT reference to the definition of the state (one of the symbols where this state is defined).
Sort and Syntype
- Free_Function, which is a function. This function pointer is non-0 for types represented using dynamic memory (Charstring, Octet_string, Strings, Bags, for example). The Free_Functions are used to return dynamic memory to the pool of dynamic memory.
- Test_Function, which is a function returning xbool. This function is non-0 for all types containing range conditions. The function pointers are used by the monitor system to check the validity of a value when assigning it to a variable.
- SortSize of type xptrint. This component represents the size, in bytes, of a variable of the current sort.
- SortType of type xTypeOfSort. This component indicates the type of sort. Possible values are: xPredef, xUserdef, xEnum, xStruct, xArray, xGArray, xCArray, xRef, xString, xPowerSet, xBag, xGPowerSet, xInherits, xSyntype, xUnion, xUnionC, and xChoice.
SortType is xArray, xGArray, xCArray
- CompOrFatherSort of type xSortIdNode. This is a pointer to the SortIdNode that represents the component sort.
- IndexSort of type xSortIdNode. This is a pointer to the SortIdNode that represents the index sort. In a xCArray the index sort in always Integer.
- In xGArray, LowestValue is used as the offset of Data in the xxx_ystruct.
In xArray and xCArray it is 0.- In xGArray, HighestValue is used as the size of the xxx_ystruct. In xArray it is 0.
In xCArray it is the highest index, i.e. the Length - 1.- In xGArray, yrecIndexOffset is used as the offset of Index in the xxx_ystruct.
In xArray and xCArray it is 0.- In xGArray, yrecDataOffset is used as the offset of Data in the type (i.e. the value representing the default value).
In xArray and xCArray it is 0.SortType is xString, xGPowerSet, xBag
- CompOrFatherSort of type xSortIdNode. This is a pointer to the SortIdNode that represents the component sort.
- LowestValue is used as the offset of Data in the xxx_ystruct.
- HighestValue is used as the size of the xxx_ystruct.
SortType is xPowerSet, xRef, xOwn, xORef
- CompOrFatherSort of type xSortIdNode. This is a pointer to the SortIdNode that represents the component sort.
SortType is xInherits
- CompOrFatherSort, of type xSortIdNode. This is a pointer to the SortIdNode that represents the inherited sort.
SortType is xSyntype
- CompOrFatherSort, of type xSortIdNode. This is a pointer to the SortIdNode that represents the father sort (the newtype from which the syntype originates, even if it is a syntype of a syntype).
- IndexSort, of type xSortIdNode. This is a pointer to the SortIdNode that represents the represents the father sort (the newtype or syntype from which the syntype originates).
- LowestValue, of type long int. If the syntype can be used as an index in an array (translated to a C array) then this value is the lowest value in the syntype range, otherwise it is 0.
- HighestValue, of type long int. If the syntype can be used as an index in an array (translated to a C array) then this value is the highest value in the syntype range, otherwise it is 0. The LowestValue and HighestValue are used by the monitor when it handles arrays with this type as index type.
Variable, FormalPar, SignalPar, and Struct Components
- SortNode of type xSortIdNode. This component is a pointer to the SortIdNode that represents the sort of this variable or parameter.
- Offset of type xptrint. This component represents the offset, in bytes, within the struct that represents the process or procedure variables, the signal parameter, or the SDL struct. In other words, this is the relative place of this component within the struct.
- Offset2 of type xptrint. For a formal parameter in a process this component represents the offset, in bytes, of a formal parameter in the StartUpSignal. For an exported variable in a process this component represents the offset, in bytes, of the exported value for this variable.
- IsAddress of type int. This component is only used for procedure and operator formal parameters and is then used to indicate if the parameter in IN or IN/OUT or a result variable.
Remote Variable
- SortSize of type xptrint. This component is the size of the type of the exported variables.
- RemoteList of type xRemoteVarListNode. This component is the start of a list of all processes that exports this variable. This list is a linked list of xRemoteVarListStructs, where each node contains a reference to the exporting process and the Offset where to find the exported value.
Type Info Nodes
This section describes the most important implementation details regarding the type info node. Type info nodes are data structures that are used during run-time by the functions providing generic implementations of SDL operators. As the type info nodes contain essentially the same information as the xSortIdNodes, the type info nodes are used in more and more places in the code where xSortIdNode previously were used. In the longer perspective the xSortIdNode will be removed completely.
The type definitions that describe the type info nodes are listed in the sctpred.h file.
Each type info node is a struct that consists of:
- general components that are available for all type info nodes
- type-specific components that describe each specific type.
The following utility macros can be used to configure the type info nodes:
#ifndef T_CONST#define T_CONST const#endif#ifndef T_SDL_EXTRA_COMP#define T_SDL_EXTRA_COMP#define T_SDL_EXTRA_VALUE#endif#ifndef T_SDL_USERDEF_COMP#define T_SDL_USERDEF_COMP#endif#if defined(XREADANDWRITEF) && !defined(T_SDL_NAMES)#define T_SDL_NAMES#endif#ifdef T_SDL_NAMES#define T_SDL_Names(P) , P#else#define T_SDL_Names(P)#endif#ifdef T_SIGNAL_SDL_NAMES#define T_Signal_SDL_Names(P) , P#else#define T_Signal_SDL_Names(P)#endif#ifdef T_SDL_INFO#define T_SDL_Info(P) , P#else#define T_SDL_Info(P)#endif#ifndef XNOUSE_OPFUNCS#define T_SDL_OPFUNCS(P) , P#else#define T_SDL_OPFUNCS(P)#endifstruct tSDLFuncInfo;General Components
The following components are available for all type info nodes. The definition of the components is only listed in this section, but it is valid for each type info node listed in the next section.
/* --- General type information for SDL types --- */typedef T_CONST struct tSDLTypeInfoS {tSDLTypeClass TypeClass;unsigned char OpNeeds;xptrint SortSize;struct tSDLFuncInfo *OpFuncs;T_SDL_EXTRA_COMP#ifdef T_SDL_NAMESchar *Name;#endif#ifdef XREADANDWRITEFxIdNode FatherScope;xSortIdNode SortIdNode;#endif} tSDLTypeInfo;
- TypeClass: This component defines which type the info node describes. A list of available types and their corresponding values can be found in the enum type definition below:
typedef enum{/*SDL - standard types*/type_SDL_Integer=128,type_SDL_Real=129,type_SDL_Natural=130,type_SDL_Boolean=131,type_SDL_Character=132,type_SDL_Time=133,type_SDL_Duration=134,type_SDL_Pid=135,type_SDL_Charstring=136,type_SDL_Bit=137,type_SDL_Bit_string=138,type_SDL_Octet=139,type_SDL_Octet_string=140,type_SDL_IA5String=141,type_SDL_NumericString=142,type_SDL_PrintableString=143,type_SDL_VisibleString=144,type_SDL_NULL=145,type_SDL_Object_identifier=146,/* SDL - standard ctypes */type_SDL_ShortInt=150,type_SDL_LongInt=151,type_SDL_UnsignedShortInt=152,type_SDL_UnsignedInt=153,type_SDL_UnsignedLongInt=154,type_SDL_Float=155,type_SDL_Charstar=156,type_SDL_Voidstar=157,type_SDL_Voidstarstar=158,/* SDL - user defined types */type_SDL_Syntype=170,type_SDL_Inherits=171,type_SDL_Enum=172,type_SDL_Struct=173,type_SDL_Union=174,type_SDL_UnionC=175,type_SDL_Choice=176,type_SDL_ChoicePresent=177,type_SDL_Powerset=178,type_SDL_GPowerset=179,type_SDL_Bag=180,type_SDL_String=181,type_SDL_LString=182,type_SDL_Array=183,type_SDL_Carray=184,type_SDL_GArray=185,type_SDL_Own=186,type_SDL_Oref=187,type_SDL_Ref=188,type_SDL_Userdef=189,type_SDL_EmptyType=190,/* SDL - signals */type_SDL_Signal=200,type_SDL_SignalId=201} tSDLTypeClass;- OpNeeds: This component contains four bits that give the properties of the type regarding assignment, equal test, free function, and initialization.
- The first bit indicates if the type is a pointer that needs to be automatically freed, or if it contains a pointer that needs to be automatically freed. If the first bit is set, it is necessary to look for memory to be freed inside of a value of this type.
- The second bit indicates if memcmp can be used to test if two values of this type are equal or not. If the bit is set, special treatment is needed.
- The third bit indicates if memcpy can be used to perform assign of this type. If the bit is set, special treatment is needed.
- The fourth bit indicates if this type needs to be initialized to anything else than 0.
The following macros can be used to test these properties:
#define NEEDSFREE(P) \(((tSDLTypeInfo *)(P))->OpNeeds & (unsigned char)1)#define NEEDSEQUAL(P) \(((tSDLTypeInfo *)(P))->OpNeeds & (unsigned char)2)#define NEEDSASSIGN(P) \(((tSDLTypeInfo *)(P))->OpNeeds & (unsigned char)4)#define NEEDSINIT(P) \(((tSDLTypeInfo *)(P))->OpNeeds & (unsigned char)8)
- SortSize: This component defines the size of the type.
- OpFuncs: This is a pointer to a struct containing references to specific assign, equal, free, read, and write functions. This component is only used in special cases. If assign, equal, free, read or write functions have been implemented using #ADT directives, information about this is stored in the OpFuncs field. The default value of the OpFuncs field is 0, but if you have provided any of these functions, the field will be a pointer to a tSDLFuncInfo struct. This struct will in turn refer to the provided functions.
typedef struct tSDLFuncInfo {void *(*AssFunc) (void *, void *, int);SDL_Boolean (*EqFunc) (void *, void *);void (*FreeFunc) (void **);#ifdef XREADANDWRITEFchar *(*WriteFunc) (void *);int (*ReadFunc) (void *);#endif} tSDLFuncInfo;- Name: This is the name of the type as a string literal.
- FatherScope: This is a pointer to the IdNode for the scope that the type is defined in.
- SortIdNode: This is a pointer to the xSortIdNode that describes the same type. This field will in a longer perspective be removed.
Type Info Node Optimization
Depending on the operations used for data types in the translated system, some of the type info nodes might not be needed. The purpose of this described optimization is to remove such type info nodes.
The first step is to surround all type info nodes with #ifdefs according to the example for the predefined type integer below.
#ifndef XTNOUSE_IntegertSDLTypeInfo ySDL_SDL_Integer = {....};#endifThis means that the type info node for integer can be removed by defining XTNOUSE_Integer.
The names for the predefined data types in the #ifndef statements are:
#ifndef XTNOUSE_Integer#ifndef XTNOUSE_Real#ifndef XTNOUSE_Natural#ifndef XTNOUSE_Boolean#ifndef XTNOUSE_Character#ifndef XTNOUSE_Time#ifndef XTNOUSE_Duration#ifndef XTNOUSE_Pid#ifndef XTNOUSE_Charstring#ifndef XTNOUSE_Bit#ifndef XTNOUSE_Bit_string#ifndef XTNOUSE_Octet#ifndef XTNOUSE_Octet_string#ifndef XTNOUSE_IA5String#ifndef XTNOUSE_NumericString#ifndef XTNOUSE_PrintableString#ifndef XTNOUSE_VisibleString#ifndef XTNOUSE_NULL#ifndef XTNOUSE_Object_identifierFor user defined types the name is selected according to the following algorithm.
- If the type name is unique (case sensitive, as C is case sensitive), that is there is only one data type in the system with this name, then name in the #ifndef will be:
- If the type name is not unique but type name plus the name of the scope where the type is defined is unique, the name in the #ifndef will be:
XTNOUSE_typename_scopename- In other cases the name in the #ifndef will be:
XTNOUSE_typename-with-prefix-or-suffixUsing only this part of the algorithm it is of course possible to manually write a .h file with the suitable defines to remove the type info nodes that are not used. The compiler/linker can help finding unused data.
However the code generator calculates the usage of type info nodes. This information will be stored in the file:
sdl_cfg.hThe last section in this file will contain the defines for the usage of type info nodes.
Example 509 : Usage of type info nodes
#ifdef XUSE_TYPEINFONODE_CFG/* Type info node configuration */#define XTNOUSE_Boolean#define XTNOUSE_Character#define XTNOUSE_Charstring/* NOT #define XTNOUSE_Integer*/......../* NOT #define XTNOUSE_s*/#endifFor every data type in the system there will be one line indicating if the type info node is used or not. Please note also that it is necessary to define XUSE_TYPEINFONODE_CFG at compilation, otherwise the automatically computed type info node optimization will not be used.
The file sdl_cfg.h is automatically included and used in Cmicro. In Cadvanced and C Code Generator the following code can be found in scttypes.h:
#ifdef USER_CONFIG#include "sct_mcf.h"#elif defined(AUTOMATIC_CONFIG)#include "sdl_cfg.h"#endifSo by defining USER_CONFIG and including sdl_cfg.h in sct_mcf.h or by defining AUTOMATIC_CONFIG the computed type info node optimization is used.
Sometimes the automatic computation on used type info nodes might fail. The most obvious case is usage inside inline C code. As the code generator does not parse such code, it has no chance to know of such usage. To cope with these situations the user has the possibility to tell the code generator that certain type info nodes are used, and thereby also the nodes that the particular node depends on. It is of course possible for a user to manually handle these situations be inserting proper #define and #undef after the type info node configuration. However this might prove difficult due to all the dependencies between type info nodes.
A user can tell the code generator that certain type info nodes are used by specifying this in a file. The code generator will look for such a file according to the following:
If the environment variable TAU_TYPEINFOCFG is defined, the value of this variable is treated as a file name (including path) and this file is read. If the code generator can not open this file it will produce an error.
If the environment variable is not defined a file with the name 'typeinfo.cfg' is looked for. In SDL Suite the code generator will first look in the source directory and if it can not find the file there it will look in the directory where SDL Suite is started from. If a 'typeinfo.cfg' file is found it is read. If no such file is found the code generator assumes that the user does not have a type info configuration file.
The contents of the type info configuration file should be:
Each type that should be registered as used should be mentioned on a line of its own, starting with the type name. If the several data types with the same name exist in the system the type name can be followed be the name of the scope that the data is defined in. One or more spaces or tabs should separate the type name and the scope name.
Example 510 : Type name and scope name
typename1typename2 scopename2typename3The code generator will search for data types that match the criteria (name or name/scope) given above. The search will in SDL Suite follow the case sensitivity option in the tool. The following rules then apply:
- The type info node in all data types that matches the criteria (type name or type name/scope name) will be registered as used.
- All type info nodes that the registered node depends on will also be registered as used.
- An error message will be given if no data type matches a criteria.
If case sensitive search is used the predefined types should be given according to the following table:
IntegerRealNaturalBooleanCharacterTimeDurationPidCharstringBitBit_stringOctetOctet_stringIA5StringNumericStringPrintableStringVisibleStringNULLObject_identifierThe name of the scope for these types is: Predefined
Memory optimization
In the kernel file sctpred.c the following functions are conditionally defined (using #ifdef) to save memory when they are not needed:
GenericIsAssignedIsPointerToMakeGenericMakeStructGenericGetValueGenericSetValueThe conditional definitions are based on usage in the kernel or generated code. However if there is a need for some reason to use them directly, it is needed to make them accessible by manually defining a flag corresponding to each function named XMK_USE_FUNC_<function name in capital letters>:
XMK_USE_FUNC_GENERICISASSIGNEDXMK_USE_FUNC_ISPOINTERTOMAKEXMK_USE_FUNC_GENERICMAKESTRUCTXMK_USE_FUNC_GENERICGETVALUEXMK_USE_FUNC_GENERICSETVALUEFurthermore the function GenericDefault has additional #ifdef constructions inside the function to save memory in some cases.
Type-Specific Components
The following section lists the components that defines the type info nodes. Only the type-specific components are explained. The general components are listed and explained in the section above.
Enumeration types
/* ------------- Enumeration type --------------- */typedef T_CONST struct {int LiteralValue;char *LiteralName;} tSDLEnumLiteralInfo;typedef T_CONST struct tSDLEnumInfoS {tSDLTypeClass TypeClass;unsigned char OpNeeds;xptrint SortSize;struct tSDLFuncInfo *OpFuncs;T_SDL_EXTRA_COMP#ifdef T_SDL_NAMESchar *Name;#endif#ifdef XREADANDWRITEFxIdNode FatherScope;xSortIdNode SortIdNode;#endif#ifdef XREADANDWRITEFint NoOfLiterals;tSDLEnumLiteralInfo *LiteralList;#endif} tSDLEnumInfo;
- NoOfLiterals: The number of literals in the enum type.
- LiteralList: a pointer to an array of tSDLEnumLiteralInfo elements. This list implements a translation table between enum values and literal names as strings
Syntypes, types with inheritance, and Own, Ref, Oref instantiations
/* ------ Syntype, Inherits, Own, Oref, Ref ----- */typedef T_CONST struct tSDLGenInfoS {tSDLTypeClass TypeClass;unsigned char OpNeeds;xptrint SortSize;struct tSDLFuncInfo *OpFuncs;T_SDL_EXTRA_COMP#ifdef T_SDL_NAMESchar *Name;#endif#ifdef XREADANDWRITEFxIdNode FatherScope;xSortIdNode SortIdNode;#endiftSDLTypeInfo *CompOrFatherSort;} tSDLGenInfo;
- CompOrFatherSort: Reference to the type info node of the father sort (syntype, inherits) or component sort (Own, Ref, Oref).
Powersets (implemented as unsigned in [ ])
/* ------------------ Powerset ------------------ */typedef T_CONST struct tSDLPowersetInfoS {tSDLTypeClass TypeClass;unsigned char OpNeeds;xptrint SortSize;struct tSDLFuncInfo *OpFuncs;T_SDL_EXTRA_COMP#ifdef T_SDL_NAMESchar *Name;#endif#ifdef XREADANDWRITEFxIdNode FatherScope;xSortIdNode SortIdNode;#endiftSDLTypeInfo *CompSort;int Length;int LowestValue;} tSDLPowersetInfo;
- CompSort: Reference to the type info node of the component sort.
- Length: The number of possible values in the component sort.
- LowestValue: The value of the lowest value in the component sort.
Structs
/* ------------------- Struct ------------------- */typedef int (*tGetFunc) (void *);typedef void (*tAssFunc) (void *, int);typedef T_CONST struct {xptrint OffsetPresent; /* 0 if not optional */void *DefaultValue;} tSDLFieldOptInfo;typedef T_CONST struct {tGetFunc GetTag;tAssFunc AssTag;} tSDLFieldBitFInfo;typedef T_CONST struct {tSDLTypeInfo *CompSort;#ifdef T_SDL_NAMESchar *Name;#endifxptrint Offset; /* ~0 for bitfield */tSDLFieldOptInfo *ExtraInfo;} tSDLFieldInfo;typedef T_CONST struct tSDLStructInfoS {tSDLTypeClass TypeClass;unsigned char OpNeeds;xptrint SortSize;struct tSDLFuncInfo *OpFuncs;T_SDL_EXTRA_COMP#ifdef T_SDL_NAMESchar *Name;#endif#ifdef XREADANDWRITEFxIdNode FatherScope;xSortIdNode SortIdNode;#endiftSDLFieldInfo *Components;int NumOfComponents;} tSDLStructInfo;
- Components: An array of tSDLFieldInfo; one component in the array for each field of the struct.
- NumOfComponents: The number of fields in the struct.
- CompSort in tSDLFieldInfo: The reference to the type info node of the field sort.
- Name in tSDLFieldInfo: The name of the field as a string.
- Offset in tSDLFieldInfo: The offset of the field in the C struct that represents the SDL struct. This component is ~0 for bitfield in SDL (offsets cannot be calculated for bitfields).
- ExtraInfo in tSDLFieldInfo: The interpretation of this component depends on the properties in the SDL field.
- if Offset is ~0, the field is a bitfield and ExtraInfo is a pointer to a tSDLFieldBitFInfo struct containing two functions to set and get the value of the bitfield.
- if Offset is not ~0 and ExtraInfo != 0, the SDL field is either optional or has a default value. ExtraInfo is a pointer to a tSDLFieldOptInfo struct containing the offset for the Present flag (0 if not optional) and a pointer to the default value (0 if no default value).
Choice and #union
/* ---------------- Choice, Union --------------- */typedef T_CONST struct {tSDLTypeInfo *CompSort;#ifdef T_SDL_NAMESchar *Name;#endif} tSDLChoiceFieldInfo;typedef T_CONST struct tSDLChoiceInfoS {tSDLTypeClass TypeClass;unsigned char OpNeeds;xptrint SortSize;struct tSDLFuncInfo *OpFuncs;T_SDL_EXTRA_COMP#ifdef T_SDL_NAMESchar *Name;#endif#ifdef XREADANDWRITEFxIdNode FatherScope;xSortIdNode SortIdNode;#endiftSDLChoiceFieldInfo *Components;int NumOfComponents;xptrint OffsetToUnion;xptrint TagSortSize;#ifdef XREADANDWRITEFtSDLTypeInfo *TagSort;#endif} tSDLChoiceInfo;
- Components: An array of tSDLChoiceFieldInfo; one component in the array for each field in the choice/#union.
- NumOfComponents: The number of fields in the choice/#union.
- OffsetToUnion: The offset to where the union, within the representation of the choice/#union, starts.
- TagSortSize: The size of the tag type.
- TagSort: A reference to the type info node of the tag sort.
Array and Carray
/* --------------- Array, CArray ---------------- */typedef T_CONST struct tSDLArrayInfoS {tSDLTypeClass TypeClass;unsigned char OpNeeds;xptrint SortSize;struct tSDLFuncInfo *OpFuncs;T_SDL_EXTRA_COMP#ifdef T_SDL_NAMESchar *Name;#endif#ifdef XREADANDWRITEFxIdNode FatherScope;xSortIdNode SortIdNode;#endiftSDLTypeInfo *CompSort;int Length;#ifdef XREADANDWRITEFtSDLTypeInfo *IndexSort;int LowestValue;#endif} tSDLArrayInfo;
- CompSort: The reference to the type info node of the component sort.
- Length: The number of components in the array.
- IndexSort: The reference to the type info node of the index sort.
- LowestValue: The start value of the index range (as an int).
General arrays
A general array is an array that is represented as a linked list in C.
/* ------------------- GArray ------------------- */typedef T_CONST struct tSDLGArrayInfoS {tSDLTypeClass TypeClass;unsigned char OpNeeds;xptrint SortSize;struct tSDLFuncInfo *OpFuncs;T_SDL_EXTRA_COMP#ifdef T_SDL_NAMESchar *Name;#endif#ifdef XREADANDWRITEFxIdNode FatherScope;xSortIdNode SortIdNode;#endiftSDLTypeInfo *IndexSort;tSDLTypeInfo *CompSort;xptrint yrecSize;xptrint yrecIndexOffset;xptrint yrecDataOffset;xptrint arrayDataOffset;} tSDLGArrayInfo;
- IndexSort: The reference to the type info node of the index sort.
- CompSort: The reference to the type info node of the component sort.
- yrecSize: The size of the type SDLType_yrec.
- yrecIndexOffset: The offset of Index in type SDLType_yrec.
- yrecDataOffset: The offset of Data in type SDLType_yrec.
- arrayDataOffset: The offset of Data in type SDLType, where SDLType is the name in C of the translated array type.
General powersets, Bags, Strings and Object_identifier
/* -- GPowerset, Bag, String, Object_Identifier - */typedef T_CONST struct tSDLGenListInfoS {tSDLTypeClass TypeClass;unsigned char OpNeeds;xptrint SortSize;struct tSDLFuncInfo *OpFuncs;T_SDL_EXTRA_COMP#ifdef T_SDL_NAMESchar *Name;#endif#ifdef XREADANDWRITEFxIdNode FatherScope;xSortIdNode SortIdNode;#endiftSDLTypeInfo *CompSort;xptrint yrecSize;xptrint yrecDataOffset;} tSDLGenListInfo;
- CompSort: The reference to the type info node of the component sort.
- yrecSize: The size of the type SDLType_yrec
- yrecDataOffset: The offset of Data in type SDLType_yrec
Limited strings
A limited string is a string that is implemented as an array in C.
/* ------------------ LString ------------------- */typedef T_CONST struct tSDLLStringInfoS {tSDLTypeClass TypeClass;unsigned char OpNeeds;xptrint SortSize;struct tSDLFuncInfo *OpFuncs;T_SDL_EXTRA_COMP#ifdef T_SDL_NAMESchar *Name;#endif#ifdef XREADANDWRITEFxIdNode FatherScope;xSortIdNode SortIdNode;#endiftSDLTypeInfo *CompSort;int MaxLength;xptrint DataOffset;} tSDLLStringInfo;
- CompSort: The reference to the type info node of the component sort.
- MaxLength: The maximum length of the string.
- DataOffset: The offset of Data in type SDLType, where SDLType is the name in C of the translated string type.
SDL type (C representation decided with a #ADT directive)
/* ------------------ Userdef ------------------- *//* used for user defined types #ADT(T(h)) */typedef T_CONST struct tSDLUserdefInfoS {tSDLTypeClass TypeClass;unsigned char OpNeeds;xptrint SortSize;struct tSDLFuncInfo *OpFuncs;T_SDL_EXTRA_COMP#ifdef T_SDL_NAMESchar *Name;#endif#ifdef XREADANDWRITEFxIdNode FatherScope;xSortIdNode SortIdNode;#endifT_SDL_USERDEF_COMP} tSDLUserdefInfo;SDL signal
A signal is treated in the same way as a struct.
/* ------------------- Signal ------------------- */typedef T_CONST struct {tSDLTypeInfo *ParaSort;xptrint Offset;} tSDLSignalParaInfo;typedef T_CONST struct tSDLSignalInfoS {tSDLTypeClass TypeClass;unsigned char OpNeeds;xptrint SortSize;struct tSDLFuncInfo *OpFuncs;T_SDL_EXTRA_COMP#ifdef T_SIGNAL_SDL_NAMESchar *Name;#endiftSDLSignalParaInfo *Param;int NoOfPara;} tSDLSignalInfo;
- Param: An array with a component of the type tSDLSignalParaInfo for each signal parameter type. For each parameter, the parameter sort is given as a reference to the type info node and as the offset for the parameter value within the struct representing the signal.
- NoOfPara: The number of parameters in the signal.
http://www.ibm.com/rational |
![]() |
![]() |
![]() |
![]() |