Referent Constraint Variables Follow
Hi,
I've looked through the docs on Constraints, but I'm still not clear on what all of the variables in a referent constraint refer to. For example, let's say I have the following model:
record : Matrix
statement: ...
statement : IfStatement
field : ...
field : ScaleX
type : <no name>[Array]
memberType : <no name>[FixedPointBit]
index : NScaleBits
and in the editor, it looks like:
record MATRIX
HasScale : UnsignedBit [ 1 ]
if ( HasScale := 1 )
NScaleBits : UnsignedBit [ 5 ]
ScaleX : FixedPointBit [ NScaleBits ]
end if
end record
The "index" node is a FieldReference (an extension of ArrayIndexExpression) which has a reference to a FieldDeclaration and I've attached a constraint to FieldReference (the same constraint you have been helping me with in another thread). When I place my cursor inside the square brackets in "FixedPointBit [ NScaleBits ]" and press ctrl-space, this is what I'm guessing the constraint variables refer to:
model - the model that is being transformed
scope - no idea
referenceNode - the FieldDeclaration pointed to by the FieldReference reference
linkTarget - no idea
enclosingNode - since I'm creating the ArrayIndexExpression at this point in editing, this seems like the parent node of the node that will be created (I'm pretending like the NScaleBits reference does not exist in the editor yet). So, this would be the "type: <no name>[Array]" node.
I know docs are typically a lower priority when releasing betas, especially since things change a lot making the docs harder to maintain, but for me, the main blocking points to my understanding of MPS are terminology. Docs could help there.
Thanks for answering all my questions. I know there have been a lot (and more to come, I'm sure :-))
-Kevin
Please sign in to leave a comment.
Hello, Kevin,
model - the model that is being transformed, right
scope - no idea, it's a object which shows you which models/language/etc you can see from the code.
referenceNode - the FieldDeclaration pointed to by the FieldReference reference
linkTarget - no idea, current value of link target in the node.
enclosingNode - since I'm creating the ArrayIndexExpression at this point in editing, this seems like the parent node of the node that will be created (I'm pretending like the NScaleBits reference does not exist in the editor yet). So, this would be the "type: <no name>[Array]" node, right