- All Superinterfaces:
Expression,Sourceable
A binary operation.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThis defines all CIVL binary operators:
AND: invalid input: '&'invalid input: '&'(logical and); LEFT_SHIFT:invalid input: '<'(bitwise left shift); RIGHT_SHIFT:>>(bitwise right shift); BITAND:invalid input: '&'(bitwise and); BITCOMPLEMENT:~(bitwise complement); BITOR:|(bitwise or); BITXOR:^(bitwise xor); DIVIDE:/(division); EQUAL:==(equal to); IMPLIES:(implication); LESS_THAN:invalid input: '<'(less than); LESS_THAN_EQUAL:invalid input: '<'=(less than or equal to); MINUS:-(subtraction); MODULO:%(modulo); NOT_EQUAL:!=(not equal to); OR:||(logical or); PLUS:+(addition); POINTER_ADD:+(pointer addition); POINTER_SUBTRACT:-(pointer subtraction); TIMES:*(multiplication);Nested classes/interfaces inherited from interface dev.civl.mc.model.IF.expression.Expression
Expression.ExpressionKind -
Method Summary
Modifier and TypeMethodDescriptionbooleanIs the value of this binary expression going to be assigned to the left-hand-side operand?left()operator()right()voidsetAssignToLeft(boolean value) booleanSwitch the left and right operands when the operator is symmetric, and return true; If the operator is not symmetric, then do nothing and return false.Methods inherited from interface dev.civl.mc.model.IF.expression.Expression
calculateConstantValue, calculateDerefs, constantValue, containsHere, expressionKind, expressionScope, freeVariables, getExpressionType, hasConstantValue, hasDerefs, isErrorFree, isPurelyLocal, lowestScope, purelyLocalAnalysis, purelyLocalAnalysisOfVariables, replaceWith, replaceWith, setErrorFree, variableAddressedOf, variableAddressedOfMethods inherited from interface dev.civl.mc.model.IF.Sourceable
getSource, setCIVLSource
-
Method Details
-
left
Expression left()- Returns:
- The left operand.
-
operator
BinaryExpression.BINARY_OPERATOR operator()- Returns:
- The binary operator
-
operatorToString
String operatorToString() -
right
Expression right()- Returns:
- The right operand.
-
setAssignToLeft
void setAssignToLeft(boolean value) -
isAssignToLeft
boolean isAssignToLeft()Is the value of this binary expression going to be assigned to the left-hand-side operand?- Returns:
-
switchOperands
boolean switchOperands()Switch the left and right operands when the operator is symmetric, and return true; If the operator is not symmetric, then do nothing and return false.- Returns:
-