An increment or decrement expression is mapped to a call behavior action for the + function (for increment) or the - function (for decrement) from the library package Alf::Library::PrimitiveBehaviors::IntegerFunctions (see Subclause 11.3.2).. The second argument input pin of the call behavior action is connected by an object flow to the result output pin of a value specification action for the value 1. The result output pin of the call behavior action is connected by an object flow to a fork node, which acts as the the source element when the expression is an assigned source.
The operand is mapped first considered as an effective argument expression. If the increment or decrement expression is a prefix expression, then the result source element of this mapping is connected by an object flow to the first argument input pin of the call behavior action and the assigned source element is also the result element for the expression. If it is a postfix expression, then the result source element of the operand expression mapping is first connected to a fork node and then that is connected to the argument input pin, and the fork node is the result source element for the expression.
The operand is also mapped as a left-hand side to which is assigned the result of the call behavior action (see Subclause 17.24).
If the operand has an index, then the index expression is only mapped once. The result source element of the index expression is connected by an object flow to a fork node, which is used as the source for the index value in the mapping of the operand expression both as an argument and as the left hand side of the assignment.
A Boolean unary expression with a Boolean negation operator is mapped as the equivalent behavior invocation (see Subclause 17.9)for the function Alf::Library:: PrimitiveBehaviors::BooleanFunctions::'!' (see Subclause 11.3.1) on the operand expression.
BitString Unary Expressions
A BitString unary expression with a BitString negation operator is mapped as the equivalent behavior invocation (see Subclause 17.9) for the function Alf::Library:: PrimitiveBehaviors::BitStringFunctions ::'~' (see Subclause 11.3.5) on the operand expression. Note that this includes the possibility of bit string conversion on the operand expression.
Numeric Unary Expressions
A numeric unary expression with a plus operator is mapped as its operand expression. A numeric unary expression with a minus operator is mapped as the equivalent behavior invocation (see Subclause 17.9) for the function Alf::Library:: PrimitiveBehaviors::IntegerFunctions::Neg (see Subclause 11.3.2) on the operand expression.
Cast Expressions
If the named type is any or is a supertype of the type of the operand expression, then a cast expression is mapped as its operand expression, except that, if the result source element is a typed element, it is typed with the type of the cast expression, rather than the type of the argument expression.
If the named type is a classifeier, then a cast expression is mapped like a select expression (see Subclause 17.19) whose condition is a read is classified object action for the type of the cast expression (“instanceof” operator).
Isolation Expressions
An isolation expression is mapped as a structured activity node with isIsolated=true and the operand expression mapped inside it. The structured activity node has a single output pin with the type and multiplicity of the operand expression. The result source element from the mapping of the operand expression is connected inside the structured activity node by an object flow to the output pin. The result source element for the isolation expression is the output pin of the structure activity node.
17.22Binary Expression
Arithmetic Expressions
An arithmetic expression is mapped as a behavior invocation (see Subclause 17.9) for the corresponding primitive behavior from the Alf::Library::PrimitiveBehaviors package (see Subclause 11.3), as given in Table 17 -16.
Table 17 16 Primitive Behavior Equivalents for Arithmetic Operators
Operator
Behavior
*
IntegerFunctions::'*'
/
IntegerFunctions::'/'
%
IntegerFunctions::'%'
+ (isConcatentation=false)
IntegerFunctions::'+'
+ (isConcatenation=true)
StringFunctions::'+'
-
IntegerFunctions::'-'
Shift Expressions
A shift expression is mapped as a behavior invocation (see Subclause 17.9) for the corresponding primitive behavior from the Alf::Library::PrimitiveBehaviors package (see Subclause 11.3), as given in Table 17 -17. Note that this includes the possibility of performing bit string conversion on the first operand.
Table 17 17 Primitive Behavior Equivalents for Arithmetic Operators
Operator
Behavior
<<
BitStringFunctions::'<<'
>>
BitStringFunctions::'>>'
>>>
BitStringFunctions::'>>>'
Relational Expressions
A relational expression is mapped as a behavior invocation (see Subclause 17.9) for the corresponding primitive behavior from the Alf::Library::PrimitiveBehaviors package (see Subclause 11.3), as given in Table 17 -18.
A logical expression is mapped as a behavior invocation (see Subclause 17.9) for the corresponding primitive behavior from the Alf::Library::PrimitiveBehaviors package (see Subclause 11.3), as given in Table 17 -19. Note that this includes the possibility of applying bit string conversion to one or both operands, if the operator is bit-wise.
A classification expression maps to a read is classified object action for the named classifier with. If the classification operator is instanceof, then isDirect=false. If the operator is hasType, then isDirect=true. The object input pin of the action is the target of an object flow from the result source element for the mapping of the operand expression. The result output pin of the action is the result source element for the classification expression.
Equality Expressions
An equality expression is mapped to a test identity action. If the expression uses the operator ==, and both operand expressions have a multiplicity lower bound of 1, then the input pins of the action are the targets of object flows from the result source elements for the mappings of the argument expressions. The output pin of the action is the result source pin for the equality expression.
If either operand expression has a multiplicity lower bound of 0, then the result of that expression is first tested for being not empty using the library function Alf::Library:: PrimitiveBehaviors::SequenceFunctions::NotEmpty (see Subclause 11.3.6). The test identity action is executed only if both argument expressions are non-empty. Otherwise, the equality expression is true only if both argument expressions are empty.
NOTE. Despite the extra checks described above, the mapping for an equality expression still always evaluates the operand expressions exactly once.
An equality expression that uses the operator != is mapped as above, but the result output pin of the test identity action is connected by an object flow to the argument input pin of a call behavior action for the library function Alf::Library::PrimitiveBehaviors:: BooleanFunctions::'!' (see Subclause 11.3.1). The result source element is the result output pin of the call behavior action.
Conditional Logical Expressions
A conditional-and expression is mapped like a conditional-test expression (see Subclause 17.23) whose first two operand expressions are the same as those of the conditional-and expression and whose third operand expression is false.
A conditional-or operator expression is mapped like a conditional-test expression (see Subclause 17.23) whose first and third operand expressions are the same as the two operand expressions of the conditional-or expression and whose second operand expression is true.