- All Superinterfaces:
ASTNode,BlockItemNode,DeclarationNode
- All Known Subinterfaces:
AbstractFunctionDefinitionNode,FunctionDeclarationNode,FunctionDefinitionNode,PredicateNode,VariableDeclarationNode
A declaration of a variable or function via a C "declarator". In addition to the identifier (common to all declarations), this also specifies a type and storage information.
Note that this is not used to declare members of structures or unions
("fields"). A FieldDeclarationNode is used for that.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe different kinds of ordinary declarations.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.BlockItemKind -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns a deep copy of this AST node.The type of the thing being declared.booleanDoes the declaration include theexternstorage class specifier? That specifier can be used for functions and objects.booleanDoes the declaration include thestaticstorage class specifier? This maybe used for functions and objects.The kind of ordinary declaration this is.voidsetExternStorage(boolean value) Sets the value that will be returned byhasExternStorage().voidsetStaticStorage(boolean value) Sets the value that will be returned byhasStaticStorage().voidsetTypeNode(TypeNode type) Sets the type node that will be returned bygetTypeNode().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
getEntity, getIdentifier, getName, isDefinition, setEntity, setIdentifier, setIsDefinition
-
Method Details
-
ordinaryDeclarationKind
OrdinaryDeclarationNode.OrdinaryDeclarationKind ordinaryDeclarationKind()The kind of ordinary declaration this is.- Returns:
- the ordinary declaration kind
-
getTypeNode
TypeNode getTypeNode()The 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.- Returns:
- the type node for the type of the entity being declared
- See Also:
-
setTypeNode
Sets the type node that will be returned bygetTypeNode().- Parameters:
type- the node representing the type part of the declaration
-
hasExternStorage
boolean hasExternStorage()Does the declaration include theexternstorage class specifier? That specifier can be used for functions and objects.- Returns:
trueiff the declaration containsextern- See Also:
-
setExternStorage
void setExternStorage(boolean value) Sets the value that will be returned byhasExternStorage(). The initial default value isfalse.- Parameters:
value-trueiff the declaration containsextern, elsefalse- See Also:
-
hasStaticStorage
boolean hasStaticStorage()Does the declaration include thestaticstorage class specifier? This maybe used for functions and objects.- Returns:
trueiff declaration containsstatic- See Also:
-
setStaticStorage
void setStaticStorage(boolean value) Sets the value that will be returned byhasStaticStorage(). Default value isfalse.- Parameters:
value-trueiff declaration containsstatic- See Also:
-
copy
OrdinaryDeclarationNode 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- Returns:
- deep copy of this node
-