- All Superinterfaces:
ASTNode,ExpressionNode,ForLoopInitializerNode,InitializerNode,SizeableNode
A node that represents an expression built using an operator.
The most common type of expression is an expression that involves an operator and some number of operands. The operands are the children of this AST node.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumAn enumerated type for all the different operators that can occur in anOperatorNode.Nested classes/interfaces inherited from interface dev.civl.abc.ast.node.IF.ASTNode
ASTNode.NodeKindNested classes/interfaces inherited from interface dev.civl.abc.ast.node.IF.expression.ExpressionNode
ExpressionNode.ExpressionKind -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns a deep copy of this AST node.getArgument(int index) Returns the index-th argument, indexed from 0.intReturns the number of arguments (operands) in this operator expression.Returns the operator of this expression.voidsetArgument(int index, ExpressionNode value) Sets the index-th argument of this expression to be the given expressionvoidsetOperator(OperatorNode.Operator operator) Sets the operator of this expression.Methods inherited from interface dev.civl.abc.ast.node.IF.ASTNode
addAllTransformAnnotations, addTransformAnnotation, child, childIndex, children, diff, equiv, getAttribute, getOwner, getScope, getSource, id, keepOnly, nextDFS, nodeKind, numChildren, parent, prettyPrint, prettyRepresentation, prettyRepresentation, print, remove, removeChild, removeTransformAnnotation, setAttribute, setChild, setId, setOwner, setScope, toString, transformAnnotationsMethods inherited from interface dev.civl.abc.ast.node.IF.expression.ExpressionNode
addConversion, expressionKind, getConversion, getConvertedType, getInitialType, getNumConversions, isConstantExpression, isLvalue, removeConversions, setInitialTypeMethods inherited from interface dev.civl.abc.ast.node.IF.declaration.InitializerNode
isSideEffectFreeMethods inherited from interface dev.civl.abc.ast.node.IF.expression.SizeableNode
getType
-
Method Details
-
getOperator
OperatorNode.Operator getOperator()Returns the operator of this expression.- Returns:
- the operator
-
setOperator
Sets the operator of this expression.- Parameters:
operator- the operator
-
getNumberOfArguments
int getNumberOfArguments()Returns the number of arguments (operands) in this operator expression.- Returns:
- the number of arguments
-
getArgument
Returns the index-th argument, indexed from 0.- Returns:
- the index-th argument (operand) of this expression
-
setArgument
Sets the index-th argument of this expression to be the given expression- Parameters:
index- nonnegative integer in appropriate range for the operatorvalue- expression to be made the operand in that index
-
copy
OperatorNode copy()Description copied from interface:ASTNodeReturns a deep copy of this AST node. The node and all of its descendants will be cloned. The cloning does not copy analysis or attribute information.- Specified by:
copyin interfaceASTNode- Specified by:
copyin interfaceExpressionNode- Specified by:
copyin interfaceForLoopInitializerNode- Specified by:
copyin interfaceInitializerNode- Specified by:
copyin interfaceSizeableNode- Returns:
- deep copy of this node
-