Module dev.civl.abc

Interface ArrowNode

All Superinterfaces:
ASTNode, ExpressionNode, ForLoopInitializerNode, InitializerNode, SizeableNode

public interface ArrowNode extends ExpressionNode
An expression in which the operator is the C -> (arrow) operator. In C, e->f is equivalent to (*e).f.
  • Method Details

    • getStructurePointer

      ExpressionNode getStructurePointer()
      Returns the node representing the left argument of the arrow operator. That argument is an expression which is a pointer to a structure or union.
      Returns:
      the left argument of the arrow operator
      See Also:
    • setStructurePointer

      void setStructurePointer(ExpressionNode structure)
      Sets the value that will be returned by getStructurePointer().
      Parameters:
      structure - the left argument of the arrow operator
    • getFieldName

      IdentifierNode getFieldName()
      Returns the node for the right argument of the arrow operator. That argument is an identifier which names a field in the structure or union.
      Returns:
      the right argument of the arrow operator
      See Also:
    • setFieldName

      void setFieldName(IdentifierNode field)
      Sets the value that will be returned by getFieldName().
      Parameters:
      field - the right argument of the arrow operator
    • copy

      ArrowNode 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 ExpressionNode
      Specified by:
      copy in interface ForLoopInitializerNode
      Specified by:
      copy in interface InitializerNode
      Specified by:
      copy in interface SizeableNode
      Returns:
      deep copy of this node
    • getNavigationSequence

      Field[] getNavigationSequence()
      Returns the sequence of nested fields navigates from an outer structure or union member to an inner member through anonymous structure or union members. Example:
       struct S {
         union {       // call this field "f0"
           struct {    // call this field "f1"
             union {   // call this field "f2"
               int x;
             };
           };
         };
       } u;
       
      For the dot expression u.x, the navigation sequence is the sequence of Field objects {f0, f1, f2, x}. If those anonymous fields were given the names f0, f1, and f2, then the dot expression would be transformed to u.f0.f1.f2.x.
      Returns:
      the navigation sequence
    • setNavigationSequence

      void setNavigationSequence(Field[] sequence)