- All Superinterfaces:
ASTNode,ExpressionNode,ForLoopInitializerNode,InitializerNode,SizeableNode
A C cast expression has the form
(typeName)expr. The type to
which the expression is being cast (typeName) is obtained via
method getCastType().
See C11 Sec. 6.5.4.-
Nested Class Summary
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.Returns the node representing the expression argument of this cast expression.Returns the node representing the type name in the cast expressionvoidsetArgument(ExpressionNode expression) Sets the value that will be returned bygetArgument().voidsetCastType(TypeNode type) Sets the value that will be returned bygetCastType().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
-
getCastType
TypeNode getCastType()Returns the node representing the type name in the cast expression- Returns:
- the node representing the type name
- See Also:
-
getArgument
ExpressionNode getArgument()Returns the node representing the expression argument of this cast expression.- Returns:
- the node for the expression being cast to a new type
- See Also:
-
setCastType
Sets the value that will be returned bygetCastType().- Parameters:
type- the node representing the type name
-
setArgument
Sets the value that will be returned bygetArgument().- Parameters:
expression- the node for the expression being cast to a new type
-
copy
CastNode 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
-