- All Superinterfaces:
ASTNode,SizeableNode,TypeNode
Represents an array type. See C11 Sec. 6.7.6.2.
Note that in certain contexts type qualifiers may also occur between the
square brackets in the array type designation. These will be determined by
calling the appropriate qualifier methods in TypeNode.
-
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.type.TypeNode
TypeNode.TypeNodeKind -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns a deep copy of this AST node.The type of the elements.The expression appearing in square brackets that specifies the length of the array.The expression appearing in square brackets that specifies the starting index of the array.booleanbooleanbooleanbooleanThe word "static" may appear between the brackets in certain situations.booleanIn C11, a star ("*") may appear between the square brackets instead of an integer expression.booleanvoidsetAtomicInBrackets(boolean value) voidsetConstInBrackets(boolean value) voidsetElementType(TypeNode elementType) voidsetExtent(ExpressionNode extent) voidsetRestrictInBrackets(boolean value) voidsetStartIndex(ExpressionNode startIndex) voidsetStaticExtent(boolean value) voidsetUnspecifiedVariableLength(boolean value) voidsetVolatileInBrackets(boolean value) 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.type.TypeNode
getType, isAtomicQualified, isConstQualified, isInputQualified, isOutputQualified, isRestrictQualified, isVolatileQualified, kind, setAtomicQualified, setConstQualified, setInputQualified, setOutputQualified, setRestrictQualified, setType, setVolatileQualified
-
Method Details
-
getElementType
TypeNode getElementType()The type of the elements. This is required and must be non-null.- Returns:
- the element type
-
setElementType
-
getExtent
ExpressionNode getExtent()The expression appearing in square brackets that specifies the length of the array. This is optional. If absent, this method will return null.- Returns:
- the array extent expression
-
setExtent
-
getStartIndex
ExpressionNode getStartIndex()The expression appearing in square brackets that specifies the starting index of the array. This is optional. If absent, this method will return null, which represents 0-index as default.- Returns:
- the array extent expression
-
setStartIndex
-
hasUnspecifiedVariableLength
boolean hasUnspecifiedVariableLength()In C11, a star ("*") may appear between the square brackets instead of an integer expression. The star represents "a variable length array type of unspecified size, which can only be used in declarations or type names with function prototype scope." See C11 Sec. 6.7.6.2(4).- Returns:
- true if a "*" occurs between the brackets
-
setUnspecifiedVariableLength
void setUnspecifiedVariableLength(boolean value) -
hasStaticExtent
boolean hasStaticExtent()The word "static" may appear between the brackets in certain situations. See C11 6.7.6.3.7 for its meaning. -
setStaticExtent
void setStaticExtent(boolean value) -
hasConstInBrackets
boolean hasConstInBrackets() -
setConstInBrackets
void setConstInBrackets(boolean value) -
hasVolatileInBrackets
boolean hasVolatileInBrackets() -
setVolatileInBrackets
void setVolatileInBrackets(boolean value) -
hasRestrictInBrackets
boolean hasRestrictInBrackets() -
setRestrictInBrackets
void setRestrictInBrackets(boolean value) -
hasAtomicInBrackets
boolean hasAtomicInBrackets() -
setAtomicInBrackets
void setAtomicInBrackets(boolean value) -
copy
ArrayTypeNode 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.
-