- All Superinterfaces:
Entity,OrdinaryEntity,ProgramEntity
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.civl.abc.ast.entity.IF.Entity
Entity.EntityKindNested classes/interfaces inherited from interface dev.civl.abc.ast.entity.IF.ProgramEntity
ProgramEntity.LinkageKind -
Method Summary
Modifier and TypeMethodDescriptionvoidaddContract(ContractNode contract) Add aContractNodewhich represents a contract clause.booleanIs the function declared with the_Noreturnspecifier, indicating that the function does not return.Returns the set of functions called by this function either by name or through a pointer dereference (the latter is relation is safely overapproximated).Returns the set of functions that call this function either by name or through a pointer dereference (the latter is relation is safely overapproximated).Returns aIteratorfor a set of contract clauses.Gets the definition, i.e., the defining declaration of this entity.getScope()Returns the function scope associated to this function.getType()Other thanLabel, andPragmaHandler, every kind of Entity has a type, returned by this method.booleanIs the function declared with the$abstractspecifier, indicating that this is an abstract function?booleanisAtomic()Is the function declared with the$atomic_fspecifier, indicating that this is an atomic function?booleanIs the function declared with theinlinespecifier, indicating that this is an inline function?booleanisLogic()booleanisPure()Is the function declared with the$purespecifier, indicating that this is a pure function?booleanbooleanIs the function declared with the$systemspecifier, indicating that this is a system function?voidsetAbstract(boolean value) Sets whether this function is an abstract functionvoidsetAtomic(boolean value) Sets whether this function is an atomic functionvoidsetDoesNotReturn(boolean value) Sets whether this function is declared with_Noreturn.voidsetIsInlined(boolean value) Sets whether this function is an inline functionvoidsetLogic(boolean value) Set weather this function is a logic function.voidsetPure(boolean value) Sets whether this function is a pure functionvoidsetStateFunction(boolean value) voidsetSystemFunction(boolean value) Sets whether this function is a system functionvoidsetSystemLibrary(String library) sets the library of this system function;gets the library of this system function; null if this is not a system function.Methods inherited from interface dev.civl.abc.ast.entity.IF.Entity
getEntityKind, getNameMethods inherited from interface dev.civl.abc.ast.entity.IF.ProgramEntity
addDeclaration, getDeclaration, getDeclarations, getFirstDeclaration, getLinkage, getNumDeclarations, isSystem, setDefinition, setIsSystem, setLinkage, setType
-
Method Details
-
getType
FunctionType getType()Description copied from interface:ProgramEntityOther than
Label, andPragmaHandler, every kind of Entity has a type, returned by this method. For aLabelorPragmaHandler, this returnsnull.The type is initially
null. It can be set using methodProgramEntity.setType(Type).- Specified by:
getTypein interfaceProgramEntity- Returns:
- the type of this entity or
null
-
isInlined
boolean isInlined()Is the function declared with theinlinespecifier, indicating that this is an inline function?- Returns:
trueiff the function is an inline function
-
setIsInlined
void setIsInlined(boolean value) Sets whether this function is an inline function- Parameters:
value-trueif inlined,falseif not
-
isAtomic
boolean isAtomic()Is the function declared with the$atomic_fspecifier, indicating that this is an atomic function?- Returns:
trueiff the function is an atomic function
-
setAtomic
void setAtomic(boolean value) Sets whether this function is an atomic function- Parameters:
value-trueif atomic,falseif not
-
isStateFunction
boolean isStateFunction() -
setStateFunction
void setStateFunction(boolean value) -
isLogic
boolean isLogic()- Returns:
- true iff this function is a logic function. The definition of a
logic function is optional but if it exists it must be a (return
of a) side-effect free expression. A logic function can be
recursively defined since a call to a logic function is
side-effect free as well.
A logic function currently can only be defined in ACSL annotations
-
setLogic
void setLogic(boolean value) Set weather this function is a logic function.- Parameters:
value- true, to set the function as a logic function; false, otherwise.
-
isPure
boolean isPure()Is the function declared with the$purespecifier, indicating that this is a pure function?- Returns:
trueiff the function is a pure function
-
setPure
void setPure(boolean value) Sets whether this function is a pure function- Parameters:
value-trueif pure,falseif not
-
isAbstract
boolean isAbstract()Is the function declared with the$abstractspecifier, indicating that this is an abstract function?- Returns:
trueiff the function is an abstract function
-
setAbstract
void setAbstract(boolean value) Sets whether this function is an abstract function- Parameters:
value-trueif abstract,falseif not
-
isSystemFunction
boolean isSystemFunction()Is the function declared with the$systemspecifier, indicating that this is a system function?- Returns:
trueiff the function is a system function
-
setSystemFunction
void setSystemFunction(boolean value) Sets whether this function is a system function- Parameters:
value-trueif this is a system function,falseif not
-
systemLibrary
String systemLibrary()gets the library of this system function; null if this is not a system function.- Returns:
-
setSystemLibrary
sets the library of this system function;- Parameters:
library-
-
doesNotReturn
boolean doesNotReturn()Is the function declared with the_Noreturnspecifier, indicating that the function does not return.- Returns:
trueiff the function is declared with_Noreturn
-
setDoesNotReturn
void setDoesNotReturn(boolean value) Sets whether this function is declared with_Noreturn.- Parameters:
value-trueif_Noreturn,falseif not
-
getDefinition
FunctionDefinitionNode getDefinition()Description copied from interface:ProgramEntityGets the definition, i.e., the defining declaration of this entity. Every entity has at most one definition. The definition is a declaration of a special kind. For example, for an object (variable), a definition is the declaration that allocates storage for that object. For a function, a definition is the declaration the contains the function body.
The definition is initially
null, but can be set using methodProgramEntity.setDefinition(DeclarationNode).- Specified by:
getDefinitionin interfaceProgramEntity- Returns:
- the definition of this entity or
null
-
getScope
Scope getScope()Returns the function scope associated to this function. This is the scope in which the ordinary labels are declared. It is the outermost scope of the function body.- Returns:
- the function scope associated to this function
-
getCallers
Returns the set of functions that call this function either by name or through a pointer dereference (the latter is relation is safely overapproximated). Transitive calling relationships are not reflected in this set, i.e., if a calls b which calls c, then a is not in getCallers() of c (unless of course a directly calls c as well). The set is initially empty; a call toCallAnalyzer.analyze(dev.civl.abc.ast.IF.AST)will populate it.- Returns:
- the set of functions that call this function
-
getCallees
Returns the set of functions called by this function either by name or through a pointer dereference (the latter is relation is safely overapproximated). Transitive calling relationships are not reflected in this set, i.e., if a calls b which calls c, then c is not in getCallees() of a (unless of course a directly calls c as well). The set is initially empty; a call toCallAnalyzer.analyze(dev.civl.abc.ast.IF.AST)will populate it.- Returns:
- the set of functions called by this function
-
addContract
Add aContractNodewhich represents a contract clause.- Parameters:
contract- A node representing a contract clause.
-
getContracts
Iterable<ContractNode> getContracts()Returns aIteratorfor a set of contract clauses.- Returns:
-