Module dev.civl.abc

Interface ArrayTypeNode

All Superinterfaces:
ASTNode, SizeableNode, TypeNode

public interface ArrayTypeNode extends 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.
  • Method Details

    • getElementType

      TypeNode getElementType()
      The type of the elements. This is required and must be non-null.
      Returns:
      the element type
    • setElementType

      void setElementType(TypeNode elementType)
    • 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

      void setExtent(ExpressionNode extent)
    • 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

      void setStartIndex(ExpressionNode startIndex)
    • 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

      Description copied from interface: ASTNode
      Returns 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:
      copy in interface ASTNode
      Specified by:
      copy in interface SizeableNode
      Specified by:
      copy in interface TypeNode
      Returns:
      deep copy of this node