Package org.eclipse.cdt.core.dom.ast
Interface IASTBinaryExpression
- All Superinterfaces:
IASTExpression
,IASTInitializerClause
,IASTNode
- All Known Subinterfaces:
ICPPASTBinaryExpression
,IGPPASTBinaryExpression
This interface represents a binary expression.
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.cdt.core.dom.ast.IASTExpression
IASTExpression.ValueCategory
Nested classes/interfaces inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
IASTNode.CopyStyle
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
assignment =static final int
binary and &static final int
binary and assign &=static final int
binary Or |static final int
binary Or assign |=static final int
binary Xor ^static final int
binary Xor assign ^=static final int
divide /static final int
divide assignemnt /=static final int
For gcc compilers, only.static final int
equals ==static final int
greater than or equals >=static final int
greater than >static final int
less than or equals <=static final int
less than <static final int
logical and &&static final int
logical or ||static final int
For g++, only.static final int
For g++, only.static final int
minus -static final int
minus assignment -=static final int
modulo %static final int
modulo assignment %=static final int
multiply *static final int
multiply assignment *=static final int
not equals !=static final int
plus +static final int
plus assignment +=static final int
For c++, only.static final int
For c==, only.static final int
shift left <<static final int
shift left assignment <<=static final int
shift right >>static final int
shift right assign >>=static final int
For c++, only.static final ASTNodeProperty
Node property that describes the relationship between anIASTBinaryExpression
and anIASTExpression
representing the lhs.static final ASTNodeProperty
Node property that describes the relationship between anIASTBinaryExpression
and anIASTExpression
representing the rhs.Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTExpression
EMPTY_EXPRESSION_ARRAY
Fields inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
EMPTY_NODE_ARRAY
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
Returns a mutable copy of the tree rooted at this node.copy
(IASTNode.CopyStyle style) Returns a mutable copy of the tree rooted at this node.Returns the second operand of the expression.Get the first operand.Get the second operand.int
Returns the operator.void
setOperand1
(IASTExpression expression) Set the first operand.void
setOperand2
(IASTExpression expression) void
setOperator
(int op) Sets the operator.Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTExpression
getExpressionType, getValueCategory, isLValue
Methods inherited from interface org.eclipse.cdt.core.dom.ast.IASTNode
accept, contains, getChildren, getContainingFilename, getFileLocation, getLeadingSyntax, getNodeLocations, getOriginalNode, getParent, getPropertyInParent, getRawSignature, getSyntax, getTrailingSyntax, getTranslationUnit, isActive, isFrozen, isPartOfTranslationUnitFile, setParent, setPropertyInParent
-
Field Details
-
OPERAND_ONE
Node property that describes the relationship between anIASTBinaryExpression
and anIASTExpression
representing the lhs. -
OPERAND_TWO
Node property that describes the relationship between anIASTBinaryExpression
and anIASTExpression
representing the rhs. -
op_multiply
static final int op_multiplymultiply *- See Also:
-
op_divide
static final int op_dividedivide /- See Also:
-
op_modulo
static final int op_modulomodulo %- See Also:
-
op_plus
static final int op_plusplus +- See Also:
-
op_minus
static final int op_minusminus -- See Also:
-
op_shiftLeft
static final int op_shiftLeftshift left <<- See Also:
-
op_shiftRight
static final int op_shiftRightshift right >>- See Also:
-
op_lessThan
static final int op_lessThanless than <- See Also:
-
op_greaterThan
static final int op_greaterThangreater than >- See Also:
-
op_lessEqual
static final int op_lessEqualless than or equals <=- See Also:
-
op_greaterEqual
static final int op_greaterEqualgreater than or equals >=- See Also:
-
op_binaryAnd
static final int op_binaryAndbinary and &- See Also:
-
op_binaryXor
static final int op_binaryXorbinary Xor ^- See Also:
-
op_binaryOr
static final int op_binaryOrbinary Or |- See Also:
-
op_logicalAnd
static final int op_logicalAndlogical and &&- See Also:
-
op_logicalOr
static final int op_logicalOrlogical or ||- See Also:
-
op_assign
static final int op_assignassignment =- See Also:
-
op_multiplyAssign
static final int op_multiplyAssignmultiply assignment *=- See Also:
-
op_divideAssign
static final int op_divideAssigndivide assignemnt /=- See Also:
-
op_moduloAssign
static final int op_moduloAssignmodulo assignment %=- See Also:
-
op_plusAssign
static final int op_plusAssignplus assignment +=- See Also:
-
op_minusAssign
static final int op_minusAssignminus assignment -=- See Also:
-
op_shiftLeftAssign
static final int op_shiftLeftAssignshift left assignment <<=- See Also:
-
op_shiftRightAssign
static final int op_shiftRightAssignshift right assign >>=- See Also:
-
op_binaryAndAssign
static final int op_binaryAndAssignbinary and assign &=- See Also:
-
op_binaryXorAssign
static final int op_binaryXorAssignbinary Xor assign ^=- See Also:
-
op_binaryOrAssign
static final int op_binaryOrAssignbinary Or assign |=- See Also:
-
op_equals
static final int op_equalsequals ==- See Also:
-
op_notequals
static final int op_notequalsnot equals !=- See Also:
-
op_pmdot
static final int op_pmdotFor c==, only.op_pmdot
pointer-to-member field dereference.- See Also:
-
op_pmarrow
static final int op_pmarrowFor c++, only.op_pmarrow
pointer-to-member pointer dereference.- See Also:
-
op_max
static final int op_maxFor g++, only.op_max
represents >?- See Also:
-
op_min
static final int op_minFor g++, only.op_min
represents <?- See Also:
-
op_ellipses
static final int op_ellipsesFor gcc compilers, only.op_ellipses
represents ... as used for case ranges.- See Also:
-
op_threewaycomparison
static final int op_threewaycomparisonFor c++, only.op_threewaycompare
represents<=>
three-way comparison operator.- Since:
- 8.1
- See Also:
-
-
Method Details
-
setOperator
void setOperator(int op) Sets the operator.- Parameters:
op
- value to set.
-
getOperator
int getOperator()Returns the operator.- Returns:
- int value as operator
-
getOperand1
IASTExpression getOperand1()Get the first operand.- Returns:
IASTExpression
representing operand 1.
-
setOperand1
Set the first operand.- Parameters:
expression
-IASTExpression
value.
-
getOperand2
IASTExpression getOperand2()Get the second operand.- Returns:
IASTExpression
representing operand 2.
-
getInitOperand2
IASTInitializerClause getInitOperand2()Returns the second operand of the expression. For c++ assignment expressions this can be a braced list initializer.- Since:
- 5.2
-
setOperand2
- Parameters:
expression
-IASTExpression
value
-
copy
IASTBinaryExpression copy()Description copied from interface:IASTNode
Returns a mutable copy of the tree rooted at this node. The following postconditions hold:copy.getParent() == null copy.getPropertyInParent() == null copy.isFrozen() == false
Preprocessor nodes do not currently support being copied. Implicit name nodes are not copied, instead they can be regenerated if required.Calling this method is equivalent to
copy(CopyStyle.withoutLocations)
.- Specified by:
copy
in interfaceIASTExpression
- Specified by:
copy
in interfaceIASTInitializerClause
- Specified by:
copy
in interfaceIASTNode
- Since:
- 5.1
-
copy
Description copied from interface:IASTNode
Returns a mutable copy of the tree rooted at this node. The following postconditions hold:copy.getParent() == null copy.getPropertyInParent() == null copy.isFrozen() == false
Preprocessor nodes do not currently support being copied. Implicit name nodes are not copied, instead they can be regenerated if required.- Specified by:
copy
in interfaceIASTExpression
- Specified by:
copy
in interfaceIASTInitializerClause
- Specified by:
copy
in interfaceIASTNode
- Parameters:
style
-IASTNode.CopyStyle
create a copy with or without locations. Please seeIASTNode.CopyStyle
for restrictions on copies with Locations.- Since:
- 5.3
-