- All Superinterfaces:
ASTNode,DeclarationNode
Represents a declaration of a field (member) in a struct or union type.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.civl.abc.ast.node.IF.ASTNode
ASTNode.NodeKind -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns a deep copy of this AST node.Returns the bit field width.Returns the entity whose existence is declared by this declaration.Returns the type of the field being declared.voidsetBitFieldWidth(ExpressionNode width) Sets the bit field width child node of this node to the given node.voidsetTypeNode(TypeNode type) Sets the type node child of this node.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.declaration.DeclarationNode
getIdentifier, getName, isDefinition, setEntity, setIdentifier, setIsDefinition
-
Method Details
-
getTypeNode
TypeNode getTypeNode()Returns the type of the field being declared. This may benull.- Returns:
- the type node child of this node
- See Also:
-
setTypeNode
Sets the type node child of this node. This is the type of field.- Parameters:
type- the type of the field being declared- See Also:
-
getBitFieldWidth
ExpressionNode getBitFieldWidth()Returns the bit field width. This is a constant expression. It is optional. If there is no identifier, the bit width must be there, but it can also be there with an identifier. If absent, this method returnsnull. This is a child node of this node.- Returns:
- the optional bit field width expression (
nullif absent) - See Also:
-
setBitFieldWidth
Sets the bit field width child node of this node to the given node.- Parameters:
width- the expression to be the bit field width of this node- See Also:
-
getEntity
Field getEntity()Description copied from interface:DeclarationNodeReturns the entity whose existence is declared by this declaration. This is initiallynull, and can be changed byDeclarationNode.setEntity(Entity).- Specified by:
getEntityin interfaceDeclarationNode- Returns:
- the entity declared by this declaration
- See Also:
-
copy
FieldDeclarationNode 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 interfaceDeclarationNode- Returns:
- deep copy of this node
-