Connection Syntax (Basic)
The connection signature tells the Translator what code to generate to connect an object to another. This is trivial when the two objects are scalar (dimension 1). However, in the more general case the translator has to generate multiple loops so each element of the connecting object can make its own connections, or connections can be made to specific elements.
In principle it would have been nice if the Translator could simply use a lowercase version of the uppercase dimension name to generate the connection loops. This is not possible, since users can specify: a numeric value, a lowercase variable, a long name or use the same name for multiple dimensions or all of the above.
Eg. [2][2][longdimname][longdimname][N][n][n]
Thus the translator must use generic symbols to distinguish the varies entries in the connector dimensions and the connectee dimensions.
Values with a # symbol are connector element ids (ie the element indexes of the connecting object), with #0 being the fastest varying dimension (ie right to left)
#0, #1, #2, ...
Values with a ^ symbol are connectee loops, specified by a multiplier in the signature with ^0 being the left most multiplier.
^0, ^1, ^2, ...
Basic Signature:
{Multipliers}{Connectee Elements}
Multipliers:
{Connectee Loop Counts}
Connectee Elements:
[ {Elements} ]
Elements:
{Element} [ , {Elements} ]
Connectee Loop Counts:
{Dim} [ . {Connectee Loop Counts}]
Element:
{Value} | {Connectee Index} | {Connector Index}
Dim:
{Value} | {Macro}
Value:
numeric constant (0 upwards)
Macro:
Text that compiles to a numeric constant
Connectee Index:
^ {Index}
Connector Index:
# {Index}
Index:
loop index - 0 is fastest varying
Thus when a 2-d object [N][M] connects to a 2-d object [P][Q] the translator, needs to generate the following code
for #1 in N
for #0 in M
for ^0 in P
for ^1 in Q
connect element [#1][#0] to [^0][^1]
Since the signature is used as the rule for each connectee object, the signature is simply P.Q[^0][^1], where the P.Q are connectee loop multipliers and the ^0, ^1 refer to these.
When a connect is made to a specific element number, the value is simply shown without any symbols (eg [3]).
Repeated Connections
Connector elements can make multiple connections to connectee elements by specifying additional Repeat count loops. The Repeat count is maintained as a separate value and not shown in the signature as it applies to every connection (innermost loop). This would become complex and tedious with the Advanced connection Signatures.
Dimension
The dimension of a connection show the number of connections that each connector element makes to the connectee object. This dimension is used to generate the access functions to the object, which take the connection element numbers NOT the object element numbers. The generated code will also check the supplied element values against the actual dimensions.
Eg. Collector Clx makes 3 repeated connections to a Tst of dimension [N][M]
Clx->TstInst1Cxn( Uns N1, Uns M1, Uns R1 )
In this case the connection dimensions N1 and M1 are the same as the object dimensions N and M with the added dimension for the repeat count R.
Examples
Clx makes 1 connection to TST
Dimension [1]
Signature [0]
Repeat 1
Clx makes N connections to the TST
Dimension [1]
Signature [0]
Repeat N
Clx makes 1 connection to each of the N TSTs
Dimension [N]
Signature N[^0]
Repeat 1
Each of the M Clx's make 1 connection to the TST
Dimension [1]
Signature [0]
Repeat 1
Each of the M Clx's make 1 connection to each of the N TST's
Dimension [N]
Signature N[^0]
Repeat 1
Each of the M Clx's make 1 connection to the TST of the matching element number
Dimension [1]
Signature [#0]
Repeat 1
Each of the M Clx's make the following connections. Each of the P Clx's connects to each of the N TST's using the same m(#1) element number
Dimension [N]
Signature N[^0,#1] NB ^0 because there is only 1 connectee loop counter (ie N), #1 because M is the slowest connector dimension
Repeat 1