- All Superinterfaces:
ASTNode,BlockItemNode,DeclarationNode,FunctionDeclarationNode,OrdinaryDeclarationNode
- All Known Subinterfaces:
PredicateNode
Represents a function definition, i.e., a function declaration which includes
the function body.
-
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.statement.BlockItemNode
BlockItemNode.BlockItemKindNested classes/interfaces inherited from interface dev.civl.abc.ast.node.IF.declaration.OrdinaryDeclarationNode
OrdinaryDeclarationNode.OrdinaryDeclarationKind -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns a deep copy of this AST node.getBody()Returns the body of the function, a compound statement.Pre-condition: call toFunctionDeclarationNode.isLogicFunction()returns true.The type of the thing being declared.voidsetBody(CompoundStatementNode statement) Sets the body to the given statement.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.statement.BlockItemNode
blockItemKindMethods inherited from interface dev.civl.abc.ast.node.IF.declaration.DeclarationNode
getIdentifier, getName, isDefinition, setEntity, setIdentifier, setIsDefinitionMethods inherited from interface dev.civl.abc.ast.node.IF.declaration.FunctionDeclarationNode
getContract, getEntity, getSystemLibrary, hasAtomicFunctionSpecifier, hasDeviceFunctionSpecifier, hasGlobalFunctionSpecifier, hasInlineFunctionSpecifier, hasNoreturnFunctionSpecifier, hasPureFunctionSpecifier, hasStatefFunctionSpecifier, hasSystemFunctionSpecifier, isLogicFunction, setAtomicFunctionSpecifier, setContract, setDeviceFunctionSpecifier, setGlobalFunctionSpecifier, setInlineFunctionSpecifier, setIsLogicFunction, setNoreturnFunctionSpecifier, setPureFunctionSpecifier, setStatefFunctionSpecifier, setSystemFunctionSpecifier, setSystemLibraryMethods inherited from interface dev.civl.abc.ast.node.IF.declaration.OrdinaryDeclarationNode
hasExternStorage, hasStaticStorage, ordinaryDeclarationKind, setExternStorage, setStaticStorage, setTypeNode
-
Method Details
-
getBody
CompoundStatementNode getBody()Returns the body of the function, a compound statement.- Returns:
- the function body
-
setBody
Sets the body to the given statement. The statement becomes a child of this node.- Parameters:
statement- node to be made the body child of this node
-
copy
FunctionDefinitionNode 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 interfaceBlockItemNode- Specified by:
copyin interfaceDeclarationNode- Specified by:
copyin interfaceFunctionDeclarationNode- Specified by:
copyin interfaceOrdinaryDeclarationNode- Returns:
- deep copy of this node
-
getTypeNode
FunctionTypeNode getTypeNode()Description copied from interface:OrdinaryDeclarationNodeThe type of the thing being declared. This may benull: e.g., in a function declaration, the parameter types do not necessarily have to be declared.- Specified by:
getTypeNodein interfaceOrdinaryDeclarationNode- Returns:
- the type node for the type of the entity being declared
- See Also:
-
getLogicDefinition
ExpressionNode getLogicDefinition()Pre-condition: call toFunctionDeclarationNode.isLogicFunction()returns true.- Returns:
- The logic function definition, which is a side-effect free expression, if this funciton is a logic function. Otherwise, null.
-